57% ewww-image-optimizer

Code Review | EWWW Image Optimizer

WordPress plugin EWWW Image Optimizer scored57%from 54 tests.

About plugin

  • Plugin page: ewww-image-optimizer
  • Plugin version: 7.2.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 7, 2012
  • Latest release: Sep 7, 2023
  • Number of updates: 1,109
  • Update frequency: every 3.7 days
  • Top authors: nosilver4u (100%)

Code review

54 tests

User reviews

1607 reviews

Install metrics

1,000,000+ active /33,684,303 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲4.63MB] [CPU: ▲27.26ms] 75% from 4 tests

Analyzing server-side resources used by EWWW Image Optimizer
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 712.31ms on /wp-admin/admin.php?page=ewww-image-optimizer-webp-migrate)
PageMemory (MB)CPU Time (ms)
Home /7.66 ▲4.2070.99 ▲29.30
Dashboard /wp-admin8.06 ▲4.7573.28 ▲20.33
Posts /wp-admin/edit.php8.11 ▲4.7582.85 ▲31.26
Add New Post /wp-admin/post-new.php10.72 ▲4.83121.13 ▲28.16
Media Library /wp-admin/upload.php8.10 ▲4.8772.54 ▲35.05
EWWW Image Optimizer /wp-admin/options-general.php?page=ewww-image-optimizer-options8.02148.06
EWWW Image Optimizer /wp-admin/tools.php?page=ewww-image-optimizer-tools8.0166.94
Bulk Optimize /wp-admin/upload.php?page=ewww-image-optimizer-bulk8.03140.74
Migrate WebP Images /wp-admin/admin.php?page=ewww-image-optimizer-webp-migrate8.01712.31

Server storage [IO: ▲16.66MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • The plugin illegally modified 3 files (2,438.56KB) outside of "wp-content/plugins/ewww-image-optimizer/" and "wp-content/uploads/"
    • (new file) wp-content/ewww/gifsicle
    • (new file) wp-content/ewww/optipng
    • (new file) wp-content/ewww/jpegtran
Filesystem: 180 new files
Database: 2 new tables, 42 new options
New tables
wp_ewwwio_images
wp_ewwwio_queue
New WordPress options
ewww_image_optimizer_webp_for_cdn
ewww_image_optimizer_exactdn_plan_id
ewww_image_optimizer_aux_resume
ewww_image_optimizer_exactdn
ewww_image_optimizer_resize_existing
can_compress_scripts
ewww_image_optimizer_pngout_level
widget_recent-posts
widget_theysaidso_widget
ewww_image_optimizer_jpg_level
...

Browser metrics Passed 4 tests

An overview of browser requirements for EWWW Image Optimizer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.28 ▼0.461.76 ▲0.0441.38 ▼3.02
Dashboard /wp-admin2,207 ▲305.59 ▲0.0689.32 ▼17.1838.64 ▼8.61
Posts /wp-admin/edit.php2,115 ▲152.02 ▲0.0640.32 ▲0.5637.20 ▲0.01
Add New Post /wp-admin/post-new.php1,544 ▲1817.91 ▼5.18616.87 ▼39.7463.03 ▲9.72
Media Library /wp-admin/upload.php1,440 ▲404.29 ▲0.01106.06 ▼1.8479.79 ▲35.51
EWWW Image Optimizer /wp-admin/options-general.php?page=ewww-image-optimizer-options1,0154.6851.0674.50
EWWW Image Optimizer /wp-admin/tools.php?page=ewww-image-optimizer-tools8091.7325.0825.71
Bulk Optimize /wp-admin/upload.php?page=ewww-image-optimizer-bulk9824.8769.1250.36
Migrate WebP Images /wp-admin/admin.php?page=ewww-image-optimizer-webp-migrate8152.0127.0525.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_ewwwio_queue
    • wp_ewwwio_images
  • Zombie WordPress options were found after uninstall: 42 options
    • exactdn_lossy
    • exactdn_exclude
    • ewww_image_optimizer_jpg_level
    • ewww_image_optimizer_webp_rewrite_exclude
    • ewww_image_optimizer_bulk_resume
    • ewww_image_optimizer_ll_all_things
    • ewww_image_optimizer_gif_level
    • exactdn_prevent_db_queries
    • widget_theysaidso_widget
    • ewww_image_optimizer_lazy_load
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 40× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/ewww-image-optimizer/tests/test-optimize.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelException' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelJpegInvalidMarkerException.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/ewww-image-optimizer/tests/test-agr.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/ewww-image-optimizer/tests/test-tables.php:12
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/ewww-image-optimizer/tests/bootstrap.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryException' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelUnexpectedFormatException.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryNumber' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelEntryShort.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryAscii' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelEntryCopyright.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelEntryLong' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelEntryRational.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'lsolesen\\pel\\PelException' not found in wp-content/plugins/ewww-image-optimizer/vendor/lsolesen/pel/src/PelInvalidDataException.php:44

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/upload.php?page=ewww-image-optimizer-bulk
    • > Javascript (severe) in unknown
    /wp-admin/js/dashboard.min.js?ver=6.3.1 1:8674 Uncaught TypeError: window.wp.deprecateL10nObject is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

ewww-image-optimizer/ewww-image-optimizer.php Passed 13 tests

The main file in "EWWW Image Optimizer" v. 7.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
129 characters long description:
Smaller Images, Faster Sites, Happier Visitors. Comprehensive image optimization that doesn't require a degree in rocket science.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/ewww-image-optimizer/binaries/cwebp.exe
      • wp-content/plugins/ewww-image-optimizer/binaries/gifsicle.exe
      • wp-content/plugins/ewww-image-optimizer/binaries/jpegtran.exe
      • wp-content/plugins/ewww-image-optimizer/binaries/optipng.exe
      • wp-content/plugins/ewww-image-optimizer/binaries/pngquant.exe
42,986 lines of code in 142 files:
LanguageFilesBlank linesComment linesLines of code
PHP1053,07816,00736,803
JavaScript233111374,268
CSS1736931
Markdown42640551
Bourne Shell26850206
JSON300117
YAML212057
XML29153

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 229)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity49.18
▷ Minimum class complexity1.00
▷ Maximum class complexity994.00
Average method complexity6.76
▷ Minimum method complexity1.00
▷ Maximum method complexity229.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes89
▷ Abstract classes55.62%
▷ Concrete classes8494.38%
▷ Final classes11.19%
Methods753
▷ Static methods739.69%
▷ Public methods66588.31%
▷ Protected methods587.70%
▷ Private methods303.98%
Functions370
▷ Named functions36899.46%
▷ Anonymous functions20.54%
Constants400
▷ Global constants4110.25%
▷ Class constants35989.75%
▷ Public constants35498.61%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/question-circle.png0.57KB0.47KB▼ 17.62%
images/test.png0.85KB0.86KB0.00%
images/ewwwio-logo.png8.36KB4.78KB▼ 42.84%
images/testorig.png0.11KB0.08KB▼ 26.32%