67% auto-reply-wechat

Code Review | 公众号自动回复

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

About plugin

  • Plugin page: auto-reply-wechat
  • Plugin version: 0.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.8.0
  • WordPress version: 5.8.1
  • First release: May 5, 2020
  • Latest release: Aug 17, 2021
  • Number of updates: 37
  • Update frequency: every 12.7 days
  • Top authors: kelerkgibo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,058 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.12MB] [CPU: ▼139.78ms] Passed 4 tests

A check of server-side resources used by 公众号自动回复
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1131.36 ▼5.52
Dashboard /wp-admin3.23 ▲0.1750.92 ▲5.26
Posts /wp-admin/edit.php3.31 ▲0.2048.88 ▲5.06
Add New Post /wp-admin/post-new.php5.54 ▲0.1090.85 ▼558.67
Media Library /wp-admin/upload.php3.12 ▲0.1133.45 ▲0.01

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 135 new files
Database: 1 new table, 2 new options
New tables
wp_WechatReplay_keywords
New WordPress options
wechatreplay_shouquan1
wechatreplay_tongji

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 /3,999 ▲40317.69 ▲2.1812.46 ▲3.9643.33 ▼8.74
Dashboard /wp-admin3,180 ▲2467.78 ▲1.86156.75 ▲11.72118.63 ▲7.02
Posts /wp-admin/edit.php2,978 ▲2394.15 ▲1.4382.62 ▲14.0790.11 ▼1.40
Add New Post /wp-admin/post-new.php1,685 ▲7018.86 ▼2.54353.34 ▲77.01107.87 ▼2.35
Media Library /wp-admin/upload.php1,830 ▲234.77 ▼0.23113.61 ▼47.25130.13 ▲14.74

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: 2 options
    • wechatreplay_tongji
    • wechatreplay_shouquan1

Smoke tests 50% 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 0% 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
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/auto-reply-wechat/wechat_replay_add.php
    • > /wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php
    • > /wp-content/plugins/auto-reply-wechat/wechat_replay_share.php
  • 47× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_share.php on line 57
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/auto-reply-wechat/wechat_replay_edit.php on line 62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php:166
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_add.php on line 64
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php on line 91
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php on line 89
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_html.php on line 71
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_qrcode.php on line 90
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/auto-reply-wechat/wechat_replay_edit.php on line 48
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/auto-reply-wechat/wechat_replay_edit.php on line 61

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.1.9 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 plugin6,727 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
CSS9509173,345
PHP11145332,862
JavaScript242129325
SVG13563195

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.59
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods225.00%
▷ Protected methods00.00%
▷ Private methods675.00%
Functions24
▷ Named functions24100.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
8 PNG files occupy 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
image/wzt_chahao.png1.52KB0.59KB▼ 60.98%
image/weixin.png5.03KB1.73KB▼ 65.57%
image/wztwangzhanshili.png38.92KB19.80KB▼ 49.11%
image/jianhao.png1.67KB0.29KB▼ 82.33%