62% tencentcloud-cdn

Code Review | 腾讯云内容分发管理(CDN)

WordPress plugin 腾讯云内容分发管理(CDN) scored 62% from 54 tests.

About plugin

  • Plugin page: tencentcloud-cdn
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.1
  • WordPress version: 5.9.2
  • First release: Jul 23, 2020
  • Latest release: Dec 8, 2020
  • Number of updates: 6
  • Update frequency: every 23.0 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 6,074 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.47MB] [CPU: ▼305.69ms] Passed 4 tests

A check of server-side resources used by 腾讯云内容分发管理(CDN)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5054.50 ▼0.69
Dashboard /wp-admin3.86 ▲0.4537.70 ▲5.28
Posts /wp-admin/edit.php4.14 ▲0.5147.19 ▲10.75
Add New Post /wp-admin/post-new.php7.41 ▲0.4196.94 ▼1,231.58
Media Library /wp-admin/upload.php3.80 ▲0.5127.60 ▲4.23
内容分发网络 /wp-admin/admin.php?page=tencent_wordpress_plugin_cdn3.8126.31
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.7826.16

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 759 new files
Database: 1 new table, 2 new options
New tables
wp_tencent_wordpress_options
New WordPress options
tencent_wordpress_common_options
tencent_wordpress_cdn_options

Browser metrics Passed 4 tests

A check of browser resources used by 腾讯云内容分发管理(CDN)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,820 ▲9816.03 ▲0.376.18 ▼0.272.18 ▼0.03
Dashboard /wp-admin2,929 ▲716.18 ▼0.06119.03 ▼20.88179.11 ▲11.10
Posts /wp-admin/edit.php2,725 ▲313.24 ▲0.0062.95 ▲1.43150.20 ▲13.89
Add New Post /wp-admin/post-new.php1,684 ▲2417.50 ▲1.29409.11 ▼20.71150.79 ▼5.72
Media Library /wp-admin/upload.php1,738 ▲435.56 ▲0.08150.98 ▲7.55209.41 ▲19.96
内容分发网络 /wp-admin/admin.php?page=tencent_wordpress_plugin_cdn1,8382.8858.73186.13
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,3312.6861.58151.58

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 uninstall procedure failed, leaving 1 table in the database
    • wp_tencent_wordpress_options
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • tencent_wordpress_common_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tencentcloud-cdn/tencentcloud-cdn.php
    • > /wp-content/plugins/tencentcloud-cdn/common/tencent-wordpress-plugins-setting-page.php
    • > /wp-content/plugins/tencentcloud-cdn/tencent-cloud-cdn-setting-page.php
  • 664× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Common/Sign.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Common/Request.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/tencentcloud-cdn/common/vendor/tencentcloud/tencentcloud-sdk-php/vendor/GuzzleHttp/Promise/AggregateException.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Cvm.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cdn/V20180606/Models/DescribeTrafficPackagesRequest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cdn/V20180606/Models/DescribeTrafficPackagesResponse.php:34
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-cdn/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Live.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-cdn/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Partners.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cdn/V20180606/Models/TopDetailData.php:28
    • > 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-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Batch.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-cdn/includes/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cdn/V20180606/Models/DescribeBillingDataResponse.php:38

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=tencent_wordpress_plugin_cdn
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=tencent_wordpress_plugin_cdn 381 The specified value "0000-00-00 00:00:00" does not conform to the required format. The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: The official readme.txt might help

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

The primary PHP file in "腾讯云内容分发管理(CDN)" version 1.0.2 is used by WordPress to initiate all plugin functionality
105 characters long description:
通过腾讯云内容分发网络服务自动刷新网站的变化内容,提升用户的浏览体验。

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
There were no executable files found in this plugin22,775 lines of code in 415 files:
LanguageFilesBlank linesComment linesLines of code
PHP3954,56620,93418,918
Markdown991703,106
JSON800497
JavaScript11825244
make1409
CSS10111

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity10.67
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces17
Interfaces56
Traits8
Classes587
▷ Abstract classes81.36%
▷ Concrete classes57998.64%
▷ Final classes284.84%
Methods3,141
▷ Static methods3099.84%
▷ Public methods2,66984.97%
▷ Protected methods250.80%
▷ Private methods44714.23%
Functions563
▷ Named functions21337.83%
▷ Anonymous functions35062.17%
Constants310
▷ Global constants247.74%
▷ Class constants28692.26%
▷ Public constants286100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin