78% user-role-editor

Code Review | User Role Editor

WordPress plugin User Role Editor scored78%from 54 tests.

About plugin

  • Plugin page: user-role-editor
  • Plugin version: 4.64.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Mar 22, 2010
  • Latest release: Oct 24, 2023
  • Number of updates: 653
  • Update frequency: every 7.6 days
  • Top authors: shinephp (100%)

Code review

54 tests

User reviews

273 reviews

Install metrics

700,000+ active /17,970,545 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.05MB] [CPU: ▼1.73ms] Passed 4 tests

A check of server-side resources used by User Role Editor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.56 ▲1.0943.41 ▲5.48
Dashboard /wp-admin4.41 ▲1.0648.56 ▼10.47
Posts /wp-admin/edit.php4.46 ▲1.1054.07 ▲5.54
Add New Post /wp-admin/post-new.php6.93 ▲1.0489.99 ▼7.47
Media Library /wp-admin/upload.php4.27 ▲1.0347.25 ▲11.87

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 80 new files
Database: no new tables, 8 new options
New WordPress options
ure_tasks_queue
user_role_editor
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by User Role Editor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.34 ▼0.211.58 ▼0.0238.74 ▼2.87
Dashboard /wp-admin2,200 ▲235.53 ▼0.0185.49 ▼1.6536.78 ▼3.97
Posts /wp-admin/edit.php2,108 ▲81.99 ▼0.0035.31 ▼0.6032.28 ▼0.89
Add New Post /wp-admin/post-new.php1,532 ▼423.71 ▲0.41658.33 ▲14.6653.03 ▲1.25
Media Library /wp-admin/upload.php1,408 ▲174.19 ▼0.0091.95 ▼8.8544.87 ▼1.06
User Role Editor /wp-admin/users-user-role-editor.php260.420.1114.54
User Role Editor /wp-admin/settings-user-role-editor.php260.420.065.65

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • ure_tasks_queue
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(URE_PLUGIN_DIRincludes/define-constants.php): failed to open stream: No such file or directory in wp-content/plugins/user-role-editor/includes/loader.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'URE_View' not found in wp-content/plugins/user-role-editor/includes/classes/user-view.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'URE_View' not found in wp-content/plugins/user-role-editor/includes/classes/role-view.php:10
    • > PHP Warning
      Use of undefined constant URE_PLUGIN_DIR - assumed 'URE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-role-editor/includes/loader.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_network_admin() in wp-content/plugins/user-role-editor/includes/define-constants.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'URE_PLUGIN_DIRincludes/define-constants.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-role-editor/includes/loader.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/user-role-editor/includes/settings-template.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'URE_Base_Lib' not found in wp-content/plugins/user-role-editor/includes/classes/lib.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/users-user-role-editor.php
    • > Network (severe)
    wp-admin/users-user-role-editor.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/settings-user-role-editor.php
    • > Network (severe)
    wp-admin/settings-user-role-editor.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (screenshot-1.png User Role Editor main form), #2 (screenshot-2.png Add/Remove roles or capabilities), #3 (screenshot-3.png User Capabilities link), #4 (screenshot-4.png User Capabilities Editor), #5 (screenshot-5.png Bulk change role for users without roles), #6 (screenshot-6.png Assign multiple roles to the selected users)
You can look at the official readme.txt

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

Analyzing the main PHP file in "User Role Editor" version 4.64.1
56 characters long description:
Change/add/delete WordPress user roles and capabilities.

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 detected12,919 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP341,8591,5876,064
JavaScript98213845,235
CSS5111751,620

PHP code Passed 2 tests

This is a very shot review 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.36
Average class complexity36.22
▷ Minimum class complexity1.00
▷ Maximum class complexity204.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods373
▷ Static methods6016.09%
▷ Public methods21056.30%
▷ Protected methods8923.86%
▷ Private methods7419.84%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
21 PNG files occupy 0.26MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png30.91KB30.54KB▼ 1.22%
screenshot-3.png35.14KB35.08KB0.16%
images/changelog-icon.png0.48KB0.40KB▼ 16.40%
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%