68% tencentcloud-sms

Code Review | 腾讯云短信(SMS)

WordPress plugin 腾讯云短信(SMS) scored 68% from 54 tests.

About plugin

  • Plugin page: tencentcloud-sms
  • 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 21, 2020
  • Latest release: Dec 8, 2020
  • Number of updates: 7
  • Update frequency: every 20.7 days
  • Top authors: chahuang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active / 5,044 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.24MB] [CPU: ▼326.87ms] Passed 4 tests

Server-side resources used by 腾讯云短信(SMS)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.6760.09 ▲7.19
Dashboard /wp-admin4.11 ▲0.7040.36 ▲7.13
Posts /wp-admin/edit.php4.33 ▲0.6940.80 ▲3.05
Add New Post /wp-admin/post-new.php3.97 ▼3.0333.74 ▼1,322.14
Media Library /wp-admin/upload.php3.99 ▲0.7029.86 ▲4.49
短信 /wp-admin/admin.php?page=TencentWordpressSMSSettingPage3.9925.41
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage3.9727.38

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for 腾讯云短信(SMS)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,968 ▲21416.86 ▲1.188.49 ▲1.452.18 ▼0.20
Dashboard /wp-admin2,932 ▲746.14 ▼0.06119.98 ▼14.70167.67 ▲8.12
Posts /wp-admin/edit.php2,728 ▲373.27 ▲0.0464.21 ▲3.34145.52 ▲6.51
Add New Post /wp-admin/post-new.php34 ▼1,7180.94 ▼20.200.04 ▼444.5343.31 ▼111.87
Media Library /wp-admin/upload.php1,735 ▲375.63 ▲0.12142.70 ▲5.17205.93 ▲25.29
短信 /wp-admin/admin.php?page=TencentWordpressSMSSettingPage1,5852.7159.71219.57
腾讯云设置 /wp-admin/admin.php?page=TencentWordpressPluginsCommonSettingPage1,3342.7257.07147.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_tencent_wordpress_options
  • This plugin does not fully uninstall, leaving 1 option in the database
    • 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
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tencentcloud-sms/common/tencent-wordpress-plugins-setting-page.php
  • 364× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-sms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/VulInfo.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/tencentcloud-sms/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/tencentcloud-sms/common/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/tencentcloud-sms/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'QCLOUDAPI_ROOT_PATH/Module/Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/tencentcloud-sms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Eip.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tencentcloud-sms/tencentcloud-sms.php:30
    • > PHP Warning
      require_once(QCLOUDAPI_ROOT_PATH/Module/Base.php): failed to open stream: No such file or directory in wp-content/plugins/tencentcloud-sms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Bill.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-sms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/QcloudApi/Module/Cns.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/tencentcloud-sms/common/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Ms/V20180408/Models/AppScanSet.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/tencentcloud-sms/common/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can take inspiration from this readme.txt

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

The main PHP script in "腾讯云短信(SMS)" version 1.0.2 is automatically included on every request by WordPress
113 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 detected28,944 lines of code in 354 files:
LanguageFilesBlank linesComment linesLines of code
PHP3234,62614,81724,061
Markdown991703,106
JSON17001,391
JavaScript31680376
make1409
CSS10111

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity11.79
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces21
Interfaces43
Traits6
Classes359
▷ Abstract classes61.67%
▷ Concrete classes35398.33%
▷ Final classes277.65%
Methods2,373
▷ Static methods30012.64%
▷ Public methods1,98983.82%
▷ Protected methods170.72%
▷ Private methods36715.47%
Functions478
▷ Named functions21444.77%
▷ Anonymous functions26455.23%
Constants279
▷ Global constants6021.51%
▷ Class constants21978.49%
▷ Public constants219100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin