Skip to content

Commit

Permalink
Deploying version 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmjones committed Nov 25, 2020
1 parent ae61dbf commit 991694a
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 49 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
**Contributors:** bradt, deliciousbrains, ianmjones
**Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
**Requires at least:** 4.9
**Tested up to:** 5.5
**Tested up to:** 5.6
**Requires PHP:** 5.5
**Stable tag:** 2.5
**Stable tag:** 2.5.1
**License:** GPLv3

Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
Expand Down Expand Up @@ -89,6 +89,13 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### WP Offload Media Lite 2.5.1- 2020-11-25 ###
* New: WordPress 5.6 compatible
* New: PHP 8.0 compatible
* Bug fix: Unexpectedly asked to select bucket after saving settings when legacy access key named constants defined
* Bug fix: srcset missing for some images
* Bug fix: Error saving item during Metadata upgrade in some cases

### WP Offload Media Lite 2.5 - 2020-11-11 ###
* [Release Summary Blog Post](https://deliciousbrains.com/wp-offload-media-2-5-released/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
* Improvement: [Error notice shown](https://deliciousbrains.com/wp-offload-media/doc/missing-table-error-notice/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting) when plugin's required custom table(s) missing
Expand Down
6 changes: 3 additions & 3 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
var n = o.name,
v = o.value;
n = n.replace( '[]', '' );
data[ n ] = undefined === data[ n ] ? v : $.isArray( data[ n ] ) ? data[ n ].concat( v ) : [ data[ n ], v ];
data[ n ] = undefined === data[ n ] ? v : Array.isArray( data[ n ] ) ? data[ n ].concat( v ) : [ data[ n ], v ];
} );

// Overwrite the save action stored in the form
Expand Down Expand Up @@ -661,7 +661,7 @@
} );

// Don't allow 'enter' key to submit form on text input settings
$( '.as3cf-setting input[type="text"]' ).keypress( function( event ) {
$( '.as3cf-setting input[type="text"]' ).on( 'keypress', function( event ) {
if ( 13 === event.which ) {
event.preventDefault();

Expand Down Expand Up @@ -813,7 +813,7 @@
} );

// Don't allow 'enter' key to submit form on text input settings
$( '.as3cf-bucket-container input[type="text"]' ).keypress( function( event ) {
$( '.as3cf-bucket-container input[type="text"]' ).on( 'keypress', function( event ) {
if ( 13 === event.which ) {
event.preventDefault();

Expand Down
2 changes: 1 addition & 1 deletion assets/js/script.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions classes/amazon-s3-and-cloudfront.php
Original file line number Diff line number Diff line change
Expand Up @@ -3898,6 +3898,14 @@ protected function handle_save_settings() {
}
}

if ( 'access-key-id' === $var && 'db' !== $_POST['authmethod'] ) {
continue;
}

if ( 'secret-access-key' === $var && 'db' !== $_POST['authmethod'] ) {
continue;
}

if ( 'use-server-roles' === $var && 'server-role' !== $_POST['authmethod'] ) {
continue;
}
Expand Down
23 changes: 23 additions & 0 deletions classes/filters/as3cf-s3-to-local.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ protected function init() {
add_filter( 'as3cf_filter_post_provider_to_local', array( $this, 'filter_post' ) );
// Widgets
add_filter( 'widget_update_callback', array( $this, 'filter_widget_save' ), 10, 4 );
// Srcset handling
add_filter( 'wp_image_file_matches_image_meta', array( $this, 'image_file_matches_image_meta' ), 10, 4 );
}

/**
Expand Down Expand Up @@ -215,4 +217,25 @@ protected function post_process_content( $content ) {
protected function pre_replace_content( $content ) {
return $content;
}

/**
* Determines if the image meta data is for the image source file.
*
* @handles wp_image_file_matches_image_meta
*
* @param bool $match
* @param string $image_location
* @param array $image_meta
* @param int $attachment_id
*
* @return bool
*/
public function image_file_matches_image_meta( $match, $image_location, $image_meta, $attachment_id ) {
// If already matched or the URL is local, there's nothing for us to do.
if ( $match || ! $this->url_needs_replacing( $image_location ) ) {
return $match;
}

return $this->attachment_id_matches_src( $attachment_id, $image_location );
}
}
2 changes: 1 addition & 1 deletion classes/items/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public function save() {
$result = $wpdb->update( static::items_table(), $this->key_values(), array( 'id' => $this->id ), $this->formats(), array( '%d' ) );
}

if ( $result ) {
if ( false !== $result ) {
// Now that the item has an ID it should be (re)cached.
static::add_to_object_cache( $this );
} else {
Expand Down
76 changes: 38 additions & 38 deletions languages/amazon-s3-and-cloudfront-en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: amazon-s3-and-cloudfront\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2020-11-11 11:45+0000\n"
"POT-Creation-Date: 2020-11-25 13:30+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -157,7 +157,7 @@ msgid "-- not shown --"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:3400
#: classes/amazon-s3-and-cloudfront.php:5777
#: classes/amazon-s3-and-cloudfront.php:5785
msgid "Settings saved."
msgstr ""

Expand Down Expand Up @@ -225,63 +225,63 @@ msgstr ""
msgid "Key File not valid JSON."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:3907
#: classes/amazon-s3-and-cloudfront.php:3921
#: classes/amazon-s3-and-cloudfront.php:3930
#: classes/amazon-s3-and-cloudfront.php:3915
#: classes/amazon-s3-and-cloudfront.php:3929
#: classes/amazon-s3-and-cloudfront.php:3938
msgctxt "missing form field"
msgid " not provided."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:3973
#: classes/amazon-s3-and-cloudfront.php:3981
msgctxt "Show the media library tab"
msgid "Media Library"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:3974
#: classes/amazon-s3-and-cloudfront.php:3982
msgctxt "Show the addons tab"
msgid "Addons"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:3975
#: classes/amazon-s3-and-cloudfront.php:3983
msgctxt "Show the support tab"
msgid "Support"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:4151
#: classes/amazon-s3-and-cloudfront.php:4159
#, php-format
msgid ""
"<strong>WP Offload Media</strong> &mdash; The file %s has been given %s "
"permissions in the bucket."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:4170
#: classes/amazon-s3-and-cloudfront.php:4178
msgid ""
"<strong>WP Offload Media Requirement Missing</strong> &mdash; Looks like you "
"don't have an image manipulation library installed on this server and "
"configured with PHP. You may run into trouble if you try to edit images. "
"Please setup GD or ImageMagick."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:4194
#: classes/amazon-s3-and-cloudfront.php:4202
#, php-format
msgid ""
"<strong>Missing Table</strong> &mdash; One or more required database tables "
"are missing, please check the Diagnostic Info in the Support tab for "
"details. %s"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5016
#: classes/amazon-s3-and-cloudfront.php:5024
#, php-format
msgid ""
"<a href=\"%s\">Define your access keys</a> to enable write access to the "
"bucket"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5023
#: classes/amazon-s3-and-cloudfront.php:5031
msgid "Quick Start Guide"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5025
#: classes/amazon-s3-and-cloudfront.php:5033
#, php-format
msgid ""
"Looks like we don't have write access to this bucket. It's likely that the "
Expand All @@ -290,47 +290,47 @@ msgid ""
"correctly."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5027
#: classes/amazon-s3-and-cloudfront.php:5035
#, php-format
msgid ""
"Looks like we don't have access to the buckets. It's likely that the user "
"you've provided credentials for hasn't been granted the correct permissions. "
"Please see our %s for instructions on setting up permissions correctly."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5195
#: classes/amazon-s3-and-cloudfront.php:5203
msgid "WP Offload Media Activation"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5196
#: classes/amazon-s3-and-cloudfront.php:5204
msgid ""
"WP Offload Media Lite and WP Offload Media cannot both be active. We've "
"automatically deactivated WP Offload Media Lite."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5198
#: classes/amazon-s3-and-cloudfront.php:5206
msgid "WP Offload Media Lite Activation"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5199
#: classes/amazon-s3-and-cloudfront.php:5207
msgid ""
"WP Offload Media Lite and WP Offload Media cannot both be active. We've "
"automatically deactivated WP Offload Media."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5253
#: classes/amazon-s3-and-cloudfront.php:5261
msgid "More&nbsp;info&nbsp;&raquo;"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5333
#: classes/amazon-s3-and-cloudfront.php:5341
msgid "this doc"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5335
#: classes/amazon-s3-and-cloudfront.php:5343
msgid "WP Offload Media Feature Removed"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5336
#: classes/amazon-s3-and-cloudfront.php:5344
#, php-format
msgid ""
"You had the \"Always non-SSL\" option selected in your settings, but we've "
Expand All @@ -341,68 +341,68 @@ msgid ""
"to the old behavior."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5371
#: classes/amazon-s3-and-cloudfront.php:5379
msgid "Offload"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5475
#: classes/amazon-s3-and-cloudfront.php:5483
msgid "No"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5480
#: classes/amazon-s3-and-cloudfront.php:5488
msgctxt "Storage provider key name"
msgid "Storage Provider"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5481
#: classes/amazon-s3-and-cloudfront.php:5489
msgctxt "Storage provider name"
msgid "Storage Provider"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5482
#: classes/amazon-s3-and-cloudfront.php:5490
msgctxt "Bucket name"
msgid "Bucket"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5483
#: classes/amazon-s3-and-cloudfront.php:5491
msgctxt "Path to file in bucket"
msgid "Path"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5484
#: classes/amazon-s3-and-cloudfront.php:5492
msgctxt "Location of bucket"
msgid "Region"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5485
#: classes/amazon-s3-and-cloudfront.php:5493
msgctxt "Access control list of the file in bucket"
msgid "Access"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5486
#: classes/amazon-s3-and-cloudfront.php:5494
msgid "URL"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5487
#: classes/amazon-s3-and-cloudfront.php:5495
msgctxt "Whether or not metadata has been verified"
msgid "Verified"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5740
#: classes/amazon-s3-and-cloudfront.php:5748
msgid "Assets Pull"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5741
#: classes/amazon-s3-and-cloudfront.php:5749
msgid ""
"An addon for WP Offload Media to serve your site's JS, CSS, and other "
"enqueued assets from Amazon CloudFront or another CDN."
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5745
#: classes/amazon-s3-and-cloudfront.php:5753
msgid "Feature"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5791
#: classes/amazon-s3-and-cloudfront.php:5799
#, php-format
msgid ""
"<strong>Amazon Web Services Plugin No Longer Required</strong> &mdash; As of "
Expand All @@ -413,7 +413,7 @@ msgid ""
"plugin, it should be safe to deactivate and delete it. %2$s"
msgstr ""

#: classes/amazon-s3-and-cloudfront.php:5823
#: classes/amazon-s3-and-cloudfront.php:5831
#, php-format
msgid ""
"<strong>WP Offload Media Settings Moved</strong> &mdash; You now define your "
Expand Down
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: bradt, deliciousbrains, ianmjones
Tags: uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
Requires at least: 4.9
Tested up to: 5.5
Tested up to: 5.6
Requires PHP: 5.5
Stable tag: 2.5
Stable tag: 2.5.1
License: GPLv3

Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
Expand Down Expand Up @@ -81,6 +81,13 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

== Changelog ==

= WP Offload Media Lite 2.5.1- 2020-11-25 =
* New: WordPress 5.6 compatible
* New: PHP 8.0 compatible
* Bug fix: Unexpectedly asked to select bucket after saving settings when legacy access key named constants defined
* Bug fix: srcset missing for some images
* Bug fix: Error saving item during Metadata upgrade in some cases

= WP Offload Media Lite 2.5 - 2020-11-11 =
* [Release Summary Blog Post](https://deliciousbrains.com/wp-offload-media-2-5-released/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
* Improvement: [Error notice shown](https://deliciousbrains.com/wp-offload-media/doc/missing-table-error-notice/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting) when plugin's required custom table(s) missing
Expand Down
4 changes: 2 additions & 2 deletions wordpress-s3.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
Description: Automatically copies media uploads to Amazon S3, DigitalOcean Spaces or Google Cloud Storage for storage and delivery. Optionally configure Amazon CloudFront or another CDN for even faster delivery.
Author: Delicious Brains
Version: 2.5
Version: 2.5.1
Author URI: https://deliciousbrains.com/
Network: True
Text Domain: amazon-s3-and-cloudfront
Expand All @@ -26,7 +26,7 @@
// Then completely rewritten.
*/

$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '2.5';
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '2.5.1';

require_once dirname( __FILE__ ) . '/classes/as3cf-compatibility-check.php';

Expand Down

0 comments on commit 991694a

Please sign in to comment.