74% security-headers

Code Review | Security Headers

WordPress plugin Security Headers scored74%from 54 tests.

About plugin

  • Plugin page: security-headers
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-5.1
  • WordPress version: 6.3.1
  • First release: Apr 10, 2015
  • Latest release: Feb 26, 2019
  • Number of updates: 25
  • Update frequency: every 56.7 days
  • Top authors: SimonRWaters (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

6,000+ active /42,139 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.07ms] Passed 4 tests

This is a short check of server-side resources used by Security Headers
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.01 ▼7.30
Dashboard /wp-admin3.42 ▲0.1147.05 ▲4.21
Posts /wp-admin/edit.php3.53 ▲0.1847.78 ▲0.14
Add New Post /wp-admin/post-new.php6.00 ▲0.1181.50 ▼5.26
Media Library /wp-admin/upload.php3.34 ▲0.1137.35 ▲0.15
HTTP Headers /wp-admin/options-general.php?page=security_headers3.3134.19

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Security Headers
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.28 ▼0.071.68 ▼0.4839.22 ▼7.84
Dashboard /wp-admin2,199 ▲195.72 ▲0.1484.83 ▼2.4539.03 ▼1.29
Posts /wp-admin/edit.php2,101 ▲11.99 ▲0.0035.96 ▼8.3930.46 ▼5.30
Add New Post /wp-admin/post-new.php1,529 ▲323.10 ▼0.10583.65 ▼29.1766.69 ▲14.12
Media Library /wp-admin/upload.php1,401 ▲14.17 ▼0.0799.53 ▼6.0046.48 ▲1.79
HTTP Headers /wp-admin/options-general.php?page=security_headers9882.0023.2428.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function unregister_setting was called with an argument that is deprecated since version 4.7.0! $sanitize_callback is deprecated. The callback from register_setting() is used instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/security-headers/security_headers.php:100

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: nosniff, https, tls, hsts

security-headers/security_headers.php 92% from 13 tests

The main PHP file in "Security Headers" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("security-headers.php" instead of "security_headers.php")

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 detected301 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15221292
Markdown1709

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin