10% wp-compress-image-optimizer

Code Review | WP Compress - Image Optimizer [All-In-One]

WordPress plugin WP Compress - Image Optimizer [All-In-One] scored10%from 54 tests.

About plugin

  • Plugin page: wp-compress-image...
  • Plugin version: 6.10.33
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 16, 2018
  • Latest release: Oct 4, 2023
  • Number of updates: 511
  • Update frequency: every 4.1 days
  • Top authors: smartersite (100%)

Code review

54 tests

User reviews

101 reviews

Install metrics

8,000+ active /500,218 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/wp-compress-image-optimizer/classes/cache.class.php+114
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.90MB] [CPU: ▼23.62ms] Passed 4 tests

This is a short check of server-side resources used by WP Compress - Image Optimizer [All-In-One]
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.31 ▲1.8532.27 ▼5.57
Dashboard /wp-admin4.84 ▲1.5434.59 ▼14.13
Posts /wp-admin/edit.php4.84 ▲1.4935.74 ▼7.23
Add New Post /wp-admin/post-new.php4.84 ▼1.0435.04 ▼67.56
Media Library /wp-admin/upload.php4.84 ▲1.6239.45 ▲10.89
WP Compress /wp-admin/options-general.php?page=wpcompress4.8538.21

Server storage [IO: ▲7.60MB] [DB: ▲0.31MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • Illegal file modification found: 5 files (4.41KB) outside of "wp-content/plugins/wp-compress-image-optimizer/" and "wp-content/uploads/"
    • (new file) wp-content/cache/wp-cio/.empty
    • (new file) wp-content/cache/critical/.empty
    • (new file) wp-content/test.txt
    • (modified) wp-config.php
    • (new file) wp-content/wp-cio-config/cache.config.php
Filesystem: 499 new files
Database: no new tables, 13 new options
New WordPress options
wps_ic_preset_setting
wps_ic
wps_ic_settings
widget_recent-comments
wpc-inline
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
wpc_version
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Compress - Image Optimizer [All-In-One]
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,549 ▲78813.14 ▼1.116.38 ▲4.7036.15 ▼8.53
Dashboard /wp-admin2,890 ▲7255.69 ▲0.1182.36 ▼6.6366.96 ▲20.20
Posts /wp-admin/edit.php2,808 ▲7082.19 ▲0.1733.83 ▼5.9034.07 ▼2.31
Add New Post /wp-admin/post-new.php2,211 ▲67618.25 ▲0.26595.51 ▼42.1536.07 ▼36.25
Media Library /wp-admin/upload.php2,285 ▲8855.32 ▲0.97115.25 ▲23.0292.72 ▲52.49
WP Compress /wp-admin/options-general.php?page=wpcompress8,9873.99130.41156.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-compress-image-optimizer/addons/legacy/compress.php+90
    Undefined index: api_key
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_theysaidso_widget
    • wps_ic_geo_locate
    • wps_ic
    • widget_recent-comments
    • wps_ic_settings
    • theysaidso_admin_options
    • widget_recent-posts
    • wps_ic_mu_settings
    • db_upgraded
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpcompress
    • > Notice in wp-content/plugins/wp-compress-image-optimizer/templates/admin/debug_tool.php+232
    Undefined index: api_key

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/bulk/popups.php
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/compatibility-popups.php
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/geolocation.php
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/v4/pull-stats.php
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/mu/tabs/manage-websites.php
    • > /wp-content/plugins/wp-compress-image-optimizer/templates/mu/tabs/bulk-connecting-process.php
  • 230× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'WPS_IC_DIRtraits/url_key.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-compress-image-optimizer/classes/combine_css.class.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'wps_ic_integrations' not found in wp-content/plugins/wp-compress-image-optimizer/integrations/elementor.php:3
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/compatibility-popups.php on line 37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/cname.php:35
    • > PHP Fatal error
      Uncaught Error: Class name must be a valid object or a string in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/boxes/optimization-mode.php:7
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/pages/mu-getting-started.php on line 46
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/cname.php on line 20
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/admin/mu-getting-started.php on line 48
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/exclude-advanced-caching.php on line 8
    • > PHP Warning
      Use of undefined constant WPS_IC_URI - assumed 'WPS_IC_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-compress-image-optimizer/templates/admin/partials/popups/js/exclude-scripts-to-footer.php on line 18

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 76% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
  • Donate link: Invalid URI ("")
  • Screenshots: Add a description for screenshot #5 in wp-compress-image-optimizer/assets to your readme.txt
Please take inspiration from this readme.txt

wp-compress-image-optimizer/wp-compress.php 69% from 13 tests

"WP Compress - Image Optimizer [All-In-One]" version 6.10.33's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Domain Path: The domain path folder was not found ("/langs")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-compress-image-optimizer.php" instead of "wp-compress.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin59,722 lines of code in 404 files:
LanguageFilesBlank linesComment linesLines of code
PHP1186,9072,44927,327
LESS123,24519214,213
JavaScript853,4993,14912,787
SVG1417332,420
Sass2277201,476
CSS42117123796
JSON300386
HTML191317

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 129)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity67.38
▷ Minimum class complexity1.00
▷ Maximum class complexity889.00
Average method complexity5.91
▷ Minimum method complexity1.00
▷ Maximum method complexity129.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes59
▷ Abstract classes00.00%
▷ Concrete classes59100.00%
▷ Final classes00.00%
Methods779
▷ Static methods12516.05%
▷ Public methods77899.87%
▷ Protected methods00.00%
▷ Private methods10.13%
Functions19
▷ Named functions736.84%
▷ Anonymous functions1263.16%
Constants61
▷ Global constants61100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
41 PNG files occupy 1.01MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/live/wp-compress-logo.png33.56KB18.47KB▼ 44.96%
assets/v2/assets/images/calendar.png0.40KB0.28KB▼ 28.57%
assets/images/rocket.png42.29KB12.94KB▼ 69.41%
assets/images/rocket_opt.png9.80KB10.54KB0.00%
assets/v2/assets/images/switcher-ball.png0.67KB0.45KB▼ 32.75%