10% httpcs-validation

Code Review | HTTPCS Validation

WordPress plugin HTTPCS Validation scored 10% from 54 tests.

About plugin

  • Plugin page: httpcs-validation
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.1
  • WordPress version: 6.3.1
  • First release: Jul 12, 2017
  • Latest release: Aug 14, 2017
  • Number of updates: 20
  • Update frequency: every 1.7 days
  • Top authors: httpcs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 804 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/httpcs-validation/httpcsValidation.php+82
    Undefined index: securedToken

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

This is a short check of server-side resources used by HTTPCS Validation
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1246.69 ▲3.10
Dashboard /wp-admin3.43 ▲0.1272.33 ▲14.47
Posts /wp-admin/edit.php3.55 ▲0.1957.11 ▲5.04
Add New Post /wp-admin/post-new.php6.01 ▲0.1289.47 ▼11.84
Media Library /wp-admin/upload.php3.36 ▲0.1243.92 ▲3.27

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

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

Browser metrics Passed 4 tests

A check of browser resources used by HTTPCS Validation
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲2714.47 ▲0.051.95 ▼0.0243.86 ▼6.46
Dashboard /wp-admin2,210 ▲75.84 ▲0.05113.99 ▲8.1484.93 ▲44.21
Posts /wp-admin/edit.php2,108 ▲192.02 ▲0.0444.15 ▲6.6337.74 ▲3.74
Add New Post /wp-admin/post-new.php1,417 ▼11718.10 ▼5.07698.96 ▲4.8256.29 ▲1.59
Media Library /wp-admin/upload.php1,404 ▲164.15 ▼0.01101.76 ▼11.0978.56 ▲30.04

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/httpcs-validation/httpcsValidation.php+82
    Undefined index: securedToken
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× 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/httpcs-validation/httpcsValidation.php:73
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/httpcs-validation/httpcsConfig.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: cyber security, web security

httpcs-validation/httpcsValidation.php 85% from 13 tests

The entry point to "HTTPCS Validation" version 1.0.7 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("httpcs-validation.php" instead of "httpcsValidation.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected942 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP46889620
CSS100168
PO File15544126
JavaScript10028

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.45
Average class complexity56.00
▷ Minimum class complexity34.00
▷ Maximum class complexity78.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/httpcsIcon.png1.55KB0.64KB▼ 58.81%
img/httpcsLogo.png7.02KB3.11KB▼ 55.73%