78% cool-responsive-mega-menu

Code Review | Cool Responsive Megamenu

WordPress plugin Cool Responsive Megamenu scored78%from 54 tests.

About plugin

  • Plugin page: cool-responsive-m...
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Nov 15, 2013
  • Latest release: Sep 4, 2022
  • Number of updates: 90
  • Update frequency: every 35.7 days
  • Top authors: razib_ (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /25,083 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
This plugin's installer ran successfully

Server metrics [RAM: ▲1.45MB] [CPU: ▲10.11ms] Passed 4 tests

This is a short check of server-side resources used by Cool Responsive Megamenu
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3434.96 ▼6.79
Dashboard /wp-admin5.14 ▲1.8060.68 ▲3.24
Posts /wp-admin/edit.php5.25 ▲1.9069.30 ▲23.54
Add New Post /wp-admin/post-new.php7.72 ▲1.83131.01 ▲37.15
Media Library /wp-admin/upload.php5.04 ▲1.8152.36 ▲20.46
Settings /wp-admin/admin.php?page=crmm-settings5.0446.65

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 67 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
db_upgraded
crmm_media_post_ID
can_compress_scripts
theysaidso_admin_options
cool_megamenu_settings
cool_megamenu
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Cool Responsive Megamenu
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,081 ▲31015.79 ▲1.049.46 ▲7.4847.83 ▲4.22
Dashboard /wp-admin2,398 ▲2077.02 ▲2.12144.14 ▲41.5741.23 ▼1.27
Posts /wp-admin/edit.php2,304 ▲2123.85 ▲1.8353.46 ▲11.6433.42 ▲1.24
Add New Post /wp-admin/post-new.php1,561 ▲4723.57 ▲6.02649.18 ▼25.7736.92 ▼9.51
Media Library /wp-admin/upload.php1,437 ▲554.65 ▲0.4585.98 ▼12.7639.99 ▼6.82
Settings /wp-admin/admin.php?page=crmm-settings1,2263.8349.7542.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • cool_megamenu_settings
    • db_upgraded
    • cool_megamenu
    • crmm_media_post_ID
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 11× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/cool-responsive-mega-menu/includes/crmm-functions.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-functions-settings-page.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-functions-option-types.php
    • > /wp-content/plugins/cool-responsive-mega-menu/templates/crmm-card.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-cleanup-api.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-functions-docs-page.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-functions-admin.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-functions-compat.php
    • > /wp-content/plugins/cool-responsive-mega-menu/cool-responsive-mega-menu.php
    • > /wp-content/plugins/cool-responsive-mega-menu/admin/crmm-settings-api.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-loop.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cool-responsive-mega-menu/includes/crmm_edit_custom_walker.php:9
    • > PHP Notice
      Undefined property: stdClass::$title in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-card.php on line 3
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-card.php on line 12
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-image.php on line 2
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-card.php on line 6
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-shortcode.php on line 3
    • > PHP Notice
      Trying to get property 'cool_megamenu_args' of non-object in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-gallery.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/cool-responsive-mega-menu/templates/crmm-gallery.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cool-responsive-mega-menu/admin/cool-options.php:5

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

cool-responsive-mega-menu/cool-responsive-mega-menu.php 92% from 13 tests

This is the main PHP file of "Cool Responsive Megamenu" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 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 plugin24,042 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP223,8873,6838,100
CSS61,8713237,754
Sass31,03224,221
SVG2002,959
JavaScript61721011,008

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity46.14
▷ Minimum class complexity13.00
▷ Maximum class complexity148.00
Average method complexity5.27
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods74
▷ Static methods22.70%
▷ Public methods6689.19%
▷ Protected methods00.00%
▷ Private methods810.81%
Functions217
▷ Named functions217100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants26100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.27MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png13.21KB7.28KB▼ 44.87%
assets/screenshot-2.png31.45KB14.90KB▼ 52.63%
assets/images/layout/right-sidebar.png3.90KB2.09KB▼ 46.42%
assets/images/crmm-select-rtl.png1.02KB0.14KB▼ 85.96%
assets/images/crmm-select-hover-rtl.png1.02KB0.14KB▼ 85.91%