84% clever-mega-menu-for-elementor

Code Review | Clever Mega Menu for Elementor

WordPress plugin Clever Mega Menu for Elementor scored84%from 54 tests.

About plugin

  • Plugin page: clever-mega-menu-...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.2
  • WordPress version: 6.3.1
  • First release: Apr 9, 2019
  • Latest release: Jun 24, 2020
  • Number of updates: 47
  • Update frequency: every 9.4 days
  • Top authors: zootemplate (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

3,000+ active /68,774 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.55MB] [CPU: ▲6.22ms] Passed 4 tests

A check of server-side resources used by Clever Mega Menu for Elementor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5348.55 ▲3.90
Dashboard /wp-admin4.86 ▲1.5553.38 ▲0.98
Posts /wp-admin/edit.php4.98 ▲1.6260.02 ▲9.64
Add New Post /wp-admin/post-new.php7.44 ▲1.55108.26 ▲10.37
Media Library /wp-admin/upload.php4.78 ▲1.5550.98 ▲14.56
Menu Skins /wp-admin/edit.php?post_type=cmm4e_menu_theme4.8748.43
Mega Menu /wp-admin/admin.php?page=cmm4e-dashboard-page4.7539.58

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 44 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
cmm4e_plugin_settings
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Clever Mega Menu for Elementor
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲20813.57 ▼1.057.67 ▲6.0740.16 ▼8.50
Dashboard /wp-admin2,253 ▲504.88 ▼0.03102.13 ▼6.0477.68 ▲32.95
Posts /wp-admin/edit.php2,147 ▲502.21 ▲0.2137.53 ▲1.0435.40 ▼0.67
Add New Post /wp-admin/post-new.php1,720 ▲18922.65 ▼0.59681.80 ▲0.3756.28 ▲3.57
Media Library /wp-admin/upload.php1,438 ▲384.34 ▲0.16112.47 ▲10.0875.30 ▲27.86
Menu Skins /wp-admin/edit.php?post_type=cmm4e_menu_theme1,6222.2535.6833.02
Mega Menu /wp-admin/admin.php?page=cmm4e-dashboard-page9824.6342.9256.71

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • cmm4e_plugin_settings

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/clever-mega-menu-for-elementor/includes/admin/pages/dashboard.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\add_action() in wp-content/plugins/clever-mega-menu-for-elementor/includes/elementor/controls/document.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\add_action() in wp-content/plugins/clever-mega-menu-for-elementor/includes/post-types/menu-theme.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\add_action() in wp-content/plugins/clever-mega-menu-for-elementor/includes/meta/menu-term.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/clever-mega-menu-for-elementor/includes/elementor/widgets/cmm4e.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/clever-mega-menu-for-elementor/includes/mega-menu-walker.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/clever-mega-menu-for-elementor/includes/templates/cmm4e-menu.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\add_action() in wp-content/plugins/clever-mega-menu-for-elementor/includes/post-types/cmm4e-menu.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\get_option() in wp-content/plugins/clever-mega-menu-for-elementor/clever-mega-menu-for-elementor.php:463
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CleverSoft\\WpPlugin\\Cmm4E\\get_post_meta() in wp-content/plugins/clever-mega-menu-for-elementor/includes/meta/menu-theme.php:250

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

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
5 plugin tags: mega menu, flyout menu, wordpress mega menu, navigation menu, elementor

clever-mega-menu-for-elementor/clever-mega-menu-for-elementor.php 92% from 13 tests

Analyzing the main PHP file in "Clever Mega Menu for Elementor" version 1.1.2
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 334 characters long)

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 detected10,955 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP119628157,938
SVG2003,005
CSS7037
JavaScript5005

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity84.54
▷ Minimum class complexity1.00
▷ Maximum class complexity467.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes861.54%
Methods274
▷ Static methods72.55%
▷ Public methods7427.01%
▷ Protected methods17864.96%
▷ Private methods228.03%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants6
▷ Global constants233.33%
▷ Class constants466.67%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/backend/images/clever-mega-menu-icon.png6.34KB3.02KB▼ 52.33%
assets/backend/images/clever-mega-menu-icon-16x16.png1.63KB1.05KB▼ 35.33%