83% wpufile-ucloud

Code Review | 优刻得UCloud对象存储插件

WordPress plugin 优刻得UCloud对象存储插件 scored83%from 54 tests.

About plugin

  • Plugin page: wpufile-ucloud
  • Plugin version: 2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 22, 2020
  • Latest release: May 13, 2023
  • Number of updates: 8
  • Update frequency: every 147.1 days
  • Top authors: laobuluo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /926 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by 优刻得UCloud对象存储插件
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2738.47 ▼1.12
Dashboard /wp-admin3.56 ▲0.2545.34 ▲0.29
Posts /wp-admin/edit.php3.67 ▲0.3250.46 ▲4.82
Add New Post /wp-admin/post-new.php6.14 ▲0.2592.77 ▲3.27
Media Library /wp-admin/upload.php3.48 ▲0.2535.95 ▼0.08
UCloud云存储设置 /wp-admin/options-general.php?page=wpufile-ucloud/index.php3.4935.95

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
WPUFile_options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

优刻得UCloud对象存储插件: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.56 ▼0.821.70 ▼0.1844.03 ▼2.21
Dashboard /wp-admin2,207 ▲195.83 ▲0.9594.91 ▼4.1743.12 ▼0.16
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0538.38 ▲3.2839.81 ▲3.38
Add New Post /wp-admin/post-new.php1,550 ▲1718.46 ▼4.92664.12 ▼22.1273.43 ▲19.48
Media Library /wp-admin/upload.php1,392 ▲104.21 ▼0.0591.91 ▼6.2243.95 ▼1.15
UCloud云存储设置 /wp-admin/options-general.php?page=wpufile-ucloud/index.php1,2421.8835.69117.14

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

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
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wpufile-ucloud/setting.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: wordpress ucloud, wordpress, ufile

wpufile-ucloud/index.php 85% from 13 tests

The primary PHP file in "优刻得UCloud对象存储插件" version 2.6 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpufile-ucloud.php" instead of "index.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 153 characters long)

Code Analysis Passed 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 plugin2,022 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP102091261,784
SVG13563195
Markdown25028
JavaScript6059
CSS6046

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.89
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods37
▷ Static methods00.00%
▷ Public methods3081.08%
▷ Protected methods00.00%
▷ Private methods718.92%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants15
▷ Global constants426.67%
▷ Class constants1173.33%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.53MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/css/modules/layer/default/icon.png11.22KB4.36KB▼ 61.19%
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
layui/images/footer_logo.png24.87KB0.95KB▼ 96.18%
screenshot-1.png407.07KB60.80KB▼ 85.06%
layui/images/logo.png24.44KB0.95KB▼ 96.10%