84% megamenu

Code Review | Max Mega Menu

WordPress plugin Max Mega Menu scored84%from 54 tests.

About plugin

  • Plugin page: megamenu
  • Plugin version: 3.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 3, 2014
  • Latest release: Oct 16, 2023
  • Number of updates: 1,650
  • Update frequency: every 2.1 days
  • Top authors: megamenu (99.94%)

Code review

54 tests

User reviews

660 reviews

Install metrics

400,000+ active /8,562,089 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.72MB] [CPU: ▲7.32ms] Passed 4 tests

An overview of server-side resources used by Max Mega Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.12 ▲1.6646.44 ▲7.75
Dashboard /wp-admin5.05 ▲1.7458.76 ▲12.22
Posts /wp-admin/edit.php5.16 ▲1.8052.42 ▲3.45
Add New Post /wp-admin/post-new.php7.63 ▲1.7489.90 ▲5.86
Media Library /wp-admin/upload.php4.97 ▲1.7450.19 ▲15.45
Menu Locations /wp-admin/admin.php?page=maxmegamenu4.9441.79
Tools /wp-admin/admin.php?page=maxmegamenu_tools4.9542.02
Menu Themes /wp-admin/admin.php?page=maxmegamenu_theme_editor9.5799.22
General Settings /wp-admin/admin.php?page=maxmegamenu_general_settings4.9537.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 77 new files
Database: no new tables, 13 new options
New WordPress options
megamenu_settings
widget_theysaidso_widget
theysaidso_admin_options
widget_maxmegamenu_reusable_block
widget_recent-comments
megamenu_install_date
db_upgraded
megamenu_multisite_share_themes
megamenu_version
widget_recent-posts
...

Browser metrics Passed 4 tests

Max Mega Menu: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲21513.51 ▼1.048.89 ▲7.3043.01 ▲0.34
Dashboard /wp-admin2,253 ▲795.57 ▼0.0184.85 ▼11.1841.35 ▼1.70
Posts /wp-admin/edit.php2,162 ▲652.00 ▲0.0134.62 ▼0.3034.35 ▼1.73
Add New Post /wp-admin/post-new.php6,395 ▲4,86027.88 ▲9.69868.70 ▲214.8671.24 ▲5.43
Media Library /wp-admin/upload.php1,456 ▲534.25 ▲0.0096.56 ▲0.7843.27 ▼1.95
Menu Locations /wp-admin/admin.php?page=maxmegamenu1,1993.3265.4353.77
Tools /wp-admin/admin.php?page=maxmegamenu_tools1,1323.3469.9435.53
Menu Themes /wp-admin/admin.php?page=maxmegamenu_theme_editor9,5675.63209.8352.95
General Settings /wp-admin/admin.php?page=maxmegamenu_general_settings1,1503.2433.2929.53

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 13 options in the database
    • db_upgraded
    • megamenu_multisite_share_themes
    • widget_maxmegamenu
    • widget_recent-posts
    • megamenu_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_maxmegamenu_reusable_block
    • megamenu_settings
    • megamenu_install_date
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/megamenu/integration/block/location/block.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/megamenu/integration/zerif/functions.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: mobile menu, menu, mega menu, responsive menu, navigation

megamenu/megamenu.php Passed 13 tests

The principal PHP file in "Max Mega Menu" v. 3.2.4 is loaded by WordPress automatically on each request
59 characters long description:
An easy to use mega menu plugin. Written the WordPress way.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected40,978 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP213,1542,63812,658
JSON40012,146
JavaScript131,0744144,551
PO File51,6262,2363,985
Sass8667263,919
CSS6219973,719

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
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity85.05
▷ Minimum class complexity1.00
▷ Maximum class complexity463.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes29.09%
Methods517
▷ Static methods101.93%
▷ Public methods28955.90%
▷ Protected methods18435.59%
▷ Private methods448.51%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/colorbox/images/ie6/borderTopLeft.png0.21KB0.20KB▼ 4.63%
js/colorbox/images/ie6/borderBottomLeft.png0.21KB0.20KB▼ 4.19%
js/colorbox/images/loading_background.png0.15KB0.15KB▼ 0.64%
js/colorbox/images/ie6/borderBottomCenter.png0.11KB0.10KB▼ 8.11%
js/colorbox/images/overlay.png0.18KB0.15KB▼ 15.93%