83% minimum-purchase-amount-for-woo-cart

Code Review | Minimum Purchase Amount For Woo Cart - For WooCommerce

WordPress plugin Minimum Purchase Amount For Woo Cart - For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: minimum-purchase-...
  • Plugin version: 2.3.15
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Sep 14, 2020
  • Latest release: Nov 19, 2023
  • Number of updates: 71
  • Update frequency: every 16.4 days
  • Top authors: cttalks (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /13,535 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Minimum Purchase Amount For Woo Cart - For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0132.01 ▼3.70
Dashboard /wp-admin3.31 ▼0.0342.42 ▼19.58
Posts /wp-admin/edit.php3.36 ▲0.0148.20 ▲1.56
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.17 ▲5.54
Media Library /wp-admin/upload.php3.24 ▲0.0134.52 ▲1.65

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Minimum Purchase Amount For Woo Cart - For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲5414.18 ▼0.051.87 ▲0.2043.26 ▼0.52
Dashboard /wp-admin2,195 ▲155.64 ▲0.0297.25 ▲0.5142.98 ▼3.11
Posts /wp-admin/edit.php2,100 ▼31.97 ▲0.0040.05 ▼1.7636.07 ▲0.70
Add New Post /wp-admin/post-new.php1,528 ▲223.26 ▼0.11632.94 ▼66.6156.31 ▲2.84
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.0396.56 ▲1.4341.94 ▼2.19

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/minimum-purchase-amount-for-woo-cart/templates/ct-mpac-promotion-notice.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/minimum-purchase-amount-for-woo-cart/templates/ct-promotions.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/minimum-purchase-amount-for-woo-cart/templates/ct-mpac-minimum-amount-notice.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: "paypal.me/cttalks"
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

minimum-purchase-amount-for-woo-cart/minimum-purchase-amount-for-woocommerce-cart.php 77% from 13 tests

"Minimum Purchase Amount For Woo Cart - For WooCommerce" version 2.3.15's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "3.5")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("minimum-purchase-amount-for-woo-cart.php" instead of "minimum-purchase-amount-for-woocommerce-cart.php")

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 plugin16,980 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript154,12814,19913,870
CSS19591232,008
PHP588107632
PO File3150174456
SVG10011
Markdown1002
JSON1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity26.50
▷ Minimum class complexity18.00
▷ Maximum class complexity35.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/DataTables/DataTables-1.10.22/images/sort_desc_disabled.png0.14KB0.25KB0.00%
assets/lib/DataTables/DataTables-1.10.22/images/sort_both.png0.20KB0.29KB0.00%
assets/lib/DataTables/DataTables-1.10.22/images/sort_asc_disabled.png0.14KB0.25KB0.00%
assets/lib/DataTables/DataTables-1.10.22/images/sort_asc.png0.16KB0.25KB0.00%
assets/lib/DataTables/DataTables-1.10.22/images/sort_desc.png0.15KB0.25KB0.00%