67% wechat-payment-for-woo

Code Review | WeChat Payments for WooCommerce

WordPress plugin WeChat Payments for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: wechat-payment-fo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7.3
  • WordPress version: 6.3.1
  • First release: Dec 10, 2015
  • Latest release: Jun 14, 2018
  • Number of updates: 13
  • Update frequency: every 70.6 days
  • Top authors: shudong (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /10,600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by WeChat Payments for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.06 ▼0.53
Dashboard /wp-admin3.32 ▲0.0145.31 ▼3.74
Posts /wp-admin/edit.php3.37 ▲0.0148.67 ▲3.16
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.06 ▼8.98
Media Library /wp-admin/upload.php3.24 ▲0.0134.33 ▲1.65

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 448 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

WeChat Payments for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5414.41 ▲0.121.90 ▼0.1740.82 ▼2.09
Dashboard /wp-admin2,206 ▲215.86 ▲1.03112.92 ▼5.1441.52 ▼0.05
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0139.59 ▲2.0836.56 ▲1.49
Add New Post /wp-admin/post-new.php1,514 ▼517.55 ▼5.62674.06 ▲25.9663.91 ▲16.59
Media Library /wp-admin/upload.php1,382 ▼94.24 ▼0.0893.55 ▼4.0339.83 ▼2.49

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

Smoke tests 50% from 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 0% from 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wechat-payment-for-woo/lib/phpqrcode/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WxPayNotifyReply' not found in wp-content/plugins/wechat-payment-for-woo/lib/WxPay.Notify.php:8

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)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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: The official readme.txt is a good inspiration

wechat-payment-for-woo/weChatPay.php 85% from 13 tests

This is the main PHP file of "WeChat Payments for WooCommerce" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wechat-payment-for-woo.php" instead of "weChatPay.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
It is important to fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wechat-payment-for-woo/lib/phpqrcode/tools/merge.bat
8,490 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,8543,7678,332
PO File1310103
JavaScript28149
Bourne Shell1002
DOS Batch1002
Markdown1002

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.29
Average class complexity21.11
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes55
▷ Abstract classes00.00%
▷ Concrete classes55100.00%
▷ Final classes00.00%
Methods755
▷ Static methods13818.28%
▷ Public methods64585.43%
▷ Protected methods9712.85%
▷ Private methods131.72%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants97
▷ Global constants97100.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
47 compressed PNG files occupy 0.53MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/phpqrcode/cache/frame_28.png0.23KB0.21KB▼ 5.98%
lib/phpqrcode/cache/frame_23.png0.21KB0.20KB▼ 8.18%
lib/phpqrcode/cache/frame_22.png0.22KB0.21KB▼ 6.19%
lib/phpqrcode/cache/frame_9.png0.19KB0.19KB▼ 2.01%
lib/phpqrcode/cache/frame_39.png0.26KB0.23KB▼ 9.85%