84% add-nsa-header

Code Review | Add NSA Header

WordPress plugin Add NSA Header scored84%from 54 tests.

About plugin

  • Plugin page: add-nsa-header
  • Plugin version: 2.7182
  • PHP compatiblity: 4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 1.2-6.4
  • WordPress version: 6.3.1
  • First release: Nov 26, 2020
  • Latest release: Oct 4, 2023
  • Number of updates: 13
  • Update frequency: every 80.2 days
  • Top authors: tehmaxh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /519 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Add NSA Header
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.96 ▼3.29
Dashboard /wp-admin3.32 ▲0.0146.75 ▼4.17
Posts /wp-admin/edit.php3.37 ▲0.0145.31 ▼0.59
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.29 ▼18.96
Media Library /wp-admin/upload.php3.24 ▲0.0136.23 ▼0.48

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Add NSA Header
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.40 ▼0.901.83 ▼0.0242.96 ▼2.46
Dashboard /wp-admin2,209 ▲244.86 ▼1.02103.51 ▼14.9443.13 ▼5.14
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0137.72 ▲0.8632.88 ▼4.82
Add New Post /wp-admin/post-new.php1,535 ▲223.53 ▲0.24648.89 ▼43.0250.40 ▼15.90
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.0698.41 ▼12.2141.97 ▼4.19

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-nsa-header/nsa-header.php:35

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
1 plugin tags: http header

add-nsa-header/nsa-header.php 92% from 13 tests

The primary PHP file in "Add NSA Header" version 2.7182 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-nsa-header.php" instead of "nsa-header.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin25 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12925

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected