84% winsite-image-optimizer

Code Review | Winsite Image Optimizer

WordPress plugin Winsite Image Optimizer scored 84% from 54 tests.

About plugin

  • Plugin page: winsite-image-opt...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.8
  • WordPress version: 5.8.1
  • First release: Jun 8, 2016
  • Latest release: Jun 29, 2017
  • Number of updates: 11
  • Update frequency: every 35.1 days
  • Top authors: winsite (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

500+ active / 8,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼136.24ms] Passed 4 tests

Server-side resources used by Winsite Image Optimizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.1036.69 ▲4.17
Dashboard /wp-admin3.17 ▲0.1245.21 ▲3.31
Posts /wp-admin/edit.php3.28 ▲0.1744.59 ▲1.09
Add New Post /wp-admin/post-new.php5.53 ▲0.1088.40 ▼545.81
Media Library /wp-admin/upload.php3.11 ▲0.1130.95 ▼3.54
WS. Image Optimizer /wp-admin/upload.php?page=wsi-image-optimizer3.0732.55

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 1 new option
New WordPress options
wsi_media_settings

Browser metrics Passed 4 tests

Winsite Image Optimizer: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11216.21 ▲0.677.86 ▼0.2948.74 ▼0.98
Dashboard /wp-admin2,972 ▲415.87 ▼0.08135.47 ▼10.49108.93 ▼2.47
Posts /wp-admin/edit.php2,744 ▲82.69 ▼0.0069.39 ▲4.4095.24 ▲5.38
Add New Post /wp-admin/post-new.php1,594 ▲9618.79 ▼0.04382.05 ▲2.71106.52 ▼9.24
Media Library /wp-admin/upload.php1,812 ▲55.05 ▲0.05142.46 ▼3.62115.65 ▲0.25
WS. Image Optimizer /wp-admin/upload.php?page=wsi-image-optimizer1,0662.3856.4667.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • wsi_media_settings

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/winsite-image-optimizer/winsite-image-optimizer.php:74
    • > PHP Fatal error
      Uncaught Error: Class 'WSI_Engine' not found in wp-content/plugins/winsite-image-optimizer/includes/engines/class-wsi-engine-imageoptim.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: image optimization, image compression

winsite-image-optimizer/winsite-image-optimizer.php 92% from 13 tests

"Winsite Image Optimizer" version 1.0.7'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:
  • 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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected543 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6126257392
Bourne Shell119693
JavaScript1191258

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.33
▷ Minimum class complexity2.00
▷ Maximum class complexity20.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes120.00%
Methods31
▷ Static methods412.90%
▷ Public methods2890.32%
▷ Protected methods00.00%
▷ Private methods39.68%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected