64% privilege-menu

Code Review | Privilege Menu

WordPress plugin Privilege Menu scored 64% from 54 tests.

About plugin

  • Plugin page: privilege-menu
  • Plugin version: 1.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.0.3
  • WordPress version: 5.8.1
  • First release: Mar 30, 2014
  • Latest release: Feb 18, 2019
  • Number of updates: 62
  • Update frequency: every 28.8 days
  • Top authors: fuzzguard (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active / 29,736 total downloads


Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼152.66ms] Passed 4 tests

Server-side resources used by Privilege Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0327.90 ▲6.26
Dashboard /wp-admin3.17 ▲0.1141.15 ▲5.73
Posts /wp-admin/edit.php3.22 ▲0.1135.53 ▲5.17
Add New Post /wp-admin/post-new.php5.47 ▲0.0370.80 ▼623.13
Media Library /wp-admin/upload.php3.06 ▲0.0524.14 ▲1.61
Install Plugins /wp-admin/plugins.php?page=fuzzguard-plugin-manager3.1221.44

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Privilege Menu
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲10515.95 ▲0.225.41 ▲0.4180.86 ▲4.75
Dashboard /wp-admin2,973 ▲776.12 ▼0.04116.14 ▼17.24185.07 ▲12.03
Posts /wp-admin/edit.php2,792 ▲553.25 ▲0.0164.41 ▲2.68152.08 ▲14.94
Add New Post /wp-admin/post-new.php3,767 ▼4018.72 ▼0.05439.09 ▼17.15159.50 ▼9.80
Media Library /wp-admin/upload.php1,799 ▲475.56 ▲0.08150.52 ▲3.33204.12 ▲18.04
Install Plugins /wp-admin/plugins.php?page=fuzzguard-plugin-manager1,2962.4155.38124.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/privilege-menu/privMenu.php+54
    Cannot declare class privMenu, because the name is already in use
  • Incomplete uninstall procedure, leaving 16 files (0.17MB) in the plugin directory
    • (new file) customWalker.php
    • (new file) lang/privilege-menu-fr_FR.po
    • (new file) lang/privilege-menu-sr_RS.mo
    • (new file) lang/privilege-menu-fr_FR.mo
    • (new file) lang/privilege-menu-de_DE.mo
    • (new file) lang/privilege-menu-es_ES.po
    • (new file) lang/privilege-menu-es_ES.mo
    • (new file) class-tgm-plugin-activation.php
    • (new file) lang/privilege-menu-sr_RS.po
    • (new file) lang/privilege-menu-de_DE.po
    • ...
  • This plugin does not fully uninstall, leaving 1 option in the database
    • recovery_mode_email_last_sent

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
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/privilege-menu/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found


Plugin configuration 96% 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
10 plugin tags: menu, menus, login, restriction, permission...

privilege-menu/privMenu.php 92% from 13 tests

"Privilege Menu" version 1.8.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("privilege-menu.php" instead of "privMenu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,279 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File52929141

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity43.00
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
▷ Static methods54.59%
▷ Public methods8678.90%
▷ Protected methods2321.10%
▷ Private methods00.00%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
No PNG images were found in this plugin