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

Code Review | Easy Digital Downloads支付宝个人版

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

About plugin

  • Plugin page: xunhu-alipay-paym...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Jan 18, 2017
  • Latest release: Jan 29, 2021
  • Number of updates: 17
  • Update frequency: every 86.5 days
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,673 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/xunhu-alipay-payment-for-easy-digital-downloads/class-xh-alipay-edd-api.php+88
    Uncaught Error: Call to undefined function edd_get_option() in wp-content/plugins/xunhu-alipay-payment-for-easy-digital-downloads/class-xh-alipay-edd-api.php:88
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): XH_Alipay_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.01MB] [CPU: ▼9.01ms] Passed 4 tests

This is a short check of server-side resources used by Easy Digital Downloads支付宝个人版
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.78 ▲5.71
Dashboard /wp-admin3.31 ▼0.0443.25 ▼14.79
Posts /wp-admin/edit.php3.36 ▲0.0044.62 ▼7.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.03 ▼16.28
Media Library /wp-admin/upload.php3.23 ▲0.0036.46 ▲2.39

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Digital Downloads支付宝个人版
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.141.63 ▼0.1640.26 ▲0.52
Dashboard /wp-admin2,206 ▲155.88 ▼0.02106.68 ▲3.1241.36 ▼0.41
Posts /wp-admin/edit.php2,086 ▼32.18 ▲0.1539.38 ▲1.8534.78 ▼0.02
Add New Post /wp-admin/post-new.php1,537 ▼723.34 ▲4.96657.89 ▲32.0253.50 ▼7.53
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0096.46 ▼2.1043.80 ▼0.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (alipay settings page), #2 (Checkout with option for alipay payment.), #3 (Order pay screen, including QR code of alipay and payment amount.)
The official readme.txt is a good inspiration

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

The primary PHP file in "Easy Digital Downloads支付宝个人版" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("xunhu-alipay-payment-for-easy-digital-downloads.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected452 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP27222397
PO File117539755

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity61.00
▷ Minimum class complexity61.00
▷ Maximum class complexity61.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1794.44%
▷ Protected methods00.00%
▷ Private methods15.56%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png3.41KB2.44KB▼ 28.24%