67% security-force

Code Review | Security Force

WordPress plugin Security Force scored67%from 54 tests.

About plugin

  • Plugin page: security-force
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 31, 2020
  • Latest release: Nov 23, 2023
  • Number of updates: 3
  • Update frequency: every 422.4 days
  • Top authors: securityforce (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /4,490 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.43MB] [CPU: ▲9.40ms] Passed 4 tests

An overview of server-side resources used by Security Force
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.34 ▲0.8842.68 ▲1.17
Dashboard /wp-admin4.92 ▲1.5774.30 ▲9.12
Posts /wp-admin/edit.php4.99 ▲1.6470.53 ▲19.20
Add New Post /wp-admin/post-new.php7.61 ▲1.72108.31 ▲11.35
Media Library /wp-admin/upload.php4.86 ▲1.6355.79 ▲15.97
Pro Options /wp-admin/admin.php?page=securityforce_secure_network4.7859.82
Security Settings /wp-admin/admin.php?page=security_force4.8153.70
Widgets /wp-admin/admin.php?page=security_force_dashboard4.8156.67
Setup Wizard /wp-admin/admin.php?page=securityforce_setup_wizard4.7952.44

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 471 new files
Database: 2 new tables, 8 new options
New tables
wp_securityforce_ab_attacks
wp_securityforce_blocked_ips
New WordPress options
theysaidso_admin_options
securityforce_firewall_phpidsinstalled
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
security_force
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Security Force
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5514.67 ▲0.291.41 ▼0.1939.99 ▼2.51
Dashboard /wp-admin2,221 ▲475.52 ▲0.0094.29 ▼6.3875.11 ▲28.08
Posts /wp-admin/edit.php2,129 ▲291.96 ▼0.0639.61 ▼1.4236.47 ▲3.37
Add New Post /wp-admin/post-new.php1,701 ▲17522.10 ▼1.11591.74 ▼118.5059.59 ▲1.30
Media Library /wp-admin/upload.php1,429 ▲294.11 ▼0.1898.53 ▼16.6874.43 ▲25.82
Pro Options /wp-admin/admin.php?page=securityforce_secure_network8732.0027.2727.99
Security Settings /wp-admin/admin.php?page=security_force2,1972.92112.0860.77
Widgets /wp-admin/admin.php?page=security_force_dashboard1,1733.24135.9835.72
Setup Wizard /wp-admin/admin.php?page=securityforce_setup_wizard9351.6528.3033.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_securityforce_ab_attacks
    • wp_securityforce_blocked_ips
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • can_compress_scripts
    • security_force
    • widget_recent-comments
    • widget_theysaidso_widget
    • securityforce_firewall_phpidsinstalled
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/security-force/firewall/libraries/IDS/Config/Config.ini.php
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Printer' not found in wp-content/plugins/security-force/firewall/libraries/IDS/vendors/htmlpurifier/standalone/HTMLPurifier/Printer/ConfigForm.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/security-force/securityforce.php:21
    • > PHP Fatal error
      require_once(): Failed opening required 'IDS/Log/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/security-force/firewall/libraries/IDS/Log/Database.php on line 35
    • > PHP Warning
      require_once(IDS/Log/Interface.php): failed to open stream: No such file or directory in wp-content/plugins/security-force/firewall/libraries/IDS/Log/File.php on line 34
    • > PHP Fatal error
      require_once(): Failed opening required 'IDS/Caching/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/security-force/firewall/libraries/IDS/Caching/Apc.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/security-force/lib/auto_config.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/security-force/lib/auto_config/woo-commerce.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLPurifier_Filter' not found in wp-content/plugins/security-force/firewall/libraries/IDS/vendors/htmlpurifier/standalone/HTMLPurifier/Filter/YouTube.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'IDS/Caching/Interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/security-force/firewall/libraries/IDS/Caching/Memcached.php on line 34
    • > PHP Fatal error
      Uncaught Error: Class 'Jetpack' not found in wp-content/plugins/security-force/lib/auto_config/jetpack.php:3

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 86% 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
1 plugin tags: security

security-force/securityforce.php 69% from 13 tests

"Security Force" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Git Repository: Please do not include Git repositories in your plugin
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Main file name: Name the main plugin file the same as the plugin slug ("security-force.php" instead of "securityforce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin42,362 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP717,73214,73430,873
JavaScript52,1992,15410,539
XML100827
CSS23173
SVG10148
INI1111
JSON1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity17.81
▷ Minimum class complexity1.00
▷ Maximum class complexity889.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes264
▷ Abstract classes166.06%
▷ Concrete classes24893.94%
▷ Final classes00.00%
Methods1,074
▷ Static methods10810.06%
▷ Public methods85979.98%
▷ Protected methods1059.78%
▷ Private methods11010.24%
Functions19
▷ Named functions842.11%
▷ Anonymous functions1157.89%
Constants91
▷ Global constants2021.98%
▷ Class constants7178.02%
▷ Public constants71100.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
10 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/hedge3.48.png3.46KB1.99KB▼ 42.57%
img/delete.png2.17KB1.62KB▼ 25.35%
img/hedge3.64.png4.77KB2.23KB▼ 53.28%
img/add.png0.51KB0.27KB▼ 47.82%
img/securityforce32.png2.75KB1.56KB▼ 43.36%