83% wp-megamenu

Code Review | WP Mega Menu

WordPress plugin WP Mega Menu scored83%from 54 tests.

About plugin

  • Plugin page: wp-megamenu
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: Nov 3, 2021
  • Number of updates: 73
  • Update frequency: every 21.5 days
  • Top authors: themeum (100%)

Code review

54 tests

User reviews

214 reviews

Install metrics

10,000+ active /557,675 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 gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▲1.08ms] Passed 4 tests

This is a short check of server-side resources used by WP Mega Menu
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5544.04 ▲6.27
Dashboard /wp-admin3.49 ▲0.1949.06 ▲4.33
Posts /wp-admin/edit.php3.55 ▲0.1942.30 ▼2.78
Add New Post /wp-admin/post-new.php6.03 ▲0.1483.17 ▼2.25
Media Library /wp-admin/upload.php3.35 ▲0.1237.18 ▲5.03
Themes /wp-admin/admin.php?page=wp_megamenu_themes3.4036.89
WP Mega Menu /wp-admin/admin.php?page=wp_megamenu3.3933.30
Go Premium /wp-admin/admin.php?page=wpmm-go-premium3.2020.90

Server storage [IO: ▲3.60MB] [DB: ▲0.10MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 98 new files
Database: no new tables, 10 new options
New WordPress options
wpmm_options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_wpmm_grid_posts_widget
WPMM_VER
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_wpmm_featuresbox_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Mega Menu
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,060 ▲28914.44 ▼0.248.19 ▲6.3641.63 ▲2.12
Dashboard /wp-admin2,309 ▲1205.47 ▲0.53121.83 ▼0.1752.82 ▲11.57
Posts /wp-admin/edit.php2,196 ▲1072.57 ▲0.5642.81 ▲8.6745.14 ▲10.89
Add New Post /wp-admin/post-new.php1,602 ▲7323.49 ▲5.48673.01 ▲73.5335.46 ▼22.35
Media Library /wp-admin/upload.php1,491 ▲1034.90 ▲0.67108.33 ▲11.8753.11 ▲10.61
Themes /wp-admin/admin.php?page=wp_megamenu_themes1,2013.8442.2244.39
WP Mega Menu /wp-admin/admin.php?page=wp_megamenu1,1252.4836.0444.19
Go Premium /wp-admin/admin.php?page=wpmm-go-premium2,1138.98226.55131.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_wpmm_featuresbox_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • wpmm_options
    • widget_wpmm_grid_posts_widget
    • db_upgraded
    • WPMM_VER
    • widget_recent-posts
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-megamenu/includes/compability.php:5
    • > PHP Warning
      Use of undefined constant WPMM_DIR - assumed 'WPMM_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-megamenu/views/admin/wp_megamenu_themes.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-megamenu/classes/class.wp-megamenu-widgets.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-megamenu/classes/class.wp-megamenu-export-import.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/wp-megamenu/views/admin/themes.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exception' not found in wp-content/plugins/wp-megamenu/libs/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php:21
    • > PHP Warning
      Use of undefined constant WPMM_DIR - assumed 'WPMM_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-megamenu/classes/class.wp-megamenu-css.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-megamenu/classes/wp_megamenu_functions.php:1497
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-megamenu/classes/class.wp-megamenu-base.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-megamenu/libs/wpmm-header-cart.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

wp-megamenu/wp-megamenu.php 85% from 13 tests

The principal PHP file in "WP Mega Menu" v. 1.4.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 162 characters long)
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin26,531 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP422,0251,84511,531
CSS92011756,824
JavaScript71,2624425,225
SVG2012,685
JSON400186
Markdown121038
YAML10031
Dockerfile12011

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 292)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity42.33
▷ Minimum class complexity1.00
▷ Maximum class complexity328.00
Average method complexity6.93
▷ Minimum method complexity1.00
▷ Maximum method complexity292.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes23
▷ Abstract classes313.04%
▷ Concrete classes2086.96%
▷ Final classes00.00%
Methods176
▷ Static methods116.25%
▷ Public methods13978.98%
▷ Protected methods3419.32%
▷ Private methods31.70%
Functions63
▷ Named functions5587.30%
▷ Anonymous functions812.70%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/6-6.png1.44KB0.41KB▼ 71.39%
assets/images/3-3-3-3-12.png2.04KB0.75KB▼ 63.24%
assets/images/4-4-4-6-6.png2.09KB0.70KB▼ 66.64%
assets/images/4-4-4.png1.49KB0.44KB▼ 70.49%
assets/images/4-4-4-12.png1.98KB0.65KB▼ 67.13%