10% xunhu-wechat-payment-for-easy-digital-downloads

Code Review | Easy Digital Downloads微信支付个人版

WordPress plugin Easy Digital Downloads微信支付个人版 scored10%from 54 tests.

About plugin

  • Plugin page: xunhu-wechat-paym...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.4
  • WordPress version: 6.3.1
  • First release: Jan 18, 2017
  • Latest release: Jul 4, 2020
  • Number of updates: 19
  • Update frequency: every 66.4 days
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,077 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/class-xh-new-wechat-edd-api.php+53
    Uncaught Error: Call to undefined function edd_get_option() in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/class-xh-new-wechat-edd-api.php:53
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): XH_New_Wechat_Payment_EDD_Api->register_activation_hook()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

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

A check of server-side resources used by Easy Digital Downloads微信支付个人版
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0046.87 ▲7.26
Dashboard /wp-admin3.31 ▲0.0044.23 ▼4.20
Posts /wp-admin/edit.php3.36 ▲0.0047.09 ▼1.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.16 ▼14.45
Media Library /wp-admin/upload.php3.23 ▲0.0030.41 ▼2.87

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Digital Downloads微信支付个人版
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.21 ▼1.474.61 ▲2.7142.50 ▼1.52
Dashboard /wp-admin2,203 ▲215.76 ▲0.8999.19 ▼3.8238.33 ▼5.07
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0439.58 ▼0.9134.57 ▼2.53
Add New Post /wp-admin/post-new.php1,528 ▲923.20 ▼0.08638.65 ▲45.4249.80 ▼9.62
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0191.76 ▼6.9639.62 ▼4.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to get property 'mchid' of non-object in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 5
    • > PHP Notice
      Undefined index: data in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 3
    • > PHP Notice
      Undefined index: status in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 14
    • > PHP Notice
      Trying to get property 'out_trade_no' of non-object in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 6
    • > PHP Notice
      Trying to get property 'hashkey' of non-object in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 10
    • > PHP Notice
      Undefined variable: order_id in wp-content/plugins/xunhu-wechat-payment-for-easy-digital-downloads/views/query.php on line 18

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

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: wechat payments, wordpress plugin, payments, easy digital downloads, wechatpay...

xunhu-wechat-payment-for-easy-digital-downloads/init.php 85% from 13 tests

The main PHP script in "Easy Digital Downloads微信支付个人版" version 1.0.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("xunhu-wechat-payment-for-easy-digital-downloads.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,697 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP513957914
JavaScript179129722
PO File117539261

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity40.67
▷ Minimum class complexity32.00
▷ Maximum class complexity52.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods717.50%
▷ Public methods3895.00%
▷ Protected methods00.00%
▷ Private methods25.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wechat/logo.png3.09KB2.47KB▼ 20.10%
images/icon.png3.09KB2.47KB▼ 20.10%
images/wechat/wechat-sys.png52.95KB19.77KB▼ 62.67%