78% partial-cod-payment-gateway-restrictions-fees

Code Review | WooCommerce Partial COD - Payment Gateway Restrictions & Fees

WordPress plugin WooCommerce Partial COD - Payment Gateway Restrictions & Fees scored78%from 54 tests.

About plugin

  • Plugin page: partial-cod-payme...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2022
  • Latest release: Sep 22, 2023
  • Number of updates: 31
  • Update frequency: every 10.0 days
  • Top authors: sundayfanz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,646 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.84MB] [CPU: ▲0.33ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Partial COD - Payment Gateway Restrictions & Fees
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.37 ▼7.92
Dashboard /wp-admin4.41 ▲1.1159.00 ▲7.44
Posts /wp-admin/edit.php4.52 ▲1.1756.29 ▲3.65
Add New Post /wp-admin/post-new.php7.01 ▲1.1295.14 ▼1.85
Media Library /wp-admin/upload.php4.34 ▲1.1151.75 ▲14.59

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 418 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Partial COD - Payment Gateway Restrictions & Fees
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10113.66 ▼0.711.73 ▼0.1141.14 ▼5.71
Dashboard /wp-admin2,268 ▲915.42 ▼0.1599.43 ▼2.4142.27 ▼1.71
Posts /wp-admin/edit.php2,180 ▲772.51 ▲0.5246.76 ▲10.0536.00 ▼3.35
Add New Post /wp-admin/post-new.php1,596 ▲6823.94 ▲0.56698.42 ▲59.7937.14 ▼17.30
Media Library /wp-admin/upload.php1,470 ▲705.00 ▲0.83120.20 ▲13.0847.03 ▲0.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 0% from 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
Please fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-simple-repeater/view-head.php
    • > /wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/optionpage/option-page-content-footer.php
    • > /wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/optionpage/option-page-content-header.php
  • 85× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-textblock/view.php:1
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/optionpage/option-page-aside-menu.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WOOPCD_PartialCOD_Main' not found in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/main/public/views/cart-messages.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-repeater/view-section-body.php on line 10
    • > PHP Notice
      Undefined variable: template in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-repeater/view-section-head.php on line 42
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/optionpage/option-page-import-export.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-repeater/view-section-head.php on line 42
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-simple-repeater/view-section.php on line 31
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-simple-repeater/view-section.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/partial-cod-payment-gateway-restrictions-fees/framework/reon/inc/controls/controls-autoid/view.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
You can look at the official readme.txt

partial-cod-payment-gateway-restrictions-fees/partial-cod-payment-gateway-restrictions-fees.php 85% from 13 tests

"WooCommerce Partial COD - Payment Gateway Restrictions & Fees" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 171 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 detected65,908 lines of code in 400 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1234,1691,90218,163
PHP1885,05214616,059
CSS335,93115414,324
Sass36811719,492
LESS18548716,888
PO File1441632927
Markdown124055

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.52
Average class complexity14.08
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes143
▷ Abstract classes00.00%
▷ Concrete classes143100.00%
▷ Final classes00.00%
Methods820
▷ Static methods58070.73%
▷ Public methods63176.95%
▷ Protected methods00.00%
▷ Private methods18923.05%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
main/assets/images/aside_logo.png2.49KB0.91KB▼ 63.43%
main/assets/images/aside_bg.png14.75KB7.11KB▼ 51.81%