78% disable-payment-method-for-woocommerce

Code Review | Disable payment method / COD fees / Advance COD or Partial payment for Order for WooCommerce

WordPress plugin Disable payment method / COD fees / Advance COD or Partial payment for Order for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: disable-payment-m...
  • Plugin version: 1.1.7.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.4.0
  • WordPress version: 6.3.1
  • First release: Mar 12, 2022
  • Latest release: Nov 26, 2023
  • Number of updates: 87
  • Update frequency: every 7.2 days
  • Top authors: rajeshsingh520 (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /19,647 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.00MB] [CPU: ▼4.15ms] Passed 4 tests

Server-side resources used by Disable payment method / COD fees / Advance COD or Partial payment for Order for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.44 ▼7.12
Dashboard /wp-admin3.32 ▼0.0346.94 ▼12.36
Posts /wp-admin/edit.php3.37 ▲0.0147.96 ▲3.99
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.61 ▲4.02
Media Library /wp-admin/upload.php3.24 ▲0.0131.77 ▼1.10

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Disable payment method / COD fees / Advance COD or Partial payment for Order for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.32 ▼0.081.64 ▼0.1538.42 ▼9.48
Dashboard /wp-admin2,198 ▲175.53 ▼0.1891.78 ▼22.8541.74 ▲0.09
Posts /wp-admin/edit.php2,107 ▲72.01 ▼0.0140.90 ▲4.1735.95 ▲0.23
Add New Post /wp-admin/post-new.php1,532 ▲623.14 ▲0.13591.98 ▼107.9959.57 ▼3.16
Media Library /wp-admin/upload.php1,409 ▲94.29 ▲0.0999.01 ▲2.7743.66 ▲1.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/disable-payment-method-for-woocommerce/includes/pisol.class.form.php
  • 55× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PI_DPMW_SELECTION_RULE_SLUG - assumed 'PI_DPMW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/city.php on line 133
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/country.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/city.php:8
    • > PHP Warning
      Use of undefined constant PI_DPMW_SELECTION_RULE_SLUG - assumed 'PI_DPMW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/zone.php on line 141
    • > PHP Fatal error
      Uncaught Error: Class 'Class_Pi_Dpmw_Add_Edit' not found in wp-content/plugins/disable-payment-method-for-woocommerce/admin/partials/list-disable-payment-rules.php:3
    • > PHP Warning
      Use of undefined constant PI_DPMW_SELECTION_RULE_SLUG - assumed 'PI_DPMW_SELECTION_RULE_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/product_tag.php on line 186
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/day_of_week.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/shipping_method.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/diff_shipping_add.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/disable-payment-method-for-woocommerce/admin/selection_rules/rules/state.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can look at the official readme.txt

disable-payment-method-for-woocommerce/disable-payment-method-for-woocommerce.php Passed 13 tests

The main PHP script in "Disable payment method / COD fees / Advance COD or Partial payment for Order for WooCommerce" version 1.1.7.11 is automatically included on every request by WordPress
54 characters long description:
Disable any payment method based on various conditions

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
No dangerous file extensions were detected19,027 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
CSS42,072289,490
PHP581,6761,1265,593
SVG3333,552
JavaScript67652392

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.58
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes48
▷ Abstract classes00.00%
▷ Concrete classes48100.00%
▷ Final classes00.00%
Methods426
▷ Static methods5412.68%
▷ Public methods41396.95%
▷ Protected methods81.88%
▷ Private methods51.17%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants6
▷ Global constants6100.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
No PNG files were detected