84% checkpay-payment-gateway-for-woocommerece

Code Review | Checkpay – WeChat Pay & Alipay for WooCommerce

WordPress plugin Checkpay – WeChat Pay & Alipay for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: checkpay-payment-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Feb 9, 2022
  • Latest release: Feb 10, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: checkpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /331 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼6.60ms] Passed 4 tests

Server-side resources used by Checkpay – WeChat Pay & Alipay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.12 ▼3.63
Dashboard /wp-admin3.31 ▲0.0147.37 ▼2.24
Posts /wp-admin/edit.php3.36 ▲0.0146.71 ▼8.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.32 ▼12.15
Media Library /wp-admin/upload.php3.24 ▲0.0134.54 ▼0.55

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Checkpay – WeChat Pay & Alipay for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.001.73 ▲0.0644.67 ▼2.30
Dashboard /wp-admin2,195 ▲185.59 ▼0.0795.57 ▼2.1941.75 ▼5.19
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0333.66 ▼0.3336.06 ▲0.67
Add New Post /wp-admin/post-new.php1,526 ▼023.55 ▲0.41673.22 ▲28.1061.39 ▲12.05
Media Library /wp-admin/upload.php1,397 ▼34.15 ▼0.0395.50 ▼8.2243.42 ▼1.32

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/checkpay-payment-gateway-for-woocommerece/views/pay.php:4

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires php: Version format is invalid
You can take inspiration from this readme.txt

checkpay-payment-gateway-for-woocommerece/checkpay-payment-gateway-for-woocommerece.php Passed 13 tests

The primary PHP file in "Checkpay – WeChat Pay & Alipay for WooCommerce" version 1.0 is used by WordPress to initiate all plugin functionality
41 characters long description:
Checkpay Payment Gateway for Woocommerece

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
Everything looks great! No dangerous files found in this plugin710 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP513911641
PO File1151760
CSS1009

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity26.33
▷ Minimum class complexity22.00
▷ Maximum class complexity31.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods931.03%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
5 PNG files occupy 0.26MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wechat.png45.78KB18.02KB▼ 60.64%
assets/images/alipayout.png31.74KB15.34KB▼ 51.67%
assets/images/alipay.png42.07KB14.76KB▼ 64.91%
views/alipay-english.png73.48KB40.70KB▼ 44.61%
views/alipay.png72.22KB39.79KB▼ 44.90%