84% imagecomply

Code Review | ImageComply

WordPress plugin ImageComply scored84%from 54 tests.

About plugin

  • Plugin page: imagecomply
  • Plugin version: 1.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2023
  • Latest release: Nov 20, 2023
  • Number of updates: 8
  • Update frequency: every 2.4 days
  • Top authors: torchsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /911 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼3.28ms] Passed 4 tests

Server-side resources used by ImageComply
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2141.73 ▲0.79
Dashboard /wp-admin3.51 ▲0.2146.16 ▼3.62
Posts /wp-admin/edit.php3.63 ▲0.2750.89 ▲2.47
Add New Post /wp-admin/post-new.php6.12 ▲0.2484.70 ▼12.76
Media Library /wp-admin/upload.php3.44 ▲0.2136.89 ▲2.74
ImageComply /wp-admin/upload.php?page=imagecomply3.4233.92
ImageComply /wp-admin/options-general.php?page=imagecomply3.4235.98

Server storage [IO: ▲0.80MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

ImageComply: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲9114.67 ▲0.432.09 ▲0.2637.93 ▼11.20
Dashboard /wp-admin2,230 ▲565.58 ▼0.0592.79 ▼6.0070.32 ▲17.67
Posts /wp-admin/edit.php2,138 ▲382.02 ▲0.0237.72 ▼0.7533.74 ▲0.10
Add New Post /wp-admin/post-new.php1,562 ▲3623.02 ▼0.15757.68 ▲129.0849.58 ▼1.45
Media Library /wp-admin/upload.php1,432 ▲324.17 ▼0.0598.69 ▲0.9761.98 ▲19.80
ImageComply /wp-admin/upload.php?page=imagecomply1,1942.2035.7869.14
ImageComply /wp-admin/options-general.php?page=imagecomply1,1982.2335.4335.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ImageComply\\add_action() in wp-content/plugins/imagecomply/includes/dashboard.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ImageComply\\add_filter() in wp-content/plugins/imagecomply/includes/media-library.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ImageComply\\add_action() in wp-content/plugins/imagecomply/includes/functions.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: compliance, media, accessibility, alt text, images...

imagecomply/imagecomply.php Passed 13 tests

This is the main PHP file of "ImageComply" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
131 characters long description:
Automate ADA compliance with alt text generation for your images, enhancing accessibility and SEO for your WordPress media library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,098 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP64665681,090
JavaScript3117237543
Sass2580344
SVG901119
CSS2002

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity26.20
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods32
▷ Static methods618.75%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png7.73KB3.88KB▼ 49.84%
assets/icon-128x128.png3.97KB2.35KB▼ 40.78%