10% wp-ban-manager

Code Review | WP ban manager

WordPress plugin WP ban manager scored10%from 54 tests.

About plugin

  • Plugin page: wp-ban-manager
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.0
  • WordPress version: 6.3.1
  • First release: Apr 1, 2014
  • Latest release: Dec 13, 2018
  • Number of updates: 5
  • Update frequency: every 343.4 days
  • Top authors: jberculo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,406 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-ban-manager/framework/admin-page-framework.min.php+4201
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▲1.21MB] [CPU: ▼42.31ms] Passed 4 tests

This is a short check of server-side resources used by WP ban manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.20 ▲1.7314.58 ▼22.96
Dashboard /wp-admin5.22 ▲1.9117.32 ▼33.48
Posts /wp-admin/edit.php5.22 ▲1.8613.87 ▼37.41
Add New Post /wp-admin/post-new.php5.22 ▼0.6713.99 ▼75.37
Media Library /wp-admin/upload.php5.22 ▲1.9915.94 ▼20.08
General settings /wp-admin/admin.php?page=wp_ban_manager_general5.2214.61
Ban definitions /wp-admin/admin.php?page=wp_ban_manager_definitions5.2218.15
Current bans /wp-admin/admin.php?page=wp_ban_manager_current5.2212.76

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP ban manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.28 ▼0.301.90 ▼0.0646.48 ▲1.37
Dashboard /wp-admin2,229 ▲495.63 ▼0.0384.25 ▼6.6539.18 ▼2.59
Posts /wp-admin/edit.php2,134 ▲371.98 ▼0.0134.10 ▼3.1033.82 ▼0.55
Add New Post /wp-admin/post-new.php1,551 ▲2223.07 ▼0.58685.05 ▲3.9659.28 ▲1.50
Media Library /wp-admin/upload.php1,431 ▲314.17 ▼0.0195.93 ▼5.4541.24 ▼5.42
General settings /wp-admin/admin.php?page=wp_ban_manager_general1,7306.71130.6261.65
Ban definitions /wp-admin/admin.php?page=wp_ban_manager_definitions8622.0026.0822.12
Current bans /wp-admin/admin.php?page=wp_ban_manager_current8722.0021.8818.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-ban-manager/framework/admin-page-framework.min.php+4201
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp_ban_manager_current
    • > Deprecated in wp-content/plugins/wp-ban-manager/framework/admin-page-framework.min.php+4201
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-ban-manager/templates/current.tpl.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/wp-ban-manager/templates/current.tpl.php:34
    • > PHP Notice
      Undefined variable: current_bans in wp-content/plugins/wp-ban-manager/templates/current.tpl.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-ban-manager/templates/definitions.tpl.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category' not found in wp-content/plugins/wp-ban-manager/framework/admin-page-framework.min.php:228
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category' not found in wp-content/plugins/wp-ban-manager/framework/admin-page-framework.min.php:228

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-ban-manager === )
Please take inspiration from this readme.txt

wp-ban-manager/wp_ban_manager.php 92% from 13 tests

This is the main PHP file of "WP ban manager" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-ban-manager.php" instead of "wp_ban_manager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected6,696 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP59245526,696

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.56
Average class complexity15.52
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes93
▷ Abstract classes2729.03%
▷ Concrete classes6670.97%
▷ Final classes00.00%
Methods623
▷ Static methods508.03%
▷ Public methods45773.35%
▷ Protected methods9314.93%
▷ Private methods7311.72%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin