Skip to content

Commit

Permalink
Deploying version 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmjones committed Jul 21, 2020
1 parent e01b096 commit 6096efe
Show file tree
Hide file tree
Showing 16 changed files with 245 additions and 246 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Requires at least:** 4.9
**Tested up to:** 5.5
**Requires PHP:** 5.5
**Stable tag:** 2.4
**Stable tag:** 2.4.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,11 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### WP Offload Media Lite 2.4.1 - 2020-07-21 ###
* Bug fix: Fatal Error with EWWW Image Optimizer 5.5 or earlier installed
* Bug fix: AWS SDK "Warning: is_readable(): open_basedir restriction in effect" message when Use ARN Region in effect
* Bug fix: "Data you have entered may not be saved" notice shown incorrectly when leaving settings page

### WP Offload Media Lite 2.4 - 2020-07-14 ###
* [Release Summary Blog Post](https://deliciousbrains.com/wp-offload-media-2-4-released/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
* New: Setting to choose a Delivery Provider (i.e. S3, CloudFront, another CDN)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/styles.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions assets/img/icon-checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/img/logo-dbi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/img/os3-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
function validateSignedUrlsKeyFilePath( $input ) {
var $error = $input.next( '.as3cf-validation-error' );
var $submit = $( '#' + $activeTab.attr( 'id' ) + ' form button[type="submit"]' );
var pattern = /[^a-zA-Z0-9\.\-\\:\/ ]/;
var pattern = /[^a-zA-Z0-9\.\-\\:\/ _]/;

if ( pattern.test( $input.val() ) ) {
$error.show();
Expand Down Expand Up @@ -463,6 +463,13 @@
$( this ).removeClass( 'locked locked-' + key );
} );
$( '#as3cf-media-settings-locked-' + key ).hide();
},

/**
* Settings locked?
*/
locked: function() {
return $( '.as3cf-media-settings' ).hasClass( 'locked' );
}

};
Expand Down Expand Up @@ -610,7 +617,7 @@

// Prompt user with dialog if leaving the settings page with unsaved changes
$( window ).on( 'beforeunload.as3cf-settings', function() {
if ( $.isEmptyObject( savedSettings ) ) {
if ( $.isEmptyObject( savedSettings ) || as3cf.Settings.Media.locked() ) {
return;
}

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

Large diffs are not rendered by default.

130 changes: 74 additions & 56 deletions assets/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -853,83 +853,87 @@ $as3cf_assets: #0769ad;
left: 670px;
width: 292px;

&.lite {
margin-top: 35px;
background: white;
border-radius: 7px;
border: 1px solid #D9E1EB;
overflow: hidden;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.block {
padding: 20px;
border: 1px solid #ccc;
}

.subscribe {
border-top: none;
text-align: center;
padding: 40px 20px;

h2 {
padding: 0;
margin: 0;
margin-bottom: 0.5em;
color: #666;
font-size: 20px;
font-size: 17px;
line-height: 1.2em;
float: none;
}

h3 {
font-size: 16px;
margin: 0;
}

p {
margin: 0;
}

.intro {
margin-bottom: 1em;
line-height: 1.4;
}

li {
line-height: 1.4;
}

.links {
margin-bottom: 2em;
margin: 20px 0 0;

a {
background-color: #E9715E;
color: white;
display: inline-block;
font-size: 13px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
padding: 15px 50px;
border-radius: 4px;
margin-bottom: 6px;
text-decoration: none;
box-shadow: 0 2px 0 #C6442F;

&:hover {
color: rgba(78, 13, 51, .65);
}
}
}

.promise {
color: #999;
font-size: 12px;
line-height: 1.4em;
p {
margin: 0;
}

.field {
margin-bottom: 0.5em;

p {
margin-bottom: 0.3em;
}

input[type=text], input[type=email] {
width: 100%;
}

&.submit-button {
margin-bottom: 1em;
}
.discount-applied {
color: rgba(0, 0, 0, 0.4);
font-size: 12px;
line-height: 1.4em;
margin-top: 10px;
}
}

.credits {
border-top: 0;
background: #2E2E31;
text-align: center;
padding: 10px;

h4 {
font-size: 16px;
font-size: 11px;
font-weight: normal;
color: rgba(255, 255, 255, 0.7);
margin-top: 0;
margin-bottom: 10px;
}

ul {
display: inline-block;
margin: 0;
}

Expand All @@ -942,25 +946,27 @@ $as3cf_assets: #0769ad;
}

img {
float: left;
margin-right: 10px;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}

span {
float: left;
display: block;
line-height: 32px;
display: inline-block;
vertical-align: middle;
font-size: 12px;
line-height: 24px;
}

a {
display: block;
text-decoration: none;
color: #444;
font-size: 16px;
color: white;
font-size: 12px;
text-align: center;

&:hover {
color: #888;
color: rgba(255, 255, 255, 0.7);
}
}
}
Expand All @@ -981,11 +987,10 @@ $as3cf_assets: #0769ad;
}

.as3cf-banner {
margin-top: 35px;
width: 292px;
height: 200px;
height: 156px;
display: block;
background: #f8cfae url(../img/os3-banner.svg) left bottom / 220px 220px no-repeat;
background: #f8cfae url(../img/os3-banner.svg) left bottom / 100% no-repeat;
}

.as3cf-banner:focus {
Expand All @@ -1002,15 +1007,22 @@ $as3cf_assets: #0769ad;
text-decoration: none;

h1 {
font-size: 28px;
color: #eee;
font-size: 27px;
color: #f8cfae;
margin: 0 0 15px 0;
padding: 0;
text-decoration: none;
font-weight: 200;
font-weight: 300;
line-height: 1;
}

h2 {
font-size: 15px;
color: #F8CFAE;
margin: 0 0 30px 0;
font-weight: 500;
line-height: 20px;
}

p {
margin: 0;
}
Expand All @@ -1028,9 +1040,15 @@ $as3cf_assets: #0769ad;
}

ul {
margin-top: 0;
margin-left: 16px;
list-style-type: disc;
margin: 0;
list-style: none;

li {
margin-bottom: 15px;
line-height: 18px;
padding-left: 25px;
background: url(../img/icon-checked.svg) left center no-repeat;
}
}
}

Expand Down
11 changes: 11 additions & 0 deletions classes/amazon-s3-and-cloudfront.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ public function get_storage_provider() {
return $this->storage_provider;
}

/**
* Backwards compat alias function for `get_storage_provider()`.
*
* @return Provider
*
* @deprecated Use get_storage_provider
*/
public function get_provider() {
return $this->get_storage_provider();
}

/**
* @param Storage_Provider|string|null $storage_provider
*
Expand Down
15 changes: 1 addition & 14 deletions classes/providers/delivery/aws-cloudfront.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,18 @@ class AWS_CloudFront extends Delivery_Provider {
public function __construct( \AS3CF_Plugin_Base $as3cf ) {
parent::__construct( $as3cf );

$this->disable_csm();

// Autoloader.
require_once $as3cf->get_plugin_sdks_dir_path() . '/Aws3/aws-autoloader.php';
}

/**
* Disable AWS CSM which tries to check ~/.aws/config causing issues if open_basedir in effect.
*
* @see https://github.com/aws/aws-sdk-php/issues/1659
*/
private function disable_csm() {
if ( apply_filters( 'as3cf_disable_aws_csm', true ) ) {
putenv( 'AWS_CSM_ENABLED=false' );
}
}

/**
* A short description of what features the delivery provider enables.
*
* @return string
*/
public function features_description() {
return sprintf(
__( 'Fast, Private Media Supported with <a href="%s" target="_blank">upgrade</a>', 'amazon-s3-and-cloudfront' ),
__( 'Fast, Private Media Supported with <a href="%s" target="_blank">upgrade</a>', 'amazon-s3-and-cloudfront' ),
$this->as3cf->dbrains_url( '/wp-offload-media/upgrade/', array(
'utm_campaign' => 'WP+Offload+S3',
) )
Expand Down
15 changes: 2 additions & 13 deletions classes/providers/storage/aws-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ class AWS_Provider extends Storage_Provider {
public function __construct( \AS3CF_Plugin_Base $as3cf ) {
parent::__construct( $as3cf );

$this->disable_csm();

// Autoloader.
require_once $as3cf->get_plugin_sdks_dir_path() . '/Aws3/aws-autoloader.php';
}
Expand Down Expand Up @@ -213,17 +211,6 @@ private function batch_command( $command, array $items ) {
return $failures;
}

/**
* Disable AWS CSM which tries to check ~/.aws/config causing issues if open_basedir in effect.
*
* @see https://github.com/aws/aws-sdk-php/issues/1659
*/
private function disable_csm() {
if ( apply_filters( 'as3cf_disable_aws_csm', true ) ) {
putenv( 'AWS_CSM_ENABLED=false' );
}
}

/**
* Returns default args array for the client.
*
Expand All @@ -234,6 +221,8 @@ protected function default_client_args() {
'signature_version' => static::SIGNATURE_VERSION,
'version' => static::API_VERSION,
'region' => $this->default_region,
'csm' => apply_filters( 'as3cf_disable_aws_csm', true ) ? false : true,
'use_arn_region' => apply_filters( 'as3cf_disable_aws_use_arn_region', true ) ? false : true,
);
}

Expand Down
Loading

0 comments on commit 6096efe

Please sign in to comment.