61% wechat-social-login

Code Review | Wechat Social login 微信QQ钉钉登录插件

WordPress plugin Wechat Social login 微信QQ钉钉登录插件 scored61%from 54 tests.

About plugin

  • Plugin page: wechat-social-login
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-9.9.9
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Dec 7, 2021
  • Number of updates: 94
  • Update frequency: every 18.3 days
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /73,547 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.46MB] [CPU: ▲9.51ms] Passed 4 tests

Analyzing server-side resources used by Wechat Social login 微信QQ钉钉登录插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.84 ▲2.3762.34 ▲24.72
Dashboard /wp-admin5.82 ▲2.4764.31 ▲5.78
Posts /wp-admin/edit.php5.94 ▲2.5864.03 ▲16.93
Add New Post /wp-admin/post-new.php8.40 ▲2.5195.34 ▼9.39
Media Library /wp-admin/upload.php5.72 ▲2.4961.53 ▲29.47
Wechat Social /wp-admin/admin.php?page=wsocial5.5040.17
Settings /wp-admin/admin.php?page=social_page_default5.7056.50
代理登录 /wp-admin/admin.php?page=social_page_wp_open5.7056.03
Add-Ons /wp-admin/admin.php?page=social_page_add_ons5.9556.04

Server storage [IO: ▲3.33MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 183 new files
Database: 4 new tables, 14 new options
New tables
wp_xh_social_channel_weibo
wp_xh_social_channel_qq
wp_xh_social_channel_wechat
wp_xh_sessions
New WordPress options
xh_social_plugins_installed
xh_social_add_ons_login_settings
widget_xh_social_login_wide
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_xh_social_share_bar
widget_xh_social_login_short
xh_social_addons_versions
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for Wechat Social login 微信QQ钉钉登录插件
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,186 ▲40015.36 ▲1.018.62 ▲6.8143.52 ▲3.17
Dashboard /wp-admin2,382 ▲2086.58 ▲1.06112.65 ▲23.4544.30 ▲4.02
Posts /wp-admin/edit.php2,323 ▲2233.70 ▲1.5652.15 ▲13.9237.87 ▲0.53
Add New Post /wp-admin/post-new.php1,572 ▲4521.27 ▼1.66650.79 ▲33.8230.30 ▼23.51
Media Library /wp-admin/upload.php1,457 ▲574.54 ▲0.3895.27 ▼10.1453.77 ▲7.76
Wechat Social /wp-admin/admin.php?page=wsocial280.420.073.55
Settings /wp-admin/admin.php?page=social_page_default1,2043.5044.9289.62
代理登录 /wp-admin/admin.php?page=social_page_wp_open1,0503.4345.7687.58
Add-Ons /wp-admin/admin.php?page=social_page_add_ons1,4473.3945.0454.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_xh_social_channel_qq
    • wp_xh_social_channel_wechat
    • wp_xh_social_channel_weibo
    • wp_xh_sessions
  • The uninstall procedure has failed, leaving 14 options in the database
    • xh_social_addons_versions
    • widget_xh_social_share_bar
    • widget_recent-posts
    • widget_xh_social_login_short
    • widget_xh_social_login_wide
    • can_compress_scripts
    • xh_social_add_ons_login_settings
    • xh_install_plugins
    • xh_social_plugins_installed
    • db_upgraded
    • ...

Smoke tests 25% 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 no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wechat-social-login/templates/___.php
    • > /wp-content/plugins/wechat-social-login/add-ons/login/templates/account/___.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Interface 'Gregwar\\Captcha\\CaptchaBuilderInterface' not found in wp-content/plugins/wechat-social-login/includes/captcha/CaptchaBuilder.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_XH_Social_Add_Ons' not found in wp-content/plugins/wechat-social-login/includes/abstracts/__abstract-xh-add-ons-update.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'XH_Social_Temp_Helper' not found in wp-content/plugins/wechat-social-login/add-ons/login/templates/account/__login.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'Gregwar\\Captcha\\PhraseBuilderInterface' not found in wp-content/plugins/wechat-social-login/includes/captcha/PhraseBuilder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Abstract_WSocial_Captcha' not found in wp-content/plugins/wechat-social-login/includes/social/class-xh-social-captcha.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/wechat-social-login/test.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'XH_Social_Temp_Helper' not found in wp-content/plugins/wechat-social-login/add-ons/social-wechat/templates/account/wechat/authorize-loading.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=wsocial
    • > Network (severe)
    wp-admin/admin.php?page=wsocial - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: A description for screenshot #11 is required in wechat-social-login/assets to your readme.txt
  • Screenshots: These screenshots do not have images: #8 (账号绑定解绑设置), #10 (手机注册设置)
You can take inspiration from this readme.txt

wechat-social-login/init.php 77% from 13 tests

The main PHP script in "Wechat Social login 微信QQ钉钉登录插件" version 1.3.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 336 characters long)
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wechat-social-login.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected35,067 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1003,6746,08418,514
JavaScript152,55982010,570
CSS9260413,823
PO File28381,3102,151
SVG9009

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity25.20
▷ Minimum class complexity1.00
▷ Maximum class complexity256.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces1
Interfaces3
Traits0
Classes108
▷ Abstract classes1312.04%
▷ Concrete classes9587.96%
▷ Final classes11.05%
Methods1,016
▷ Static methods20820.47%
▷ Public methods92290.75%
▷ Protected methods343.35%
▷ Private methods605.91%
Functions50
▷ Named functions1122.00%
▷ Anonymous functions3978.00%
Constants59
▷ Global constants4372.88%
▷ Class constants1627.12%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
25 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/dingding.png1.96KB1.52KB▼ 22.63%
assets/image/v2.ui2.close2.png1.15KB0.24KB▼ 79.27%
assets/image/linkendin-icon.png1.76KB0.67KB▼ 61.67%
assets/image/icon_popup19fb81.png2.14KB1.83KB▼ 14.55%
assets/image/mobile-icon.png1.45KB0.49KB▼ 66.51%