10% social-medias-connect

Code Review | Social Medias Connect

WordPress plugin Social Medias Connect scored10%from 54 tests.

About plugin

  • Plugin page: social-medias-con...
  • Plugin version: 2.0.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9
  • WordPress version: 6.3.1
  • First release: Apr 15, 2011
  • Latest release: Jul 15, 2014
  • Number of updates: 280
  • Update frequency: every 4.3 days
  • Top authors: QiQiBoY (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /27,771 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/social-medias-connect/SMConnect.php+1174
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.31MB] [CPU: ▼52.69ms] Passed 4 tests

Analyzing server-side resources used by Social Medias Connect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.68 ▼0.797.07 ▼34.50
Dashboard /wp-admin2.70 ▼0.617.64 ▼46.45
Posts /wp-admin/edit.php2.70 ▼0.667.81 ▼41.77
Add New Post /wp-admin/post-new.php2.70 ▼3.197.07 ▼88.05
Media Library /wp-admin/upload.php2.70 ▼0.539.09 ▼29.34
插件设置 /wp-admin/admin.php?page=smc_bind_weibo_option2.7010.32
卸载插件 /wp-admin/admin.php?page=smc_bind_weibo_uninstall2.707.30
帮助 /wp-admin/admin.php?page=smc_bind_weibo_help2.708.00
微博账号绑定 /wp-admin/admin.php?page=social-medias-connect2.706.58

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 67 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
smc_weibo_options
widget_smc_sidebar_login_widget
widget_theysaidso_widget
theysaidso_admin_options
smc_vesion_compatible
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Social Medias Connect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲14813.27 ▼1.141.61 ▼0.6044.14 ▼1.67
Dashboard /wp-admin2,234 ▲464.90 ▼0.9899.52 ▼24.1990.43 ▲44.94
Posts /wp-admin/edit.php2,131 ▲422.04 ▼0.0137.15 ▲1.2448.38 ▲10.90
Add New Post /wp-admin/post-new.php6,246 ▲4,71326.04 ▲2.611,037.36 ▲326.1875.81 ▲17.01
Media Library /wp-admin/upload.php1,431 ▲404.18 ▼0.0499.19 ▼16.1281.64 ▲33.97
插件设置 /wp-admin/admin.php?page=smc_bind_weibo_option1,4222.0438.4082.39
卸载插件 /wp-admin/admin.php?page=smc_bind_weibo_uninstall9372.0426.6055.45
帮助 /wp-admin/admin.php?page=smc_bind_weibo_help1,0362.0824.7882.69
微博账号绑定 /wp-admin/admin.php?page=social-medias-connect1,0442.1726.9462.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/social-medias-connect/SMConnect.php+1174
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • Incomplete uninstall procedure, leaving 67 files (0.41MB) in the plugin directory
    • (new file) bindweibo.php
    • (new file) douban/Douban.php
    • (new file) 163weibo/NetEaseWeibo.php
    • (new file) 360cn/CN360.php
    • (new file) facebook/Facebook.php
    • (new file) css/smc-admin.css
    • (new file) baidu/Baidu.php
    • (new file) bindoption.php
    • (new file) SMConnect.php
    • (new file) css/smc-style.css
    • ...
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • smc_weibo_options
    • theysaidso_admin_options
    • db_upgraded
    • widget_smc_sidebar_login_widget
    • smc_vesion_compatible
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Warning in wp-content/plugins/social-medias-connect/SMConnect.php+1174
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Deprecated in wp-content/plugins/social-medias-connect/widgets.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; smc_sidebar_login_widget has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in smc_sidebar_login_widget is deprecated since version 4.3.0! Use __construct() instead.
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/SMConnect.php+404
    Undefined index: smcaction
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/SMConnect.php+111
    Undefined index: smc_request
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/SMConnect.php+1071
    Undefined index: socialmedia
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/SMConnect.php+1071
    Undefined index: oauth_token
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/SMConnect.php+166
    Undefined index: smcregister
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_option
    • > Notice in wp-content/plugins/social-medias-connect/bindoption.php+183
    Undefined index: box
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_uninstall
    • > Notice in wp-content/plugins/social-medias-connect/uninstall.php+1
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_uninstall
    • > Notice in wp-content/plugins/social-medias-connect/uninstall.php+41
    Undefined index: uninstall_unsend
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_uninstall
    • > Notice in wp-content/plugins/social-medias-connect/uninstall.php+41
    Undefined index: uninstall_send
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_uninstall
    • > Notice in wp-content/plugins/social-medias-connect/uninstall.php+9
    Undefined index: reset_option
    • > GET request to /wp-admin/admin.php?page=smc_bind_weibo_uninstall
    • > Notice in wp-content/plugins/social-medias-connect/uninstall.php+58
    Undefined variable: info
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/smctable.php+110
    Undefined index: filter
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/smctable.php+42
    Undefined index: orderby
    • > GET request to /wp-admin/admin.php?page=social-medias-connect
    • > Notice in wp-content/plugins/social-medias-connect/smctable.php+43
    Undefined index: order

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
  • 40× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/social-medias-connect/smctable.php on line 3
    • > PHP Notice
      Undefined index: reset_option in wp-content/plugins/social-medias-connect/uninstall.php on line 9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/social-medias-connect/uninstall.php:49
    • > PHP Fatal error
      Uncaught Error: Class 'smcHttp' not found in wp-content/plugins/social-medias-connect/163weibo/NetEaseWeibo.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'smcHttp' not found in wp-content/plugins/social-medias-connect/msnlive/MSNLive.php:2
    • > PHP Notice
      Undefined index: uninstall_send in wp-content/plugins/social-medias-connect/uninstall.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'smcHttp' not found in wp-content/plugins/social-medias-connect/360cn/CN360.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'smcHttp' not found in wp-content/plugins/social-medias-connect/douban/Douban.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-medias-connect/widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'smcHttp' not found in wp-content/plugins/social-medias-connect/google/Google.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (后台同步文章效果), #2 (登陆界面效果), #3 (后台绑定文章页面), #4 (后台设置界面)
The official readme.txt might help

social-medias-connect/social-medias-connect.php Passed 13 tests

The entry point to "Social Medias Connect" version 2.0.16 is a PHP file that has certain tags in its header comment area
80 characters long description:
为WordPress提供社交媒体网站连接同步功能, 支持微博账号绑定

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin4,151 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP291232933,956
JavaScript224100
CSS20495

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.31
Average class complexity19.87
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods214
▷ Static methods177.94%
▷ Public methods21399.53%
▷ Protected methods00.00%
▷ Private methods10.47%
Functions3
▷ Named functions3100.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
31 PNG files occupy 0.22MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/360cn.png2.31KB1.76KB▼ 23.88%
images/icons/google.png2.38KB0.86KB▼ 63.85%
images/icons/renren.png1.02KB1.12KB0.00%
images/icons/github.png4.20KB1.04KB▼ 75.23%
images/icons/taobao.png2.10KB0.50KB▼ 76.30%