83% minimum-purchase-for-woocommerce

Code Review | Minimum Purchase for WooCommerce

WordPress plugin Minimum Purchase for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: minimum-purchase-...
  • Plugin version: 2.0.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.8-6.0.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2013
  • Latest release: Oct 9, 2022
  • Number of updates: 165
  • Update frequency: every 22.1 days
  • Top authors: vark (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

4,000+ active /96,025 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
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Minimum Purchase for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.79 ▲0.69
Dashboard /wp-admin3.31 ▲0.0050.34 ▼3.73
Posts /wp-admin/edit.php3.36 ▲0.0051.53 ▼0.12
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.87 ▲12.27
Media Library /wp-admin/upload.php3.23 ▲0.0034.66 ▼2.25

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Minimum Purchase for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.19 ▼0.091.98 ▲0.2940.98 ▼5.03
Dashboard /wp-admin2,195 ▲185.65 ▼0.0191.05 ▼2.7039.28 ▼1.79
Posts /wp-admin/edit.php2,097 ▼31.99 ▼0.0441.70 ▲6.4634.60 ▲3.44
Add New Post /wp-admin/post-new.php1,529 ▼323.65 ▲0.89610.25 ▲8.9762.56 ▲11.02
Media Library /wp-admin/upload.php1,400 ▼34.22 ▲0.02107.69 ▲3.1844.75 ▼0.13

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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minimum-purchase-for-woocommerce/admin/vtmin-license-options.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/minimum-purchase-for-woocommerce/vt-minimum-purchase.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-definitions.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/minimum-purchase-for-woocommerce/core/vtmin-backbone.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/minimum-purchase-for-woocommerce/admin/vtmin-setup-options.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-functions.php:414

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Minimum Purchase Rule Screen), #2 (Group Search Criteria), #3 (Rule application method - Any), #4 (Rule application method - Each), #5 (Rule application method - All), #6 (Quantity or Price Minimum Amount), #7 (Error Message at Checkout)
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

minimum-purchase-for-woocommerce/vt-minimum-purchase.php 85% from 13 tests

"Minimum Purchase for WooCommerce" version 2.0.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("minimum-purchase-for-woocommerce.php" instead of "vt-minimum-purchase.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.3" instead of "6.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin6,715 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP161,7542,3985,901
CSS24575628
JavaScript23353186

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity39.28
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity5.36
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods158
▷ Static methods00.00%
▷ Public methods15698.73%
▷ Protected methods00.00%
▷ Private methods21.27%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants29100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin