89% scanforpay-alipay-alipayhk-for-woocommerce

Code Review | ScanForPay - Alipay & AlipayHK & WechatPay Payment Solutions for WooCommerce

WordPress plugin ScanForPay - Alipay & AlipayHK & WechatPay Payment Solutions for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: scanforpay-alipay...
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.4.16+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.10-5.5.3
  • WordPress version: 6.3.1
  • First release: May 13, 2019
  • Latest release: Dec 2, 2021
  • Number of updates: 47
  • Update frequency: every 19.9 days
  • Top authors: scanforpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by ScanForPay - Alipay & AlipayHK & WechatPay Payment Solutions for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0045.60 ▲3.98
Dashboard /wp-admin3.31 ▲0.0050.37 ▼3.68
Posts /wp-admin/edit.php3.36 ▲0.0047.77 ▼6.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.12 ▼16.77
Media Library /wp-admin/upload.php3.23 ▲0.0037.08 ▲0.27

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ScanForPay - Alipay & AlipayHK & WechatPay Payment Solutions for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.101.68 ▼0.1343.63 ▼2.02
Dashboard /wp-admin2,195 ▲185.59 ▼0.0784.48 ▼7.5041.06 ▼1.82
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.1635.69 ▼1.8036.33 ▼0.24
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▲0.16681.25 ▼29.9853.35 ▼2.38
Media Library /wp-admin/upload.php1,403 ▼04.25 ▲0.0599.79 ▼18.8745.99 ▼2.75

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% 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
6 plugin tags: alipayhk, payment, alipay, wechatpay, scanforpay...

scanforpay-alipay-alipayhk-for-woocommerce/scanforpay-alipay-for-woocommerce.php 77% from 13 tests

"ScanForPay - Alipay & AlipayHK & WechatPay Payment Solutions for WooCommerce" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 202 characters long)
  • Plugin Name: Keep the plugin name shorter than 70 characters (currently 88 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("scanforpay-alipay-alipayhk-for-woocommerce.php" instead of "scanforpay-alipay-for-woocommerce.php")

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 plugin908 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5149177817
SVG30391

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity28.25
▷ Minimum class complexity21.00
▷ Maximum class complexity32.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods45
▷ Static methods2453.33%
▷ Public methods4497.78%
▷ Protected methods00.00%
▷ Private methods12.22%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/white_logo.png41.19KB21.84KB▼ 46.98%