84% opti-mozjpeg-guetzli-webp

Code Review | Opti MozJpeg Guetzli WebP

WordPress plugin Opti MozJpeg Guetzli WebP scored84%from 54 tests.

About plugin

  • Plugin page: opti-mozjpeg-guet...
  • Plugin version: 1.16
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.7
  • WordPress version: 6.3.1
  • First release: Dec 10, 2017
  • Latest release: Jul 31, 2018
  • Number of updates: 56
  • Update frequency: every 4.3 days
  • Top authors: ihorsl (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /5,985 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▼1.93ms] Passed 4 tests

An overview of server-side resources used by Opti MozJpeg Guetzli WebP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0835.63 ▼11.31
Dashboard /wp-admin3.80 ▲0.4948.21 ▼0.23
Posts /wp-admin/edit.php3.85 ▲0.4953.55 ▲8.95
Add New Post /wp-admin/post-new.php6.31 ▲0.4296.54 ▲2.02
Media Library /wp-admin/upload.php3.66 ▲0.4235.96 ▲1.79
Opti MozJpeg Guetzli WebP /wp-admin/upload.php?page=opti-mozjpeg-guetzli-webp3.6439.59

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Opti MozJpeg Guetzli WebP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.23 ▼1.394.53 ▲2.4842.72 ▼1.50
Dashboard /wp-admin2,210 ▲254.86 ▼0.05110.32 ▲5.1441.42 ▲0.20
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0339.04 ▼1.4636.00 ▼1.42
Add New Post /wp-admin/post-new.php1,536 ▲223.42 ▲0.33619.20 ▼59.3856.31 ▼9.69
Media Library /wp-admin/upload.php1,386 ▲44.23 ▲0.0494.84 ▼5.1340.95 ▼3.22
Opti MozJpeg Guetzli WebP /wp-admin/upload.php?page=opti-mozjpeg-guetzli-webp1,0532.0628.0346.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Please take a closer look at the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/RC4.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/RC2.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\et\\SSH2' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Net/SFTP.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/Twofish.php:48
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Rijndael' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/AES.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/Rijndael.php:64
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/DES.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\DES' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/TripleDES.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/opti-mozjpeg-guetzli-webp/phpseclib/Crypt/Blowfish.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opti-mozjpeg-guetzli-webp/opti-mozjpeg-guetzli-webp.php:174

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: seo, pagespeed, free image optimization, pingdom, wordpress images optimization

opti-mozjpeg-guetzli-webp/opti-mozjpeg-guetzli-webp.php Passed 13 tests

"Opti MozJpeg Guetzli WebP" version 1.16's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
108 characters long description:
Optimize your Wordpress images using this plugin and Mozilla MozJpeg, Google Guetzli or Google WebP encoders

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin23,267 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP384,39211,56622,923
CSS1433192
JavaScript11226152

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity104.83
▷ Minimum class complexity1.00
▷ Maximum class complexity598.00
Average method complexity6.29
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes36
▷ Abstract classes12.78%
▷ Concrete classes3597.22%
▷ Final classes00.00%
Methods709
▷ Static methods20.28%
▷ Public methods70899.86%
▷ Protected methods00.00%
▷ Private methods10.14%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants224
▷ Global constants6830.36%
▷ Class constants15669.64%
▷ Public constants156100.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.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/facebook-share.png4.47KB2.58KB▼ 42.23%
images/twitter-share.png3.22KB2.07KB▼ 35.79%