84% oss-upload

Code Review | OSS Upload

WordPress plugin OSS Upload scored84%from 54 tests.

About plugin

  • Plugin page: oss-upload
  • Plugin version: 4.8.9
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 19, 2016
  • Latest release: Mar 3, 2020
  • Number of updates: 102
  • Update frequency: every 11.4 days
  • Top authors: playes (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

900+ active /25,279 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼2.30ms] Passed 4 tests

Analyzing server-side resources used by OSS Upload
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2749.34 ▼1.01
Dashboard /wp-admin3.57 ▲0.2746.66 ▲1.73
Posts /wp-admin/edit.php3.68 ▲0.3344.84 ▼1.57
Add New Post /wp-admin/post-new.php6.15 ▲0.2790.46 ▼6.76
Media Library /wp-admin/upload.php3.50 ▲0.2734.74 ▲0.14
OSS Upload /wp-admin/options-general.php?page=oss-upload3.4632.74

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

OSS Upload: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.58 ▼0.851.85 ▼0.1044.44 ▲4.65
Dashboard /wp-admin2,213 ▲284.89 ▼0.99102.07 ▲0.4739.88 ▼5.83
Posts /wp-admin/edit.php2,093 ▲72.04 ▲0.0338.86 ▼0.8834.69 ▼3.45
Add New Post /wp-admin/post-new.php1,536 ▲16323.22 ▲6.45623.31 ▲117.9159.84 ▲13.50
Media Library /wp-admin/upload.php1,389 ▲14.25 ▲0.03104.79 ▲5.1145.09 ▲0.74
OSS Upload /wp-admin/options-general.php?page=oss-upload1,4941.9528.4434.87

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/oss-upload/oss-upload.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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 need to be fixed:
  • Screenshots: Screenshot #1 (Settings) image required
The official readme.txt is a good inspiration

oss-upload/oss-upload.php Passed 13 tests

The main PHP script in "OSS Upload" version 4.8.9 is automatically included on every request by WordPress
95 characters long description:
Upload with Aliyun OSS, with modified OSS Wrapper and fully native image edit function support.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin5,721 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP84351,2743,496
Markdown357701,609
PO File2212245488
JavaScript12326128

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity49.67
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods153
▷ Static methods2616.99%
▷ Public methods14192.16%
▷ Protected methods00.00%
▷ Private methods127.84%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
Constants161
▷ Global constants7043.48%
▷ Class constants9156.52%
▷ Public constants91100.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
2 PNG files occupy 1.42MB with 0.89MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png709.72KB263.68KB▼ 62.85%
screenshot-1.png739.34KB274.55KB▼ 62.87%