83% snappay-alipay-wechat-payment-gateway

Code Review | Payment Gateway for Alipay and WeChat Pay (支付宝,微信支付,银联支付北美版)

WordPress plugin Payment Gateway for Alipay and WeChat Pay (支付宝,微信支付,银联支付北美版) scored83%from 54 tests.

About plugin

  • Plugin page: snappay-alipay-we...
  • Plugin version: 2.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 11, 2018
  • Latest release: Jan 18, 2023
  • Number of updates: 31
  • Update frequency: every 51.4 days
  • Top authors: eviesun (54.84%)snappay (48.39%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /8,341 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.19ms] Passed 4 tests

This is a short check of server-side resources used by Payment Gateway for Alipay and WeChat Pay (支付宝,微信支付,银联支付北美版)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0248.25 ▲1.97
Dashboard /wp-admin3.32 ▼0.0251.11 ▼17.96
Posts /wp-admin/edit.php3.37 ▲0.0250.57 ▼4.11
Add New Post /wp-admin/post-new.php5.90 ▲0.02101.96 ▼9.68
Media Library /wp-admin/upload.php3.24 ▲0.0237.44 ▼1.00

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Gateway for Alipay and WeChat Pay (支付宝,微信支付,银联支付北美版)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲16313.96 ▼0.3810.41 ▲8.6840.60 ▼4.67
Dashboard /wp-admin2,193 ▲135.57 ▼0.0589.59 ▼1.7343.12 ▼0.01
Posts /wp-admin/edit.php2,097 ▼31.94 ▼0.0634.14 ▼4.0541.96 ▲4.17
Add New Post /wp-admin/post-new.php1,528 ▼321.64 ▼1.49752.37 ▲116.8457.38 ▲8.14
Media Library /wp-admin/upload.php1,395 ▼84.14 ▼0.06103.64 ▲0.5645.29 ▲2.59

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/snappay-alipay-wechat-payment-gateway/snappaynotifyresponse.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: alipay, payment gateway, woocommerce, cad, usd...

snappay-alipay-wechat-payment-gateway/snappaymain.php 69% from 13 tests

"Payment Gateway for Alipay and WeChat Pay (支付宝,微信支付,银联支付北美版)" version 2.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("snappay-alipay-wechat-payment-gateway.php" instead of "snappaymain.php")
  • Plugin Name: It is recommended to keep the plugin name shorter than 70 characters (currently 100 characters long)
  • Description: The description should be shorter than 140 characters (currently 191 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin659 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP411234629
JavaScript30230

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity52.00
▷ Minimum class complexity52.00
▷ Maximum class complexity52.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wechat_webscan01.png1.67KB1.09KB▼ 34.95%
images/wechat_webscan02.png32.63KB13.58KB▼ 58.40%
images/Alipay_logo.png8.37KB3.39KB▼ 59.45%
images/Wechat_logo.png9.22KB3.83KB▼ 58.45%
images/unionpay_logo.png5.00KB2.59KB▼ 48.13%