84% user-role-blocker

Code Review | User Role Blocker

WordPress plugin User Role Blocker scored84%from 54 tests.

About plugin

  • Plugin page: user-role-blocker
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Mar 4, 2021
  • Number of updates: 10
  • Update frequency: every 31.6 days
  • Top authors: captainhaddock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /507 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.12MB] [CPU: ▼17.31ms] Passed 4 tests

Analyzing server-side resources used by User Role Blocker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▼0.0240.93 ▼10.67
Dashboard /wp-admin3.31 ▲0.0151.48 ▼13.34
Posts /wp-admin/edit.php3.37 ▼0.4850.29 ▼24.54
Add New Post /wp-admin/post-new.php5.90 ▲0.01101.37 ▼20.70
Media Library /wp-admin/upload.php3.24 ▲0.0139.43 ▼1.65

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

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

Browser metrics Passed 4 tests

Checking browser requirements for User Role Blocker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▲0.251.82 ▲0.1554.14 ▲2.06
Dashboard /wp-admin2,195 ▲185.63 ▲0.03100.34 ▼6.8348.97 ▼1.05
Posts /wp-admin/edit.php2,103 ▼02.00 ▲0.0643.72 ▲0.1336.85 ▼2.66
Add New Post /wp-admin/post-new.php1,364 ▼16216.42 ▼4.48553.44 ▼170.7145.69 ▼31.70
Media Library /wp-admin/upload.php1,400 ▼04.17 ▲0.04119.89 ▼0.4853.23 ▼6.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 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 everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-role-blocker/user-role-blocker.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Requires at least: Invalid version format
Please take inspiration from this readme.txt

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

Analyzing the main PHP file in "User Role Blocker" version 1.1.0
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin40 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP131040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin