68% china-super

Code Review | 中文超级工具箱(China Super ToolS)

WordPress plugin 中文超级工具箱(China Super ToolS) scored68%from 54 tests.

About plugin

  • Plugin page: china-super
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Jan 9, 2015
  • Latest release: Jan 10, 2015
  • Number of updates: 17
  • Update frequency: every 0.1 days
  • Top authors: nocase (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,718 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.67MB] [CPU: ▼48.16ms] Passed 4 tests

A check of server-side resources used by 中文超级工具箱(China Super ToolS)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.21 ▼6.85
Dashboard /wp-admin2.28 ▼1.0712.24 ▼45.30
Posts /wp-admin/edit.php2.28 ▼1.088.18 ▼36.21
Add New Post /wp-admin/post-new.php2.28 ▼3.615.84 ▼85.05
Media Library /wp-admin/upload.php2.28 ▼0.958.91 ▼26.09
CST自定义扩展 /wp-admin/admin.php?page=cst_user2.287.22
CST系统扩展 /wp-admin/admin.php?page=cst_system2.288.84
CST在线扩展 /wp-admin/admin.php?page=cst_install2.286.76
上传CST扩展 /wp-admin/admin.php?page=cst_upload2.287.60
Super ToolS /wp-admin/admin.php?page=cst_option2.285.97

Server storage [IO: ▲0.04MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Illegal file modification found: 6 files (2.38KB) outside of "wp-content/plugins/china-super/" and "wp-content/uploads/"
    • (new file) wp-content/CstPort/lib/jpcomment.php
    • (new file) wp-content/CstPort/lib/QiNiuSEO.php
    • (new file) wp-content/CstPort/option/.empty
    • (new file) wp-content/CstPort/inc/.empty
    • (new file) wp-content/CstPort/lib/cnNames.php
    • (new file) wp-content/CstPort/lib/Md5Filename.php
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for 中文超级工具箱(China Super ToolS)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲17013.62 ▼0.781.55 ▼0.2940.94 ▼6.51
Dashboard /wp-admin2,322 ▲1345.49 ▲0.47106.40 ▼1.4743.12 ▼1.24
Posts /wp-admin/edit.php2,208 ▲1192.21 ▲0.1934.31 ▼2.0438.04 ▲6.90
Add New Post /wp-admin/post-new.php1,552 ▲3823.28 ▲5.74667.31 ▼18.7736.45 ▼23.07
Media Library /wp-admin/upload.php1,501 ▲1134.77 ▲0.5696.84 ▼16.0946.75 ▼0.32
CST自定义扩展 /wp-admin/admin.php?page=cst_user8982.1032.7459.53
CST系统扩展 /wp-admin/admin.php?page=cst_system9132.1326.6744.46
CST在线扩展 /wp-admin/admin.php?page=cst_install9012.1427.1746.23
上传CST扩展 /wp-admin/admin.php?page=cst_upload9132.1427.7639.34
Super ToolS /wp-admin/admin.php?page=cst_option9432.1326.3747.50

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
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_localize_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wct_ajaxrequest handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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 server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cst_option
    • > User notice in wp-includes/functions.php+5905
    Function wp_localize_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wct_ajaxrequest handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cst_install
    • > Notice in wp-content/plugins/china-super/private/ini.c.php+120
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=cst_install
    • > Warning in wp-content/plugins/china-super/private/ini.c.php+110
    Invalid argument supplied for foreach()

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
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/china-super/china-tools.php:11
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/china-super/private/CstPort/lib/QiNiuSEO.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/china-super/private/CstPort/lib/jpcomment.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/china-super/private/system/GoogleFontsSYS.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/china-super/private/system/GravatarSYS.php:11
    • > PHP Fatal error
      Uncaught Error: Undefined constant 'CST_C' in wp-content/plugins/china-super/router.php:3
    • > PHP Fatal error
      Uncaught Error: Undefined constant 'CST_C' in wp-content/plugins/china-super/private/ini.c.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/china-super/private/CstPort/lib/cnNames.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/china-super/private/CstPort/lib/Md5Filename.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 (Super ToolS下可以插件当前安装的扩展数量,并且可以生成代码引用块), #2 (针对用户添加的代码,都进行压缩合并,并生成一个唯一的引用文件。), #3 (记录代码功能), #4 (可在线扩展功能), #5 (系统内置两个中文网站加速模块(google fonts to fonts,china gravatar cdn))
Please take inspiration from this readme.txt

china-super/china-tools.php 92% from 13 tests

The main file in "中文超级工具箱(China Super ToolS)" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("china-super.php" instead of "china-tools.php")

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
There were no executable files found in this plugin868 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP114138711
JavaScript100117
CSS10040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity38.33
▷ Minimum class complexity5.00
▷ Maximum class complexity56.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1236.36%
▷ Public methods3193.94%
▷ Protected methods00.00%
▷ Private methods26.06%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants1083.33%
▷ Class constants216.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin