68% tencentcloud-tms

Code Review | 腾讯云文本内容安全(TMS)

WordPress plugin 腾讯云文本内容安全(TMS) scored 68% from 54 tests.

About plugin

  • Plugin page: tencentcloud-tms
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.1
  • WordPress version: 5.9.2
  • First release: Jul 24, 2020
  • Latest release: May 10, 2021
  • Number of updates: 12
  • Update frequency: every 24.2 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 4,423 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
Install script ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▼301.01ms] Passed 4 tests

An overview of server-side resources used by 腾讯云文本内容安全(TMS)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6069.40 ▲9.46
Dashboard /wp-admin4.04 ▲0.6347.38 ▲9.80
Posts /wp-admin/edit.php4.27 ▲0.6246.69 ▲0.81
Add New Post /wp-admin/post-new.php7.51 ▲0.53104.39 ▼1,211.38
Media Library /wp-admin/upload.php3.93 ▲0.6330.14 ▼2.92
文本内容安全 /wp-admin/admin.php?page=TencentWordpressTMSSettingPage3.9033.66
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.9034.14

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 509 new files
Database: 2 new tables, 1 new option
New tables
wp_tencent_wordpress_tms_keyword_records
wp_tencent_wordpress_options
New WordPress options
tencent_wordpress_common_options

Browser metrics Passed 4 tests

Checking browser requirements for 腾讯云文本内容安全(TMS)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,839 ▲9516.10 ▲0.406.49 ▼1.002.56 ▲0.16
Dashboard /wp-admin2,932 ▲716.23 ▲0.01118.71 ▼16.60178.84 ▲16.07
Posts /wp-admin/edit.php2,731 ▲403.27 ▲0.0362.75 ▼1.49146.00 ▲3.83
Add New Post /wp-admin/post-new.php1,687 ▼8617.06 ▼4.41384.09 ▼65.93160.79 ▲2.81
Media Library /wp-admin/upload.php1,741 ▲435.60 ▲0.06145.45 ▼0.36199.28 ▲9.58
文本内容安全 /wp-admin/admin.php?page=TencentWordpressTMSSettingPage1,5132.7457.39241.23
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,3312.7257.68152.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_tencent_wordpress_options
  • Zombie WordPress options were found after uninstall: 1 option
    • tencent_wordpress_common_options

Smoke tests 50% 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 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/tencentcloud-tms/common/tencent-wordpress-plugins-setting-page.php
  • 361× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Feecenter.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/DescribeUserBaseInfoInstanceResponse.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/CreateResourceInstancesRequest.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/PhoneDetect.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/CreateTextSampleResponse.php:34
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Vod.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Common/Sign.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Common/Request.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/CustomResult.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/DeleteShieldInstancesResponse.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-tms/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/DescribeFileSampleRequest.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: tencent cloud, tms, qcloud

tencentcloud-tms/tencentcloud-tms.php Passed 13 tests

The primary PHP file in "腾讯云文本内容安全(TMS)" version 1.0.1 is used by WordPress to initiate all plugin functionality
93 characters long description:
通过腾讯云文本内容安全服务对评论提交的文字进行内容检测和过滤。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected28,417 lines of code in 354 files:
LanguageFilesBlank linesComment linesLines of code
PHP3204,58914,70623,659
Markdown1394403,159
JSON17001,391
JavaScript22138198
make1409
CSS10111

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.75
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces21
Interfaces43
Traits6
Classes356
▷ Abstract classes61.69%
▷ Concrete classes35098.31%
▷ Final classes277.71%
Methods2,340
▷ Static methods29412.56%
▷ Public methods1,95783.63%
▷ Protected methods170.73%
▷ Private methods36615.64%
Functions478
▷ Named functions21444.77%
▷ Anonymous functions26455.23%
Constants273
▷ Global constants6021.98%
▷ Class constants21378.02%
▷ Public constants213100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin