83% user-blocker

Code Review | User Blocker

WordPress plugin User Blocker scored83%from 54 tests.

About plugin

  • Plugin page: user-blocker
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2015
  • Latest release: Nov 24, 2023
  • Number of updates: 50
  • Update frequency: every 61.7 days
  • Top authors: solwininfotech (100%)

Code review

54 tests

User reviews

57 reviews

Install metrics

4,000+ active /60,109 total downloads

Benchmarks

Plugin footprint 82% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.21MB] [CPU: ▲10.61ms] 75% from 4 tests

A check of server-side resources used by User Blocker
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,029.95ms on /wp-admin/admin.php?page=block_user_permenant)
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.2157.85 ▲14.32
Dashboard /wp-admin4.53 ▲1.181,368.48 ▲1,304.64
Posts /wp-admin/edit.php4.64 ▲1.2956.53 ▲9.83
Add New Post /wp-admin/post-new.php7.11 ▲1.22100.73 ▲8.31
Media Library /wp-admin/upload.php4.45 ▲1.2246.10 ▲9.98
All Type Blocked User list /wp-admin/admin.php?page=all_type_blocked_user_list4.4353.50
Blocked User list /wp-admin/admin.php?page=blocked_user_list4.4343.65
User Blocker Settings /wp-admin/admin.php?page=user_blocker_settings4.4239.59
Date Wise Block User /wp-admin/admin.php?page=block_user_date5.051,035.39
Date Wise Blocked User list /wp-admin/admin.php?page=datewise_blocked_user_list4.4344.48
Permanently Block User /wp-admin/admin.php?page=block_user_permenant5.051,029.95
Permanent Blocked User list /wp-admin/admin.php?page=permanent_blocked_user_list4.4348.60

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
user_blocking_promo_time
is_user_subscribed_cancled
widget_theysaidso_widget
can_compress_scripts
ublk_version
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Blocker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲23914.38 ▼0.331.75 ▲0.0545.24 ▲3.06
Dashboard /wp-admin2,406 ▲2325.66 ▲0.0685.61 ▼7.7375.02 ▲32.26
Posts /wp-admin/edit.php2,225 ▲1252.02 ▲0.0837.96 ▲2.1933.84 ▲1.82
Add New Post /wp-admin/post-new.php1,638 ▲11223.17 ▼0.27648.03 ▲22.04159.49 ▲112.18
Media Library /wp-admin/upload.php1,525 ▲1254.26 ▲0.0696.97 ▼2.5773.11 ▲29.75
All Type Blocked User list /wp-admin/admin.php?page=all_type_blocked_user_list1,3221.9642.5531.05
Blocked User list /wp-admin/admin.php?page=blocked_user_list1,3082.1339.9826.16
User Blocker Settings /wp-admin/admin.php?page=user_blocker_settings9611.9528.7228.25
Date Wise Block User /wp-admin/admin.php?page=block_user_date1,5892.0834.1047.25
Date Wise Blocked User list /wp-admin/admin.php?page=datewise_blocked_user_list1,3241.9830.7827.67
Permanently Block User /wp-admin/admin.php?page=block_user_permenant1,6091.9930.7644.68
Permanent Blocked User list /wp-admin/admin.php?page=permanent_blocked_user_list1,2751.9630.2926.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • theysaidso_admin_options
    • is_user_subscribed_cancled
    • ublk_version
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • user_blocking_promo_time
    • db_upgraded
    • widget_theysaidso_widget
    • ublk_is_optin

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-blocker/includes/user-blocker-promo-notice.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/user-blocker/includes/user-blocker-common-functions.php:231

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 28 tag instead of maximum 10
The official readme.txt might help

user-blocker/user_blocker.php 92% from 13 tests

This is the main PHP file of "User Blocker" version 1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("user-blocker.php" instead of "user_blocker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected13,225 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP62095307,227
JavaScript75371963,723
CSS572602,275

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions73
▷ Named functions73100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
23 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%