79% hm-multiple-roles

Code Review | HM Multiple Roles

WordPress plugin HM Multiple Roles scored79%from 54 tests.

About plugin

  • Plugin page: hm-multiple-roles
  • Plugin version: 1.9
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 30, 2021
  • Latest release: Jul 14, 2023
  • Number of updates: 38
  • Update frequency: every 23.6 days
  • Top authors: mhmrajib (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /16,590 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.35MB] [CPU: ▲19.09ms] 50% from 4 tests

Server-side resources used by HM Multiple Roles
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,777.76ms on /wp-admin/admin.php?page=hm-multiple-roles)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.35MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7664.36 ▲19.34
Dashboard /wp-admin9.24 ▲5.9473.32 ▲19.53
Posts /wp-admin/edit.php9.24 ▲5.8879.18 ▲27.40
Add New Post /wp-admin/post-new.php9.72 ▲3.83109.47 ▲10.09
Media Library /wp-admin/upload.php9.24 ▲6.0165.59 ▲29.18
HM Multiple Roles /wp-admin/admin.php?page=hm-multiple-roles9.241,777.76
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2461.87

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 184 new files
Database: no new tables, 9 new options
New WordPress options
fs_debug_mode
fs_active_plugins
theysaidso_admin_options
fs_accounts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for HM Multiple Roles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.34 ▼0.211.62 ▼0.2329.34 ▼17.21
Dashboard /wp-admin2,212 ▲325.56 ▼0.1096.93 ▲1.2145.42 ▲0.99
Posts /wp-admin/edit.php2,118 ▲211.98 ▼0.1339.61 ▲2.6038.75 ▲4.32
Add New Post /wp-admin/post-new.php1,531 ▲522.05 ▼1.00690.39 ▲57.3359.61 ▲4.73
Media Library /wp-admin/upload.php1,414 ▲204.19 ▲0.0497.43 ▼7.0145.48 ▼0.28
HM Multiple Roles /wp-admin/admin.php?page=hm-multiple-roles9771.6728.1960.98
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0691.6725.2228.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/hm-multiple-roles/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • fs_active_plugins
    • fs_accounts
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: user roles, roles, users, role, user

hm-multiple-roles/hm-multiple-roles.php Passed 13 tests

This is the main PHP file of "HM Multiple Roles" version 1.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
115 characters long description:
It hides the default role dropdown list and displays a list of role checkboxes to select multiple roles for a user.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected33,483 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1208,00417,21033,037
Markdown1680214
JavaScript43962208
CSS143424

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity93.06
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19715.65%
▷ Public methods87069.10%
▷ Protected methods171.35%
▷ Private methods37229.55%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants152
▷ Global constants10569.08%
▷ Class constants4730.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/hm-multiple-roles.png52.86KB25.91KB▼ 50.99%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%