10% changyan

Code Review | 畅言评论系统

WordPress plugin 畅言评论系统 scored10%from 54 tests.

About plugin

  • Plugin page: changyan
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2013
  • Latest release: Jul 1, 2016
  • Number of updates: 45
  • Update frequency: every 23.2 days
  • Top authors: sohu (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /29,143 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/changyan/sohuchangyan.php+12
    Constant WP_DEBUG already defined

Server metrics [RAM: ▼1.97MB] [CPU: ▼59.94ms] Passed 4 tests

This is a short check of server-side resources used by 畅言评论系统
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.12 ▼44.57
Dashboard /wp-admin2.05 ▼1.305.78 ▼62.32
Posts /wp-admin/edit.php2.05 ▼1.315.91 ▼44.78
Add New Post /wp-admin/post-new.php2.05 ▼3.846.81 ▼88.10
Media Library /wp-admin/upload.php2.05 ▼1.185.51 ▼31.99

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for 畅言评论系统
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8714.74 ▲0.431.92 ▲0.0146.24 ▲1.46
Dashboard /wp-admin2,227 ▲215.79 ▲0.93109.31 ▲4.6985.38 ▲41.73
Posts /wp-admin/edit.php2,124 ▲212.00 ▼0.0139.69 ▼3.1345.93 ▲8.92
Add New Post /wp-admin/post-new.php1,696 ▲17022.50 ▲5.00726.19 ▲21.4053.17 ▼9.33
Media Library /wp-admin/upload.php1,412 ▲94.27 ▲0.04108.11 ▲6.0687.76 ▲39.98

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
    • > Notice in wp-content/plugins/changyan/sohuchangyan.php+12
    Constant WP_DEBUG already defined
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 fix the following items
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(CHANGYAN_PLUGIN_PATH/Handler.php): failed to open stream: No such file or directory in wp-content/plugins/changyan/setup.php on line 3
    • > PHP Warning
      Use of undefined constant CHANGYAN_PLUGIN_PATH - assumed 'CHANGYAN_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/changyan/audit.php on line 2
    • > PHP Warning
      Use of undefined constant CHANGYAN_PLUGIN_PATH - assumed 'CHANGYAN_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/changyan/Handler.php on line 4
    • > PHP Warning
      Use of undefined constant CHANGYAN_PLUGIN_PATH - assumed 'CHANGYAN_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/changyan/comments_sohu.php on line 2
    • > PHP Notice
      Undefined variable: wp_version in wp-content/plugins/changyan/sohuchangyan.php on line 29
    • > PHP Warning
      require_once(CHANGYAN_PLUGIN_PATH/Handler.php): failed to open stream: No such file or directory in wp-content/plugins/changyan/audit.php on line 2
    • > PHP Warning
      require_once(CHANGYAN_PLUGIN_PATH/Synchronizer.php): failed to open stream: No such file or directory in wp-content/plugins/changyan/Handler.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_comment_pages_count() in wp-content/plugins/changyan/comments_seo.php:43
    • > PHP Warning
      require_once(CHANGYAN_PLUGIN_PATH/Handler.php): failed to open stream: No such file or directory in wp-content/plugins/changyan/comments_sohu.php on line 2
    • > PHP Warning
      require_once(CHANGYAN_PLUGIN_PATH/Handler.php): failed to open stream: No such file or directory in wp-content/plugins/changyan/settings.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (文章/页面下的评论框,支持用新浪微博、QQ、人人、搜狐等社交账号登录。), #2 (评论一键同步至社交网络,为您的网站带来更多流量。), #3 (评论列表多级回复样式简洁明快。)
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

changyan/sohuchangyan.php 85% from 13 tests

"畅言评论系统" version 2.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("changyan.php" instead of "sohuchangyan.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 206 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected2,388 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP122664501,918
HTML3410470

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity31.00
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods71
▷ Static methods22.82%
▷ Public methods5476.06%
▷ Protected methods22.82%
▷ Private methods1521.13%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants41
▷ Global constants1639.02%
▷ Class constants2560.98%
▷ Public constants25100.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
5 PNG files occupy 0.42MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png33.61KB16.61KB▼ 50.57%
logo.png3.22KB0.49KB▼ 84.89%
changyan.png2.29KB1.15KB▼ 49.87%
screenshot-2.png90.36KB41.78KB▼ 53.77%
screenshot-3.png300.73KB131.54KB▼ 56.26%