78% wp-security-hardening

Code Review | WP Hardening - Fix Your WordPress Security

WordPress plugin WP Hardening - Fix Your WordPress Security scored78%from 54 tests.

About plugin

  • Plugin page: wp-security-harde...
  • Plugin version: 1.2.6
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.0.3
  • WordPress version: 6.3.1
  • First release: Oct 27, 2019
  • Latest release: Oct 20, 2022
  • Number of updates: 25
  • Update frequency: every 43.6 days
  • Top authors: astrasecuritysuite (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

10,000+ active /92,236 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▲0.16ms] Passed 4 tests

Server-side resources used by WP Hardening - Fix Your WordPress Security
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5344.17 ▲4.09
Dashboard /wp-admin3.84 ▲0.5452.90 ▲2.70
Posts /wp-admin/edit.php3.89 ▲0.5349.79 ▲3.94
Add New Post /wp-admin/post-new.php6.37 ▲0.4994.30 ▼10.07
Media Library /wp-admin/upload.php3.69 ▲0.4740.78 ▲8.27
Hardening Audit /wp-admin/admin.php?page=wphwp_harden3.7137.12
Security Fixers /wp-admin/admin.php?page=wphwp_harden_fixers3.6835.32
Help /wp-admin/admin.php?page=wphwp_harden_help3.6432.28
Upgrade to Firewall /wp-admin/admin.php?page=wphwp_harden_upgrade3.6433.81

Server storage [IO: ▲2.00MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • You have illegally modified 1 file (0.00KB) outside of "wp-content/plugins/wp-security-hardening/" and "wp-content/uploads/"
    • (new file) wp-includes/index.php
Filesystem: 85 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
whp_scan_results_time
widget_recent-comments
widget_theysaidso_widget
whp_scan_results
whp_fixer_option
whp_radio_clickjacking_protection
hard_cron
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Hardening - Fix Your WordPress Security
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲32513.53 ▼1.038.77 ▲7.0327.71 ▼15.45
Dashboard /wp-admin2,473 ▲2995.63 ▲0.0589.11 ▼3.0194.66 ▲57.98
Posts /wp-admin/edit.php2,262 ▲1592.10 ▲0.0840.39 ▼1.3045.22 ▲4.20
Add New Post /wp-admin/post-new.php1,663 ▲12822.43 ▲4.29736.48 ▲123.2658.22 ▼7.09
Media Library /wp-admin/upload.php1,477 ▲774.24 ▲0.0298.69 ▼1.2080.93 ▲37.52
Hardening Audit /wp-admin/admin.php?page=wphwp_harden1,4831.8634.9657.38
Security Fixers /wp-admin/admin.php?page=wphwp_harden_fixers1,4871.9933.9449.15
Help /wp-admin/admin.php?page=wphwp_harden_help9792.2025.5829.28
Upgrade to Firewall /wp-admin/admin.php?page=wphwp_harden_upgrade9802.3325.9727.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • whp_radio_clickjacking_protection
    • whp_scan_results_time
    • hard_cron
    • whp_fixer_option
    • whp_scan_results
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/settings.php+102
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/formElementsClass.php+522
    Undefined index: width
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/formElementsClass.php+526
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/formElementsClass.php+526
    Undefined index: style
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/formElementsClass.php+526
    Undefined index: class
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wphwp_harden_upgrade
    • > Notice in wp-content/plugins/wp-security-hardening/modules/formElementsClass.php+533
    Undefined index: sub_text

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
The following issues need your attention
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-security-hardening/modules/formElementsClass.php
    • > /wp-content/plugins/wp-security-hardening/modules/scripts.php
    • > /wp-content/plugins/wp-security-hardening/modules/ajax.php
    • > /wp-content/plugins/wp-security-hardening/modules/hooks.php
    • > /wp-content/plugins/wp-security-hardening/wp-hardening.php
    • > /wp-content/plugins/wp-security-hardening/modules/settings.php
    • > /wp-content/plugins/wp-security-hardening/modules/gaIP.php
    • > /wp-content/plugins/wp-security-hardening/modules/functions.php

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

wp-security-hardening/wp-hardening.php 92% from 13 tests

"WP Hardening - Fix Your WordPress Security" version 1.2.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-security-hardening.php" instead of "wp-hardening.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin25,514 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
CSS133446811,876
JavaScript132,4851,3257,942
PHP87151852,452
Sass1319221,158
LESS1319311,149
SVG500519
PO File1132141418

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity32.12
▷ Minimum class complexity11.00
▷ Maximum class complexity74.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods72
▷ Static methods45.56%
▷ Public methods6590.28%
▷ Protected methods00.00%
▷ Private methods79.72%
Functions24
▷ Named functions2187.50%
▷ Anonymous functions312.50%
Constants3
▷ Global constants3100.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
8 PNG files occupy 0.25MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/images/wp-harden.png15.25KB0.40KB▼ 97.36%
modules/css/noise_layer.png134.67KB81.08KB▼ 39.79%
modules/images/tick-inside-circle.png17.83KB0.49KB▼ 97.27%
modules/images/wp-harden-active.png15.24KB0.40KB▼ 97.36%
modules/inc/assets/css/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%