74% user-menus

Code Review | User Menus - Nav Menu Visibility

WordPress plugin User Menus - Nav Menu Visibility scored74%from 54 tests.

About plugin

  • Plugin page: user-menus
  • Plugin version: 1.3.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Jul 19, 2023
  • Number of updates: 69
  • Update frequency: every 36.7 days
  • Top authors: danieliser (78.26%)jungleplugins (13.04%)fpcorso (11.59%)

Code review

54 tests

User reviews

1106 reviews

Install metrics

90,000+ active /761,550 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.53MB] [CPU: ▼10.62ms] 75% from 4 tests

An overview of server-side resources used by User Menus - Nav Menu Visibility
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,796.49ms on /wp-admin/admin.php?page=user-menus)
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5939.26 ▼1.15
Dashboard /wp-admin3.90 ▲0.5547.25 ▼18.24
Posts /wp-admin/edit.php3.95 ▲0.5951.11 ▼3.46
Add New Post /wp-admin/post-new.php6.42 ▲0.5382.50 ▼19.63
Media Library /wp-admin/upload.php3.66 ▲0.4340.79 ▲6.83
User Menus /wp-admin/admin.php?page=user-menus4.161,796.49
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0237.66

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 199 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
fs_debug_mode
fs_accounts
jpum_reviews_installed_on
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for User Menus - Nav Menu Visibility
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.61 ▼0.994.33 ▲2.6931.47 ▼16.18
Dashboard /wp-admin2,221 ▲335.83 ▼0.0697.80 ▼17.6141.43 ▼1.51
Posts /wp-admin/edit.php2,107 ▲182.01 ▼0.0539.71 ▲2.0837.97 ▼2.47
Add New Post /wp-admin/post-new.php1,533 ▼023.20 ▲0.02663.66 ▼10.9563.68 ▲10.48
Media Library /wp-admin/upload.php1,409 ▲244.26 ▲0.0697.26 ▲0.4344.97 ▲0.01
User Menus /wp-admin/admin.php?page=user-menus9731.8426.7261.96
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0471.8525.5424.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/user-menus/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 10 options in the database
    • jpum_reviews_installed_on
    • fs_debug_mode
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • fs_active_plugins
    • fs_accounts
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields-deprecated.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/nav-menu.php): failed to open stream: No such file or directory in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields-deprecated.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/nav-menu.php): failed to open stream: No such file or directory in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/nav-menu.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/nav-menu.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields-deprecated.php on line 10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-menus/includes/classes/walker/nav-menu-edit-custom-fields.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
9 plugin tags: logout, nav-menu, user, user-role, nav-menus...

user-menus/user-menus.php Passed 13 tests

The entry point to "User Menus - Nav Menu Visibility" version 1.3.2 is a PHP file that has certain tags in its header comment area
91 characters long description:
Quickly customize your menus with a user's name & avatar, or show items based on user role.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin34,633 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1308,31917,83734,027
JavaScript55860291
Markdown1680214
CSS15173101

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity77.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,318
▷ Static methods23617.91%
▷ Public methods92570.18%
▷ Protected methods191.44%
▷ Private methods37428.38%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-128x128.png20.92KB7.69KB▼ 63.23%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/user-menus.png22.56KB8.93KB▼ 60.43%