78% headwp

Code Review | Head.WP

WordPress plugin Head.WP scored 78% from 54 tests.

About plugin

  • Plugin page: headwp
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.8.1
  • WordPress version: 6.3.1
  • First release: Apr 21, 2013
  • Latest release: Feb 18, 2014
  • Number of updates: 11
  • Update frequency: every 27.6 days
  • Top authors: kylereicks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,002 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.11MB] [CPU: ▼3.01ms] Passed 4 tests

An overview of server-side resources used by Head.WP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.53 ▲6.30
Dashboard /wp-admin3.33 ▲0.0245.16 ▲1.84
Posts /wp-admin/edit.php3.38 ▲0.0249.28 ▲1.22
Add New Post /wp-admin/post-new.php5.38 ▼0.5066.09 ▼21.40
Media Library /wp-admin/upload.php3.25 ▲0.0238.20 ▲6.43

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
head_js_wp_update_timestamp
widget_recent-comments
head_js_wp_version
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Head.WP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,700 ▼357.87 ▼6.444.00 ▲2.2543.80 ▲5.19
Dashboard /wp-admin2,209 ▲185.86 ▼0.0495.76 ▼23.9343.72 ▼1.08
Posts /wp-admin/edit.php2,086 ▼62.05 ▲0.0433.85 ▼0.6934.47 ▲4.87
Add New Post /wp-admin/post-new.php1,544 ▲3018.30 ▲0.60629.85 ▼137.4660.83 ▲1.48
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0595.89 ▼1.1241.13 ▼0.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/headwp/inc/templates/min/head-init-template.php
    • > /wp-content/plugins/headwp/inc/templates/head-init-template.php
    • > /wp-content/plugins/headwp/inc/templates/min/load-async-script-template.php
    • > /wp-content/plugins/headwp/inc/templates/load-async-script-template.php
  • 39× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/headwp/inc/templates/min/head-ready-template.php:10
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/headwp/inc/templates/head-ready-template.php:12
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/headwp/inc/templates/min/inline-script-template.php:2
    • > PHP Notice
      Undefined variable: item in wp-content/plugins/headwp/inc/templates/head-ready-template.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/headwp/inc/templates/head-ready-template.php on line 3
    • > PHP Notice
      Undefined variable: src in wp-content/plugins/headwp/inc/templates/min/load-async-script-template.php on line 1
    • > PHP Notice
      Undefined variable: queue in wp-content/plugins/headwp/inc/templates/head-init-template.php on line 3
    • > PHP Notice
      Undefined variable: model in wp-content/plugins/headwp/inc/templates/min/head-load-template.php on line 2
    • > PHP Notice
      Undefined variable: item in wp-content/plugins/headwp/inc/templates/min/head-load-template.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/headwp/inc/templates/head-load-template.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: wp_enqueue_script, headjs, script loading, async, enqueue...

headwp/head-js-wp.php 92% from 13 tests

Analyzing the main PHP file in "Head.WP" version 2.0.3
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("headwp.php" instead of "head-js-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin680 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2124200388
PHP15549292

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity11.50
▷ Minimum class complexity3.00
▷ Maximum class complexity27.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods18
▷ Static methods844.44%
▷ Public methods1266.67%
▷ Protected methods00.00%
▷ Private methods633.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There are no PNG files in this plugin