74% s3-image-optimizer

Code Review | S3 Image Optimizer

WordPress plugin S3 Image Optimizer scored74%from 54 tests.

About plugin

  • Plugin page: s3-image-optimizer
  • Plugin version: 2.5.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.3
  • WordPress version: 6.3.1
  • First release: Jun 17, 2021
  • Latest release: Sep 20, 2023
  • Number of updates: 10
  • Update frequency: every 82.5 days
  • Top authors: nosilver4u (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /13,201 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.60MB] [CPU: ▼1.22ms] Passed 4 tests

Analyzing server-side resources used by S3 Image Optimizer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6443.13 ▲6.51
Dashboard /wp-admin3.95 ▲0.6158.06 ▼6.13
Posts /wp-admin/edit.php4.00 ▲0.6451.58 ▲5.55
Add New Post /wp-admin/post-new.php6.47 ▲0.5886.24 ▼10.79
Media Library /wp-admin/upload.php3.81 ▲0.5838.91 ▲8.12

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 562 new files
Database: 1 new table, 7 new options
New tables
wp_s3io_images
New WordPress options
can_compress_scripts
db_upgraded
s3io_version
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for S3 Image Optimizer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1814.36 ▲0.001.78 ▲0.0445.82 ▲3.72
Dashboard /wp-admin2,213 ▲495.62 ▲0.0292.31 ▼3.8044.15 ▼1.43
Posts /wp-admin/edit.php2,113 ▲132.03 ▲0.0134.43 ▼3.2334.52 ▼3.66
Add New Post /wp-admin/post-new.php1,541 ▲1523.08 ▼0.37647.82 ▼55.4358.05 ▲1.08
Media Library /wp-admin/upload.php1,409 ▲64.20 ▲0.0297.39 ▼2.5444.25 ▲0.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_s3io_images
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • s3io_version
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 198× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Crypto/AesStreamInterface.php:6
    • > PHP Fatal error
      Trait 'S3IO\\Aws3\\Aws\\Token\\ParsesIniTrait' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Token/TokenProvider.php on line 29
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\Aws\\MonitoringEventsInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Exception/AwsException.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/GuzzleHttp/Psr7/BufferStream.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\Aws\\Endpoint\\UseFipsEndpoint\\ConfigurationInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Endpoint/UseFipsEndpoint/Configuration.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'S3IO\\Aws3\\Aws\\Arn\\AccessPointArn' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Arn/S3/AccessPointArn.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\Aws\\CommandInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Command.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'S3IO\\Aws3\\Aws\\Api\\ErrorParser\\AbstractErrorParser' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/Api/ErrorParser/JsonRpcErrorParser.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'S3IO\\Aws3\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/GuzzleHttp/Promise/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'S3IO\\Aws3\\Aws\\ClientSideMonitoring\\AbstractMonitoringMiddleware' not found in wp-content/plugins/s3-image-optimizer/vendor/Aws3/Aws/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: s3, optimize, optimization, picture, amazon...

s3-image-optimizer/s3-image-optimizer.php Passed 13 tests

The main file in "S3 Image Optimizer" v. 2.5.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
118 characters long description:
Reduce file sizes for images in S3 buckets using lossless and lossy optimization methods via the EWWW Image Optimizer.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected39,664 lines of code in 505 files:
LanguageFilesBlank linesComment linesLines of code
PHP4991,10317,63229,216
Markdown23,43209,603
JavaScript105411
CSS11620374
XML18138
YAML18022

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.73
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces60
Interfaces52
Traits29
Classes336
▷ Abstract classes154.46%
▷ Concrete classes32195.54%
▷ Final classes329.97%
Methods2,562
▷ Static methods47818.66%
▷ Public methods1,75368.42%
▷ Protected methods1295.04%
▷ Private methods68026.54%
Functions474
▷ Named functions12025.32%
▷ Anonymous functions35474.68%
Constants383
▷ Global constants7519.58%
▷ Class constants30880.42%
▷ Public constants308100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin