84% sync-media-with-aws-s3-cloudfront

Code Review | Sync media with AWS S3 CloudFront

WordPress plugin Sync media with AWS S3 CloudFront scored84%from 54 tests.

About plugin

  • Plugin page: sync-media-with-a...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Apr 4, 2020
  • Latest release: May 2, 2023
  • Number of updates: 20
  • Update frequency: every 56.2 days
  • Top authors: softsprint (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /2,129 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.99ms] Passed 4 tests

This is a short check of server-side resources used by Sync media with AWS S3 CloudFront
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.90 ▼0.86
Dashboard /wp-admin3.35 ▲0.0544.61 ▼2.29
Posts /wp-admin/edit.php3.40 ▲0.0451.41 ▼3.82
Add New Post /wp-admin/post-new.php5.95 ▲0.0689.52 ▼4.81
Media Library /wp-admin/upload.php3.27 ▲0.0432.77 ▼21.02
AWS S3 Sync /wp-admin/tools.php?page=sync-media-with-aws-s3-cloudfront/templates/main_page_s3.php3.2731.31

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,396 new files
Database: 1 new table, 7 new options
New tables
wp_s3_sync_smwas3c
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
option_smwas3c

Browser metrics Passed 4 tests

A check of browser resources used by Sync media with AWS S3 CloudFront
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5114.74 ▲0.371.84 ▼0.2943.54 ▼0.99
Dashboard /wp-admin2,214 ▲325.87 ▲0.02103.37 ▼0.5135.13 ▼6.59
Posts /wp-admin/edit.php2,100 ▲112.02 ▼0.0240.63 ▲0.5734.35 ▲2.74
Add New Post /wp-admin/post-new.php1,525 ▼1723.38 ▲4.92672.22 ▲37.4755.10 ▼5.39
Media Library /wp-admin/upload.php1,393 ▲54.21 ▲0.0297.66 ▼8.9242.08 ▼3.52
AWS S3 Sync /wp-admin/tools.php?page=sync-media-with-aws-s3-cloudfront/templates/main_page_s3.php1,0771.7127.3626.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

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 | 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
  • 587× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/CloudWatchLogs/Exception/CloudWatchLogsException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/WafRegional/Exception/WafRegionalException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/Personalize/Exception/PersonalizeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/CostandUsageReportService/CostandUsageReportServiceClient.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Psr/Http/Message/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AbstractConfigurationProvider' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/Sts/RegionalEndpoints/ConfigurationProvider.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/GroundStation/GroundStationClient.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/ElasticInference/Exception/ElasticInferenceException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/NetworkManager/Exception/NetworkManagerException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/sync-media-with-aws-s3-cloudfront/aws/Aws/Cloud9/Cloud9Client.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: aws, media, link, image, s3...

sync-media-with-aws-s3-cloudfront/sync-media-with-AWS-S3-CloudFront.php 85% from 13 tests

This is the main PHP file of "Sync media with AWS S3 CloudFront" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sync-media-with-aws-s3-cloudfront.php" instead of "sync-media-with-AWS-S3-CloudFront.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 170 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin38,562 lines of code in 1,394 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,3876,12730,27333,392
Markdown41,86204,788
JavaScript1246309
CSS18057
SVG10016

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.37
Average class complexity5.31
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces473
Interfaces38
Traits17
Classes695
▷ Abstract classes111.58%
▷ Concrete classes68498.42%
▷ Final classes121.75%
Methods2,205
▷ Static methods31814.42%
▷ Public methods1,52068.93%
▷ Protected methods1155.22%
▷ Private methods57025.85%
Functions412
▷ Named functions7618.45%
▷ Anonymous functions33681.55%
Constants199
▷ Global constants00.00%
▷ Class constants199100.00%
▷ Public constants199100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin