77% chillpay-payment-gateway

Code Review | ChillPay WooCommerce

WordPress plugin ChillPay WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: chillpay-payment-...
  • Plugin version: 2.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Sep 6, 2023
  • Number of updates: 14
  • Update frequency: every 64.9 days
  • Top authors: chillpay01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,328 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.03MB] [CPU: ▼3.17ms] Passed 4 tests

Server-side resources used by ChillPay WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.77 ▼2.97
Dashboard /wp-admin3.33 ▲0.0346.08 ▼6.27
Posts /wp-admin/edit.php3.38 ▲0.0348.30 ▼1.14
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.52 ▼2.31
Media Library /wp-admin/upload.php3.26 ▲0.0336.62 ▲4.69

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for ChillPay WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.29 ▲0.011.59 ▼0.0138.16 ▼3.18
Dashboard /wp-admin2,210 ▲335.62 ▼0.0594.87 ▼5.9443.57 ▼3.87
Posts /wp-admin/edit.php2,113 ▲101.95 ▼0.0541.37 ▲3.6837.75 ▲1.92
Add New Post /wp-admin/post-new.php1,548 ▲2218.35 ▼4.50595.43 ▼80.7575.61 ▲24.45
Media Library /wp-admin/upload.php1,412 ▲94.13 ▼0.0394.04 ▼13.9840.77 ▼5.82

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 24× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/chillpay-payment-gateway/includes/gateway/class-chillpay-payment-ewallet.php
    • > /wp-content/plugins/chillpay-payment-gateway/templates/payment/main-script.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/class-chillpay-setting.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/class-chillpay-fee.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/classes/class-chillpay-card-image.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/gateway/class-chillpay-payment-installment.php
    • > /wp-content/plugins/chillpay-payment-gateway/chillpay-util.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/gateway/class-chillpay-payment-mobilebanking.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/gateway/class-chillpay-payment-creditcard.php
    • > /wp-content/plugins/chillpay-payment-gateway/includes/chillpay-config.php
  • 101× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-installment.php on line 25
    • > PHP Notice
      Undefined variable: viewData in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-pay-with-points.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-ewallet.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-billpayment.php on line 6
    • > PHP Notice
      Undefined variable: viewData in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-ewallet.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-kiosk-machine.php on line 5
    • > PHP Notice
      Undefined variable: viewData in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-ewallet.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-kiosk-machine.php on line 4
    • > PHP Notice
      Undefined variable: viewData in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-creditcard.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/chillpay-payment-gateway/templates/payment/form-mobilebanking.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
Please fix the following attributes: The official readme.txt might help

chillpay-payment-gateway/chillpay-woocommerce.php 77% from 13 tests

The principal PHP file in "ChillPay WooCommerce" v. 2.5.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 490 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("chillpay-payment-gateway.php" instead of "chillpay-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin8,764 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP431,4772,0657,880
CSS1210912500
JavaScript44413279
Markdown2790105

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 127)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity19.29
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity127.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes42
▷ Abstract classes12.38%
▷ Concrete classes4197.62%
▷ Final classes00.00%
Methods352
▷ Static methods14340.62%
▷ Public methods29583.81%
▷ Protected methods4913.92%
▷ Private methods82.27%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
Constants60
▷ Global constants2541.67%
▷ Class constants3558.33%
▷ Public constants2674.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
52 PNG files occupy 0.28MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-bank/IconBank_KTB2.png10.21KB4.52KB▼ 55.71%
assets/images/icon-bank/IconBank_KTC-Forever2.png7.93KB2.61KB▼ 67.07%
assets/images/ChillPay_16x16.png2.27KB0.77KB▼ 66.05%
assets/images/icon-line-pay/IconLinePay_RabbitLinePay.png3.34KB1.62KB▼ 51.71%
assets/images/icon-epayment/Icon_ShopeePay.png2.87KB1.53KB▼ 46.73%