Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to v3 branch #567

Merged
merged 12 commits into from
Mar 2, 2022
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<key> --admin-secret=<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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 5 additions & 2 deletions inc/class-image-editor-imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
4 changes: 2 additions & 2 deletions inc/class-wp-cli-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function generate_iam_policy() {
}

/**
* List files in the S3 bukcet
* List files in the S3 bucket
*
* @synopsis [<path>]
*
Expand Down Expand Up @@ -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' );
Expand Down
2 changes: 1 addition & 1 deletion s3-uploads.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down