Skip to content

Commit

Permalink
Deploying version 2.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmjones committed Mar 3, 2021
1 parent 65d1b99 commit 99995c8
Show file tree
Hide file tree
Showing 10 changed files with 1,510 additions and 15 deletions.
19 changes: 16 additions & 3 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.6
**Tested up to:** 5.7
**Requires PHP:** 5.5
**Stable tag:** 2.6dev
**Stable tag:** 2.5.3
**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,7 +89,20 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### WP Offload Media Lite 2.5.1- 2020-11-25 ###
### WP Offload Media Lite 2.5.3 - 2021-03-03 ###
* New: Added DigitalOcean region San Francisco 3
* Bug fix: Domain mapping not handled correctly when the local URL includes a port number
* Bug fix: In some unusual configurations the upgrade routine uses incorrect name for multisite blogs table
* Tested: WordPress 5.7

### WP Offload Media Lite 2.5.2 - 2020-12-14 ###
* New: AWS PHP SDK 3.168.0
* New: Google Cloud Storage SDK 1.23.0
* Improvement: Faster saving of posts with many external links
* Improvement: Faster URL rewriting when Force HTTPS setting is being used but is not needed
* Bug fix: PHP Fatal error on the settings page when using PHP 8.0

### 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
Expand Down
13 changes: 11 additions & 2 deletions classes/as3cf-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,22 @@ public function get_bare_upload_base_urls( $refresh = false ) {
$uploads = wp_upload_dir();
$base_url = AS3CF_Utils::remove_scheme( $uploads['baseurl'] );
$orig_domain = AS3CF_Utils::parse_url( $base_url, PHP_URL_HOST );
$domains[] = $orig_domain;
$base_urls[] = $base_url;
$port = AS3CF_Utils::parse_url( $base_url, PHP_URL_PORT );
if ( ! empty( $port ) ) {
$orig_domain .= ':' . $port;
}

$domains[] = $orig_domain;
$base_urls = array( $base_url );

// Current domain and path after potential domain mapping.
$base_url = $this->as3cf->maybe_fix_local_subsite_url( $uploads['baseurl'] );
$base_url = AS3CF_Utils::remove_scheme( $base_url );
$curr_domain = AS3CF_Utils::parse_url( $base_url, PHP_URL_HOST );
$port = AS3CF_Utils::parse_url( $base_url, PHP_URL_PORT );
if ( ! empty( $port ) ) {
$curr_domain .= ':' . $port;
}

if ( $curr_domain !== $orig_domain ) {
$domains[] = $curr_domain;
Expand Down
2 changes: 1 addition & 1 deletion classes/items/media-library-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public static function get_missing_source_ids( $upper_bound, $limit, $count = fa
}

$sql .= "
FROM {$wpdb->prefix}posts AS posts
FROM {$wpdb->posts} AS posts
WHERE posts.post_type = 'attachment'
AND posts.ID NOT IN (
SELECT items.source_id
Expand Down
3 changes: 2 additions & 1 deletion classes/providers/storage/digitalocean-provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class DigitalOcean_Provider extends AWS_Provider {
'nyc3' => 'New York',
'ams3' => 'Amsterdam',
'sgp1' => 'Singapore',
'sfo2' => 'San Francisco',
'sfo2' => 'San Francisco 2',
'sfo3' => 'San Francisco 3',
'fra1' => 'Frankfurt',
);

Expand Down
4 changes: 2 additions & 2 deletions classes/upgrades/upgrade-content-replace-urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function upgrade_blog() {
protected function upgrade_theme_mods() {
global $wpdb;

$mods = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}options` WHERE option_name LIKE 'theme_mods_%'" );
$mods = $wpdb->get_results( "SELECT * FROM `{$wpdb->options}` WHERE option_name LIKE 'theme_mods_%'" );

foreach ( $mods as $mod ) {
$value = maybe_unserialize( $mod->option_value );
Expand All @@ -82,7 +82,7 @@ protected function upgrade_theme_mods() {
$value = maybe_serialize( $value );

if ( $value !== $mod->option_value ) {
$wpdb->query( "UPDATE `{$wpdb->prefix}options` SET option_value = '{$value}' WHERE option_id = '{$mod->option_id}'" );
$wpdb->query( "UPDATE `{$wpdb->options}` SET option_value = '{$value}' WHERE option_id = '{$mod->option_id}'" );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/upgrades/upgrade-filter-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class Upgrade_Filter_Post extends Upgrade {
protected function get_highest_post_id() {
global $wpdb;

return (int) $wpdb->get_var( "SELECT MAX(ID) FROM {$wpdb->prefix}posts" );
return (int) $wpdb->get_var( "SELECT MAX(ID) FROM {$wpdb->posts}" );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/upgrades/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ protected function get_final_blog_id() {
global $wpdb;

if ( is_multisite() ) {
return $wpdb->get_var( "SELECT MAX(blog_id) FROM {$wpdb->prefix}blogs" );
return $wpdb->get_var( "SELECT MAX(blog_id) FROM {$wpdb->blogs}" );
}

return 1;
Expand Down
Loading

0 comments on commit 99995c8

Please sign in to comment.