84% lh-add-headers

Code Review | LH Add Headers

WordPress plugin LH Add Headers scored84%from 54 tests.

About plugin

  • Plugin page: lh-add-headers
  • Plugin version: 1.04
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-4.8
  • WordPress version: 6.3.1
  • First release: May 6, 2016
  • Latest release: May 2, 2017
  • Number of updates: 9
  • Update frequency: every 49.8 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,750 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.44ms] Passed 4 tests

This is a short check of server-side resources used by LH Add Headers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.90 ▼0.25
Dashboard /wp-admin3.31 ▼0.0448.41 ▼10.15
Posts /wp-admin/edit.php3.36 ▲0.0042.34 ▼1.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.35 ▼13.81
Media Library /wp-admin/upload.php3.23 ▲0.0036.00 ▲2.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for LH Add Headers
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲5314.24 ▼0.111.92 ▲0.2138.53 ▼2.13
Dashboard /wp-admin2,195 ▲155.57 ▼0.1185.08 ▼8.1339.75 ▼10.42
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0133.55 ▼5.5534.81 ▼0.51
Add New Post /wp-admin/post-new.php1,526 ▼023.47 ▲0.65611.68 ▼97.3650.97 ▼13.76
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0096.31 ▼8.6243.09 ▼1.91

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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
Even though no errors were found, 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
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 add_action() in wp-content/plugins/lh-add-headers/lh-add-headers.php:126

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
Please take inspiration from this readme.txt

lh-add-headers/lh-add-headers.php Passed 13 tests

This is the main PHP file of "LH Add Headers" version 1.04, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
41 characters long description:
Adds simple cacheing headers to wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin44 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1841144

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.21
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods375.00%
▷ Protected methods00.00%
▷ Private methods125.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected