73% auto-reply-wechat

Code Review | 公众号自动回复

WordPress plugin 公众号自动回复 scored73%from 54 tests.

About plugin

  • Plugin page: auto-reply-wechat
  • Plugin version: 0.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: May 5, 2020
  • Latest release: Aug 15, 2023
  • Number of updates: 72
  • Update frequency: every 16.6 days
  • Top authors: kelerkgibo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /5,607 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼9.34ms] Passed 4 tests

A check of server-side resources used by 公众号自动回复
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2236.58 ▼0.33
Dashboard /wp-admin3.52 ▲0.1846.07 ▼13.22
Posts /wp-admin/edit.php3.64 ▲0.2846.88 ▼2.00
Add New Post /wp-admin/post-new.php6.11 ▲0.2281.81 ▼21.80
Media Library /wp-admin/upload.php3.45 ▲0.2135.32 ▲2.40

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 38 new files
Database: 1 new table, 7 new options
New tables
wp_WechatReplay_keywords
New WordPress options
widget_recent-comments
widget_recent-posts
wechatreplay_tongji
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for 公众号自动回复
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲17713.55 ▼0.808.78 ▲7.0840.54 ▼3.68
Dashboard /wp-admin2,211 ▲375.51 ▼0.0983.10 ▼5.0144.81 ▲3.57
Posts /wp-admin/edit.php2,116 ▲162.01 ▲0.0232.78 ▼3.5837.93 ▲0.94
Add New Post /wp-admin/post-new.php1,539 ▲1123.42 ▲0.33630.05 ▼28.6771.50 ▲17.70
Media Library /wp-admin/upload.php1,419 ▲164.16 ▼0.0395.28 ▼1.9542.92 ▼0.89

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_WechatReplay_keywords
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • wechatreplay_tongji

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_book.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/auto-reply-wechat/wechat_replay.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_pladd.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_add.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/auto-reply-wechat/inc/wx_yzm.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_head.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_html.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/auto-reply-wechat/inc/wx_share.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/auto-reply-wechat/wechat_replay_share.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
Please fix the following attributes:
  • Tags: Please add at least on tag
  • Screenshots: Please describe screenshot #1 in auto-reply-wechat/assets to your readme.txt
The official readme.txt is a good inspiration

auto-reply-wechat/wechat_replay.php 85% from 13 tests

The principal PHP file in "公众号自动回复" v. 0.2.7 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 186 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("auto-reply-wechat.php" instead of "wechat_replay.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
There were no executable files found in this plugin3,776 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP13233772,872
CSS1711843
JavaScript235061

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity33.50
▷ Minimum class complexity17.00
▷ Maximum class complexity50.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1571.43%
▷ Protected methods00.00%
▷ Private methods628.57%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
20 PNG files occupy 0.46MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/wzt_chahao.png1.52KB0.59KB▼ 60.98%
image/wztwangzhanshili.png60.50KB28.39KB▼ 53.07%
image/logo.png59.53KB19.99KB▼ 66.41%
image/weixinimg.png13.30KB5.37KB▼ 59.62%
image/wzbbx.png81.06KB28.41KB▼ 64.95%