83% oss-aliyun

Code Review | OSS Aliyun

WordPress plugin OSS Aliyun scored83%from 54 tests.

About plugin

  • Plugin page: oss-aliyun
  • Plugin version: 1.4.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 31, 2020
  • Latest release: Oct 19, 2023
  • Number of updates: 48
  • Update frequency: every 27.0 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /14,579 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.35ms] Passed 4 tests

An overview of server-side resources used by OSS Aliyun
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.20 ▲3.48
Dashboard /wp-admin3.32 ▲0.0246.57 ▼0.70
Posts /wp-admin/edit.php3.37 ▲0.0242.66 ▲0.57
Add New Post /wp-admin/post-new.php5.90 ▲0.0278.56 ▼6.56
Media Library /wp-admin/upload.php3.24 ▲0.0238.23 ▲1.29
阿里云 OSS /wp-admin/options-general.php?page=oss-aliyun/aliyun-oss-wordpress.php3.2127.13

Server storage [IO: ▲2.23MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 361 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
oss_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for OSS Aliyun
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.271.85 ▲0.2143.73 ▲1.22
Dashboard /wp-admin2,193 ▲135.63 ▼0.0493.63 ▲7.7345.03 ▲5.32
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0135.19 ▲2.7837.10 ▼2.99
Add New Post /wp-admin/post-new.php1,529 ▼823.55 ▲5.02626.75 ▼24.5950.93 ▼17.79
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.0994.21 ▼12.1347.71 ▲0.83
阿里云 OSS /wp-admin/options-general.php?page=oss-aliyun/aliyun-oss-wordpress.php1,4332.0024.45159.65

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 143× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(wp-content/plugins/oss-aliyun/sdk/vendor/aliyuncs/oss-sdk-php/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/oss-aliyun/sdk/vendor/aliyuncs/oss-sdk-php/index.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/oss-aliyun/sdk/vendor/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/oss-aliyun/sdk/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AlibabaCloud\\Credentials\\Providers\\Provider' not found in wp-content/plugins/oss-aliyun/sdk/vendor/alibabacloud/credentials/src/Providers/RamRoleArnProvider.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/oss-aliyun/sdk/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'AlibabaCloud\\Credentials\\Request\\Request' not found in wp-content/plugins/oss-aliyun/sdk/vendor/alibabacloud/credentials/src/Request/GenerateSessionAccessKey.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/oss-aliyun/sdk/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetBucketStatResult.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'OSS\\Model\\XmlConfig' not found in wp-content/plugins/oss-aliyun/sdk/vendor/aliyuncs/oss-sdk-php/src/OSS/Model/RequestPaymentConfig.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/oss-aliyun/sdk/vendor/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/oss-aliyun/sdk/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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (设置页面), #2 (数据库同步)
Please take inspiration from this readme.txt

oss-aliyun/aliyun-oss-wordpress.php 85% from 13 tests

This is the main PHP file of "OSS Aliyun" version 1.4.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oss-aliyun.php" instead of "aliyun-oss-wordpress.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin43,757 lines of code in 340 files:
LanguageFilesBlank linesComment linesLines of code
PHP2824,12911,55537,394
Markdown301,59104,428
JSON16001,769
YAML7203111
XML21037
Dockerfile18010
Bourne Shell2648

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.79
▷ Minimum class complexity1.00
▷ Maximum class complexity242.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces28
Interfaces20
Traits3
Classes221
▷ Abstract classes31.36%
▷ Concrete classes21898.64%
▷ Final classes2511.47%
Methods1,579
▷ Static methods26116.53%
▷ Public methods1,33184.29%
▷ Protected methods633.99%
▷ Private methods18511.72%
Functions196
▷ Named functions9950.51%
▷ Anonymous functions9749.49%
Constants307
▷ Global constants4414.33%
▷ Class constants26385.67%
▷ Public constants263100.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
2 PNG files occupy 0.44MB with 0.30MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png385.12KB116.21KB▼ 69.82%
screenshot-2.png61.75KB19.51KB▼ 68.41%