10% wp-connect

Code Review | WordPress连接微博

WordPress plugin WordPress连接微博 scored10%from 54 tests.

About plugin

  • Plugin page: wp-connect
  • Plugin version: 2.5.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Feb 25, 2011
  • Latest release: Apr 4, 2018
  • Number of updates: 378
  • Update frequency: every 6.9 days
  • Top authors: smyx (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /126,403 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-connect/functions.php+9
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.61MB] [CPU: ▼51.14ms] Passed 4 tests

This is a short check of server-side resources used by WordPress连接微博
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.38 ▼1.087.59 ▼36.99
Dashboard /wp-admin2.40 ▼0.918.90 ▼42.47
Posts /wp-admin/edit.php2.40 ▼0.9611.28 ▼37.14
Add New Post /wp-admin/post-new.php2.40 ▼3.499.78 ▼87.94
Media Library /wp-admin/upload.php2.40 ▼0.8310.58 ▼25.84
WordPress连接微博 /wp-admin/options-general.php?page=wp-connect2.4011.43

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 101 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
wptm_key
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WordPress连接微博
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.19 ▼1.191.69 ▼0.3541.50 ▼2.10
Dashboard /wp-admin2,204 ▲195.83 ▲0.95102.41 ▼16.4745.31 ▲1.15
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0240.89 ▲0.7738.83 ▲7.50
Add New Post /wp-admin/post-new.php1,527 ▼623.00 ▲4.64654.96 ▲6.9356.39 ▲6.30
Media Library /wp-admin/upload.php1,392 ▲74.25 ▲0.05103.76 ▼2.1352.20 ▲6.30
WordPress连接微博 /wp-admin/options-general.php?page=wp-connect3,0923.1759.2870.50

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-connect/functions.php+9
    Array and string offset access syntax with curly braces is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • wptm_key
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 0% 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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Deprecated in wp-content/plugins/wp-connect/functions.php+13
    Array and string offset access syntax with curly braces is deprecated
  • 106 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+77
    Trying to access array offset on value of type bool
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/config.php+17
    Undefined offset: 9
  • 58 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/config.php+17
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/connect.php+460
    Undefined index: fields
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+69
    Undefined variable: keybug
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/update.php+198
    Undefined index: username
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/update.php+199
    Undefined index: password
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Warning in wp-content/plugins/wp-connect/bind.php+6
    Use of undefined constant IS_PROFILE_PAGE - assumed 'IS_PROFILE_PAGE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+6
    Undefined variable: user_id
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+18
    Undefined index: twitter
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+19
    Undefined index: qq
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+20
    Undefined index: sina
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+21
    Undefined index: netease
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+22
    Undefined index: sohu
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+145
    Undefined index: renren
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+27
    Undefined index: tianya
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+28
    Undefined index: douban
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+152
    Undefined index: wbto
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+146
    Undefined index: kaixin001
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+147
    Undefined index: digu
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+148
    Undefined index: fanfou
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+149
    Undefined index: renjian
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+150
    Undefined index: zuosa
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/bind.php+151
    Undefined index: follow5
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+548
    Undefined variable: donate_152
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+487
    Undefined variable: blog_options
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+508
    Undefined variable: wptm_blog
  • 28 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+567
    Undefined variable: wptm_share
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Warning in wp-content/plugins/wp-connect/wp-connect.php+572
    Use of undefined constant WP_CONNECT_ADVANCED - assumed 'WP_CONNECT_ADVANCED' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+50
    Undefined index: page
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Notice in wp-content/plugins/wp-connect/wp-connect.php+50
    Undefined index: action

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 items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-connect/check.php
    • > /wp-content/plugins/wp-connect/go.php
    • > /wp-content/plugins/wp-connect/denglu.php
    • > /wp-content/plugins/wp-connect/bind.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wp-connect/wp-connect.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wp-connect/config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-connect/update.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-connect/comments-widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wp-connect/config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-connect/comments.php:4
    • > PHP Notice
      Undefined variable: wptm_connect in wp-content/plugins/wp-connect/functions.php on line 574
    • > PHP Warning
      Declaration of OAuthSignatureMethod_RSA_SHA1::check_signature($request, $consumer, $token, $signature) should be compatible with OAuthSignatureMethod::check_signature(&$request, $consumer, $token, $signature) in wp-content/plugins/wp-connect/OAuth/OAuth.php on line 154
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-connect/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wp-connect/config.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Javascript (severe) in unknown
    /wp-admin/js/common.min.js?ver=6.3.1 1:6139 Uncaught TypeError: W(...).on is not a function
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Javascript (severe) in unknown
    /wp-includes/js/heartbeat.min.js?ver=6.3.1 1:5086 Uncaught TypeError: i.on is not a function
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Javascript (severe) in unknown
    /wp-includes/js/wp-auth-check.min.js?ver=6.3.1 1:502 Uncaught TypeError: i(...).on is not a function
    • > GET request to /wp-admin/options-general.php?page=wp-connect
    • > Javascript (severe) in unknown
    /wp-admin/js/common.min.js?ver=6.3.1 1:3796 Uncaught TypeError: W(...).on is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-connect === )
  • Tags: There are too many tags (34 tag instead of maximum 10)
You can look at the official readme.txt

wp-connect/wp-connect.php Passed 13 tests

"WordPress连接微博" version 2.5.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
120 characters long description:
支持使用20家合作网站帐号登录WordPress,同步文章、评论到微博/SNS,支持使用社会化评论。

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
There were no executable files found in this plugin7,584 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP345721,7337,508
CSS20773
JavaScript30163

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity10.81
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods282
▷ Static methods144.96%
▷ Public methods26192.55%
▷ Protected methods124.26%
▷ Private methods93.19%
Functions193
▷ Named functions193100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants2395.83%
▷ Class constants14.17%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
44 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/btn_facebook.png0.67KB0.75KB0.00%
images/submit.png1.84KB1.54KB▼ 15.96%
images/wbto.png1.13KB1.69KB0.00%
images/twitter.png0.95KB1.09KB0.00%
images/login_sina.png2.24KB1.80KB▼ 19.44%