90% banhammer

Code Review | Banhammer – Monitor Site Traffic, Block Bad Users and Bots

WordPress plugin Banhammer – Monitor Site Traffic, Block Bad Users and Bots scored90%from 54 tests.

About plugin

  • Plugin page: banhammer
  • Plugin version: 3.4.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jan 19, 2018
  • Latest release: Oct 27, 2023
  • Number of updates: 38
  • Update frequency: every 55.5 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /26,069 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.55MB] [CPU: ▲1.22ms] Passed 4 tests

A check of server-side resources used by Banhammer – Monitor Site Traffic, Block Bad Users and Bots
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1737.94 ▼1.71
Dashboard /wp-admin4.02 ▲0.7249.83 ▲3.09
Posts /wp-admin/edit.php4.07 ▲0.7249.08 ▲6.13
Add New Post /wp-admin/post-new.php6.54 ▲0.6583.22 ▼1.87
Media Library /wp-admin/upload.php3.88 ▲0.6537.76 ▲5.35
Armory /wp-admin/admin.php?page=banhammer-armory3.8736.08
Tower /wp-admin/admin.php?page=banhammer-tower3.8635.98
Settings /wp-admin/admin.php?page=banhammer3.8736.28

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 315 new files
Database: 1 new table, 6 new options
New tables
wp_banhammer
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Banhammer – Monitor Site Traffic, Block Bad Users and Bots
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.27 ▼0.091.84 ▲0.2243.41 ▲4.22
Dashboard /wp-admin2,231 ▲515.63 ▼0.0580.92 ▼9.3938.88 ▼2.20
Posts /wp-admin/edit.php2,130 ▲302.00 ▼0.0333.24 ▼2.7634.93 ▼0.56
Add New Post /wp-admin/post-new.php1,567 ▲3922.75 ▼0.32653.59 ▼13.8349.30 ▼10.53
Media Library /wp-admin/upload.php1,430 ▲304.28 ▼0.0599.58 ▼13.5543.40 ▼4.36
Armory /wp-admin/admin.php?page=banhammer-armory1,9742.5450.2634.40
Tower /wp-admin/admin.php?page=banhammer-tower1,9522.5445.3927.46
Settings /wp-admin/admin.php?page=banhammer1,5051.9829.2657.02

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: bots, ban, banhammer, security, block...

banhammer/banhammer.php Passed 13 tests

The main PHP script in "Banhammer – Monitor Site Traffic, Block Bad Users and Bots" version 3.4.1 is automatically included on every request by WordPress
42 characters long description:
Monitor traffic and ban unwanted visitors.

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
No dangerous file extensions were detected25,073 lines of code in 278 files:
LanguageFilesBlank linesComment linesLines of code
SVG2520120,289
PHP151,6201342,556
PO File14204311,261
JavaScript45913623
CSS66322344

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions125
▷ Named functions125100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
12 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/banhammer-bg-ban.png1.62KB0.42KB▼ 73.99%
img/banhammer-loading.png5.81KB3.23KB▼ 44.37%
img/banhammer-bg-fade.png0.93KB0.21KB▼ 77.26%
img/banhammer-bg-warn.png1.57KB0.42KB▼ 73.07%
img/banhammer-header.png54.31KB54.31KB0.01%