83% woo-minimum-order-purchase

Code Review | Woocommerce Minimum Order Purchase

WordPress plugin Woocommerce Minimum Order Purchase scored83%from 54 tests.

About plugin

  • Plugin page: woo-minimum-order...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.5
  • WordPress version: 6.3.1
  • First release: Jun 8, 2017
  • Latest release: Jun 8, 2017
  • Number of updates: 10
  • Update frequency: every 1.2 days
  • Top authors: smscentral (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /946 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.45ms] Passed 4 tests

An overview of server-side resources used by Woocommerce Minimum Order Purchase
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0134.82 ▼4.03
Dashboard /wp-admin3.32 ▲0.0143.92 ▼2.75
Posts /wp-admin/edit.php3.37 ▲0.0147.00 ▲0.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.87 ▼10.05
Media Library /wp-admin/upload.php3.24 ▲0.0136.63 ▼0.96

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Minimum Order Purchase
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.28 ▼0.041.62 ▲0.0042.32 ▲1.45
Dashboard /wp-admin2,192 ▲125.49 ▼0.1384.13 ▼6.3541.47 ▼1.41
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.0641.61 ▲5.4434.95 ▼2.91
Add New Post /wp-admin/post-new.php1,526 ▼222.94 ▼0.17640.50 ▲1.9854.83 ▲3.50
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0895.48 ▼2.7142.34 ▼3.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woo-minimum-order-purchase/woocommece-minimum-order-purchase.php:95

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-minimum-order-purchase === )
  • Screenshots: These screenshots do not have images: #1 (The admin screen), #2 (An example error message)
The official readme.txt is a good inspiration

woo-minimum-order-purchase/woocommece-minimum-order-purchase.php 92% from 13 tests

This is the main PHP file of "Woocommerce Minimum Order Purchase" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-minimum-order-purchase.php" instead of "woocommece-minimum-order-purchase.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin56 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1251756

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png22.66KB9.14KB▼ 59.66%
screenshot-1.png86.05KB24.21KB▼ 71.86%