10% ap-mega-menu

Code Review | Mega Menu Plugin for WordPress - AP Mega Menu

WordPress plugin Mega Menu Plugin for WordPress - AP Mega Menu scored 10% from 54 tests.

About plugin

  • Plugin page: ap-mega-menu
  • Plugin version: 3.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9
  • WordPress version: 5.9.2
  • First release: Jan 2, 2017
  • Latest release: Feb 24, 2022
  • Number of updates: 47
  • Update frequency: every 40.0 days
  • Top authors: Access Keys (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

6,000+ active / 186,659 total downloads

Benchmarks

Plugin footprint 39% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/ap-mega-menu/inc/backend/activation.php+176
    Undefined variable: wpmm_second_menu

Server metrics [RAM: ▲0.84MB] [CPU: ▼293.07ms] Passed 4 tests

A check of server-side resources used by Mega Menu Plugin for WordPress - AP Mega Menu
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.8755.92 ▲8.21
Dashboard /wp-admin4.25 ▲0.8439.01 ▲4.90
Posts /wp-admin/edit.php4.47 ▲0.8340.60 ▲3.26
Add New Post /wp-admin/post-new.php7.77 ▲0.8094.73 ▼1,183.04
Media Library /wp-admin/upload.php4.20 ▲0.9028.64 ▲2.59
Create theme /wp-admin/admin.php?page=wpmm-add-theme4.3740.41
More WordPress Stuff /wp-admin/admin.php?page=wpmm-about-us4.1929.29
General Settings /wp-admin/admin.php?page=ap-mega-menu4.2828.85
Menus /wp-admin/nav-menus.php4.2138.58
Documentation /wp-admin/admin.php?page=apmm-doclinks3.9321.06
Check Premium Version /wp-admin/admin.php?page=apmm-premium3.9325.60
Theme Settings /wp-admin/admin.php?page=wpmm-theme-settings4.2131.60
Widgets /wp-admin/widgets.php5.9851.90
How to Use /wp-admin/admin.php?page=wpmm-how-to-use4.2125.90

Server storage [IO: ▲34.91MB] [DB: ▲0.03MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Try to limit filesystem usage to 25MB (currently using 34.91MB)
Filesystem: 3,857 new files
Database: 1 new table, 8 new options
New tables
wp_apmm_custom_theme
New WordPress options
apmm_font_family
wpmm_default_settings
apmm_register_skin
widget_wpmegamenu_contact_info
widget_wpmegamenu_pro_linkimage
widget_wpmegamenu_widget
widget_wpmegamenu_pro_html_text
apmega_settings

Browser metrics 75% from 4 tests

This is an overview of browser requirements for Mega Menu Plugin for WordPress - AP Mega Menu
Having an awesome user experience is important, so please improve the following
  • Nodes: It is recommended to reduce the number of DOM nodes under 25,000 (currently 29,880 on /wp-admin/admin.php?page=wpmm-add-theme)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,049 ▲29516.96 ▲1.2413.78 ▲8.082.76 ▼0.23
Dashboard /wp-admin2,995 ▲1347.01 ▲0.86118.43 ▼19.38159.13 ▼5.26
Posts /wp-admin/edit.php2,799 ▲1083.47 ▲0.2470.67 ▲5.99157.14 ▲13.99
Add New Post /wp-admin/post-new.php1,758 ▲9719.22 ▲3.66401.32 ▼19.03158.27 ▲7.47
Media Library /wp-admin/upload.php1,801 ▲1005.96 ▲0.42128.62 ▼10.77191.10 ▲5.99
Create theme /wp-admin/admin.php?page=wpmm-add-theme29,8806.18334.47132.03
More WordPress Stuff /wp-admin/admin.php?page=wpmm-about-us1,5385.69154.41203.45
General Settings /wp-admin/admin.php?page=ap-mega-menu2,6926.10132.58206.86
Menus /wp-admin/nav-menus.php2,8637.64133.38126.45
Documentation /wp-admin/admin.php?page=apmm-doclinks1,8328.36301.96246.84
Check Premium Version /wp-admin/admin.php?page=apmm-premium4,05928.93808.36216.36
Theme Settings /wp-admin/admin.php?page=wpmm-theme-settings1,4955.57115.79187.98
Widgets /wp-admin/widgets.php2,55423.45630.56180.90
How to Use /wp-admin/admin.php?page=wpmm-how-to-use1,7515.72121.74248.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_apmm_custom_theme
  • Zombie WordPress options were found after uninstall: 8 options
    • apmm_font_family
    • widget_wpmegamenu_contact_info
    • apmm_register_skin
    • widget_wpmegamenu_pro_linkimage
    • widget_wpmegamenu_widget
    • wpmm_default_settings
    • widget_wpmegamenu_pro_html_text
    • apmega_settings

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 items
  • 46× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/mtdowling/jmespath.php/bin/jp.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/about.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/view/editor/social-icons_settings_editor.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/view/editor/flyout_settings_editor.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/view/save-theme-settings.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/wpmm_search_shortcode.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/multisite-activation.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/view/add_theme_settings.php
    • > /wp-content/plugins/ap-mega-menu/inc/backend/tabs/image-settings.php
    • > /wp-content/plugins/ap-mega-menu/inc/admin/menu_settings_class.php
  • 1384× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\Crypto\\AesStreamInterface' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/aws/aws-sdk-php/src/Crypto/AesGcmDecryptingStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/aws/aws-sdk-php/src/Lightsail/LightsailClient.php:235
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/aws/aws-sdk-php/src/EKS/Exception/EKSException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/microsoft/azure-storage/tests/unit/Table/Models/Filters/FilterTest.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/mtdowling/jmespath.php/tests/LexerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/aws/aws-sdk-php/src/Kms/KmsClient.php:102
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\VarDumper\\Dumper\\DataDumperInterface' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/symfony/var-dumper/Dumper/AbstractDumper.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/ap-mega-menu/js/ckfinder/core/connector/php/vendor/cksource/ckfinder/tests/CKSource/CKFinder/Tests/Acl/PermissionTest.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=ap-mega-menu
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=ap-mega-menu 244 The specified value "3s" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=ap-mega-menu
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=ap-mega-menu 253 The specified value "2s" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=apmm-doclinks
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/documentation/ap-mega-menu/ - Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apmm-premium
    • > Network (severe)
    https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=apmm-premium
    • > Other (warning) in unknown
    https://accesspressthemes.com/wordpress-plugins/wp-mega-menu-pro/ 376 is not supported. Use , https://goo.gl/ximf56
    • > GET request to /wp-admin/admin.php?page=apmm-premium
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/wordpress-plugins/wp-mega-menu-pro/ - Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: responsive mega menu, mega menu, flyout menu, responsive, horizontal menu...

ap-mega-menu/ap-mega-menu.php 92% from 13 tests

"Mega Menu Plugin for WordPress - AP Mega Menu" version 3.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected197,305 lines of code in 3,218 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,52928,35987,138125,530
JSON1478024,508
CSS431,96989921,270
Markdown773,402011,411
JavaScript2979791,5929,716
SVG880563,595
HTML88332464
XML15292281
Ant14018225
reStructuredText2129164156
YAML7180114
make210022
Dockerfile18010
Bourne Shell1203

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 138)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.86
▷ Minimum class complexity1.00
▷ Maximum class complexity316.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity138.00
Code structure
Namespaces657
Interfaces131
Traits30
Classes1,648
▷ Abstract classes492.97%
▷ Concrete classes1,59997.03%
▷ Final classes1106.88%
Methods9,080
▷ Static methods1,00211.04%
▷ Public methods7,46782.24%
▷ Protected methods5896.49%
▷ Private methods1,02411.28%
Functions689
▷ Named functions15822.93%
▷ Anonymous functions53177.07%
Constants1,058
▷ Global constants514.82%
▷ Class constants1,00795.18%
▷ Public constants99198.41%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
559 PNG files occupy 4.13MB with 0.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/ckfinder/skins/core/file-icons/22/directory.png0.86KB1.26KB0.00%
js/ckfinder/skins/core/file-icons/22/access.png0.85KB0.80KB▼ 6.19%
images/mega_menu_images/flyout-left.PNG1.29KB0.20KB▼ 84.52%
js/ckfinder/skins/core/file-icons/22/excel.png1.02KB1.11KB0.00%
js/ckfinder/libs/images/icons-png/back-black.png0.23KB0.32KB0.00%