10% duoshuo

Code Review | 多说社会化评论框

WordPress plugin 多说社会化评论框 scored10%from 54 tests.

About plugin

  • Plugin page: duoshuo
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.6
  • WordPress version: 6.3.1
  • First release: Dec 2, 2011
  • Latest release: Dec 18, 2015
  • Number of updates: 102
  • Update frequency: every 14.6 days
  • Top authors: shen2 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active /170,030 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
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/duoshuo/duoshuo.php+23
    Undefined variable: wp_version

Server metrics [RAM: ▼0.85MB] [CPU: ▼37.23ms] Passed 4 tests

Server-side resources used by 多说社会化评论框
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.56 ▼0.36
Dashboard /wp-admin3.11 ▼0.2429.29 ▼38.12
Posts /wp-admin/edit.php3.11 ▼0.2525.03 ▼25.43
Add New Post /wp-admin/post-new.php3.11 ▼2.7825.59 ▼69.12
Media Library /wp-admin/upload.php3.11 ▼0.1222.44 ▼16.24

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 23 new options
New WordPress options
widget_recent-posts
duoshuo_theme
widget_theysaidso_widget
duoshuo_style_patch
db_upgraded
duoshuo_cron_sync_enabled
widget_ds-top-threads
duoshuo_seo_enabled
duoshuo_comments_wrapper_intro
duoshuo_last_log_id
...

Browser metrics Passed 4 tests

An overview of browser requirements for 多说社会化评论框
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.29 ▼1.301.83 ▲0.0343.65 ▲1.23
Dashboard /wp-admin2,210 ▲194.92 ▼0.0197.07 ▼13.2581.55 ▲37.83
Posts /wp-admin/edit.php2,110 ▲211.97 ▼0.0338.93 ▲1.9845.46 ▲8.77
Add New Post /wp-admin/post-new.php1,541 ▲2723.26 ▲5.73777.06 ▲82.0657.19 ▲1.70
Media Library /wp-admin/upload.php1,398 ▲74.20 ▼0.0296.93 ▼3.5779.15 ▲34.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • This plugin did not uninstall without warnings or 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.
  • This plugin did not uninstall successfully, leaving 23 options in the database
    • db_upgraded
    • widget_ds-recent-visitors
    • duoshuo_postpone_print_scripts
    • duoshuo_debug
    • duoshuo_comments_wrapper_intro
    • widget_recent-posts
    • duoshuo_style_patch
    • widget_ds-recent-comments
    • duoshuo_seo_enabled
    • duoshuo_social_login_enabled
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/duoshuo/duoshuo.php:24
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/themes.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/profile.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/manage.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Duoshuo_WordPress' not found in wp-content/plugins/duoshuo/comments.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/settings.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/preferences.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/duoshuo/widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/duoshuo/statistics.php:1
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/duoshuo/bind.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (文章/页面下的评论框,支持用新浪微博、QQ、人人、豆瓣、网易微博、搜狐微博、开心网、百度账号帐号登录), #2 (针对手机界面深度优化,响应式的设计自动适配各种移动终端), #3 (评论列表单级回复样式), #4 (你的评论被回复之后,实时提醒), #5 (多款主题供您选择,深色背景的网站毫无违和感。CSS样式代码全面开源,供您深度定制属于自己的评论框), #6 (集成在WordPress后台的多说评论管理界面,智能过滤垃圾评论)
The official readme.txt is a good inspiration

duoshuo/duoshuo.php 92% from 13 tests

The main PHP file in "多说社会化评论框" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 245 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected3,433 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP246946783,289
HTML11093
CSS13051

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity35.71
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods140
▷ Static methods42.86%
▷ Public methods13999.29%
▷ Protected methods10.71%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants822.22%
▷ Class constants2877.78%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.29MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu-icon.png0.56KB0.78KB0.00%
screenshot-5.png42.61KB16.94KB▼ 60.24%
screenshot-2.png39.52KB15.96KB▼ 59.61%
images/service_icons_32x32.png43.83KB42.11KB▼ 3.93%
screenshot-4.png83.75KB25.71KB▼ 69.30%