10% wp-optimizer

Code Review | WP Optimizer

WordPress plugin WP Optimizer scored10%from 54 tests.

About plugin

  • Plugin page: wp-optimizer
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 92
  • Update frequency: every 14.3 days
  • Top authors: sh1zen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /9,990 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Parse error in wp-content/plugins/wp-optimizer/vendors/wps-framework/Query.class.php+214
    syntax error, unexpected '=>' (T_DOUBLE_ARROW)

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.41ms] Passed 4 tests

Analyzing server-side resources used by WP Optimizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.86 ▼3.11
Dashboard /wp-admin3.31 ▲0.0045.67 ▼4.67
Posts /wp-admin/edit.php3.36 ▲0.0045.87 ▼1.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.28 ▲0.50
Media Library /wp-admin/upload.php3.24 ▲0.0035.22 ▼0.10

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 99 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Optimizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.67 ▲0.331.94 ▲0.2744.87 ▲0.63
Dashboard /wp-admin2,198 ▲245.61 ▲0.0491.39 ▼12.8841.94 ▼0.39
Posts /wp-admin/edit.php2,103 ▲61.95 ▼0.0738.92 ▼1.3937.94 ▲0.77
Add New Post /wp-admin/post-new.php1,531 ▲523.46 ▲0.22658.15 ▲58.2158.00 ▲4.88
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.0095.09 ▼0.7540.63 ▼2.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Almost there! Just fix the following items
  • 53× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-optimizer/modules/supporters/media/Media_Table.class.php on line 11
    • > PHP Warning
      require_once(WPS_FRAMEWORKfunctions/images.php): failed to open stream: No such file or directory in wp-content/plugins/wp-optimizer/vendors/wps-framework/functions/autoload.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WPOptimizer\\modules\\supporters\\Cache_Dispatcher' not found in wp-content/plugins/wp-optimizer/modules/supporters/cache/objectcache.class.php:12
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-optimizer/modules/supporters/activity-log/ActivityLog_Table.class.php on line 11
    • > PHP Parse error
      syntax error, unexpected '=>' (T_DOUBLE_ARROW) in wp-content/plugins/wp-optimizer/vendors/wps-framework/Query.class.php on line 214
    • > PHP Parse error
      syntax error, unexpected '=>' (T_DOUBLE_ARROW) in wp-content/plugins/wp-optimizer/vendors/wps-framework/Query.class.php on line 214
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/wp-optimizer/admin/upgrades/1.6.0.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPS\\modules\\Module' not found in wp-content/plugins/wp-optimizer/modules/wp_updates.class.php:15
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-optimizer/modules/supporters/cache/db.php on line 16
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-optimizer/inc/constants.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5 in wp-optimizer/assets to your readme.txt
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-optimizer/wp-optimizer.php 85% from 13 tests

Analyzing the main PHP file in "WP Optimizer" version 2.2.0
It is important 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
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin15,220 lines of code in 92 files:
LanguageFilesBlank linesComment linesLines of code
PHP813,7961,87613,124
JavaScript6359751,125
CSS415813958
XML10013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity35.13
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes60
▷ Abstract classes00.00%
▷ Concrete classes60100.00%
▷ Final classes00.00%
Methods720
▷ Static methods17924.86%
▷ Public methods51170.97%
▷ Protected methods9012.50%
▷ Private methods11916.53%
Functions128
▷ Named functions7659.38%
▷ Anonymous functions5240.62%
Constants37
▷ Global constants924.32%
▷ Class constants2875.68%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin