94% headroomjs

Code Review | Headroom.js

WordPress plugin Headroom.js scored 94% from 54 tests.

About plugin

  • Plugin page: headroomjs
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 5.8.1
  • First release: May 30, 2014
  • Latest release: May 30, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: MikevHoenselaar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 2,554 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼142.57ms] Passed 4 tests

Analyzing server-side resources used by Headroom.js
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1550.12 ▲18.55
Dashboard /wp-admin3.14 ▲0.0953.26 ▼17.44
Posts /wp-admin/edit.php3.25 ▲0.1552.46 ▲6.39
Add New Post /wp-admin/post-new.php5.50 ▲0.07104.63 ▼569.73
Media Library /wp-admin/upload.php3.09 ▲0.0845.43 ▲10.52
Headroom /wp-admin/tools.php?page=hr_settings3.0636.92

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Headroom.js
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.96 ▲0.3110.74 ▼1.1050.37 ▼7.32
Dashboard /wp-admin2,972 ▲415.95 ▲0.01153.63 ▼22.80115.90 ▼6.78
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0174.46 ▲2.7393.35 ▼9.49
Add New Post /wp-admin/post-new.php1,686 ▲318.45 ▲2.32432.14 ▼26.15118.31 ▼1.39
Media Library /wp-admin/upload.php1,812 ▲25.04 ▲0.02180.57 ▲21.12134.90 ▲15.00
Headroom /wp-admin/tools.php?page=hr_settings1,2323.8089.6894.37

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/headroomjs/headroom.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === headroomjs === )
The official readme.txt might help

headroomjs/headroom.php 92% from 13 tests

This is the main PHP file of "Headroom.js" version 0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("headroomjs.php" instead of "headroom.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected556 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP294165358
CSS2223196
JavaScript13102

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity35.50
▷ Minimum class complexity26.00
▷ Maximum class complexity45.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin