84% clever-mega-menu

Code Review | Clever Mega Menu for Visual Composer

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

About plugin

  • Plugin page: clever-mega-menu
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.3
  • WordPress version: 6.3.1
  • First release: Jan 13, 2017
  • Latest release: Dec 3, 2019
  • Number of updates: 21
  • Update frequency: every 50.1 days
  • Top authors: zootemplate (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /31,221 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: ▼0.01MB] [CPU: ▼9.52ms] Passed 4 tests

Analyzing server-side resources used by Clever Mega Menu for Visual Composer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.36 ▼2.41
Dashboard /wp-admin3.31 ▼0.0443.69 ▼16.89
Posts /wp-admin/edit.php3.36 ▲0.0047.71 ▼4.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.98 ▼14.38
Media Library /wp-admin/upload.php3.23 ▲0.0034.34 ▼1.01

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Clever Mega Menu for Visual Composer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.111.59 ▼0.0941.05 ▼0.45
Dashboard /wp-admin2,206 ▲215.84 ▲0.0397.76 ▼4.7039.42 ▼2.79
Posts /wp-admin/edit.php2,089 ▼02.05 ▼0.0035.45 ▼6.3633.26 ▼2.22
Add New Post /wp-admin/post-new.php1,538 ▲1923.26 ▲0.15627.80 ▼18.3954.54 ▼4.63
Media Library /wp-admin/upload.php1,385 ▼34.18 ▲0.0993.30 ▼11.7242.54 ▼5.71

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/clever-mega-menu/clever-mega-menu.php:526
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/clever-mega-menu/includes/class-clever-mega-menu-walker.php:7

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: visual composer, mega menu, navigation menu, flyout menu, wordpress mega menu

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

The principal PHP file in "Clever Mega Menu for Visual Composer" v. 1.0.1 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 229 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
Everything looks great! No dangerous files found in this plugin11,292 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,0201,0567,926
CSS1020761,503
JavaScript142521901,098
Sass420765

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity74.20
▷ Minimum class complexity1.00
▷ Maximum class complexity467.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes960.00%
Methods299
▷ Static methods41.34%
▷ Public methods8428.09%
▷ Protected methods18461.54%
▷ Private methods3110.37%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/backend/images/clever-mega-menu-icon-16x16.png1.78KB0.82KB▼ 53.71%