83% alpha-pay-wechat-pay-alipay-for-woocommerce

Code Review | AlphaPay Payment Plugin for WeChat Pay, Alipay, UnionPay, and Credit Card All-in-One Payment(微信支付,支付宝,银联,信用卡支付)

WordPress plugin AlphaPay Payment Plugin for WeChat Pay, Alipay, UnionPay, and Credit Card All-in-One Payment(微信支付,支付宝,银联,信用卡支付) scored83%from 54 tests.

About plugin

  • Plugin page: alpha-pay-wechat-...
  • Plugin version: 1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 3, 2018
  • Latest release: Jun 29, 2023
  • Number of updates: 43
  • Update frequency: every 40.2 days
  • Top authors: alphapay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,055 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.18ms] Passed 4 tests

This is a short check of server-side resources used by AlphaPay Payment Plugin for WeChat Pay, Alipay, UnionPay, and Credit Card All-in-One Payment(微信支付,支付宝,银联,信用卡支付)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0136.96 ▼4.85
Dashboard /wp-admin3.32 ▼0.0343.97 ▼16.40
Posts /wp-admin/edit.php3.37 ▲0.0148.30 ▲4.89
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.43 ▼13.58
Media Library /wp-admin/upload.php3.24 ▲0.0136.02 ▲2.11

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

AlphaPay Payment Plugin for WeChat Pay, Alipay, UnionPay, and Credit Card All-in-One Payment(微信支付,支付宝,银联,信用卡支付): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.25 ▼1.131.78 ▼0.0744.79 ▼5.55
Dashboard /wp-admin2,206 ▲215.86 ▲0.00104.06 ▼13.2538.25 ▼4.28
Posts /wp-admin/edit.php2,092 ▲31.96 ▼0.0839.65 ▲2.0634.56 ▼1.02
Add New Post /wp-admin/post-new.php1,514 ▼017.67 ▲0.21672.27 ▼20.6661.41 ▲5.04
Media Library /wp-admin/upload.php1,388 ▲64.21 ▲0.01108.34 ▲10.1645.03 ▼1.52

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

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

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined index: data in wp-content/plugins/alpha-pay-wechat-pay-alipay-for-woocommerce/includes/qrcode.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: credit card, cad, wechat pay, unionpay, cny...

alpha-pay-wechat-pay-alipay-for-woocommerce/woocommerce-gateway-alphapay.php 69% from 13 tests

"AlphaPay Payment Plugin for WeChat Pay, Alipay, UnionPay, and Credit Card All-in-One Payment(微信支付,支付宝,银联,信用卡支付)" version 1.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Plugin Name: A shorter plugin name is better (currently 149 characters long instead of max. 70)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("alpha-pay-wechat-pay-alipay-for-woocommerce.php" instead of "woocommerce-gateway-alphapay.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected3,827 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP91,1246733,822
CSS1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity30.14
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods208
▷ Static methods7536.06%
▷ Public methods20699.04%
▷ Protected methods00.00%
▷ Private methods20.96%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants34
▷ Global constants34100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wechat-logo.png3.40KB2.06KB▼ 39.58%
assets/images/wechat-scan.png54.89KB18.54KB▼ 66.22%
assets/images/wechat-scan-note.png2.78KB1.08KB▼ 61.28%
assets/images/unionpay-logo.png3.94KB2.19KB▼ 44.37%
assets/images/credit-card-logo.png4.53KB2.39KB▼ 47.32%