89% wp-fail2ban-addon-contact-form-7

Code Review | WP fail2ban Add-on for Contact Form 7

WordPress plugin WP fail2ban Add-on for Contact Form 7 scored 89% 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 18, 2019
  • Latest release: Nov 13, 2022
  • Number of updates: 22
  • Update frequency: every 59.4 days
  • Top authors: invisnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active / 4,558 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by WP fail2ban Add-on for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.26 ▼4.29
Dashboard /wp-admin3.31 ▲0.0045.47 ▼2.75
Posts /wp-admin/edit.php3.36 ▲0.0047.94 ▲0.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.91 ▼6.38
Media Library /wp-admin/upload.php3.23 ▲0.0032.43 ▼1.55

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

WP fail2ban Add-on for Contact Form 7: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼1.101.65 ▼0.2241.09 ▼4.46
Dashboard /wp-admin2,203 ▲155.81 ▲0.00107.90 ▼7.2239.71 ▼3.07
Posts /wp-admin/edit.php2,089 ▼02.18 ▲0.1939.56 ▲1.1036.24 ▲1.22
Add New Post /wp-admin/post-new.php1,517 ▼1817.92 ▼5.24617.67 ▼63.1950.50 ▼7.12
Media Library /wp-admin/upload.php1,391 ▲64.19 ▼0.0699.04 ▼1.8641.13 ▼4.40

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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 | 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: contact form 7, fail2ban, security, classicpress, spam

wp-fail2ban-addon-contact-form-7/addon.php 85% from 13 tests

The entry point to "WP fail2ban Add-on for Contact Form 7" version 2.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-fail2ban-addon-contact-form-7.php" instead of "addon.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
There were no executable files found in this plugin335 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP971243314
JSON10021

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
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

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.png13.19KB6.99KB▼ 47.04%