83% hsts-strict-preload

Code Review | HSTS strict-preload

WordPress plugin HSTS strict-preload scored83%from 54 tests.

About plugin

  • Plugin page: hsts-strict-preload
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 28, 2019
  • Latest release: Feb 28, 2019
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: timpet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /723 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.71ms] Passed 4 tests

A check of server-side resources used by HSTS strict-preload
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.65 ▼0.84
Dashboard /wp-admin3.31 ▲0.0045.11 ▼2.33
Posts /wp-admin/edit.php3.36 ▲0.0045.80 ▼4.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.86 ▼14.42
Media Library /wp-admin/upload.php3.23 ▲0.0033.90 ▼2.06

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 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

This is an overview of browser requirements for HSTS strict-preload
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.001.56 ▼0.1637.49 ▼1.52
Dashboard /wp-admin2,192 ▲155.62 ▼0.0389.32 ▲3.9040.60 ▼4.96
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0139.20 ▲3.3236.70 ▲1.16
Add New Post /wp-admin/post-new.php1,526 ▼023.49 ▲0.42694.90 ▼21.3453.63 ▲0.55
Media Library /wp-admin/upload.php1,403 ▲34.17 ▼0.08104.24 ▼6.8845.78 ▼7.21

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

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)
Even though everything seems fine, this is not 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hsts-strict-preload/hsts-preload-strict.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is missing
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === hsts-strict-preload === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
The official readme.txt might help

hsts-strict-preload/hsts-preload-strict.php 92% from 13 tests

The main PHP script in "HSTS strict-preload" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("hsts-strict-preload.php" instead of "hsts-preload-strict.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin11 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12911

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.67
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%
Functions1
▷ Named functions1100.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