62% uyan

Code Review | 友言评论 UYan Comment

WordPress plugin 友言评论 UYan Comment scored 62% from 54 tests.

About plugin

  • Plugin page: uyan
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Jan 6, 2014
  • Latest release: Jan 2, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: uyancc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 11,861 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.94MB] [CPU: ▼35.35ms] Passed 4 tests

Server-side resources used by 友言评论 UYan Comment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.60 ▼2.33
Dashboard /wp-admin3.01 ▼0.3022.70 ▼25.53
Posts /wp-admin/edit.php3.01 ▼0.3524.03 ▼29.00
Add New Post /wp-admin/post-new.php3.01 ▼2.8822.97 ▼76.77
Media Library /wp-admin/upload.php3.01 ▼0.2326.95 ▼10.09
数据同步 /wp-admin/admin.php?page=uyan_sync3.0122.86
友言评论 /wp-admin/admin.php?page=uyan3.0123.68
统计分析 /wp-admin/admin.php?page=uyan_analysis3.0123.02
安装设置 /wp-admin/admin.php?page=uyan_setting3.0125.51

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for 友言评论 UYan Comment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.19 ▼1.191.86 ▼0.4640.10 ▼2.65
Dashboard /wp-admin2,239 ▲485.82 ▲0.94111.15 ▲0.8590.65 ▲46.81
Posts /wp-admin/edit.php2,122 ▲332.00 ▼0.0038.81 ▼2.8746.47 ▲8.47
Add New Post /wp-admin/post-new.php1,692 ▲15821.64 ▼1.44691.31 ▲94.8956.09 ▲1.44
Media Library /wp-admin/upload.php1,412 ▲274.22 ▼0.10100.64 ▼4.0472.35 ▲30.57
数据同步 /wp-admin/admin.php?page=uyan_sync8422.0325.1552.28
友言评论 /wp-admin/admin.php?page=uyan8452.0823.9240.72
统计分析 /wp-admin/admin.php?page=uyan_analysis8422.0324.7739.98
安装设置 /wp-admin/admin.php?page=uyan_setting8422.0324.8339.71

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
The following items require your attention
  • Uninstall procedure had uncaught 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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uyan_setting
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.

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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/uyan/uyan_code.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/uyan/uyan_header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/uyan/uyan_plugin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/uyan/uyan_header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/uyan/uyan_header.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=uyan_setting
    • > Network (severe)
    http://www.uyan.cc/resource/js/notice.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (评论框样式), #2 (自定义设置), #3 (评论管理), #4 (数据分析)
The official readme.txt might help

uyan/uyan_plugin.php 85% from 13 tests

"友言评论 UYan Comment" version 4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 432 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("uyan.php" instead of "uyan_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin268 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP52212151
JavaScript103117

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png16.31KB16.30KB0.03%
screenshot-5.png22.27KB21.97KB▼ 1.32%
screenshot-2.png15.11KB15.06KB0.32%
img/uyan_logo.png1.83KB1.77KB▼ 3.31%
screenshot-3.png24.92KB24.98KB0.00%