84% hide-menu-items-by-role

Code Review | Hide Menu Items by Role

WordPress plugin Hide Menu Items by Role scored84%from 54 tests.

About plugin

  • Plugin page: hide-menu-items-b...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2023
  • Latest release: Jun 19, 2023
  • Number of updates: 4
  • Update frequency: every 24.2 days
  • Top authors: mahfuzurwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /156 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Hide Menu Items by Role
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.16 ▼6.77
Dashboard /wp-admin3.32 ▲0.0248.79 ▼4.49
Posts /wp-admin/edit.php3.37 ▲0.0249.17 ▼2.59
Add New Post /wp-admin/post-new.php5.90 ▲0.0296.41 ▼8.40
Media Library /wp-admin/upload.php3.25 ▲0.0237.71 ▲0.83

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hide Menu Items by Role
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.151.86 ▼0.1240.21 ▲3.12
Dashboard /wp-admin2,198 ▲215.60 ▼0.0690.02 ▼3.8042.94 ▼2.00
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.1033.63 ▼7.1034.26 ▼3.01
Add New Post /wp-admin/post-new.php1,526 ▼223.61 ▲0.61681.86 ▼3.2355.09 ▲4.13
Media Library /wp-admin/upload.php1,394 ▼64.23 ▲0.0097.61 ▼0.3841.01 ▼2.96

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hide-menu-items-by-role/hide-menu-items-by-role.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-menu-items-by-role/includes/admin/custom-fields.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hide-menu-items-by-role/includes/functions.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes: You can take inspiration from this readme.txt

hide-menu-items-by-role/hide-menu-items-by-role.php 92% from 13 tests

The principal PHP file in "Hide Menu Items by Role" v. 1.0.0 is loaded by WordPress automatically on each request
It is important 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

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
Good job! No executable or dangerous file extensions detected77 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3142877

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin