10% wordpress-tencent-microblog

Code Review | Wordpress Tencent Microblog

WordPress plugin Wordpress Tencent Microblog scored10%from 54 tests.

About plugin

  • Plugin page: wordpress-tencent...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.4.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2010
  • Latest release: Sep 9, 2012
  • Number of updates: 33
  • Update frequency: every 23.7 days
  • Top authors: hzlzh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,355 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php+98
    Methods with the same name as their class will not be constructors in a future version of PHP; TencentMicroblog has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼52.85ms] Passed 4 tests

A check of server-side resources used by Wordpress Tencent Microblog
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.72 ▼35.44
Dashboard /wp-admin2.12 ▼1.185.80 ▼49.49
Posts /wp-admin/edit.php2.12 ▼1.235.60 ▼44.97
Add New Post /wp-admin/post-new.php2.12 ▼3.767.26 ▼81.48
Media Library /wp-admin/upload.php2.12 ▼1.105.37 ▼31.88
腾讯微博插件 /wp-admin/options-general.php?page=WTM-options2.135.45

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_tencentmicroblog
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress Tencent Microblog
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.70 ▼0.671.65 ▼0.0142.24 ▼6.85
Dashboard /wp-admin2,222 ▲255.85 ▲0.0497.73 ▼10.9945.96 ▲5.15
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0038.30 ▲0.3643.74 ▲9.60
Add New Post /wp-admin/post-new.php1,558 ▲1318.17 ▼4.92642.20 ▼47.6053.89 ▲0.41
Media Library /wp-admin/upload.php1,404 ▲74.21 ▲0.02102.55 ▼3.3448.92 ▲2.12
腾讯微博插件 /wp-admin/options-general.php?page=WTM-options7972.0523.5361.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php+98
    Methods with the same name as their class will not be constructors in a future version of PHP; TencentMicroblog has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_tencentmicroblog
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php+98
    Methods with the same name as their class will not be constructors in a future version of PHP; TencentMicroblog has a deprecated constructor
  • 40 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/lib/Services/JSON.php+821
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/lib/Services/JSON.php+119
    Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > Deprecated in wp-content/plugins/wordpress-tencent-microblog/lib/Services/JSON.php+924
    Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in TencentMicroblog is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=WTM-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please fix the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'OpenSDK/OAuth/Client.php' (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/Tencent/Weibo.php on line 3
    • > PHP Warning
      require_once(OpenSDK/OAuth/Client.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/Tencent/Weibo.php on line 3
    • > PHP Warning
      require_once(Services/JSON.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/Util.php on line 3
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php on line 14
    • > PHP Warning
      require_once(OpenSDK/OAuth/Client.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/OAuth/QQSNSClient.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'Services/JSON.php' (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/Util.php on line 3
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php on line 16
    • > PHP Fatal error
      require_once(): Failed opening required 'OpenSDK/Util.php' (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/OAuth/Client.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wordpress-tencent-microblog/wordpress-tencent-microblog.php:25
    • > PHP Warning
      require_once(OpenSDK/Util.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-tencent-microblog/lib/OpenSDK/OAuth/Client.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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: Add images for these screenshots: #1 (使用侧边栏[小工具]调用的效果), #2 (后台截图)
The official readme.txt is a good inspiration

wordpress-tencent-microblog/wordpress-tencent-microblog.php 92% from 13 tests

"Wordpress Tencent Microblog" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 301 characters long)

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
Everything looks great! No dangerous files found in this plugin1,259 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP82367441,259

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity28.75
▷ Minimum class complexity1.00
▷ Maximum class complexity126.00
Average method complexity5.27
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods52
▷ Static methods2242.31%
▷ Public methods4280.77%
▷ Protected methods1019.23%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants1055.56%
▷ Class constants844.44%
▷ Public constants8100.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
3 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png17.45KB7.12KB▼ 59.19%
txwb.png41.83KB0.96KB▼ 97.71%
screenshot-1.png31.45KB11.13KB▼ 64.63%