90% woo-payment-discounts

Code Review | Discounts Per Payment Method for WooCommerce

WordPress plugin Discounts Per Payment Method for WooCommerce scored 90% from 54 tests.

About plugin

  • Plugin page: woo-payment-disco...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.6.0
  • WordPress version: 5.8.1
  • First release: Sep 14, 2016
  • Latest release: Dec 12, 2020
  • Number of updates: 43
  • Update frequency: every 36.1 days
  • Top authors: wpcodelibrary (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

9,000+ active / 31,163 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.03MB] [CPU: ▼143.07ms] Passed 4 tests

A check of server-side resources used by Discounts Per Payment Method for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.68 ▼0.1624.41 ▼11.57
Dashboard /wp-admin3.08 ▲0.0241.35 ▼6.07
Posts /wp-admin/edit.php3.13 ▲0.0243.47 ▼0.22
Add New Post /wp-admin/post-new.php5.44 ▲0.0192.47 ▼551.94
Media Library /wp-admin/upload.php3.02 ▲0.0230.36 ▼2.70
Discounts Per Payment Method for WooCommerce /wp-admin/index.php?page=wpd-about2.9927.49

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 1 new option
New WordPress options
woo_payment_discounts

Browser metrics Passed 4 tests

Checking browser requirements for Discounts Per Payment Method for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,255 ▼34116.16 ▲0.440.47 ▼8.9811.83 ▼38.19
Dashboard /wp-admin2,975 ▲846.13 ▲0.30136.40 ▼7.04108.12 ▼5.00
Posts /wp-admin/edit.php2,738 ▼12.72 ▼0.1369.85 ▲2.2296.06 ▲3.93
Add New Post /wp-admin/post-new.php1,606 ▼6618.49 ▼0.40355.53 ▼30.92105.42 ▼2.65
Media Library /wp-admin/upload.php1,809 ▲25.04 ▲0.02142.56 ▼19.46116.16 ▼3.11
Discounts Per Payment Method for WooCommerce /wp-admin/index.php?page=wpd-about1,3262.0553.2794.56

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • woo_payment_discounts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

woo-payment-discounts/woo-payment-discounts.php Passed 13 tests

This is the main PHP file of "Discounts Per Payment Method for WooCommerce" version 1.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
69 characters long description:
Setup discounts for specific payment methods is selected on checkout.

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 plugin346 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP682121310
CSS11028
JavaScript1108

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.41
Average class complexity8.00
▷ Minimum class complexity4.00
▷ Maximum class complexity15.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods1676.19%
▷ Protected methods419.05%
▷ Private methods14.76%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin