84% user-roles

Code Review | User Roles

WordPress plugin User Roles scored 84% from 54 tests.

About plugin

  • Plugin page: user-roles
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Apr 25, 2017
  • Latest release: Apr 25, 2017
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: ehabstar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 856 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.83ms] Passed 4 tests

Server-side resources used by User Roles
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.14 ▲2.94
Dashboard /wp-admin3.31 ▲0.0147.09 ▼7.28
Posts /wp-admin/edit.php3.36 ▲0.0145.11 ▼6.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.28 ▼13.78
Media Library /wp-admin/upload.php3.24 ▲0.0136.72 ▼0.01

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Roles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.40 ▼0.021.74 ▲0.2047.54 ▲1.48
Dashboard /wp-admin2,210 ▲194.81 ▼0.13109.56 ▲6.9942.90 ▼2.73
Posts /wp-admin/edit.php2,090 ▲192.04 ▲0.0134.78 ▼1.8935.95 ▲2.46
Add New Post /wp-admin/post-new.php1,517 ▼317.57 ▼5.61654.46 ▼79.4268.26 ▼2.15
Media Library /wp-admin/upload.php1,386 ▼24.28 ▲0.1097.95 ▼20.3743.31 ▼2.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-roles/user-roles.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (screenshot-1.png User Role main form), #2 (screenshot-2.png Add/Remove capabilities), #3 (screenshot-3.png Rôles utilisateurs Français), #4 (screenshot-4.png 用户角色 站点默认), #5 (screenshot-5.png رُتب الأعضاء العربية)
You can take inspiration from this readme.txt

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

"User Roles" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin411 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2625411

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity55.00
▷ Minimum class complexity55.00
▷ Maximum class complexity55.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods15100.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.48MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png44.08KB22.68KB▼ 48.54%
screenshot-4.png148.91KB65.81KB▼ 55.81%
screenshot-3.png114.16KB56.22KB▼ 50.75%
screenshot-5.png104.88KB51.44KB▼ 50.95%
screenshot-2.png76.50KB35.64KB▼ 53.41%