10% alipay-donate

Code Review | AlipayDonate

WordPress plugin AlipayDonate scored10%from 54 tests.

About plugin

  • Plugin page: alipay-donate
  • Plugin version: 1.8.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7.0-3.3
  • WordPress version: 6.3.1
  • First release: Dec 20, 2011
  • Latest release: Dec 20, 2011
  • Number of updates: 6
  • Update frequency: every 2.5 days
  • Top authors: waisir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,879 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/alipay-donate/alipay-donate.php+52
    Function create_function() is deprecated

Server metrics [RAM: ▼1.94MB] [CPU: ▼55.98ms] Passed 4 tests

Server-side resources used by AlipayDonate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.414.96 ▼35.57
Dashboard /wp-admin2.11 ▼1.2311.26 ▼41.10
Posts /wp-admin/edit.php2.11 ▼1.298.67 ▼47.09
Add New Post /wp-admin/post-new.php2.11 ▼3.826.74 ▼100.17
Media Library /wp-admin/upload.php2.11 ▼1.166.44 ▼32.48
AlipayDonate /wp-admin/options-general.php?page=ws_alido_settings_page2.117.11

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 8 new options
New WordPress options
ws_alipay_donate_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_ws_alido
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AlipayDonate
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▼0.031.92 ▼0.0142.41 ▼0.85
Dashboard /wp-admin2,199 ▲225.62 ▲0.0793.51 ▲4.4441.31 ▼6.65
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0138.49 ▲1.6635.22 ▼4.98
Add New Post /wp-admin/post-new.php1,529 ▲323.71 ▲0.57628.34 ▼77.7450.41 ▼6.51
Media Library /wp-admin/upload.php1,404 ▲44.23 ▲0.0698.25 ▼7.1141.31 ▼4.97
AlipayDonate /wp-admin/options-general.php?page=ws_alido_settings_page1,1832.0224.4376.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/alipay-donate/alipay-donate.php+52
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 8 options in the database
    • ws_alipay_donate_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_ws_alido
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ws_alido_settings_page
    • > Deprecated in wp-content/plugins/alipay-donate/alipay-donate.php+52
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=ws_alido_settings_page
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in WS_AliDo_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% 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
Almost there! Just fix the following items
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/alipay-donate/includes/cls.widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/alipay-donate/includes/tpl.settings.php:3
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 22
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 25
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 19
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 28
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 22
    • > PHP Warning
      Use of undefined constant WS_ALIDO_URL - assumed 'WS_ALIDO_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/tpl.settings.php on line 2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/alipay-donate/includes/cfg.config.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/alipay-donate/includes/cls.settings.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (前台捐赠面板), #2 (后台控制面板)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === alipay-donate === )
Please take inspiration from this readme.txt

alipay-donate/alipay-donate.php Passed 13 tests

The main PHP file in "AlipayDonate" ver. 1.8.8 adds more information about the plugin and also serves as the entry point for this plugin
58 characters long description:
AlipayDonate,支付宝为您提供快捷的捐赠服务.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected521 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP918562482
JavaScript111323
CSS23016

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods2195.45%
▷ Protected methods00.00%
▷ Private methods14.55%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
styles/images/donate_06.png4.44KB1.27KB▼ 71.47%
screenshot-1.png40.93KB18.00KB▼ 56.02%
styles/images/donate_05.png4.16KB0.92KB▼ 77.92%
styles/images/donate_04.png4.45KB1.23KB▼ 72.39%
styles/images/donate_10.png4.09KB3.17KB▼ 22.44%