83% mini-cart-for-woocommerce

Code Review | Mini Cart For WooCommerce - Ajax Mini Cart for your Shop site

WordPress plugin Mini Cart For WooCommerce - Ajax Mini Cart for your Shop site scored83%from 54 tests.

About plugin

  • Plugin page: mini-cart-for-woo...
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2020
  • Latest release: Nov 29, 2022
  • Number of updates: 30
  • Update frequency: every 32.2 days
  • Top authors: sharabindu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,481 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.34ms] Passed 4 tests

An overview of server-side resources used by Mini Cart For WooCommerce - Ajax Mini Cart for your Shop site
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.32 ▼1.57
Dashboard /wp-admin3.37 ▲0.0743.93 ▼1.42
Posts /wp-admin/edit.php3.42 ▲0.0741.74 ▲0.41
Add New Post /wp-admin/post-new.php5.97 ▲0.0997.81 ▼3.48
Media Library /wp-admin/upload.php3.30 ▲0.0731.62 ▼2.89
WooCommrce Mini cart /wp-admin/admin.php?page=whmc_menu3.3434.04

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Mini Cart For WooCommerce - Ajax Mini Cart for your Shop site
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.65 ▼0.706.60 ▲4.7247.02 ▲4.20
Dashboard /wp-admin2,218 ▲445.83 ▲0.1892.82 ▼3.4036.19 ▼9.50
Posts /wp-admin/edit.php2,128 ▲312.43 ▲0.4537.58 ▲2.7929.72 ▼7.09
Add New Post /wp-admin/post-new.php1,555 ▲2918.46 ▼4.82610.64 ▼80.0345.79 ▼10.79
Media Library /wp-admin/upload.php1,426 ▲264.58 ▲0.38101.82 ▲0.3440.44 ▼6.13
WooCommrce Mini cart /wp-admin/admin.php?page=whmc_menu3,52810.38387.1594.37

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mini-cart-for-woocommerce/public/class-whmc-framgents.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mini-cart-for-woocommerce/inc/class-whmc_cart.php:42
    • > PHP Warning
      Use of undefined constant MCFWC_LIGHT_URL - assumed 'MCFWC_LIGHT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mini-cart-for-woocommerce/admin/pro-features.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mini-cart-for-woocommerce/inc/regiter_hook_light.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/mini-cart-for-woocommerce/admin/pro-features.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mini-cart-for-woocommerce/public/class-whmc-singleajax.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mini-cart-for-woocommerce/admin/class-whmc-settings.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can take inspiration from this readme.txt

mini-cart-for-woocommerce/mini_cart_fwc.php 85% from 13 tests

This is the main PHP file of "Mini Cart For WooCommerce - Ajax Mini Cart for your Shop site" version 1.6.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "2.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mini-cart-for-woocommerce.php" instead of "mini_cart_fwc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin3,643 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
CSS3153141,703
PHP177365881,591
SVG300192
JavaScript54435157

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.92
▷ Minimum class complexity1.00
▷ Maximum class complexity64.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods82
▷ Static methods22.44%
▷ Public methods7793.90%
▷ Protected methods00.00%
▷ Private methods56.10%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
22 compressed PNG files occupy 0.60MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/img/DELETE-min.png23.62KB22.65KB▼ 4.13%
assets/admin/img/shortcode-min.png44.16KB43.40KB▼ 1.72%
assets/admin/img/menuadmin.png49.74KB48.98KB▼ 1.52%
assets/admin/img/coupon-min.png50.26KB49.50KB▼ 1.51%
assets/admin/img/nofiboxa.png44.72KB43.95KB▼ 1.73%