84% simple-ip-ban

Code Review | IP Ban

WordPress plugin IP Ban scored84%from 54 tests.

About plugin

  • Plugin page: simple-ip-ban
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-4.7
  • WordPress version: 6.3.1
  • First release: Sep 9, 2012
  • Latest release: Dec 10, 2016
  • Number of updates: 37
  • Update frequency: every 42.0 days
  • Top authors: almos20 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

5,000+ active /46,470 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
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by IP Ban
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.41 ▼5.40
Dashboard /wp-admin3.31 ▲0.0147.26 ▼2.58
Posts /wp-admin/edit.php3.36 ▲0.0049.53 ▼0.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.14 ▼16.06
Media Library /wp-admin/upload.php3.23 ▲0.0037.11 ▲1.50
Simple IP Ban /wp-admin/options-general.php?page=simple-ip-ban3.2031.42

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
s_not_for_logged_in_user
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by IP Ban
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲10013.34 ▼1.302.29 ▲0.6538.30 ▼1.81
Dashboard /wp-admin2,230 ▲324.84 ▼0.12101.67 ▼12.7839.87 ▼6.13
Posts /wp-admin/edit.php2,106 ▲32.04 ▲0.0141.92 ▲4.2635.02 ▼2.60
Add New Post /wp-admin/post-new.php1,545 ▼223.19 ▼0.03659.24 ▲12.1153.35 ▲2.52
Media Library /wp-admin/upload.php1,406 ▲34.19 ▼0.07103.66 ▲7.6144.53 ▲0.92
Simple IP Ban /wp-admin/options-general.php?page=simple-ip-ban8732.0124.1432.94

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • s_not_for_logged_in_user
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-ip-ban/ip-ban.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: user agent ban, ip ban, protection, anti-spam

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

The entry point to "IP Ban" version 1.3.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-ip-ban.php" instead of "ip-ban.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected133 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14830120
CSS13013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png48.37KB11.45KB▼ 76.33%