83% members-role-hierarchy

Code Review | Members - Role Hiearchy

WordPress plugin Members - Role Hiearchy scored83%from 54 tests.

About plugin

  • Plugin page: members-role-hier...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 6, 2017
  • Latest release: Nov 8, 2019
  • Number of updates: 3
  • Update frequency: every 334.7 days
  • Top authors: supercleanse (66.67%)greenshady (66.67%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /20,136 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼12.55ms] Passed 4 tests

Analyzing server-side resources used by Members - Role Hiearchy
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.55 ▼5.46
Dashboard /wp-admin3.38 ▲0.0347.87 ▼14.51
Posts /wp-admin/edit.php3.49 ▲0.1448.33 ▲3.57
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.92 ▼30.30
Media Library /wp-admin/upload.php3.30 ▲0.0735.99 ▲0.09

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Members - Role Hiearchy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.64 ▼0.721.75 ▼0.5740.35 ▼4.56
Dashboard /wp-admin2,206 ▲185.83 ▼0.09105.78 ▼9.0935.81 ▼9.16
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0539.75 ▼1.3335.05 ▼0.05
Add New Post /wp-admin/post-new.php1,533 ▼323.21 ▼0.03660.80 ▲6.1257.51 ▼1.26
Media Library /wp-admin/upload.php1,388 ▼04.24 ▼0.0697.53 ▼5.2742.26 ▼1.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/members-role-hierarchy/inc/functions-filters.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/members-role-hierarchy/admin/class-edit-role.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/members-role-hierarchy/admin/functions-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/members-role-hierarchy/admin/class-manage-roles.php:57
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/members-role-hierarchy/members-role-hierarchy.php:107

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Role Position meta box on edit role screen)
You can take inspiration from this readme.txt

members-role-hierarchy/members-role-hierarchy.php 85% from 13 tests

"Members - Role Hiearchy" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 226 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin629 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
Markdown4980328
PHP7155459301

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.00
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes3100.00%
Methods21
▷ Static methods314.29%
▷ Public methods1361.90%
▷ Protected methods00.00%
▷ Private methods838.10%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png38.47KB19.03KB▼ 50.54%