84% strict-security-headers

Code Review | Strict Security Headers

WordPress plugin Strict Security Headers scored84%from 54 tests.

About plugin

  • Plugin page: strict-security-h...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Sep 24, 2023
  • Latest release: Sep 25, 2023
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: Kopepasah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /34 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼10.63ms] Passed 4 tests

Analyzing server-side resources used by Strict Security Headers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.09 ▼24.03
Dashboard /wp-admin3.32 ▲0.0244.91 ▼6.58
Posts /wp-admin/edit.php3.43 ▲0.0848.75 ▼2.96
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.37 ▼8.93
Media Library /wp-admin/upload.php3.24 ▲0.0232.49 ▼2.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Strict Security Headers
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,781 ▲3514.46 ▼0.221.22 ▼1.1812.62 ▼32.82
Dashboard /wp-admin2,209 ▲215.93 ▲1.0494.85 ▼18.5037.62 ▼6.86
Posts /wp-admin/edit.php1,906 ▼1830.74 ▼1.302.79 ▼30.9111.10 ▼25.80
Add New Post /wp-admin/post-new.php1,514 ▼517.46 ▼5.77679.77 ▲74.4071.60 ▲17.04
Media Library /wp-admin/upload.php1,391 ▲64.21 ▲0.0695.23 ▼0.0946.64 ▲3.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'DualFocus\\StrictSecurityHeaders\\HeaderInterface' not found in wp-content/plugins/strict-security-headers/lib/Header.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/ReferrerPolicy.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/XContentTypeOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/PermissionsPolicy.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/XFrameOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/ContentSecurityPolicy.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'DualFocus\\StrictSecurityHeaders\\Header' not found in wp-content/plugins/strict-security-headers/lib/StrictTransportSecurity.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: security headers, http headers, security, headers

strict-security-headers/strict-security-headers.php Passed 13 tests

The main PHP file in "Strict Security Headers" ver. 0.1.0 adds more information about the plugin and also serves as the entry point for this plugin
57 characters long description:
Enables enforcement of strict security headers on a site.

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
Everything looks great! No dangerous files found in this plugin718 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP18183650713
JSON1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes19.09%
Methods55
▷ Static methods2545.45%
▷ Public methods4989.09%
▷ Protected methods35.45%
▷ Private methods35.45%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
PNG images were not found in this plugin