84% wpf2b-addon-blocklist

Code Review | WP fail2ban Blocklist

WordPress plugin WP fail2ban Blocklist scored84%from 54 tests.

About plugin

  • Plugin page: wpf2b-addon-block...
  • Plugin version: 2.2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2022
  • Latest release: Mar 29, 2023
  • Number of updates: 32
  • Update frequency: every 12.6 days
  • Top authors: invisnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /9,506 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼29.60ms] Passed 4 tests

A check of server-side resources used by WP fail2ban Blocklist
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0345.39 ▲3.54
Dashboard /wp-admin3.34 ▼0.0049.96 ▼18.34
Posts /wp-admin/edit.php3.39 ▲0.0348.21 ▼5.62
Add New Post /wp-admin/post-new.php5.92 ▲0.0487.35 ▼94.30
Media Library /wp-admin/upload.php3.26 ▲0.0339.38 ▼0.15

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP fail2ban Blocklist
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.22 ▼1.154.82 ▲2.8743.08 ▼1.27
Dashboard /wp-admin2,221 ▲185.83 ▲0.94104.35 ▼13.9140.54 ▼7.99
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0534.56 ▼2.8633.29 ▼2.13
Add New Post /wp-admin/post-new.php1,545 ▲1323.19 ▲2.31693.38 ▼173.4368.61 ▼2.75
Media Library /wp-admin/upload.php1,400 ▲34.26 ▲0.05112.68 ▲0.5143.14 ▼12.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'com\\wp_fail2ban\\addons\\Blocklist\\Coder' not found in wp-content/plugins/wpf2b-addon-blocklist/classes/Encoder.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'com\\wp_fail2ban\\addons\\Blocklist\\Coder' not found in wp-content/plugins/wpf2b-addon-blocklist/classes/Decoder.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: fail2ban, blocklist, security

wpf2b-addon-blocklist/addon.php 92% from 13 tests

The main PHP file in "WP fail2ban Blocklist" ver. 2.2.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpf2b-addon-blocklist.php" instead of "addon.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
There were no executable files found in this plugin1,907 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP303861,3591,865
JSON10021
JavaScript10020
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.12
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces6
Interfaces0
Traits4
Classes12
▷ Abstract classes541.67%
▷ Concrete classes758.33%
▷ Final classes00.00%
Methods61
▷ Static methods4370.49%
▷ Public methods3354.10%
▷ Protected methods2845.90%
▷ Private methods00.00%
Functions48
▷ Named functions3879.17%
▷ Anonymous functions1020.83%
Constants20
▷ Global constants1260.00%
▷ Class constants840.00%
▷ Public constants8100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png15.24KB9.61KB▼ 36.93%