89% woocommerce-menu-bar-cart

Code Review | Menu Cart for WooCommerce

WordPress plugin Menu Cart for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-menu-...
  • Plugin version: 2.14.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 24, 2012
  • Latest release: Nov 8, 2023
  • Number of updates: 104
  • Update frequency: every 38.2 days
  • Top authors: jprummer (42.31%)wpovernight (37.5%)pomegranate (22.12%)

Code review

54 tests

User reviews

98 reviews

Install metrics

100,000+ active /2,309,053 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼9.47ms] 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.52 ▲0.0534.77 ▼6.06
Dashboard /wp-admin3.38 ▲0.0345.43 ▼11.23
Posts /wp-admin/edit.php3.46 ▲0.1048.89 ▼4.08
Add New Post /wp-admin/post-new.php5.96 ▲0.0784.74 ▼16.49
Media Library /wp-admin/upload.php3.30 ▲0.0740.56 ▲4.69
Menu Cart Setup /wp-admin/options-general.php?page=wpmenucart_options_page3.3032.39

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 139 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
wpmenucart
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Menu Cart for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲3714.13 ▼0.131.56 ▼0.2840.65 ▼2.20
Dashboard /wp-admin2,207 ▲275.60 ▼0.2590.44 ▲2.0540.43 ▲2.10
Posts /wp-admin/edit.php2,109 ▲91.97 ▲0.0140.03 ▼2.2537.06 ▼2.64
Add New Post /wp-admin/post-new.php6,377 ▲4,84227.51 ▲2.10929.86 ▲291.2865.01 ▼9.26
Media Library /wp-admin/upload.php1,409 ▲94.16 ▼0.11107.37 ▲3.1947.41 ▲6.13
Menu Cart Setup /wp-admin/options-general.php?page=wpmenucart_options_page1,3781.8328.3344.61

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • wpmenucart
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: shopping cart, woocommerce, bar, basket, edd...

woocommerce-menu-bar-cart/wp-menu-cart.php 69% from 13 tests

The entry point to "Menu Cart for WooCommerce" version 2.14.2 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-menu-bar-cart.php" instead of "wp-menu-cart.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 264 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must match the one declared in readme.txt ("3.4" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected8,620 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PO File231,4491,6213,949
SVG2002,707
PHP72613061,436
JavaScript133332250
CSS17218243
Markdown113035

PHP code Passed 2 tests

An short overview of 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.47
Average class complexity31.71
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods74
▷ Static methods34.05%
▷ Public methods7398.65%
▷ Protected methods00.00%
▷ Private methods11.35%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
28 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cart-icon-7.png0.69KB0.55KB▼ 20.00%
images/cart-icon-11.png0.58KB0.47KB▼ 20.07%
images/cart-icon-8.png0.74KB0.59KB▼ 20.87%
assets/images/cart-icon-5.png0.78KB0.59KB▼ 23.71%
assets/images/cart-icon-12.png0.80KB0.61KB▼ 23.53%