Skip to content


Browse files Browse the repository at this point in the history
Minor changes to make it work with Google Cloud Storage instead
  • Loading branch information
timwhite committed Oct 5, 2015
1 parent 87bd0a0 commit 8b55698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions classes/amazon-s3-and-cloudfront.php
Expand Up @@ -55,7 +55,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
const DEFAULT_ACL = 'public-read';
const PRIVATE_ACL = 'private';
const DEFAULT_EXPIRES = 900;
const DEFAULT_REGION = 'us-east-1';
const DEFAULT_REGION = 'global';

const SETTINGS_KEY = 'tantan_wordpress_s3';

Expand Down Expand Up @@ -998,7 +998,7 @@ function get_file_prefix( $time = null, $post_id = null ) {
* @return string
function get_s3_url_prefix( $region = '', $expires = null ) {
$prefix = 's3';
$prefix = 'storage';

if ( '' !== $region ) {
$delimiter = '-';
Expand Down Expand Up @@ -1046,10 +1046,10 @@ function get_s3_url_domain( $bucket, $region = '', $expires = null, $args = arra
$s3_domain = $bucket;
elseif ( 'path' === $args['domain'] || $this->use_ssl( $args['ssl'] ) ) {
$s3_domain = $prefix . '' . $bucket;
$s3_domain = $prefix . '' . $bucket;
else {
$s3_domain = $bucket . '.' . $prefix . '';
$s3_domain = $bucket . '.' . $prefix . '';

return $s3_domain;
Expand Down
4 changes: 2 additions & 2 deletions view/domain-setting.php
Expand Up @@ -21,12 +21,12 @@
<label class="subdomain-wrap <?php echo $subdomain_class; // xss ok?>">
<input type="radio" name="domain" value="subdomain" <?php checked( $domain, 'subdomain' ); ?> <?php echo $subdomain_disabled; // xss ok ?>>
<?php _e( 'Bucket name as subdomain', 'amazon-s3-and-cloudfront' ); ?>
<input type="radio" name="domain" value="path" <?php checked( $domain, 'path' ); ?>>
<?php _e( 'Bucket name in path', 'amazon-s3-and-cloudfront' ); ?>
<input type="radio" name="domain" value="virtual-host" <?php checked( $domain, 'virtual-host' ); ?>>
Expand Down

2 comments on commit 8b55698

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, not sure if you will check this comment, but there was no way reach you.

I was looking for this exactly.

  1. I tried with azure blob storage(there is plugin for azure). but, there was no way to import my existing wordpress media library files to the azure storage, which is size about 200GB ( there are azcopy and few more tools but they are only for windows machine, I need linux CLI so that I can command upload files directly from my live server to the cloud storage.)

google and aws s3 has linux CLI that I can upload my heavy media library to the cloud storage.

so now, I try to look up any existing plugin for google cloud storage connect to wordpress media library.but no luck except this one. every one seems to build plugin for google drop box, not for "google cloud storage".

r u planning to build native Google Cloud Storage plugin for wordpress??

I may wait for it...

if you are not planning, I have to work with aws S3...

any replying will be appreciate, thanks

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at that blog post. That shows how with the AWS plugin (and this one because it uses Google's S3 API as well) can upload your existing media library easily. Just this plugin and wp-cli required and a simple bash script.

Ideally I'd like to build a native Google Cloud Storage plugin, or Backblaze B2 plugin. Realistically that won't happen for awhile due to time constraints.

Hope that helps. Easiest way to respond to the blog post is to open an issue on the post (

Please sign in to comment.