78% better-headers

Code Review | Better Headers

WordPress plugin Better Headers scored 78% from 54 tests.

About plugin

  • Plugin page: better-headers
  • Plugin version: 2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 9, 2019
  • Latest release: May 24, 2022
  • Number of updates: 27
  • Update frequency: every 43.5 days
  • Top authors: riklewis (55.56%)bettersecurity (48.15%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,817 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.22MB] [CPU: ▲0.34ms] Passed 4 tests

An overview of server-side resources used by Better Headers
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2144.27 ▲2.93
Dashboard /wp-admin3.53 ▲0.2348.16 ▼2.49
Posts /wp-admin/edit.php3.65 ▲0.2948.65 ▼0.73
Add New Post /wp-admin/post-new.php6.11 ▲0.2388.89 ▲1.65
Media Library /wp-admin/upload.php3.46 ▲0.2335.67 ▲5.01
Better Headers /wp-admin/options-general.php?page=better-headers-settings3.4031.33

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Better Headers
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.26 ▼1.151.98 ▲0.3342.69 ▼6.94
Dashboard /wp-admin2,207 ▲195.83 ▲0.9598.74 ▼7.6239.80 ▼3.36
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.1639.55 ▼3.4339.15 ▲3.60
Add New Post /wp-admin/post-new.php1,523 ▼1023.33 ▲0.07668.50 ▼4.7754.69 ▲1.00
Media Library /wp-admin/upload.php1,383 ▼54.17 ▲0.0299.07 ▼6.6843.07 ▲0.54
Better Headers /wp-admin/options-general.php?page=better-headers-settings1,7911.7231.6848.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=better-headers-settings
    • > Notice in wp-content/plugins/better-headers/better-headers.php+724
    Trying to access array offset on value of type bool

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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/better-headers/better-headers.php

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: better, policy, response, headers, options...

better-headers/better-headers.php 85% from 13 tests

Analyzing the main PHP file in "Better Headers" version 2.1
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin757 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP25659757

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions60
▷ Named functions5998.33%
▷ Anonymous functions11.67%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
header.png10.50KB6.82KB▼ 35.03%