58% upcasted-s3-offload

Code Review | Upcasted S3 Offload - AWS S3, Digital Ocean Spaces, Backblaze, Minio and more

WordPress plugin Upcasted S3 Offload - AWS S3, Digital Ocean Spaces, Backblaze, Minio and more scored58%from 54 tests.

About plugin

  • Plugin page: upcasted-s3-offload
  • Plugin version: 3.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9.2
  • WordPress version: 6.3.1
  • First release: Jun 27, 2020
  • Latest release: Apr 4, 2022
  • Number of updates: 40
  • Update frequency: every 16.2 days
  • Top authors: upcasted (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /5,275 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.50MB] [CPU: ▼4.31ms] Passed 4 tests

A check of server-side resources used by Upcasted S3 Offload - AWS S3, Digital Ocean Spaces, Backblaze, Minio and more
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5240.69 ▼3.84
Dashboard /wp-admin3.82 ▲0.4861.61 ▼5.78
Posts /wp-admin/edit.php3.87 ▲0.5254.55 ▼0.53
Add New Post /wp-admin/post-new.php6.36 ▲0.4793.21 ▼7.10
Media Library /wp-admin/upload.php3.75 ▲0.5251.59 ▲14.91
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius3.9236.90
S3 Offload Settings /wp-admin/upload.php?page=upcasted-s3-offload-panel3.9634.92

Server storage [IO: ▲38.53MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Filesystem usage must be lower than 25MB (currently using 38.53MB)
Filesystem: 3,602 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
fs_debug_mode
fs_accounts
can_compress_scripts
widget_recent-comments
fs_active_plugins
fs_gdpr
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Upcasted S3 Offload - AWS S3, Digital Ocean Spaces, Backblaze, Minio and more: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.20 ▼1.111.70 ▼0.4731.92 ▼10.48
Dashboard /wp-admin2,235 ▲475.88 ▲0.10108.87 ▲2.4044.67 ▲2.57
Posts /wp-admin/edit.php2,124 ▲352.05 ▼0.0241.61 ▲0.6738.31 ▲1.64
Add New Post /wp-admin/post-new.php1,532 ▼1023.45 ▲5.16663.92 ▲26.0852.19 ▲2.60
Media Library /wp-admin/upload.php1,420 ▲324.16 ▼0.05112.57 ▲10.1749.56 ▲5.54
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0671.8025.4328.73
S3 Offload Settings /wp-admin/upload.php?page=upcasted-s3-offload-panel9921.7127.4555.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/upcasted-s3-offload/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 10 options
    • fs_gdpr
    • widget_recent-comments
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • fs_accounts
    • theysaidso_admin_options
    • can_compress_scripts
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/upcasted-s3-offload/vendor/bin/jp.php
    • > /wp-content/plugins/upcasted-s3-offload/vendor/mtdowling/jmespath.php/bin/jp.php
  • 2052× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-sdk-php/src/SnowDeviceManagement/SnowDeviceManagementClient.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/upcasted-s3-offload/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Common\\Enum' not found in wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-sdk-php/src/Aws/Ec2/Enum/DiskImageFormat.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\ElastiCache\\Exception\\ElastiCacheException' not found in wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-sdk-php/src/Aws/ElastiCache/Exception/InsufficientCacheClusterCapacityException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/upcasted-s3-offload/vendor/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Route53\\Exception\\Route53Exception' not found in wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-sdk-php/src/Aws/Route53/Exception/InvalidChangeBatchException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/upcasted-s3-offload/vendor/symfony/event-dispatcher/Tests/EventTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/upcasted-s3-offload/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-sdk-php/src/MediaStoreData/Exception/MediaStoreDataException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/upcasted-s3-offload/vendor/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/CachePluginTest.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% 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
5 plugin tags: minio, amazon s3, aws s3, digital ocean spaces, s3

upcasted-s3-offload/upcasted-s3-offload.php 92% from 13 tests

"Upcasted S3 Offload - AWS S3, Digital Ocean Spaces, Backblaze, Minio and more" version 3.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Plugin Name: A shorter plugin name is better (currently 77 characters long instead of max. 70)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/upcasted-s3-offload/vendor/aws/aws-crt-php/run_tests.bat
326,887 lines of code in 3,519 files:
LanguageFilesBlank linesComment linesLines of code
PHP3,34826,24097,704314,455
Markdown291,49704,918
JSON502102,293
reStructuredText311,2711,8231,883
C1025089882
JavaScript67097491
C/C++ Header210538441
CSS14592420
YAML85157270
XML52911238
Bourne Shell3194176
make2285133
HTML216095
GLSL117055
Python1222349
Ant110134
m414422
Pascal151514
Bourne Again Shell15013
INI2003
DOS Batch1202

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.73
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces784
Interfaces131
Traits25
Classes2,299
▷ Abstract classes572.48%
▷ Concrete classes2,24297.52%
▷ Final classes452.01%
Methods7,949
▷ Static methods98412.38%
▷ Public methods6,40980.63%
▷ Protected methods5046.34%
▷ Private methods1,03613.03%
Functions849
▷ Named functions30335.69%
▷ Anonymous functions54664.31%
Constants1,474
▷ Global constants1177.94%
▷ Class constants1,35792.06%
▷ Public constants1,357100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.27MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/guzzle/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
vendor/guzzle/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
admin/assets/img/logo-upcasted.png11.93KB4.87KB▼ 59.22%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%