88% wp-image-optimizer

Code Review | WP Image Optimizer

WordPress plugin WP Image Optimizer scored 88% from 54 tests.

About plugin

  • Plugin page: wp-image-optimizer
  • Plugin version: 1.1.5.1
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 5.8.1
  • First release: Jun 1, 2018
  • Latest release: Jun 18, 2018
  • Number of updates: 15
  • Update frequency: every 1.3 days
  • Top authors: nir0ma (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 3,413 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼131.55ms] Passed 4 tests

Analyzing server-side resources used by WP Image Optimizer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.07 ▲0.2343.22 ▲3.77
Dashboard /wp-admin3.35 ▲0.3055.10 ▲6.07
Posts /wp-admin/edit.php3.40 ▲0.2954.50 ▲7.92
Add New Post /wp-admin/post-new.php5.65 ▲0.21106.96 ▼543.97
Media Library /wp-admin/upload.php3.23 ▲0.2344.01 ▲9.57
WP Image Optimizer /wp-admin/upload.php?page=wp-image-optimizer3.1230.78

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Image Optimizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.79 ▼0.1211.25 ▲2.5554.17 ▲3.82
Dashboard /wp-admin2,980 ▲495.96 ▲0.01148.36 ▼24.76121.26 ▲5.69
Posts /wp-admin/edit.php2,746 ▲72.68 ▼0.0264.28 ▼8.8099.47 ▲5.32
Add New Post /wp-admin/post-new.php1,688 ▲518.73 ▲0.03386.54 ▼0.87113.64 ▼10.17
Media Library /wp-admin/upload.php1,814 ▲75.05 ▲0.05145.92 ▼2.43136.31 ▲11.03
WP Image Optimizer /wp-admin/upload.php?page=wp-image-optimizer1,4762.3465.98112.27

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/upload.php?page=wp-image-optimizer
    • > User notice in wp-includes/functions.php+5663
    WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-image-optimizer/inc/admin/views/html-wp-image-optimizer-admin-display.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

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

The primary PHP file in "WP Image Optimizer" version 1.1.5.1 is used by WordPress to initiate all plugin functionality
114 characters long description:
Reduce image file sizes and improve website performance using Linux littleutils image optimizers within WordPress.

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected1,484 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11238549928
CSS12313309
JavaScript13532247

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.14
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.51
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods45
▷ Static methods36.67%
▷ Public methods4191.11%
▷ Protected methods00.00%
▷ Private methods48.89%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin