89% wp-fail2ban-addon-gravity-forms

Code Review | WP fail2ban Add-on for Gravity Forms

WordPress plugin WP fail2ban Add-on for Gravity Forms scored89%from 54 tests.

About plugin

  • Plugin page: wp-fail2ban-addon...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1
  • WordPress version: 6.3.1
  • First release: Apr 11, 2019
  • Latest release: Nov 13, 2022
  • Number of updates: 27
  • Update frequency: every 48.6 days
  • Top authors: invisnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,057 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.39ms] Passed 4 tests

An overview of server-side resources used by WP fail2ban Add-on for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.89 ▲1.70
Dashboard /wp-admin3.31 ▲0.0045.06 ▲1.55
Posts /wp-admin/edit.php3.36 ▲0.0044.82 ▼3.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.25 ▼0.63
Media Library /wp-admin/upload.php3.23 ▲0.0031.72 ▼2.63

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP fail2ban Add-on for Gravity Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.26 ▼1.521.83 ▲0.1841.60 ▼2.60
Dashboard /wp-admin2,209 ▲214.85 ▼1.05107.70 ▲8.2242.32 ▼1.36
Posts /wp-admin/edit.php2,092 ▲62.02 ▼0.0338.86 ▼1.8734.63 ▼3.38
Add New Post /wp-admin/post-new.php1,543 ▲1018.48 ▼4.88586.51 ▼30.9060.58 ▼2.37
Media Library /wp-admin/upload.php1,388 ▲64.19 ▼0.0997.66 ▼2.4043.07 ▼0.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: gravity forms, security, spam, fail2ban, classicpress

wp-fail2ban-addon-gravity-forms/addon.php 85% from 13 tests

This is the main PHP file of "WP fail2ban Add-on for Gravity Forms" version 2.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-fail2ban-addon-gravity-forms.php" instead of "addon.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected335 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP969246314
JSON10021

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods3
▷ Static methods3100.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png3.80KB3.21KB▼ 15.49%