84% wp-custom-menu

Code Review | Menu Logic

WordPress plugin Menu Logic scored84%from 54 tests.

About plugin

  • Plugin page: wp-custom-menu
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6.1
  • WordPress version: 6.3.1
  • First release: Jan 22, 2014
  • Latest release: Jan 22, 2014
  • Number of updates: 2
  • Update frequency: every 39.0 days
  • Top authors: wpsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /939 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼5.12ms] Passed 4 tests

Analyzing server-side resources used by Menu Logic
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.5245.64 ▲3.41
Dashboard /wp-admin3.82 ▲0.4853.62 ▼6.13
Posts /wp-admin/edit.php3.87 ▲0.5247.96 ▼5.25
Add New Post /wp-admin/post-new.php6.34 ▲0.4595.01 ▼9.55
Media Library /wp-admin/upload.php3.68 ▲0.4535.90 ▲0.45

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Menu Logic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.82 ▲0.531.84 ▲0.0647.38 ▲5.62
Dashboard /wp-admin2,203 ▲245.83 ▼0.0597.32 ▼8.0441.51 ▼2.46
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0338.32 ▼0.8434.03 ▲1.42
Add New Post /wp-admin/post-new.php1,533 ▼323.28 ▲0.20631.82 ▼34.3555.49 ▼9.26
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0296.96 ▼4.3242.01 ▼1.66

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'MLCMI_Select' not found in wp-content/plugins/wp-custom-menu/lib/classes/menu-items.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-custom-menu/lib/classes/views/nav-menus-logic.php:9
    • > PHP Warning
      require(ABSPATHWPINC/nav-menu-template.php): failed to open stream: No such file or directory in wp-content/plugins/wp-custom-menu/lib/classes/walker.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-custom-menu/wp-custom-menu.php:32
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-custom-menu/lib/classes/walker.php on line 17
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-custom-menu/lib/classes/walker.php on line 17
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHWPINC/nav-menu-template.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-custom-menu/lib/classes/walker.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

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
4 plugin tags: menu-logic, menus, conditionals, logged in menus

wp-custom-menu/wp-custom-menu.php Passed 13 tests

"Menu Logic" version 0.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
41 characters long description:
Easily, conditionally control menu items.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,718 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP93061,1351,230
JavaScript3124141,080
CSS2817408

PHP code Passed 2 tests

A brief analysis 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.35
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes423.53%
▷ Concrete classes1376.47%
▷ Final classes00.00%
Methods79
▷ Static methods1822.78%
▷ Public methods79100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
css/chosen-sprite.png0.63KB0.88KB0.00%