89% blackhole-bad-bots

Code Review | Blackhole for Bad Bots

WordPress plugin Blackhole for Bad Bots scored89%from 54 tests.

About plugin

  • Plugin page: blackhole-bad-bots
  • Plugin version: 3.6.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 18, 2016
  • Latest release: Oct 28, 2023
  • Number of updates: 63
  • Update frequency: every 44.6 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

131 reviews

Install metrics

30,000+ active /580,998 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.34ms] Passed 4 tests

Server-side resources used by Blackhole for Bad Bots
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2939.53 ▼2.72
Dashboard /wp-admin3.73 ▲0.4350.76 ▲4.02
Posts /wp-admin/edit.php3.82 ▲0.4648.05 ▼1.92
Add New Post /wp-admin/post-new.php6.29 ▲0.4089.59 ▼0.66
Media Library /wp-admin/upload.php3.63 ▲0.4036.18 ▼0.07
Bad Bots /wp-admin/admin.php?page=blackhole_badbots3.6133.46
Settings /wp-admin/admin.php?page=blackhole_settings3.6335.18

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Blackhole for Bad Bots
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.35 ▼0.021.82 ▼0.1544.17 ▼4.29
Dashboard /wp-admin2,222 ▲425.65 ▼0.0196.54 ▼4.7844.15 ▲0.70
Posts /wp-admin/edit.php2,127 ▲272.02 ▲0.0234.62 ▼2.6736.35 ▲3.07
Add New Post /wp-admin/post-new.php1,548 ▲2223.23 ▲0.27624.07 ▼74.1758.63 ▼1.92
Media Library /wp-admin/upload.php1,430 ▲304.23 ▲0.0394.79 ▼23.7943.44 ▼5.66
Bad Bots /wp-admin/admin.php?page=blackhole_badbots1,0572.1134.4544.46
Settings /wp-admin/admin.php?page=blackhole_settings1,5192.1735.5844.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: There are too many tags (18 tag instead of maximum 10)
The official readme.txt is a good inspiration

blackhole-bad-bots/blackhole.php 92% from 13 tests

"Blackhole for Bad Bots" version 3.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("blackhole-bad-bots.php" instead of "blackhole.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,232 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP14886531,461
PO File1212220665
CSS112159
JavaScript15147

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods16
▷ Static methods531.25%
▷ Public methods1487.50%
▷ Protected methods00.00%
▷ Private methods212.50%
Functions74
▷ Named functions74100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/bbb-icon-88.png3.30KB1.47KB▼ 55.36%