93% hsts-ready

Code Review | HSTS Ready

WordPress plugin HSTS Ready scored 93% from 54 tests.

About plugin

  • Plugin page: hsts-ready
  • Plugin version: 1.03
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8
  • WordPress version: 5.8.1
  • First release: Sep 21, 2017
  • Latest release: Sep 8, 2021
  • Number of updates: 14
  • Update frequency: every 103.5 days
  • Top authors: manu225 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active / 14,650 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by HSTS Ready
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0130.52 ▼5.41
Dashboard /wp-admin3.08 ▲0.0246.05 ▼0.51
Posts /wp-admin/edit.php3.13 ▲0.0247.06 ▲0.07
Add New Post /wp-admin/post-new.php5.43 ▼0.0093.39 ▼559.37
Media Library /wp-admin/upload.php3.02 ▲0.0130.63 ▼3.72
HSTS Ready /wp-admin/options-general.php?page=hsts_ready_settings2.9927.67

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 2 new options
New WordPress options
hsts_ready_subdomains
hsts_ready_expire

Browser metrics Passed 4 tests

Checking browser requirements for HSTS Ready
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8816.25 ▲0.629.99 ▲1.2149.70 ▼4.42
Dashboard /wp-admin2,975 ▲445.95 ▼0.07138.66 ▼8.12103.16 ▼9.11
Posts /wp-admin/edit.php2,741 ▲22.72 ▲0.0167.21 ▲4.5088.35 ▼3.07
Add New Post /wp-admin/post-new.php1,675 ▲518.87 ▼0.23382.83 ▲10.43111.89 ▲5.40
Media Library /wp-admin/upload.php1,815 ▲85.02 ▼0.02146.70 ▼13.87124.06 ▼4.96
HSTS Ready /wp-admin/options-general.php?page=hsts_ready_settings1,0592.0951.1265.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 no errors were found, 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/hsts-ready/hsts_ready.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: security, strict transport security, https, hsts, seo

hsts-ready/hsts_ready.php 77% from 13 tests

The primary PHP file in "HSTS Ready" version 1.03 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hsts-ready.php" instead of "hsts_ready.php")
  • Domain Path: The domain path should use only dashes and lowercase characters ("")
  • Domain Path: Please prefix the domain path with a forward slash character ("/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected47 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1131347

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions5
▷ Named functions5100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/fb.png1.59KB1.00KB▼ 37.42%