78% user-role

Code Review | User Role by BestWebSoft - Add and Customize Roles and Capabilities in WordPress

WordPress plugin User Role by BestWebSoft - Add and Customize Roles and Capabilities in WordPress scored78%from 54 tests.

About plugin

  • Plugin page: user-role
  • Plugin version: 1.6.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: May 12, 2014
  • Latest release: Aug 10, 2023
  • Number of updates: 48
  • Update frequency: every 70.4 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

4,000+ active /86,290 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.71ms] Passed 4 tests

A check of server-side resources used by User Role by BestWebSoft - Add and Customize Roles and Capabilities in WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0748.86 ▲7.12
Dashboard /wp-admin3.37 ▲0.0750.03 ▼4.14
Posts /wp-admin/edit.php3.48 ▲0.1355.32 ▲4.52
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.65 ▼6.76
Media Library /wp-admin/upload.php3.29 ▲0.0639.97 ▼0.45

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 141 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
bstwbsftwppdtplgns_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by User Role by BestWebSoft - Add and Customize Roles and Capabilities in WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7414.34 ▼0.071.91 ▲0.2438.15 ▼5.41
Dashboard /wp-admin2,244 ▲705.71 ▲0.1995.30 ▼10.3242.10 ▼2.06
Posts /wp-admin/edit.php2,149 ▲522.04 ▼0.0839.19 ▲3.0534.74 ▼6.53
Add New Post /wp-admin/post-new.php1,564 ▲3823.35 ▲0.40600.90 ▼71.0953.83 ▲4.38
Media Library /wp-admin/upload.php1,449 ▲494.19 ▲0.02100.36 ▼12.5944.05 ▼7.84
Add New /wp-admin/user-role.php?page=srrl_add_new_roles260.420.1414.72
Settings /wp-admin/user-role.php?page=srrl_settings260.420.107.70
BWS Panel /wp-admin/user-role.php?page=srrl-bws-panel260.420.095.72
Roles /wp-admin/user-role.php260.420.157.46

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/user-role/includes/class-user-role.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-role/includes/class-user-role.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/user-role/includes/class-srrl-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/user-role/user-role.php:733
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/user-role/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/user-role/includes/edit-role-page.php:38
    • > PHP Notice
      Trying to get property 'roles' of non-object in wp-content/plugins/user-role/includes/edit-role-page.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-role/bws_menu/class-bws-settings.php:1452
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-role/includes/class-user-role.php on line 10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/user-role.php?page=srrl_add_new_roles
    • > Network (severe)
    wp-admin/user-role.php?page=srrl_add_new_roles - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/user-role.php?page=srrl_settings
    • > Network (severe)
    wp-admin/user-role.php?page=srrl_settings - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/user-role.php?page=srrl-bws-panel
    • > Network (severe)
    wp-admin/user-role.php?page=srrl-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/user-role.php
    • > Network (severe)
    wp-admin/user-role.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Roles page.), #2 (Edit administrator`s role page.), #3 (Edit subscriber`s role page.), #4 (Roles page for network admin panel.), #5 (Edit administrator`s role page on network admin panel.)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

user-role/user-role.php Passed 13 tests

"User Role by BestWebSoft - Add and Customize Roles and Capabilities in WordPress" version 1.6.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
102 characters long description:
Powerful user role management plugin for WordPress website. Create, edit, copy, and delete user roles.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected24,723 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PO File205,73110,13213,101
PHP124937455,483
CSS91602595,430
JavaScript637120559
SVG400150

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity71.25
▷ Minimum class complexity1.00
▷ Maximum class complexity210.00
Average method complexity8.39
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3284.21%
▷ Protected methods00.00%
▷ Private methods615.79%
Functions79
▷ Named functions79100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
64 PNG files occupy 3.28MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/images/tooltip_icons.png0.81KB0.82KB0.00%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_flat_75_ffffff_40x100.png0.25KB0.11KB▼ 55.38%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-icons_cd0a0a_256x240.png4.49KB4.20KB▼ 6.46%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.21KB▼ 34.34%
bws_menu/css/jquery-ui-styles/1.9.2/images/ui-bg_glass_75_e6e6e6_1x400.png0.15KB0.14KB▼ 6.62%