10% tencentcloud-captcha

Code Review | 腾讯云验证码 (CAPTCHA)

WordPress plugin 腾讯云验证码 (CAPTCHA) scored 10% from 54 tests.

About plugin

  • Plugin page: tencentcloud-captcha
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8
  • WordPress version: 5.9.2
  • First release: Jul 8, 2020
  • Latest release: Dec 28, 2021
  • Number of updates: 18
  • Update frequency: every 30.0 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 3,120 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/tencentcloud-captcha/TencentCloudCaptchaActions.php+721
    Undefined index: site_report_on

Server metrics [RAM: ▲0.59MB] [CPU: ▼283.49ms] Passed 4 tests

Server-side resources used by 腾讯云验证码 (CAPTCHA)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6265.74 ▲6.46
Dashboard /wp-admin3.98 ▲0.5772.10 ▲32.06
Posts /wp-admin/edit.php4.26 ▲0.6346.73 ▼1.75
Add New Post /wp-admin/post-new.php7.50 ▲0.53103.41 ▼1,149.71
Media Library /wp-admin/upload.php3.92 ▲0.6337.86 ▲11.05
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.9045.54
验证码 /wp-admin/admin.php?page=tencent_wordpress_plugin_captcha3.9432.85

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 499 new files
Database: 1 new table, 2 new options
New tables
wp_tencent_wordpress_options
New WordPress options
tencent_wordpress_common_options
tencent_wordpress_captcha_options

Browser metrics Passed 4 tests

An overview of browser requirements for 腾讯云验证码 (CAPTCHA)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,858 ▲10416.04 ▲0.015.83 ▼0.512.47 ▲0.02
Dashboard /wp-admin2,957 ▲996.56 ▲0.30131.84 ▼3.68180.27 ▼38.10
Posts /wp-admin/edit.php2,739 ▲513.32 ▲0.0888.50 ▲23.69186.91 ▲45.73
Add New Post /wp-admin/post-new.php11,614 ▲9,95321.07 ▲4.44747.46 ▲322.91242.38 ▲89.05
Media Library /wp-admin/upload.php1,768 ▲746.07 ▲0.54128.77 ▼21.13208.38 ▼18.68
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,5493.5182.62224.84
验证码 /wp-admin/admin.php?page=tencent_wordpress_plugin_captcha1,8183.46104.15186.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/tencentcloud-captcha/TencentCloudCaptchaActions.php+721
    Undefined index: site_report_on
  • 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 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/tencentcloud-captcha/common/tencent-wordpress-plugins-setting-page.php
  • 342× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/ScanSensitiveList.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-captcha/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Captcha/V20190722/Models/DescribeCaptchaUserAllAppIdRequest.php:25
    • > 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-captcha/common/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-captcha/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Captcha/V20190722/Models/CaptchaQueryData.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Monitor.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/tencentcloud-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/vendor/GuzzleHttp/Psr7/LazyOpenStream.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-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Redis.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-captcha/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Captcha/V20190722/Models/DescribeCaptchaDataResponse.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/PlanInfo.php:56
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-captcha/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Tbaas.php on line 2

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: tencent, tencentcloud, captcha, qcloud

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

The principal PHP file in "腾讯云验证码 (CAPTCHA)" v. 1.0.2 is loaded by WordPress automatically on each request
63 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
No dangerous file extensions were detected29,879 lines of code in 340 files:
LanguageFilesBlank linesComment linesLines of code
PHP2994,42613,53723,291
Markdown171,53804,980
JSON18001,389
JavaScript21559192
Dockerfile18010
make1409
CSS20118

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity12.12
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces20
Interfaces43
Traits6
Classes334
▷ Abstract classes61.80%
▷ Concrete classes32898.20%
▷ Final classes278.23%
Methods2,289
▷ Static methods30213.19%
▷ Public methods1,90483.18%
▷ Protected methods170.74%
▷ Private methods36816.08%
Functions477
▷ Named functions21344.65%
▷ Anonymous functions26455.35%
Constants285
▷ Global constants6221.75%
▷ Class constants22378.25%
▷ Public constants223100.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