83% yabandpay-for-woocommerce

Code Review | YabandPay For WooCommerce

WordPress plugin YabandPay For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: yabandpay-for-woo...
  • Plugin version: 2.31
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Jun 28, 2018
  • Latest release: Dec 23, 2021
  • Number of updates: 73
  • Update frequency: every 17.5 days
  • Top authors: yaband (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,906 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼13.13ms] Passed 4 tests

A check of server-side resources used by YabandPay For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.64 ▼10.07
Dashboard /wp-admin3.33 ▲0.0345.53 ▼8.31
Posts /wp-admin/edit.php3.38 ▲0.0246.18 ▲0.22
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.93 ▼34.36
Media Library /wp-admin/upload.php3.25 ▲0.0234.95 ▲1.76

Server storage [IO: ▲0.32MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • There were 4 files (0.00KB) illegally modified outside of "wp-content/plugins/yabandpay-for-woocommerce/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/yabandpay-for-woocommerce/vendor/persi/yabandpay/src_LAPTOP-GNMEIBN3_11\346\234\210-10-091600-2021_conflict_parent/Account.php"
    • (new file) "wp-content/plugins/yabandpay-for-woocommerce/vendor/yabandpayment/api/src_LAPTOP-GNMEIBN3_11\346\234\210-10-092244-2021_conflict_parent/Exception/RequestErrorException.php"
    • (new file) "wp-content/plugins/yabandpay-for-woocommerce/vendor/persi/yabandpay/src_LAPTOP-GNMEIBN3_11\346\234\210-10-091600-2021_conflict_parent/Exception/RequestErrorException.php"
    • (new file) "wp-content/plugins/yabandpay-for-woocommerce/vendor/yabandpayment/api/src_LAPTOP-GNMEIBN3_11\346\234\210-10-092244-2021_conflict_parent/Api.php"
Filesystem: 86 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for YabandPay For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.48 ▲0.101.80 ▲0.1242.01 ▼2.41
Dashboard /wp-admin2,206 ▲185.90 ▲1.03104.73 ▼15.6240.24 ▼1.24
Posts /wp-admin/edit.php2,086 ▼62.01 ▼0.0540.91 ▼8.8144.67 ▲10.48
Add New Post /wp-admin/post-new.php1,519 ▲523.06 ▲5.37592.16 ▼64.0852.29 ▼1.54
Media Library /wp-admin/upload.php1,391 ▲94.22 ▼0.00101.22 ▲0.5644.59 ▲1.42

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayunionpaycard.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayunionpayquickpass.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayvisa.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayideal.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpaywechatpay.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayunionpaywap.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpay.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayklarna.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpayalipay.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_YabandPay' not found in wp-content/plugins/yabandpay-for-woocommerce/class-wc-yabandpaybancontact.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === yabandpay-for-woocommerce === )
Please take inspiration from this readme.txt

yabandpay-for-woocommerce/YaBandPay.php 77% from 13 tests

This is the main PHP file of "YabandPay For WooCommerce" version 2.31, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yabandpay-for-woocommerce.php" instead of "YaBandPay.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,796 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP455627212,230
JavaScript273128415
JSON40081
Markdown134070

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes43
▷ Abstract classes12.33%
▷ Concrete classes4297.67%
▷ Final classes00.00%
Methods213
▷ Static methods4923.00%
▷ Public methods17783.10%
▷ Protected methods2813.15%
▷ Private methods83.76%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants97
▷ Global constants00.00%
▷ Class constants97100.00%
▷ Public constants97100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
26 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/yabandpay_unionpayquickpass_zh.png3.43KB1.84KB▼ 46.37%
images/yabandpay_unionpay_en.png3.33KB1.73KB▼ 48.02%
images/yabandpay_unionpayquickpass_en.png3.43KB1.84KB▼ 46.37%
images/yabandpay_klarna_zh.png2.34KB1.26KB▼ 45.93%
images/yabandpay_sofort_zh.png3.19KB1.66KB▼ 47.93%