68% tencentcloud-vod

Code Review | 腾讯云点播 (VOD)

WordPress plugin 腾讯云点播 (VOD) scored 68% from 54 tests.

About plugin

  • Plugin page: tencentcloud-vod
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.7
  • WordPress version: 5.9.2
  • First release: Mar 29, 2021
  • Latest release: Jun 22, 2021
  • Number of updates: 21
  • Update frequency: every 4.5 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 597 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.52MB] [CPU: ▼309.54ms] Passed 4 tests

An overview of server-side resources used by 腾讯云点播 (VOD)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4457.01 ▲5.14
Dashboard /wp-admin3.81 ▲0.4034.67 ▲1.03
Posts /wp-admin/edit.php4.09 ▲0.4541.21 ▲4.70
Add New Post /wp-admin/post-new.php3.59 ▼3.3822.50 ▼1,246.52
Media Library /wp-admin/upload.php3.74 ▲0.4526.21 ▲2.65
云点播 /wp-admin/admin.php?page=TencentCloudVodSettingPage3.7526.06
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.7325.49

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 2,099 new files
Database: 1 new table, 2 new options
New tables
wp_tencent_wordpress_options
New WordPress options
tencent_wordpress_vod_options
tencent_wordpress_common_options

Browser metrics Passed 4 tests

Checking browser requirements for 腾讯云点播 (VOD)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,832 ▲7816.18 ▲0.526.33 ▲0.112.82 ▼0.64
Dashboard /wp-admin2,929 ▲756.14 ▼0.06123.85 ▼6.60180.37 ▲24.20
Posts /wp-admin/edit.php2,728 ▲343.24 ▲0.0064.77 ▲1.09149.40 ▲5.15
Add New Post /wp-admin/post-new.php1,685 ▲2416.85 ▲0.54408.65 ▼10.18150.19 ▼5.01
Media Library /wp-admin/upload.php1,735 ▲345.57 ▲0.05134.32 ▼2.18201.77 ▲14.73
云点播 /wp-admin/admin.php?page=TencentCloudVodSettingPage1,3152.5558.95355.88
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,3262.6855.88243.56

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 successfully, leaving 1 table in the database
    • wp_tencent_wordpress_options
  • Zombie WordPress options detected upon uninstall: 1 option
    • tencent_wordpress_common_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/tencentcloud-vod/common/tencent-wordpress-plugins-setting-page.php
  • 1832× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Common\\Exception\\RuntimeException' not found in wp-content/plugins/tencentcloud-vod/vendor/guzzle/guzzle/src/Guzzle/Service/Exception/InconsistentClientTransferException.php:10
    • > 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-vod/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Eip.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-vod/vendor/tencentcloud/vod/src/TencentCloud/Vod/V20180717/Models/AiAnalysisTaskClassificationOutput.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/tencentcloud-vod/vendor/guzzle/guzzle/tests/Guzzle/Tests/Common/EventTest.php:10
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-vod/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Market.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-vod/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/ShieldInfo.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-vod/vendor/tencentcloud/vod/src/TencentCloud/Vod/V20180717/Models/CreateAnimatedGraphicsTemplateResponse.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-vod/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Vod/V20180717/Models/AiAnalysisTaskCoverOutput.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/tencentcloud-vod/vendor/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Md5/CommandContentMd5PluginTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/tencentcloud-vod/vendor/guzzle/guzzle/tests/Guzzle/Tests/Stream/StreamTest.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

tencentcloud-vod/tencentcloud-vod.php 92% from 13 tests

The main file in "腾讯云点播 (VOD)" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 207 characters long)

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin126,523 lines of code in 1,898 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,75921,11384,930111,612
Markdown272,03306,921
JSON571503,067
CSS5323292,267
reStructuredText301,2361,7941,824
JavaScript523101255
XML62911236
make2285133
HTML216095
Python1222349
Ant110134
YAML23020
Dockerfile18010

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity9.29
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces126
Interfaces96
Traits6
Classes1,735
▷ Abstract classes271.56%
▷ Concrete classes1,70898.44%
▷ Final classes382.22%
Methods7,395
▷ Static methods4466.03%
▷ Public methods6,74491.20%
▷ Protected methods2333.15%
▷ Private methods4185.65%
Functions585
▷ Named functions18531.62%
▷ Anonymous functions40068.38%
Constants510
▷ Global constants9618.82%
▷ Class constants41481.18%
▷ Public constants414100.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
2 PNG files occupy 0.24MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/guzzle/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
vendor/guzzle/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%