83% ioptimizer

Code Review | IOptimizer - Compress, Optimize and Lazy Load Images

WordPress plugin IOptimizer - Compress, Optimize and Lazy Load Images scored83%from 54 tests.

About plugin

  • Plugin page: ioptimizer
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Apr 18, 2020
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: mainericiangel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /514 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
Installer ran successfully

Server metrics [RAM: ▼0.56MB] [CPU: ▼13.28ms] Passed 4 tests

Server-side resources used by IOptimizer - Compress, Optimize and Lazy Load Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1239.06 ▼2.66
Dashboard /wp-admin3.42 ▲0.1251.41 ▲3.25
Posts /wp-admin/edit.php3.54 ▲0.1846.40 ▼1.19
Add New Post /wp-admin/post-new.php3.30 ▼2.5938.28 ▼52.38
Media Library /wp-admin/upload.php3.35 ▲0.1237.03 ▲3.11

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
ioptimizer_lazy_load
ioptimizer_token
widget_theysaidso_widget
ioptimizer_status
ioptimizer_host
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for IOptimizer - Compress, Optimize and Lazy Load Images
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.72 ▲0.371.67 ▼0.0542.15 ▼0.70
Dashboard /wp-admin2,211 ▲315.58 ▼0.0185.56 ▼13.4440.39 ▼1.86
Posts /wp-admin/edit.php2,119 ▲221.97 ▼0.0534.72 ▼3.2035.96 ▼5.83
Add New Post /wp-admin/post-new.php1,548 ▲2218.37 ▼4.67636.22 ▼17.4467.02 ▲9.13
Media Library /wp-admin/upload.php1,416 ▲164.21 ▼0.01103.03 ▼12.0644.29 ▼3.45

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 did not uninstall successfully, leaving 10 options in the database
    • widget_theysaidso_widget
    • ioptimizer_host
    • widget_recent-posts
    • widget_recent-comments
    • ioptimizer_lazy_load
    • theysaidso_admin_options
    • ioptimizer_token
    • can_compress_scripts
    • db_upgraded
    • ioptimizer_status

Smoke tests 75% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ioptimizer/admin/partials/ioptimizer-admin-display.php:2

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

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The main interface), #2 (The image menu)
The official readme.txt is a good inspiration

ioptimizer/ioptimizer.php Passed 13 tests

The entry point to "IOptimizer - Compress, Optimize and Lazy Load Images" version 1.0.3 is a PHP file that has certain tags in its header comment area
51 characters long description:
Compress images remotely for a better loading time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,133 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12143503623
CSS1645401
JavaScript1131108
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.38
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods3083.33%
▷ Protected methods00.00%
▷ Private methods616.67%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.06MB with 0.82MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png214.09KB40.70KB▼ 80.99%
assets/screenshot-2.png871.06KB236.10KB▼ 72.90%