89% wp-head-optimizer

Code Review | WP Head Optimizer

WordPress plugin WP Head Optimizer scored89%from 54 tests.

About plugin

  • Plugin page: wp-head-optimizer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2017
  • Latest release: Jul 9, 2021
  • Number of updates: 6
  • Update frequency: every 244.0 days
  • Top authors: gr8nilay (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /4,694 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.17MB] [CPU: ▼12.93ms] Passed 4 tests

A check of server-side resources used by WP Head Optimizer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7314.53 ▼28.00
Dashboard /wp-admin3.32 ▲0.0250.05 ▼5.21
Posts /wp-admin/edit.php3.37 ▲0.0147.08 ▼5.62
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.34 ▼12.89
Media Library /wp-admin/upload.php3.24 ▲0.0138.67 ▼3.21

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
wpho_activated_on
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Head Optimizer: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.20 ▼0.181.78 ▼0.3444.94 ▲1.91
Dashboard /wp-admin2,202 ▲225.71 ▲0.0395.24 ▲1.85100.18 ▲56.96
Posts /wp-admin/edit.php2,125 ▲282.02 ▲0.0436.27 ▼2.0034.33 ▼1.86
Add New Post /wp-admin/post-new.php1,560 ▲1523.22 ▲1.91732.39 ▲11.9469.07 ▲8.16
Media Library /wp-admin/upload.php1,416 ▲164.40 ▲0.18101.51 ▼11.3666.59 ▲20.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (Admin Screen of the plugin at where you can play with the plugin) image not found
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-head-optimizer === )
The official readme.txt might help

wp-head-optimizer/wp-head-optimizer.php 92% from 13 tests

The main PHP script in "WP Head Optimizer" version 1.0.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected349 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11135455327
JavaScript15016
CSS1006

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.29
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
snapshot-1.png82.98KB34.57KB▼ 58.34%
admin/css/wpho_icon.png1.45KB0.87KB▼ 40.07%