68% website-security-check

Code Review | Website Security Check

WordPress plugin Website Security Check scored 68% from 54 tests.

About plugin

  • Plugin page: website-security-...
  • Plugin version: 1.2.00
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.5
  • WordPress version: 6.3.1
  • First release: Feb 18, 2019
  • Latest release: Aug 27, 2020
  • Number of updates: 15
  • Update frequency: every 37.1 days
  • Top authors: johndarrel (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 4,277 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲0.19ms] Passed 4 tests

Server-side resources used by Website Security Check
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.90 ▼3.91
Dashboard /wp-admin3.41 ▲0.1146.84 ▲2.12
Posts /wp-admin/edit.php3.46 ▲0.1048.75 ▲0.89
Add New Post /wp-admin/post-new.php5.93 ▲0.04107.95 ▲3.44
Media Library /wp-admin/upload.php3.27 ▲0.0435.52 ▲1.65

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 64 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
wsc_securitycheck
wsc_securitycheck_time
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Website Security Check
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲15613.74 ▼0.461.56 ▼0.7129.01 ▼16.55
Dashboard /wp-admin2,297 ▲1064.95 ▲0.07113.52 ▲15.2873.77 ▲30.89
Posts /wp-admin/edit.php2,132 ▲402.02 ▲0.0141.94 ▲1.3535.40 ▼2.99
Add New Post /wp-admin/post-new.php1,548 ▲618.27 ▲0.06682.15 ▲79.6857.62 ▲4.60
Media Library /wp-admin/upload.php1,418 ▲304.12 ▼0.07110.70 ▲11.3845.68 ▼0.90

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/website-security-check/config/config.php+30
    Constant WSC_OPTION already defined
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • wsc_securitycheck_time
    • widget_recent-posts
    • wsc_securitycheck
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 19× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/website-security-check/index.php
    • > /wp-content/plugins/website-security-check/classes/DisplayController.php
    • > /wp-content/plugins/website-security-check/models/Settings.php
    • > /wp-content/plugins/website-security-check/controllers/SecurityCheck.php
    • > /wp-content/plugins/website-security-check/config/paths.php
    • > /wp-content/plugins/website-security-check/controllers/Menu.php
    • > /wp-content/plugins/website-security-check/classes/Error.php
    • > /wp-content/plugins/website-security-check/models/Security.php
    • > /wp-content/plugins/website-security-check/controllers/Settings.php
    • > /wp-content/plugins/website-security-check/debug/index.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/website-security-check/view/SecurityCheck.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WSC_Classes_Tools' not found in wp-content/plugins/website-security-check/view/Dashboard.php:4
    • > PHP Notice
      Undefined variable: message in wp-content/plugins/website-security-check/view/Notices.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/website-security-check/view/Connect.php:3
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/website-security-check/view/Notices.php on line 1

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: wordpress security check, security, security check, website security check

website-security-check/index.php 85% from 13 tests

The principal PHP file in "Website Security Check" v. 1.2.00 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("website-security-check.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin9,046 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP235468182,714
SVG2002,710
CSS74192,044
PO File23463961,312
JavaScript3176229
JSON10037

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity32.07
▷ Minimum class complexity3.00
▷ Maximum class complexity148.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods156
▷ Static methods6139.10%
▷ Public methods15196.79%
▷ Protected methods10.64%
▷ Private methods42.56%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 0.30MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
view/img/security_check.png23.70KB13.61KB▼ 42.58%
view/img/cache.png10.36KB10.79KB0.00%
view/img/pro_captcha.png5.37KB2.70KB▼ 49.66%
view/img/speedometer_medium.png20.89KB21.60KB0.00%
view/img/minloading.png3.45KB3.54KB0.00%