84% optimole-wp

Code Review | Image Optimization by Optimole - Lazy Load, CDN, Convert to WebP & AVIF

WordPress plugin Image Optimization by Optimole - Lazy Load, CDN, Convert to WebP & AVIF scored84%from 54 tests.

About plugin

  • Plugin page: optimole-wp
  • Plugin version: 3.11.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Sep 23, 2018
  • Latest release: Nov 23, 2023
  • Number of updates: 159
  • Update frequency: every 11.9 days
  • Top authors: optimole (100%)

Code review

54 tests

User reviews

548 reviews

Install metrics

200,000+ active /3,395,774 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.86MB] [CPU: ▲17.64ms] Passed 4 tests

This is a short check of server-side resources used by Image Optimization by Optimole - Lazy Load, CDN, Convert to WebP & AVIF
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.34 ▲2.8763.49 ▲20.62
Dashboard /wp-admin6.18 ▲2.8772.98 ▲21.37
Posts /wp-admin/edit.php6.21 ▲2.8562.42 ▲14.80
Add New Post /wp-admin/post-new.php8.80 ▲2.90110.39 ▲13.75
Media Library /wp-admin/upload.php6.08 ▲2.8559.48 ▲26.13

Server storage [IO: ▲3.68MB] [DB: ▲0.38MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 146 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
optml_defaults_updated
widget_theysaidso_widget
optimole_wp_install
optml-version
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Optimization by Optimole - Lazy Load, CDN, Convert to WebP & AVIF
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,310 ▲52314.20 ▼0.171.82 ▼0.6228.77 ▼14.30
Dashboard /wp-admin2,715 ▲5405.53 ▼0.1897.39 ▼18.1986.80 ▲40.33
Posts /wp-admin/edit.php2,499 ▲3962.12 ▲0.1236.09 ▼6.4433.17 ▼4.65
Add New Post /wp-admin/post-new.php1,704 ▲16823.36 ▲0.24787.39 ▲129.8158.51 ▲7.67
Media Library /wp-admin/upload.php1,792 ▲3954.23 ▲0.07101.02 ▼4.8373.62 ▲26.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • optimole_wp_install
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • optml_defaults_updated
    • optml-version
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 53× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Trait 'Optml_Normalizer' not found in wp-content/plugins/optimole-wp/inc/settings.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_Property_Type' not found in wp-content/plugins/optimole-wp/inc/image_properties/resize.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_compatibility' not found in wp-content/plugins/optimole-wp/inc/compatibilities/foogallery.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_Property_Type' not found in wp-content/plugins/optimole-wp/inc/image_properties/height.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_Abstract_Conflict' not found in wp-content/plugins/optimole-wp/inc/conflicts/jetpack_lazyload.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_compatibility' not found in wp-content/plugins/optimole-wp/inc/compatibilities/wp_rest_cache.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_compatibility' not found in wp-content/plugins/optimole-wp/inc/compatibilities/master_slider.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_compatibility' not found in wp-content/plugins/optimole-wp/inc/compatibilities/yith_quick_view.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Optml_compatibility' not found in wp-content/plugins/optimole-wp/inc/compatibilities/elementor_builder.php:8
    • > PHP Fatal error
      Trait 'Optml_Validator' not found in wp-content/plugins/optimole-wp/inc/image_properties/property_type.php on line 7

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

optimole-wp/optimole-wp.php 92% from 13 tests

The primary PHP file in "Image Optimization by Optimole - Lazy Load, CDN, Convert to WebP & AVIF" version 3.11.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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 detected18,448 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
PHP1082,9356,96614,832
JavaScript63042601,645
Markdown367001,162
CSS5128622
SVG200138
JSON10049

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity24.74
▷ Minimum class complexity1.00
▷ Maximum class complexity356.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces5
Interfaces0
Traits3
Classes90
▷ Abstract classes66.67%
▷ Concrete classes8493.33%
▷ Final classes89.52%
Methods783
▷ Static methods10513.41%
▷ Public methods67586.21%
▷ Protected methods91.15%
▷ Private methods9912.64%
Functions58
▷ Named functions1220.69%
▷ Anonymous functions4679.31%
Constants73
▷ Global constants810.96%
▷ Class constants6589.04%
▷ Public constants65100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 compressed PNG files occupy 0.32MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codeinwp/themeisle-sdk/assets/images/otter/otter-builder.png26.41KB26.24KB▼ 0.63%
assets/img/connecting.png9.20KB9.14KB▼ 0.59%
vendor/codeinwp/themeisle-sdk/assets/images/otter/otter-patterns.png87.50KB87.41KB0.10%
assets/img/logo.png8.01KB4.14KB▼ 48.33%
vendor/codeinwp/themeisle-sdk/assets/images/otter/otter-library.png173.18KB173.42KB0.00%