From 9958e1ac5b47bb0d3dcd883500c05aa4a556c1cf Mon Sep 17 00:00:00 2001 From: Flavio Maria De Stefano Date: Sat, 14 Aug 2021 10:33:30 +0200 Subject: [PATCH 1/6] Updating version to latest release Releases are at 3.0.3, but this still has 3.0.0 beta --- s3-uploads.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-uploads.php b/s3-uploads.php index 289d9ab5..639e9c08 100644 --- a/s3-uploads.php +++ b/s3-uploads.php @@ -4,7 +4,7 @@ Plugin Name: S3 Uploads Description: Store uploads in S3 Author: Human Made Limited -Version: 3.0.0-beta +Version: 3.0.3 Author URI: https://hmn.md */ From 1e8df2498ae0444c3cb626d560492b8f5ae5e242 Mon Sep 17 00:00:00 2001 From: Jeremy Emery <2809847+jezemery@users.noreply.github.com> Date: Thu, 19 Aug 2021 15:11:02 +0100 Subject: [PATCH 2/6] Fix spelling mistake in class-wp-cli-command.php > bukcet > bucket --- inc/class-wp-cli-command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-wp-cli-command.php b/inc/class-wp-cli-command.php index 81962a68..c189cdc3 100644 --- a/inc/class-wp-cli-command.php +++ b/inc/class-wp-cli-command.php @@ -121,7 +121,7 @@ public function generate_iam_policy() { } /** - * List files in the S3 bukcet + * List files in the S3 bucket * * @synopsis [] * From 54000365325d301355a6b8da69bceadd9e64dd4f Mon Sep 17 00:00:00 2001 From: Jeremy Emery <2809847+jezemery@users.noreply.github.com> Date: Thu, 19 Aug 2021 15:20:15 +0100 Subject: [PATCH 3/6] Remove misleading documentation from README.md Documentation in README.md suggests you can create an IAM user using the `create-iam-user ` subcommand, however this subcommand does not actually exist. --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 2ab6cc71..b1b67de9 100644 --- a/README.md +++ b/README.md @@ -98,15 +98,7 @@ like so: wp s3-uploads verify ``` -You'll want to create a new IAM user for the S3-Uploads plugin, so you are not using admin level access keys on your site. S3-Uploads can create the IAM user for you and asign the correct permissions. - -``` -wp s3-uploads create-iam-user --admin-key= --admin-secret= -``` - -This will provide you with a new Access Key and Secret Key which you can configure S3-Uploads with. Paste the values in the `wp-config.php`. Once you have migrated your media to S3 with any of the below methods, you'll want to enable S3 Uploads: `wp s3-uploads enable`. - -If you want to create your IAM user yourself, or attach the necessary permissions to an existing user, you can output the policy via `wp s3-uploads generate-iam-policy` +You will need to create your IAM user yourself, or attach the necessary permissions to an existing user, you can output the policy via `wp s3-uploads generate-iam-policy` ## Listing files on S3 From ddef642c61048eea18ec746be3ed86c213c37b84 Mon Sep 17 00:00:00 2001 From: Jeremy Emery <2809847+jezemery@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:47:30 +0100 Subject: [PATCH 4/6] Fix typo in class-wp-cli-command.php Ensable > Enable --- inc/class-wp-cli-command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-wp-cli-command.php b/inc/class-wp-cli-command.php index c189cdc3..1134bfc1 100644 --- a/inc/class-wp-cli-command.php +++ b/inc/class-wp-cli-command.php @@ -270,7 +270,7 @@ function() { } /** - * Ensable the auto-rewriting of media links to S3 + * Enable the auto-rewriting of media links to S3 */ public function enable() { update_option( 's3_uploads_enabled', 'enabled' ); From 4b32278f377eb51f010abaeb42e0031107046ffb Mon Sep 17 00:00:00 2001 From: Ulrich Pogson Date: Tue, 5 Oct 2021 20:50:23 +0200 Subject: [PATCH 5/6] Support composer/installers 2.x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6fd8f928..ee085ff9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "type": "wordpress-plugin", "require": { - "composer/installers": "~1.0", + "composer/installers": "~1.0 || ^2.0", "aws/aws-sdk-php": "~3.18" }, "require-dev": { From a5ab2eeb27d33087e38499e5adaf80b31dfd6d9e Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 22 Feb 2022 11:33:09 +0100 Subject: [PATCH 6/6] Image Editor Imagick: Always return the WP_Error object of parent call If `WP_Image_Editor_Imagick::_save()` returns a `WP_Error` but no temp filename exists the `WP_Error` should still be returned. This prevents a fatal error `Cannot use object of type WP_Error as array` for the `$copy_result = copy( $save['path'], $filename );` line. --- inc/class-image-editor-imagick.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/class-image-editor-imagick.php b/inc/class-image-editor-imagick.php index 37900d95..9963fd08 100644 --- a/inc/class-image-editor-imagick.php +++ b/inc/class-image-editor-imagick.php @@ -106,8 +106,11 @@ protected function _save( $image, $filename = null, $mime_type = null ) { */ $parent_call = parent::_save( $image, $temp_filename ?: $filename, $mime_type ); - if ( is_wp_error( $parent_call ) && $temp_filename ) { - unlink( $temp_filename ); + if ( is_wp_error( $parent_call ) ) { + if ( $temp_filename ) { + unlink( $temp_filename ); + } + return $parent_call; } else { /**