78% menu-cart-for-woocommerce

Code Review | Menu Cart For Woocommerce

WordPress plugin Menu Cart For Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: menu-cart-for-woo...
  • Plugin version: 1.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 27, 2022
  • Latest release: Nov 20, 2023
  • Number of updates: 15
  • Update frequency: every 34.3 days
  • Top authors: rajkakadiya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.10ms] Passed 4 tests

Server-side resources used by Menu Cart For Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.61 ▲2.10
Dashboard /wp-admin3.31 ▲0.0048.03 ▼0.15
Posts /wp-admin/edit.php3.36 ▲0.0047.32 ▲2.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.72 ▲0.46
Media Library /wp-admin/upload.php3.23 ▲0.0031.60 ▼2.00

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Menu Cart For Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.34 ▼0.001.87 ▲0.0045.18 ▲1.88
Dashboard /wp-admin2,189 ▲85.52 ▼0.1881.43 ▼24.3636.28 ▼6.46
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0233.85 ▼2.4232.41 ▲0.15
Add New Post /wp-admin/post-new.php1,526 ▼1923.80 ▼1.23619.59 ▼35.2552.83 ▼19.20
Media Library /wp-admin/upload.php1,403 ▲64.18 ▼0.0396.24 ▼6.9542.57 ▼1.18

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

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

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/menu-cart-for-woocommerce/admin/settings/pro-features.php
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'mcfw_general_settings' not found in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php:15
    • > PHP Warning
      include(): Failed opening 'MCFW_PLUGIN_DIR_PATHadmin/settings/sticky-cart-setting.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/menu-cart-for-woocommerce/admin/settings/flyout-setting.php:3
    • > PHP Warning
      include(): Failed opening 'MCFW_PLUGIN_DIR_PATHadmin/settings/shortcode-setting.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/menu-cart-for-woocommerce/admin/settings/design-elements-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/menu-cart-for-woocommerce/front/index.php:2
    • > PHP Warning
      Use of undefined constant MCFW_PLUGIN_DIR_PATH - assumed 'MCFW_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 4
    • > PHP Warning
      Use of undefined constant MCFW_PLUGIN_DIR_PATH - assumed 'MCFW_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 2
    • > PHP Warning
      Use of undefined constant MCFW_PLUGIN_DIR_PATH - assumed 'MCFW_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 6
    • > PHP Warning
      Use of undefined constant MCFW_PLUGIN_DIR_PATH - assumed 'MCFW_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/menu-cart-for-woocommerce/admin/option.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #8 is required in menu-cart-for-woocommerce/assets to your readme.txt
  • Screenshots: These screenshots require images: #1 (General Settings), #2 (Flyout Settings), #3 (Sticky Cart Setting), #4 (Design Elements), #5 (Flyout Cart menu preview), #6 (Flyout Cart menu preview)
You can look at the official readme.txt

menu-cart-for-woocommerce/menu-cart-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Menu Cart For Woocommerce" version 1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 244 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected9,152 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,2973414,993
PHP12299211,893
CSS415591,246
Sass21430983
SVG100037

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity25.00
▷ Minimum class complexity2.00
▷ Maximum class complexity45.00
Average method complexity4.93
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods55100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
24 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/menu_icons/Cart8.png1.31KB0.67KB▼ 48.85%
assets/images/menu_icons/cart1.png0.98KB0.67KB▼ 31.65%
assets/images/web-browser.png0.53KB0.55KB0.00%
assets/images/menu_icons/cart7.png0.83KB0.61KB▼ 27.08%
assets/images/crown.png0.73KB0.69KB▼ 4.31%