10% menu-rules

Code Review | Menu Rules

WordPress plugin Menu Rules scored10%from 54 tests.

About plugin

  • Plugin page: menu-rules
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5
  • WordPress version: 6.3.1
  • First release: Mar 21, 2012
  • Latest release: Dec 18, 2012
  • Number of updates: 19
  • Update frequency: every 14.6 days
  • Top authors: phill_brown (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /4,717 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/menu-rules/rules/active-parent.php+4
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.69ms] Passed 4 tests

A check of server-side resources used by Menu Rules
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.395.80 ▼35.45
Dashboard /wp-admin2.09 ▼1.215.40 ▼54.43
Posts /wp-admin/edit.php2.09 ▼1.265.36 ▼41.96
Add New Post /wp-admin/post-new.php2.09 ▼3.795.88 ▼78.90
Media Library /wp-admin/upload.php2.09 ▼1.146.69 ▼25.95
Menu Rules /wp-admin/edit.php?post_type=menu_rule2.095.73

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Menu Rules
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.69 ▼0.871.92 ▼0.0045.81 ▲2.38
Dashboard /wp-admin2,210 ▲224.84 ▼0.07114.85 ▲15.0141.58 ▼2.67
Posts /wp-admin/edit.php2,099 ▲102.02 ▲0.0342.22 ▲3.2733.87 ▼1.41
Add New Post /wp-admin/post-new.php1,550 ▲818.23 ▲0.09600.55 ▼0.7456.76 ▲7.61
Media Library /wp-admin/upload.php1,395 ▲134.23 ▼0.18100.80 ▼4.4644.15 ▲0.62
Menu Rules /wp-admin/edit.php?post_type=menu_rule1,0711.9630.7829.94

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/menu-rules/rules/active-parent.php+4
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=menu_rule
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/menu-rules/rules/child-page.php+4
    Function create_function() is deprecated

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
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/rules/child-page.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PB_Meta_Box' not found in wp-content/plugins/menu-rules/admin/meta-box-conditions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/libs/scb-framework/scb-info.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/libs/scb-framework/scb/load.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/libs/scb-framework/scb/load.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/menu-rules/libs/scb-framework/scb/Widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/libs/scb-framework/scb/load.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/menu-rules/libs/scb-framework/scb/BoxesPage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-rules/rules/active-parent.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/menu-rules/libs/scb-framework/scb/Widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: rules, active menu, menus, parent menu, context...

menu-rules/menu-rules.php Passed 13 tests

The main PHP file in "Menu Rules" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
100 characters long description:
An extension of the menu system with context-based rules and a flexible framework to write your own.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,888 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP258374472,481
CSS21013402
JavaScript2185

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes520.00%
▷ Concrete classes2080.00%
▷ Final classes00.00%
Methods200
▷ Static methods9246.00%
▷ Public methods16080.00%
▷ Protected methods105.00%
▷ Private methods3015.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
libs/pb-framework/assets/vendor/chosen/chosen-sprite.png1.52KB0.70KB▼ 54.36%