73% premmerce-user-roles

Code Review | Premmerce User Roles

WordPress plugin Premmerce User Roles scored 73% from 54 tests.

About plugin

  • Plugin page: premmerce-user-roles
  • Plugin version: 1.0.13
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.2
  • WordPress version: 6.3.1
  • First release: Nov 6, 2017
  • Latest release: Aug 19, 2023
  • Number of updates: 26
  • Update frequency: every 81.3 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 15,858 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲4.99MB] [CPU: ▲20.04ms] 75% from 4 tests

Server-side resources used by Premmerce User Roles
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,606.05ms on /wp-admin/admin.php?page=premmerce-users-roles)
PageMemory (MB)CPU Time (ms)
Home /8.84 ▲5.3859.34 ▲8.52
Dashboard /wp-admin8.86 ▲5.5668.68 ▲23.19
Posts /wp-admin/edit.php8.86 ▲5.5169.36 ▲21.70
Add New Post /wp-admin/post-new.php9.38 ▲3.50121.15 ▲26.73
Media Library /wp-admin/upload.php8.86 ▲5.6362.60 ▲31.09
User Roles /wp-admin/admin.php?page=premmerce-users-roles8.861,606.05
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8657.41

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 396 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
fs_accounts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
fs_active_plugins
db_upgraded
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Premmerce User Roles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲10114.48 ▼0.111.69 ▼0.6829.23 ▼18.78
Dashboard /wp-admin2,264 ▲765.82 ▼0.0295.43 ▼6.5742.57 ▼6.76
Posts /wp-admin/edit.php2,147 ▲582.05 ▼0.0740.46 ▲0.1838.04 ▲1.48
Add New Post /wp-admin/post-new.php1,538 ▲517.71 ▼5.36620.59 ▼50.0458.83 ▲4.43
Media Library /wp-admin/upload.php1,453 ▲654.22 ▲0.0594.90 ▼17.2947.40 ▼0.73
User Roles /wp-admin/admin.php?page=premmerce-users-roles9931.7129.5161.02
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1091.7025.0325.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/premmerce-user-roles/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-comments
    • db_upgraded
    • fs_debug_mode
    • widget_recent-posts
    • fs_active_plugins
    • fs_accounts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Yaoi\\Command' not found in wp-content/plugins/premmerce-user-roles/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\SDK\\V2\\Plugin\\PluginInterface' not found in wp-content/plugins/premmerce-user-roles/src/UsersRolesPlugin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 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: custom user roles, user roles, user roles management, users roles, create custom user role

premmerce-user-roles/premmerce-users-roles.php 85% from 13 tests

The entry point to "Premmerce User Roles" version 1.0.13 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("premmerce-user-roles.php" instead of "premmerce-users-roles.php")

Code Analysis 97% from 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 detected39,046 lines of code in 346 files:
LanguageFilesBlank linesComment linesLines of code
PHP3188,37217,99438,153
Markdown51430329
JavaScript45659243
PO File284120156
JSON350136
CSS144029

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity78.10
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces9
Interfaces1
Traits0
Classes59
▷ Abstract classes35.08%
▷ Concrete classes5694.92%
▷ Final classes00.00%
Methods1,360
▷ Static methods22616.62%
▷ Public methods95169.93%
▷ Protected methods191.40%
▷ Private methods39028.68%
Functions104
▷ Named functions9995.19%
▷ Anonymous functions54.81%
Constants153
▷ Global constants9864.05%
▷ Class constants5535.95%
▷ Public constants55100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/premmerce-users-roles.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%