72% stopbadbots

Code Review | Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection

WordPress plugin Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection scored72%from 54 tests.

About plugin

  • Plugin page: stopbadbots
  • Plugin version: 9.17
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: May 13, 2016
  • Latest release: Dec 2, 2023
  • Number of updates: 1,165
  • Update frequency: every 2.4 days
  • Top authors: sminozzi (100%)

Code review

54 tests

User reviews

99 reviews

Install metrics

9,000+ active /1,177,105 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.18MB] [CPU: ▲12.52ms] Passed 4 tests

A check of server-side resources used by Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.28 ▲0.8146.62 ▲8.36
Dashboard /wp-admin4.66 ▲1.3167.17 ▲7.97
Posts /wp-admin/edit.php4.72 ▲1.3578.27 ▲34.02
Add New Post /wp-admin/post-new.php7.20 ▲1.31104.34 ▲3.75
Media Library /wp-admin/upload.php4.54 ▲1.3165.54 ▲29.98
Visits Chart /wp-admin/admin.php?page=stopbadbots_my-custom-submenu-page-stats4.6063.13
More Tools Same Author /wp-admin/admin.php?page=stopbadbots_new_more_plugins4.5254.25
Go Pro /wp-admin/admin.php?page=sbb_my-custom-submenu-page94.5256.44
Visits Log /wp-admin/admin.php?page=stopbadbots_my-custom-submenu-page4.5363.75
Settings /wp-admin/admin.php?page=settings-stop-bad-bots4.5255.18
Bad Bots Table /wp-admin/admin.php?page=sbb_my-custom-submenu-page4.5356.58
Bad Referer Table /wp-admin/admin.php?page=sbb_my-custom-submenu-page34.5356.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 369 new files
Database: 7 new tables, 21 new options
New tables
wp_sbb_visitorslog
wp_sbb_stats
wp_sbb_http_tools
wp_sbb_badips
wp_sbb_blacklist
wp_sbb_badref
wp_sbb_fingerprint
New WordPress options
sbb_was_activated
can_compress_scripts
stopbadbots_tables_empty
stopbadbots_http_tools
stopbadbots_last_checked
stopbadbots_last_checked2
bill_go_pro_hide
stopbadbots_block_false_google
theysaidso_admin_options
widget_recent-posts
...

Browser metrics Passed 4 tests

Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,018 ▲27115.42 ▲1.087.86 ▲6.3636.81 ▼3.07
Dashboard /wp-admin2,318 ▲1376.17 ▲0.47110.49 ▼1.7292.06 ▲46.01
Posts /wp-admin/edit.php2,236 ▲1333.07 ▲1.1347.33 ▲5.5558.89 ▲22.75
Add New Post /wp-admin/post-new.php1,799 ▲27323.95 ▲0.72623.32 ▼10.3032.92 ▼14.90
Media Library /wp-admin/upload.php1,531 ▲1345.31 ▲1.12110.77 ▲11.7082.80 ▲37.61
Add Bad Referer to Table /wp-admin/admin.php?page=Add New Bad Referer9412.5637.5632.10
Visits Chart /wp-admin/admin.php?page=stopbadbots_my-custom-submenu-page-stats1,4413.3993.4369.08
More Tools Same Author /wp-admin/admin.php?page=stopbadbots_new_more_plugins1,1163.0658.3733.43
Go Pro /wp-admin/admin.php?page=sbb_my-custom-submenu-page92,1266.05132.1475.89
Visits Log /wp-admin/admin.php?page=stopbadbots_my-custom-submenu-page1,5603.4168.6163.15
Add Bad Bot to Table /wp-admin/admin.php?page=Add New Bad Bot9672.6745.2530.04
Add Bad IP to Table /wp-admin/admin.php?page=Add New Bad IP9882.6244.9730.78
Settings /wp-admin/admin.php?page=settings-stop-bad-bots1,1012.6641.9066.42
Bad Bots Table /wp-admin/admin.php?page=sbb_my-custom-submenu-page1,2782.7746.7031.99
Bad Referer Table /wp-admin/admin.php?page=sbb_my-custom-submenu-page31,3052.7646.0030.37

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 10 options
    • sbb_loaded_timestamp
    • db_upgraded
    • widget_recent-posts
    • stopbadbots_last_checked2
    • bill_go_pro_hide
    • widget_theysaidso_widget
    • can_compress_scripts
    • stopbadbots_was_activated
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/stopbadbots/functions/class-sbb-catch-errors.php
    • > /wp-content/plugins/stopbadbots/functions/bill-catch-errors.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/stopbadbots/dashboard/circle_status.php:26
    • > PHP Fatal error
      require_once(): Failed opening required 'STOPBADBOTSPATH/includes/tgm/class-tgm-plugin-activation.php' (include_path='.:/usr/share/php') in wp-content/plugins/stopbadbots/includes/tgm/pinstaller.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/stopbadbots/template/content_stopbadbots.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/stopbadbots/dashboard/circle_memory.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bill_banners\\get_transient() in wp-content/plugins/stopbadbots/dashboard/mybanners.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function StopBadBotsPlugin_activate\\is_multisite() in wp-content/plugins/stopbadbots/includes/feedback/activated-manager.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/stopbadbots/includes/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Warning
      Use of undefined constant STOPBADBOTSPATH - assumed 'STOPBADBOTSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/stopbadbots/includes/tgm/pinstaller.php on line 36
    • > PHP Warning
      require_once(STOPBADBOTSPATH/includes/tgm/class-tgm-plugin-activation.php): failed to open stream: No such file or directory in wp-content/plugins/stopbadbots/includes/tgm/pinstaller.php on line 36
    • > PHP Fatal error
      Uncaught Error: Class 'StopBadBotsWPSettings\\Page' not found in wp-content/plugins/stopbadbots/settings/options/plugin_options_tabbed.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=sbb_my-custom-submenu-page9
    • > Network (severe)
    https://stopbadbots.com/wp-admin/admin-ajax.php?action=stopbadbots_grava_fingerprint&fingerprint=%23Europe%2FBucharest%23-120%23linux%20x86_64%23Linux%230%2Cfalse%2Cfalse%231%231 - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Dashboard), #2 (Dashboard), #3 (Settings Page), #4 (Default Bot Table), #5 (Visitors Log Ajax Page), #6 (Visitors Chart)
  • Tags: There are too many tags (29 tag instead of maximum 10)
The official readme.txt might help

stopbadbots/stopbadbots.php Passed 13 tests

"Block Bad Bots and Stop Bad Bots Crawlers and Spiders and Anti Spam Protection" version 9.17's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
98 characters long description:
Stop Bad Bots, SPAM bots and spiders. No DNS or Cloud Traffic Redirection. No Slow Down Your Site!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin32,556 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
PHP582,8083,49314,257
PO File62,9063,7808,688
JavaScript241,8121,0636,943
CSS122461992,668

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.69
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods214
▷ Static methods219.81%
▷ Public methods17079.44%
▷ Protected methods4420.56%
▷ Private methods00.00%
Functions219
▷ Named functions21899.54%
▷ Anonymous functions10.46%
Constants36
▷ Global constants3391.67%
▷ Class constants38.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
238 compressed PNG files occupy 0.93MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/it.png0.09KB0.10KB0.00%
assets/images/flags/bg.png0.12KB0.13KB0.00%
assets/images/flags/et.png0.35KB0.35KB0.00%
assets/images/flags/tm.png0.56KB0.68KB0.00%
assets/images/flags/sr.png0.20KB0.21KB0.00%