84% wechat

Code Review | WeChat (连接微信)

WordPress plugin WeChat (连接微信) scored84%from 54 tests.

About plugin

  • Plugin page: wechat
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.0
  • WordPress version: 6.3.1
  • First release: Sep 16, 2013
  • Latest release: Apr 3, 2018
  • Number of updates: 22
  • Update frequency: every 77.9 days
  • Top authors: smyx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /13,005 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.01ms] Passed 4 tests

A check of server-side resources used by WeChat (连接微信)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.01 ▼0.67
Dashboard /wp-admin3.32 ▲0.0250.23 ▲1.78
Posts /wp-admin/edit.php3.37 ▲0.0247.44 ▼7.47
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.74 ▼17.67
Media Library /wp-admin/upload.php3.24 ▲0.0249.81 ▲12.86

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WeChat (连接微信)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.79 ▲0.111.93 ▼0.9445.79 ▲0.75
Dashboard /wp-admin2,221 ▲335.86 ▲0.95111.79 ▼4.2281.10 ▲41.91
Posts /wp-admin/edit.php2,107 ▲182.13 ▲0.1239.48 ▼0.6836.14 ▼2.55
Add New Post /wp-admin/post-new.php1,681 ▲16722.32 ▲4.87687.65 ▲1.3956.48 ▲4.18
Media Library /wp-admin/upload.php1,400 ▲154.20 ▼0.0698.26 ▼27.9176.19 ▲27.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wechat/wechat.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wechat === )
You can take inspiration from this readme.txt

wechat/wechat.php 92% from 13 tests

The main PHP script in "WeChat (连接微信)" version 0.5 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 318 characters long)

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 detected108 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PO File1101774
PHP12934

PHP code Passed 2 tests

This is a short overview 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.05
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
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_weixin.png4.15KB1.33KB▼ 68.03%