58% wechat-subscribers-lite

Code Review | WeChat Subscribers Lite 微信公众订阅号插件

WordPress plugin WeChat Subscribers Lite 微信公众订阅号插件 scored58%from 54 tests.

About plugin

  • Plugin page: wechat-subscriber...
  • Plugin version: 1.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2014
  • Latest release: May 3, 2016
  • Number of updates: 90
  • Update frequency: every 8.8 days
  • Top authors: redyyu (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

100+ active /19,668 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.91MB] [CPU: ▼20.88ms] Passed 4 tests

A check of server-side resources used by WeChat Subscribers Lite 微信公众订阅号插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1866.09 ▲24.20
Dashboard /wp-admin3.04 ▼0.3043.45 ▼24.35
Posts /wp-admin/edit.php3.04 ▼0.3141.73 ▼12.06
Add New Post /wp-admin/post-new.php3.04 ▼2.8449.11 ▼59.41
Media Library /wp-admin/upload.php3.04 ▼0.1950.63 ▲12.30
WeChat Subscribers Settings /wp-admin/options-general.php?page=wpwsl-settings-page3.0443.55
Statistics /wp-admin/admin.php?page=wpwsl-history-page3.0441.07
Custom Replies /wp-admin/admin.php?page=wpwsl-general-page3.0441.23

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WeChat Subscribers Lite 微信公众订阅号插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲18614.49 ▼0.171.76 ▲0.1243.37 ▼1.31
Dashboard /wp-admin2,338 ▲1646.19 ▲0.60118.09 ▲20.77100.23 ▲53.48
Posts /wp-admin/edit.php2,295 ▲1953.48 ▲1.4566.11 ▲28.1570.79 ▲32.92
Add New Post /wp-admin/post-new.php1,694 ▲16621.89 ▼1.26694.36 ▼28.0046.25 ▼6.57
Media Library /wp-admin/upload.php1,424 ▲274.25 ▲0.07106.35 ▼2.8280.85 ▲36.78
WeChat Subscribers Settings /wp-admin/options-general.php?page=wpwsl-settings-page1,1003.1744.1266.71
Statistics /wp-admin/admin.php?page=wpwsl-history-page1,2223.0243.7367.09
Custom Replies /wp-admin/admin.php?page=wpwsl-general-page1,2342.9846.7865.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wechat_subscribers_lite_history
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpwsl-general-page
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
    • > GET request to /wp-admin/options-general.php?page=wpwsl-settings-page
    • > Notice in wp-content/plugins/wechat-subscribers-lite/_settings.php+18
    Undefined index: sup_wechat_big
    • > GET request to /wp-admin/options-general.php?page=wpwsl-settings-page
    • > Notice in wp-content/plugins/wechat-subscribers-lite/_settings.php+20
    Undefined index: sup_wechat_small
    • > GET request to /wp-admin/admin.php?page=wpwsl-history-page
    • > Notice in wp-content/plugins/wechat-subscribers-lite/_history.php+78
    Undefined variable: per_page

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wechat-subscribers-lite/class-wpwsl-history-table.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wechat-subscribers-lite/class-wpwsl-history-table.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wechat-subscribers-lite/class-wpwsl-list-table.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_post_type() in wp-content/plugins/wechat-subscribers-lite/posttype_wpwsl_template.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/wechat-subscribers-lite/interface.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/wechat-subscribers-lite/_edit.php:141
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wechat-subscribers-lite/ajax_request_handle.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wechat-subscribers-lite/content.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/wechat-subscribers-lite/class-wpwsl-list-table.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wechat-subscribers-lite/_settings.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: subscribers, wechat, weixin, wx

wechat-subscribers-lite/wpwsl_core.php 85% from 13 tests

Analyzing the main PHP file in "WeChat Subscribers Lite 微信公众订阅号插件" version 1.6.6
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wechat-subscribers-lite.php" instead of "wpwsl_core.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin3,411 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP163182042,280
JavaScript2116114549
CSS22243354
PO File198102228

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.50
▷ Minimum class complexity3.00
▷ Maximum class complexity73.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods53
▷ Static methods35.66%
▷ Public methods3769.81%
▷ Protected methods00.00%
▷ Private methods1630.19%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
12 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/qr_wp_wechat.png11.57KB6.21KB▼ 46.31%
img/link.png0.66KB0.63KB▼ 3.70%
img/default_img.png1.75KB0.71KB▼ 59.62%
img/sup_wechat_big.png26.00KB11.11KB▼ 57.28%
img/wpwsl_icon_16.png0.30KB0.24KB▼ 19.68%