84% ais-ip-blocker

Code Review | AIS: IP Blocker

WordPress plugin AIS: IP Blocker scored84%from 54 tests.

About plugin

  • Plugin page: ais-ip-blocker
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: May 25, 2020
  • Latest release: Jul 29, 2022
  • Number of updates: 9
  • Update frequency: every 88.7 days
  • Top authors: aistechnolabspvtltd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,063 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.04MB] [CPU: ▼7.87ms] Passed 4 tests

An overview of server-side resources used by AIS: IP Blocker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0648.45 ▲4.08
Dashboard /wp-admin3.40 ▲0.0151.60 ▼14.61
Posts /wp-admin/edit.php3.51 ▲0.1152.31 ▲3.80
Add New Post /wp-admin/post-new.php5.98 ▲0.0587.51 ▼19.62
Media Library /wp-admin/upload.php3.32 ▲0.0537.91 ▼1.04
IP Blocker /wp-admin/options-general.php?page=ip-blocker3.2933.52

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

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

Browser metrics Passed 4 tests

Checking browser requirements for AIS: IP Blocker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.02 ▼0.621.88 ▲0.1645.55 ▲2.69
Dashboard /wp-admin2,202 ▲225.57 ▲0.0689.60 ▼6.0138.06 ▼1.70
Posts /wp-admin/edit.php2,104 ▲72.01 ▲0.0333.42 ▼3.2434.23 ▼0.91
Add New Post /wp-admin/post-new.php1,529 ▲323.58 ▲0.63700.01 ▲42.0260.35 ▲6.64
Media Library /wp-admin/upload.php1,404 ▲74.19 ▲0.1195.54 ▼11.4543.43 ▼1.74
IP Blocker /wp-admin/options-general.php?page=ip-blocker1,1002.4643.1565.88

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
    • ipBlockOptionName
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ais-ip-blocker/ip-blocker.php:11

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 94% from 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
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

ais-ip-blocker/ip-blocker.php 92% from 13 tests

The entry point to "AIS: IP Blocker" version 2.2.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ais-ip-blocker.php" instead of "ip-blocker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected8,419 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS21,09877,958
PHP1325255
JavaScript3111206

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin