99% wechat-weixin-payments-for-woocommerce

Code Review | WordPress WooCommerce 微信支付插件

WordPress plugin WordPress WooCommerce 微信支付插件 scored 99% from 54 tests.

About plugin

  • Plugin page: wechat-weixin-pay...
  • Plugin version: 1.8.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1.1
  • WordPress version: 5.8.1
  • First release: May 24, 2016
  • Latest release: May 6, 2019
  • Number of updates: 24
  • Update frequency: every 45.0 days
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 15,311 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

This is a short check of server-side resources used by WordPress WooCommerce 微信支付插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1242.18 ▲20.58
Dashboard /wp-admin3.06 ▲0.0145.27 ▼0.63
Posts /wp-admin/edit.php3.11 ▲0.0144.83 ▲0.30
Add New Post /wp-admin/post-new.php5.43 ▼0.0187.99 ▼562.17
Media Library /wp-admin/upload.php3.00 ▼0.0029.93 ▼9.10

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WordPress WooCommerce 微信支付插件: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11715.78 ▲0.307.64 ▼2.0747.97 ▲0.15
Dashboard /wp-admin2,967 ▲366.07 ▲0.17135.90 ▼0.46104.84 ▲4.84
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0164.36 ▼2.4290.41 ▲12.86
Add New Post /wp-admin/post-new.php1,500 ▼11518.61 ▼2.45363.90 ▲98.35107.91 ▲9.01
Media Library /wp-admin/upload.php1,810 ▲35.02 ▲0.01140.43 ▼8.14111.52 ▼1.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt is a good inspiration

wechat-weixin-payments-for-woocommerce/init.php 77% from 13 tests

The main PHP script in "WordPress WooCommerce 微信支付插件" version 1.8.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("wechat-weixin-payments-for-woocommerce.php" instead of "init.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 191 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin3,029 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP83691,6682,209
JavaScript281128750
PO File1191970

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.35
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods382
▷ Static methods174.45%
▷ Public methods37297.38%
▷ Protected methods10.26%
▷ Private methods92.36%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ep_new_sprites1.png2.89KB0.20KB▼ 92.93%
images/weixin.png3.57KB2.02KB▼ 43.49%
images/logo.png3.09KB2.47KB▼ 20.10%