77% minimum-order-amount-for-woocommerce

Code Review | Minimum Order Amount for Woocommerce

WordPress plugin Minimum Order Amount for Woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: minimum-order-amo...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 3, 2016
  • Latest release: Nov 2, 2018
  • Number of updates: 23
  • Update frequency: every 33.1 days
  • Top authors: dcurasi (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /28,749 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼10.01ms] Passed 4 tests

An overview of server-side resources used by Minimum Order Amount for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0834.24 ▼3.18
Dashboard /wp-admin3.39 ▲0.0844.39 ▼5.63
Posts /wp-admin/edit.php3.50 ▲0.1447.74 ▲0.48
Add New Post /wp-admin/post-new.php5.97 ▲0.0881.11 ▼31.20
Media Library /wp-admin/upload.php3.31 ▲0.0834.77 ▼0.04
Minimum Order /wp-admin/admin.php?page=dc-moafw-menu-page3.2931.25

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 12 new options
New WordPress options
dc_moafw_message
dc_moafw_activate
theysaidso_admin_options
dc_moafw_currency_display_type
can_compress_scripts
dc_moafw_minimum
dc_moafw_current_total_text
widget_recent-posts
widget_recent-comments
dc_moafw_message_shop
...

Browser metrics Passed 4 tests

An overview of browser requirements for Minimum Order Amount for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.18 ▼1.201.46 ▼0.3943.07 ▼2.34
Dashboard /wp-admin2,219 ▲315.82 ▲0.7698.06 ▼11.4740.75 ▼1.77
Posts /wp-admin/edit.php2,104 ▲152.01 ▼0.0439.52 ▼2.9037.34 ▲1.42
Add New Post /wp-admin/post-new.php1,539 ▲1823.39 ▲0.21686.28 ▲90.8657.31 ▲7.79
Media Library /wp-admin/upload.php1,401 ▲164.20 ▼0.0898.68 ▲2.9843.88 ▲3.86
Minimum Order /wp-admin/admin.php?page=dc-moafw-menu-page9692.1721.9527.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • theysaidso_admin_options
    • dc_moafw_current_total_text
    • dc_moafw_activate
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • dc_moafw_minimum
    • dc_moafw_message_shop
    • dc_moafw_message
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/minimum-order-amount-for-woocommerce/public/partials/dc-moafw-public-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/minimum-order-amount-for-woocommerce/admin/partials/dc-moafw-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/minimum-order-amount-for-woocommerce/uninstall.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can look at the official readme.txt

minimum-order-amount-for-woocommerce/dc-moafw.php 77% from 13 tests

"Minimum Order Amount for Woocommerce" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.2.0" instead of "2.1.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("minimum-order-amount-for-woocommerce.php" instead of "dc-moafw.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin643 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP12140592392
PO File36060241
JavaScript24546
CSS2084

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin