10% automatic-ban-ip

Code Review | Automatic Ban IP

WordPress plugin Automatic Ban IP scored10%from 54 tests.

About plugin

  • Plugin page: automatic-ban-ip
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Nov 30, 2014
  • Latest release: Apr 17, 2016
  • Number of updates: 21
  • Update frequency: every 24.0 days
  • Top authors: sedLex (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /4,386 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/automatic-ban-ip/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor

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

An overview of server-side resources used by Automatic Ban IP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.97 ▼1.47
Dashboard /wp-admin3.31 ▲0.0051.02 ▼2.95
Posts /wp-admin/edit.php3.36 ▲0.0046.56 ▼2.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.07 ▼11.40
Media Library /wp-admin/upload.php3.23 ▲0.0038.24 ▲2.03

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 163 new files
Database: 1 new table, 7 new options
New tables
wp_pluginSL_automatic_ban_ip
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
automatic_ban_ip_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Automatic Ban IP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.68 ▼0.691.89 ▼0.3244.58 ▲0.25
Dashboard /wp-admin2,206 ▲185.83 ▼0.0299.91 ▼17.5740.85 ▼3.44
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0433.83 ▼4.7634.37 ▲0.62
Add New Post /wp-admin/post-new.php1,533 ▲1923.16 ▲5.64670.12 ▲30.9167.43 ▲16.32
Media Library /wp-admin/upload.php1,388 ▲64.21 ▼0.00112.67 ▼16.7950.77 ▲1.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/automatic-ban-ip/core.class.php+1698
    Methods with the same name as their class will not be constructors in a future version of PHP; coreSLframework has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/automatic-ban-ip/automatic-ban-ip.php
    • > /wp-content/plugins/automatic-ban-ip/core.class.php
    • > /wp-content/plugins/automatic-ban-ip/core.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/automatic-ban-ip/core/templates/my-plugin.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/automatic-ban-ip/core/templates/my-plugin.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (The world map of banned spammers), #2 (An extract of list of banned spammers)
Please take inspiration from this readme.txt

automatic-ban-ip/automatic-ban-ip.php 92% from 13 tests

Analyzing the main PHP file in "Automatic Ban IP" version 1.0.7
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 745 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected16,908 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PO File333,91608,546
PHP199761,7836,973
JavaScript7206235781
CSS118813493
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity52.05
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity7.22
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods156
▷ Static methods3623.08%
▷ Public methods15398.08%
▷ Protected methods31.92%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 PNG files occupy 0.55MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/tree_node_plus.png0.15KB0.13KB▼ 12.50%
core/img/title_popup.png2.72KB0.20KB▼ 92.65%
img/icon-256x256.png38.39KB15.17KB▼ 60.49%
core/img/tab_mail.png0.66KB0.62KB▼ 6.63%
core/img/tab_empty.png0.08KB0.09KB0.00%