84% user-role-sidebar-menu

Code Review | User role sidebar menu

WordPress plugin User role sidebar menu scored84%from 54 tests.

About plugin

  • Plugin page: user-role-sidebar...
  • Plugin version: 0.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Feb 24, 2014
  • Latest release: Aug 20, 2018
  • Number of updates: 18
  • Update frequency: every 91.6 days
  • Top authors: achyuth401 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /3,585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.48ms] Passed 4 tests

This is a short check of server-side resources used by User role sidebar menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0339.15 ▲3.47
Dashboard /wp-admin3.34 ▼0.0143.99 ▼11.48
Posts /wp-admin/edit.php3.39 ▲0.0345.37 ▼2.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.92 ▼5.30
Media Library /wp-admin/upload.php3.26 ▲0.0335.58 ▲1.08

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_user_role_base_widget_id
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for User role sidebar menu
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲13013.51 ▼0.768.71 ▲6.8543.41 ▼1.83
Dashboard /wp-admin2,202 ▲215.64 ▼0.0284.16 ▼14.4739.68 ▼3.94
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0140.21 ▲2.3036.63 ▲2.99
Add New Post /wp-admin/post-new.php1,530 ▲423.87 ▲0.46633.04 ▼50.8755.25 ▼1.74
Media Library /wp-admin/upload.php1,404 ▲14.15 ▼0.0796.96 ▼7.1146.77 ▼0.97

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_user_role_base_widget_id
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 2× 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-role-sidebar-menu/role-base-sidebar-menu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-role-sidebar-menu/role-base-sidebar-menu.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: role base menu, user role sidebar menu, menus, sidebar menu

user-role-sidebar-menu/plugin-file.php 92% from 13 tests

The principal PHP file in "User role sidebar menu" v. 0.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("user-role-sidebar-menu.php" instead of "plugin-file.php")

Code Analysis Passed 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 detected123 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23882102
JavaScript10515
CSS1056

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/parent.png3.14KB0.62KB▼ 80.40%
img/leaf.png3.06KB0.44KB▼ 85.60%