10% minimum-order-amount

Code Review | Minimum Order Amount

WordPress plugin Minimum Order Amount scored10%from 54 tests.

About plugin

  • Plugin page: minimum-order-amount
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.1.1
  • WordPress version: 6.3.1
  • First release: Nov 18, 2016
  • Latest release: Mar 19, 2019
  • Number of updates: 38
  • Update frequency: every 23.8 days
  • Top authors: easycpmods (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,273 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/minimum-order-amount/ecpm-moa.php+33
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.86MB] [CPU: ▼29.42ms] Passed 4 tests

This is a short check of server-side resources used by Minimum Order Amount
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.57 ▲3.83
Dashboard /wp-admin3.08 ▼0.2232.05 ▼15.01
Posts /wp-admin/edit.php3.08 ▼0.2825.00 ▼23.69
Add New Post /wp-admin/post-new.php3.08 ▼2.8123.56 ▼69.21
Media Library /wp-admin/upload.php3.08 ▼0.1522.22 ▼9.75
Minimum Order Amount /wp-admin/options-general.php?page=ecpm_moa_settings_page3.0925.88

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
ecpm_moa_settings
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Minimum Order Amount
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.24 ▼1.131.95 ▲0.3042.23 ▲2.06
Dashboard /wp-admin2,215 ▲275.85 ▲0.96112.89 ▲7.9042.23 ▲4.85
Posts /wp-admin/edit.php2,095 ▲62.05 ▲0.0135.24 ▲0.2331.93 ▼3.39
Add New Post /wp-admin/post-new.php1,533 ▼023.12 ▼0.20677.75 ▲22.1261.96 ▲9.17
Media Library /wp-admin/upload.php1,397 ▲64.16 ▼0.0194.39 ▼4.1445.05 ▼1.04
Minimum Order Amount /wp-admin/options-general.php?page=ecpm_moa_settings_page1,1562.0223.6166.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/minimum-order-amount/ecpm-moa.php+39
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=ecpm_moa_settings_page
    • > Warning in wp-content/plugins/minimum-order-amount/ecpm-moa.php+39
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)

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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/minimum-order-amount/image_sidebar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/minimum-order-amount/ecpm-moa.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/minimum-order-amount/paid_plugin_inc.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=ecpm_moa_settings_page
    • > Network (severe)
    wp-content/plugins/minimum-order-amount/images/easy-credit-payments.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Plugin's settings), #2 (Warning message), #3 (Error message)
The official readme.txt is a good inspiration

minimum-order-amount/ecpm-moa.php 77% from 13 tests

The main file in "Minimum Order Amount" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("minimum-order-amount.php" instead of "ecpm-moa.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: The description should be shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected482 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP46211328
PO File24345141
CSS12013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.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
24 PNG files occupy 0.39MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/user-ads-limiter.png43.08KB16.86KB▼ 60.86%
images/image-loop-rotator.png2.74KB2.85KB0.00%
images/minimum-order-amount.png21.68KB9.69KB▼ 55.32%
images/better-featured-slider.png16.74KB7.50KB▼ 55.18%
screenshot-3.png18.48KB11.66KB▼ 36.87%