83% sync-qcloud-cos

Code Review | Sync QCloud COS

WordPress plugin Sync QCloud COS scored83%from 54 tests.

About plugin

  • Plugin page: sync-qcloud-cos
  • Plugin version: 2.3.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.4
  • WordPress version: 6.3.1
  • First release: Jan 16, 2020
  • Latest release: Nov 24, 2023
  • Number of updates: 121
  • Update frequency: every 11.6 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /11,975 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.86MB] [CPU: ▲2.06ms] 75% from 4 tests

Analyzing server-side resources used by Sync QCloud COS
Please have a look at the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 9,727.45ms on /wp-admin/admin.php?page=sync-qcloud-cos-metric)
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5240.77 ▲3.64
Dashboard /wp-admin4.32 ▲1.0155.45 ▲4.93
Posts /wp-admin/edit.php4.37 ▲1.0152.48 ▲6.46
Add New Post /wp-admin/post-new.php6.84 ▲0.9588.60 ▼5.65
Media Library /wp-admin/upload.php4.18 ▲0.9539.28 ▲5.31
联系作者 /wp-admin/admin.php?page=sync-qcloud-cos-contact4.1434.37
数据监控 /wp-admin/admin.php?page=sync-qcloud-cos-metric5.419,727.45
配置 /wp-admin/admin.php?page=sync-qcloud-cos-config4.1435.25
数据迁移 /wp-admin/admin.php?page=sync-qcloud-cos-sync4.1434.57
腾讯云 COS /wp-admin/admin.php?page=sync-qcloud-cos4.1434.13
腾讯云 COS /wp-admin/options-general.php?page=sync-qcloud-cos/sync-qcloud-cos.php4.1535.58
文档处理 /wp-admin/admin.php?page=sync-qcloud-cos-document4.1434.16
文本审核 /wp-admin/admin.php?page=sync-qcloud-cos-text4.1431.85
图片极智压缩 /wp-admin/admin.php?page=sync-qcloud-cos-slim4.1435.37

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 297 new files
Database: no new tables, 7 new options
New WordPress options
cos_options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Sync QCloud COS
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8314.29 ▼0.061.57 ▼0.0835.74 ▼8.21
Dashboard /wp-admin2,253 ▲755.63 ▼0.0597.72 ▼11.3351.41 ▲8.94
Posts /wp-admin/edit.php2,152 ▲552.00 ▲0.0639.08 ▲0.4246.81 ▲13.52
Add New Post /wp-admin/post-new.php1,569 ▲4323.69 ▲0.31677.97 ▲46.2351.73 ▼10.47
Media Library /wp-admin/upload.php1,452 ▲554.17 ▼0.0999.91 ▲0.1150.45 ▲6.63
联系作者 /wp-admin/admin.php?page=sync-qcloud-cos-contact9592.0028.0991.78
数据监控 /wp-admin/admin.php?page=sync-qcloud-cos-metric1,6584.22116.2799.25
配置 /wp-admin/admin.php?page=sync-qcloud-cos-config1,3992.0023.06102.87
数据迁移 /wp-admin/admin.php?page=sync-qcloud-cos-sync1,0342.0022.5276.35
腾讯云 COS /wp-admin/admin.php?page=sync-qcloud-cos1,4021.9725.3086.29
腾讯云 COS /wp-admin/options-general.php?page=sync-qcloud-cos/sync-qcloud-cos.php1,3992.0023.2194.41
文档处理 /wp-admin/admin.php?page=sync-qcloud-cos-document9702.1324.9661.48
文本审核 /wp-admin/admin.php?page=sync-qcloud-cos-text1,0362.1424.8165.51
图片极智压缩 /wp-admin/admin.php?page=sync-qcloud-cos-slim1,0452.1323.8773.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 103× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Qcloud\\Cos\\ImageParamTemplate\\ImageTemplate' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/qcloud/cos-sdk-v5/src/ImageParamTemplate/ImageQrcodeTemplate.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\RequestLocation\\AbstractLocation' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/guzzle-services/src/RequestLocation/FormParamLocation.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\Serializer' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/qcloud/cos-sdk-v5/src/Serializer.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Command\\Guzzle\\ResponseLocation\\ResponseLocationInterface' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/AbstractLocation.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/psr/http-message/src/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\ResponseLocation\\AbstractLocation' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/BodyLocation.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Exception\\CommandException' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/command/src/Exception/CommandServerException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\RequestLocation\\AbstractLocation' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/guzzle-services/src/RequestLocation/MultiPartLocation.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\ResponseLocation\\AbstractLocation' not found in wp-content/plugins/sync-qcloud-cos/cos-sdk-v5/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/JsonLocation.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: tencent, qcloud, cos

sync-qcloud-cos/sync-qcloud-cos.php 92% from 13 tests

Analyzing the main PHP file in "Sync QCloud COS" version 2.3.6
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis 97% from 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 plugin68,103 lines of code in 275 files:
LanguageFilesBlank linesComment linesLines of code
PHP2343,97310,05461,604
Markdown211,67304,684
JSON17001,776
XML10019
Dockerfile18010
make15010

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity13.49
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces34
Interfaces24
Traits3
Classes175
▷ Abstract classes42.29%
▷ Concrete classes17197.71%
▷ Final classes2514.62%
Methods1,654
▷ Static methods49129.69%
▷ Public methods1,43686.82%
▷ Protected methods321.93%
▷ Private methods18611.25%
Functions243
▷ Named functions12651.85%
▷ Anonymous functions11748.15%
Constants202
▷ Global constants4823.76%
▷ Class constants15476.24%
▷ Public constants154100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin