77% wp-s3-smart-upload

Code Review | SSU - WordPress Amazon S3 & Wasabi Smart File Uploads Plugin

WordPress plugin SSU - WordPress Amazon S3 & Wasabi Smart File Uploads Plugin scored77%from 54 tests.

About plugin

  • Plugin page: wp-s3-smart-upload
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2020
  • Latest release: Oct 22, 2022
  • Number of updates: 18
  • Update frequency: every 55.1 days
  • Top authors: gaupoit (88.89%)profaceoff (16.67%)

Code review

54 tests

User reviews

8 reviews

Install metrics

500+ active /8,415 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼14.04ms] Passed 4 tests

Server-side resources used by SSU - WordPress Amazon S3 & Wasabi Smart File Uploads Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3545.80 ▼2.49
Dashboard /wp-admin3.66 ▲0.3550.78 ▼12.94
Posts /wp-admin/edit.php3.71 ▲0.3548.07 ▼25.68
Add New Post /wp-admin/post-new.php6.19 ▲0.3099.44 ▼15.03
Media Library /wp-admin/upload.php3.52 ▲0.2937.31 ▲1.56
S3 Smart Upload /wp-admin/upload.php?page=s3-smart-upload-settings3.4929.56

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

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Total filesystem usage should be limited to 25MB (currently using 25.52MB)
Filesystem: 1,171 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

SSU - WordPress Amazon S3 & Wasabi Smart File Uploads Plugin: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.72 ▲0.371.90 ▲0.2740.36 ▼1.71
Dashboard /wp-admin2,202 ▲405.61 ▼0.0898.65 ▼97.2238.27 ▼72.52
Posts /wp-admin/edit.php2,104 ▲12.01 ▲0.0335.50 ▼18.2034.68 ▼20.85
Add New Post /wp-admin/post-new.php1,540 ▼018.33 ▼2.58632.67 ▼149.5765.97 ▲3.65
Media Library /wp-admin/upload.php1,401 ▲14.21 ▲0.10109.09 ▼13.4544.70 ▼11.09
S3 Smart Upload /wp-admin/upload.php?page=s3-smart-upload-settings8598.55176.4924.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-s3-smart-upload/admin/partials/s3-smart-upload-admin-display.php
    • > /wp-content/plugins/wp-s3-smart-upload/public/partials/s3-smart-upload-public-display.php
  • 175× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Trait 'BWPS\\SSU\\Aws3\\Aws\\Crypto\\Polyfill\eedsTrait' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Crypto/Polyfill/AesGcm.php on line 20
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\S3\\RegionalEndpoint\\ConfigurationInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/S3/RegionalEndpoint/Configuration.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\Crypto\\MaterialsProviderInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Crypto/MaterialsProvider.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\MonitoringEventsInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Exception/AwsException.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'BWPS\\SSU\\Aws3\\Aws\\Arn\\Arn' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Arn/S3/OutpostsBucketArn.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\MonitoringEventsInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Retry/Exception/ConfigurationException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\MonitoringEventsInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Exception/InvalidRegionException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BWPS\\SSU\\Aws3\\Aws\\Crypto\\MaterialsProviderV2' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/Crypto/KmsMaterialsProviderV2.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/HashingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'BWPS\\SSU\\Aws3\\Aws\\AwsClientInterface' not found in wp-content/plugins/wp-s3-smart-upload/lib/aws3/Aws/MultiRegionClient.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% 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
These attributes need to be fixed:
  • Screenshots: Screenshot #7 (Upload files on the front-end) image not found
You can take inspiration from this readme.txt

wp-s3-smart-upload/s3-smart-upload.php 77% from 13 tests

This is the main PHP file of "SSU - WordPress Amazon S3 & Wasabi Smart File Uploads Plugin" version 1.5.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-s3-smart-upload.php" instead of "s3-smart-upload.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected35,159 lines of code in 1,147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,1292,06518,13128,056
Markdown62,51806,734
JavaScript724241256
JSON20097
XML10014
CSS21122

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.05
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces46
Interfaces43
Traits23
Classes297
▷ Abstract classes144.71%
▷ Concrete classes28395.29%
▷ Final classes258.83%
Methods2,362
▷ Static methods40217.02%
▷ Public methods1,63669.26%
▷ Protected methods1325.59%
▷ Private methods59425.15%
Functions451
▷ Named functions10723.73%
▷ Anonymous functions34476.27%
Constants308
▷ Global constants4213.64%
▷ Class constants26686.36%
▷ Public constants266100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.52MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wp-assets/screenshot-1.png73.08KB20.19KB▼ 72.38%
wp-assets/screenshot-4.png59.77KB20.78KB▼ 65.23%
wp-assets/icon-128x128.png51.93KB19.99KB▼ 61.50%
wp-assets/banner-772x250.png127.07KB48.44KB▼ 61.88%
wp-assets/screenshot-6.png34.28KB10.51KB▼ 69.35%