78% wposs

Code Review | WPOSS阿里云对象存储

WordPress plugin WPOSS阿里云对象存储 scored78%from 54 tests.

About plugin

  • Plugin page: wposs
  • Plugin version: 4.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 6, 2019
  • Latest release: May 13, 2023
  • Number of updates: 31
  • Update frequency: every 48.3 days
  • Top authors: laobuluo (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /17,831 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.55MB] [CPU: ▼1.41ms] Passed 4 tests

Server-side resources used by WPOSS阿里云对象存储
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5842.52 ▼4.49
Dashboard /wp-admin3.88 ▲0.5750.20 ▼4.83
Posts /wp-admin/edit.php3.93 ▲0.5756.39 ▲5.81
Add New Post /wp-admin/post-new.php6.40 ▲0.51101.85 ▼2.13
Media Library /wp-admin/upload.php3.79 ▲0.5643.26 ▲6.61
WPOSS设置 /wp-admin/options-general.php?page=wposs/index.php3.7539.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 177 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
wposs_options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WPOSS阿里云对象存储
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.72 ▲0.561.69 ▼0.3743.12 ▼1.83
Dashboard /wp-admin2,199 ▲225.63 ▼0.02102.77 ▲6.9749.92 ▲4.17
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0341.66 ▲3.9644.97 ▲7.04
Add New Post /wp-admin/post-new.php1,529 ▲123.18 ▲0.18654.57 ▼15.5452.21 ▼2.65
Media Library /wp-admin/upload.php1,407 ▲74.18 ▲0.01106.03 ▲4.2250.29 ▲3.58
WPOSS设置 /wp-admin/options-general.php?page=wposs/index.php1,3061.8138.63124.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 14× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/BucketLifecycle.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/RunAll.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/Callback.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/BucketCors.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/LiveChannel.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/Bucket.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/BucketReferer.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/Object.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/Image.php
    • > /wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/samples/Signature.php
  • 96× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/tests/OSS/Tests/CorsConfigTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/tests/OSS/Tests/MimeTypesTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Result/SymlinkResult.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Result/GetLocationResult.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'OSS\\Model\\XmlConfig' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Model/RefererConfig.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/tests/OSS/Tests/BucketInfoTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/tests/OSS/Tests/TestOssClientBase.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Result/DeleteObjectsResult.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'OSS\\Result\\Result' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Result/GetStorageCapacityResult.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'OSS\\Model\\XmlConfig' not found in wp-content/plugins/wposs/sdk/aliyun-oss-php-sdk/src/OSS/Model/LifecycleConfig.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: wordpress oss, oss

wposs/index.php 85% from 13 tests

The main PHP script in "WPOSS阿里云对象存储" version 4.9 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 189 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wposs.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin11,398 lines of code in 158 files:
LanguageFilesBlank linesComment linesLines of code
PHP1361,7693,30010,842
Markdown41360276
SVG13563195
JSON10024
YAML20023
XML11018
JavaScript6059
CSS6046
Bourne Shell1445

PHP code Passed 2 tests

A brief analysis 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.19
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes118
▷ Abstract classes10.85%
▷ Concrete classes11799.15%
▷ Final classes10.85%
Methods641
▷ Static methods324.99%
▷ Public methods55286.12%
▷ Protected methods375.77%
▷ Private methods528.11%
Functions46
▷ Named functions4597.83%
▷ Anonymous functions12.17%
Constants135
▷ Global constants00.00%
▷ Class constants135100.00%
▷ Public constants135100.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
5 PNG files occupy 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/images/logo.png24.44KB0.95KB▼ 96.10%
layui/images/qrcode.png72.54KB12.37KB▼ 82.94%
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
layui/images/footer_logo.png24.87KB0.95KB▼ 96.18%
layui/css/modules/layer/default/icon.png11.22KB4.36KB▼ 61.19%