83% uss-upyun

Code Review | USS Upyun

WordPress plugin USS Upyun scored83%from 54 tests.

About plugin

  • Plugin page: uss-upyun
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 28, 2020
  • Latest release: Jul 30, 2023
  • Number of updates: 34
  • Update frequency: every 35.9 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,793 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.31MB] [CPU: ▼5.47ms] Passed 4 tests

An overview of server-side resources used by USS Upyun
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3536.70 ▲0.20
Dashboard /wp-admin3.64 ▲0.3447.35 ▲2.02
Posts /wp-admin/edit.php3.69 ▲0.3448.17 ▲0.07
Add New Post /wp-admin/post-new.php6.16 ▲0.2882.83 ▼23.06
Media Library /wp-admin/upload.php3.50 ▲0.2835.48 ▲0.91
又拍云USS设置 /wp-admin/options-general.php?page=uss-upyun/upyun-uss-wordpress.php3.4731.28

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 205 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
uss_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by USS Upyun
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.18 ▼1.214.75 ▲3.0540.85 ▼5.49
Dashboard /wp-admin2,204 ▲125.80 ▲0.8396.59 ▼11.5942.12 ▲0.60
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0040.84 ▲0.5840.59 ▲5.39
Add New Post /wp-admin/post-new.php1,540 ▼223.13 ▲4.91663.79 ▲54.5168.22 ▲0.34
Media Library /wp-admin/upload.php1,386 ▼54.22 ▲0.0498.32 ▲2.5143.48 ▲3.24
又拍云USS设置 /wp-admin/options-general.php?page=uss-upyun/upyun-uss-wordpress.php1,2252.0324.7298.48

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 57× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/uss-upyun/upyun-uss-wordpress.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Cannot declare class Error, because the name is already in use in wp-content/plugins/uss-upyun/sdk/vendor/symfony/polyfill-php70/Resources/stubs/Error.php on line 3
    • > PHP Warning
      require_once(lib/byte_safe_strings.php): failed to open stream: No such file or directory in wp-content/plugins/uss-upyun/sdk/vendor/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/psr7/src/UploadedFile.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/uss-upyun/sdk/vendor/guzzlehttp/promises/src/RejectedPromise.php:11

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)
No browser errors were detected

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (screenshot-1.png), #2 (screenshot-2.png)
You can take inspiration from this readme.txt

uss-upyun/upyun-uss-wordpress.php 92% from 13 tests

Analyzing the main PHP file in "USS Upyun" version 1.3.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("uss-upyun.php" instead of "upyun-uss-wordpress.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin33,930 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
PHP1532,5116,81528,898
Markdown171,22603,617
JSON13001,383
XML10019
Dockerfile18010
Bourne Shell1203

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity15.58
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces16
Interfaces16
Traits2
Classes100
▷ Abstract classes00.00%
▷ Concrete classes100100.00%
▷ Final classes2525.00%
Methods805
▷ Static methods17621.86%
▷ Public methods66081.99%
▷ Protected methods40.50%
▷ Private methods14117.52%
Functions185
▷ Named functions9249.73%
▷ Anonymous functions9350.27%
Constants172
▷ Global constants4425.58%
▷ Class constants12874.42%
▷ Public constants128100.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.41MB with 0.28MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png61.75KB19.51KB▼ 68.41%
screenshot-1.png353.28KB110.10KB▼ 68.84%