83% ht-menu-lite

Code Review | HT Menu - WordPress Mega Menu Builder for Elementor

WordPress plugin HT Menu - WordPress Mega Menu Builder for Elementor scored83%from 54 tests.

About plugin

  • Plugin page: ht-menu-lite
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 9, 2019
  • Latest release: Aug 1, 2023
  • Number of updates: 30
  • Update frequency: every 49.8 days
  • Top authors: hasthemes (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /38,955 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.22ms] Passed 4 tests

Server-side resources used by HT Menu - WordPress Mega Menu Builder for Elementor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.15 ▲0.12
Dashboard /wp-admin3.32 ▲0.0151.28 ▼1.46
Posts /wp-admin/edit.php3.37 ▲0.0148.83 ▼1.48
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.29 ▲2.67
Media Library /wp-admin/upload.php3.24 ▲0.0136.37 ▲1.93

Server storage [IO: ▲1.47MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

HT Menu - WordPress Mega Menu Builder for Elementor: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.26 ▼0.091.71 ▼0.1742.95 ▲0.94
Dashboard /wp-admin2,203 ▲265.64 ▲0.0292.86 ▲2.6142.89 ▲4.43
Posts /wp-admin/edit.php2,108 ▲82.11 ▲0.1235.45 ▼1.6733.31 ▼3.56
Add New Post /wp-admin/post-new.php1,534 ▲823.54 ▲0.10678.01 ▼15.2365.48 ▲5.09
Media Library /wp-admin/upload.php1,405 ▲84.24 ▼0.1196.39 ▼9.5046.81 ▼2.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • htmegamenu_do_activation_redirect
    • widget_theysaidso_widget
    • widget_recent-comments

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
Even though no errors were found, this is by no means 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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/ht-menu-lite/index.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/ht-menu-lite/include/menu/htmenu_walker.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ht-menu-lite/include/menu/menu_term.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ht-menu-lite/include/admin/include/templates_list.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ht-menu-lite/include/menu/htmenu_menu.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% 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: menu, elementor, mega menu, widget, megamenu

ht-menu-lite/ht-mega-menu.php 77% from 13 tests

The primary PHP file in "HT Menu - WordPress Mega Menu Builder for Elementor" version 1.2.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ht-menu-lite.php" instead of "ht-mega-menu.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin5,554 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP166574043,226
CSS676251,191
JavaScript7350157955
JSON140129
YAML22034
SVG10019

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods110
▷ Static methods65.45%
▷ Public methods10292.73%
▷ Protected methods65.45%
▷ Private methods21.82%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
60 PNG files occupy 0.91MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/admin/assets/images/portfolio-icon.png3.59KB3.89KB0.00%
.wordpress-org/screenshot-4.png459.56KB129.13KB▼ 71.90%
include/admin/assets/images/insert-headers-and-footers-script.png6.03KB2.71KB▼ 55.09%
include/admin/assets/images/hashbar-icon.png1.95KB2.06KB0.00%
include/admin/assets/images/instagram-icon.png5.13KB2.77KB▼ 45.95%