68% tencentcloud-ims

Code Review | 腾讯云图片内容安全(IMS)

WordPress plugin 腾讯云图片内容安全(IMS) scored 68% from 54 tests.

About plugin

  • Plugin page: tencentcloud-ims
  • 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 27, 2020
  • Latest release: May 10, 2021
  • Number of updates: 6
  • Update frequency: every 48.3 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 4,148 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.51MB] [CPU: ▼288.53ms] Passed 4 tests

A check of server-side resources used by 腾讯云图片内容安全(IMS)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5457.45 ▲7.91
Dashboard /wp-admin3.90 ▲0.5037.19 ▲4.81
Posts /wp-admin/edit.php4.19 ▲0.5541.16 ▲5.71
Add New Post /wp-admin/post-new.php7.46 ▲0.4696.61 ▼1,165.84
Media Library /wp-admin/upload.php3.84 ▲0.5525.67 ▲1.19
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.8226.20
图片内容安全 /wp-admin/admin.php?page=TencentWordpressIMSSettingPage3.8226.68

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 511 new files
Database: 1 new table, 1 new option
New tables
wp_tencent_wordpress_options
New WordPress options
tencent_wordpress_common_options

Browser metrics Passed 4 tests

Checking browser requirements for 腾讯云图片内容安全(IMS)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,808 ▲5415.98 ▲0.325.79 ▼0.302.03 ▼0.82
Dashboard /wp-admin2,928 ▲676.30 ▲0.11115.21 ▼22.28175.11 ▲18.29
Posts /wp-admin/edit.php2,731 ▲463.25 ▲0.0164.60 ▲1.15151.61 ▲11.09
Add New Post /wp-admin/post-new.php1,687 ▼2417.14 ▼3.64415.49 ▼30.31153.93 ▼2.43
Media Library /wp-admin/upload.php1,735 ▲405.57 ▲0.06135.31 ▼5.68205.26 ▲17.35
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,3342.7255.10161.56
图片内容安全 /wp-admin/admin.php?page=TencentWordpressIMSSettingPage1,2462.6258.11170.94

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • 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 short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/tencentcloud-ims/common/tencent-wordpress-plugins-setting-page.php
  • 361× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/vendor/GuzzleHttp/Psr7/Uri.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/tencentcloud-ims/common/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Account.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'TENCENT_WORDPRESS_PLUGINS_COMMON_DIRtencent-wordpress-plugins-setting-page.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-ims/common/TencentWordpressPluginsSettingActions.php on line 18
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Cloudaudit.php on line 2
    • > PHP Warning
      Use of undefined constant QCLOUDAPI_ROOT_PATH - assumed 'QCLOUDAPI_ROOT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Tmt.php on line 2
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Snapshot.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-ims/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Bm.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-ims/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-ims/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/DescribeFileSampleResponse.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: tencent cloud, ims, qcloud

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

"腾讯云图片内容安全(IMS)" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
108 characters long description:
通过腾讯云图片内容安全服务对媒体库上传和URL插入的图片进行内容检测和过滤。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected27,918 lines of code in 353 files:
LanguageFilesBlank linesComment linesLines of code
PHP3204,55514,65523,308
Markdown1394403,159
JSON16001,375
JavaScript233866
make1409
CSS10111

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.70
▷ 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,327
▷ Static methods29212.55%
▷ Public methods1,94783.67%
▷ Protected methods170.73%
▷ Private methods36315.60%
Functions478
▷ Named functions21444.77%
▷ Anonymous functions26455.23%
Constants269
▷ Global constants6022.30%
▷ Class constants20977.70%
▷ Public constants209100.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