WP Offload S3 Lite - Version 0.9.6

Version Description

  • 2015-10-01 =

  • Improvement: Update text domains for translate.wordpress.org integration

Download this release

Release Info

Developer deliciousbrains
Plugin Icon 128x128 WP Offload S3 Lite
Version 0.9.6
Comparing to
See all releases

Code changes from version 0.9.5 to 0.9.6

README.md CHANGED
@@ -3,7 +3,7 @@
3
**Tags:** uploads, amazon, s3, mirror, admin, media, cdn, cloudfront
4
**Requires at least:** 3.7
5
**Tested up to:** 4.3
6
- **Stable tag:** 0.9.5
7
**License:** GPLv3
8
9
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
@@ -67,6 +67,10 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
67
68
## Changelog ##
69
70
### 0.9.5 - 2015-09-01 ###
71
* Bug fix: Fatal error: Cannot use object of type WP_Error as array
72
3
**Tags:** uploads, amazon, s3, mirror, admin, media, cdn, cloudfront
4
**Requires at least:** 3.7
5
**Tested up to:** 4.3
6
+ **Stable tag:** 0.9.6
7
**License:** GPLv3
8
9
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
67
68
## Changelog ##
69
70
+ ### 0.9.6 - 2015-10-01 ###
71
+
72
+ * Improvement: Update text domains for translate.wordpress.org integration
73
+
74
### 0.9.5 - 2015-09-01 ###
75
* Bug fix: Fatal error: Cannot use object of type WP_Error as array
76
assets/js/notice.min.js ADDED
@@ -0,0 +1 @@
1
+ !function(a){a("body").on("click",".as3cf-notice .notice-dismiss",function(b){var c=a(this).parents(".as3cf-notice").attr("id");if(c){var d={action:"as3cf-dismiss-notice",notice_id:c,_nonce:as3cf_notice.nonces.dismiss_notice};a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:d,error:function(a,b,c){alert(as3cf_notice.strings.dismiss_notice_error+c)}})}})}(jQuery);
assets/js/script.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(b){var c=a("#"+b),d=c.find("input[type=checkbox]");c.toggleClass("on").find("span").toggleClass("checked");var e=c.find("span.on").hasClass("checked");d.attr("checked",e).trigger("change")}function e(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b){"undefined"!=typeof b.success?a(".as3cf-url-preview").html(b.url):alert(as3cf.strings.get_url_preview_error+b.error)}})}function f(){as3cf.buckets.bucketSelectLock=!1}var g,h={},i=/[^a-z0-9.-]/,j=a(".as3cf-tab");as3cf.tabs={defaultTab:"media",toggle:function(c,d){j.hide(),g=a("#tab-"+c),g.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".aws-main").attr("data-tab",c),g.attr("data-prefix")&&(b.prefix=g.attr("data-prefix")),d||a(".as3cf-updated").removeClass("show")}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.attr("data-working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),g.scrollToSelected()):g.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===g.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList()),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),h=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),g.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.attr("data-working")),e.prop("disabled",!0);var i={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){e.text(h),j.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c){e.text(h),e.prop("disabled",!1),"undefined"!=typeof c.success?(j.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected")):j.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return g.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").attr("data-bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.attr("data-bucket"),h={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(b,c,f){d.removeClass("saving"),i.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(i.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val("")):(i.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").attr("disabled",!0):c.find("button[type=submit]").attr("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").attr("disabled",!0):d.find("button[type=submit]").attr("disabled",!1)}},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,(!d||e.hasClass(d))&&(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(i,j,k){var l=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&""===m.text()){d("copy-to-s3-wrap"),d("serve-from-s3-wrap");var n=g.attr("id");h[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(i),l.find(".as3cf-bucket-name").val(i),a("#"+b.prefix+"-bucket").val(i),a("#"+b.prefix+"-region").val(j),a(".updated").not(".as3cf-notice").show(),g.addClass("as3cf-has-bucket"),g.find(".as3cf-can-write-error").toggle(!k),g.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&e(),b.close(f)},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.attr("data-working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").removeAttr("selected"),d.val(""),f.attr("disabled",!0)):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return a.length<3||a.length>63?!1:!0===i.test(a)?!1:!0},updateNameNotice:function(b){var c=null;!0===i.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),a(".as3cf-invalid-bucket-name").html(c&&b.length>0?c:"")}},a(document).ready(function(){var f=a(".wrap.aws-main .nav-tab-wrapper");if(a(".aws-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(f),window.location.hash){var i=window.location.hash.substring(1);as3cf.tabs.toggle(i,!0)}else g=a("#tab-"+as3cf.tabs.defaultTab),a(".aws-main").attr("data-tab",as3cf.tabs.defaultTab);a(".aws-main").on("click",".nav-tab",function(b){if(b.preventDefault(),!a(this).hasClass("nav-tab-active")){var c=a(this).attr("data-tab");as3cf.tabs.toggle(c),"media"===c?(window.location.hash="","function"==typeof window.history.replaceState&&"#"===window.location.href.slice(-1)&&history.replaceState({},"",window.location.href.slice(0,-1))):window.location.hash=c}}),j.length&&j.each(function(a,b){h[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(h)){var b=g.attr("id");return c(b)!==h[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(){a(this).hasClass("disabled")||d(a(this).attr("id"))}),j.on("change",".sub-toggle",function(){var b=a(this).attr("id");a(".as3cf-setting."+b).toggleClass("hide")}),a(".as3cf-domain").on("change",'input[type="radio"]',function(){var b=a(this).closest('input:radio[name="domain"]:checked'),c=b.val(),d=a(this).parents(".as3cf-domain").find(".as3cf-setting.cloudfront"),e="cloudfront"===c;d.toggleClass("hide",!e)}),a(".as3cf-ssl").on("change",'input[type="radio"]',function(){var b=a('input:radio[name="ssl"]:checked').val();if("https"===b){var c=a('input:radio[name="domain"]:checked').val();"subdomain"===c&&a('input[name="domain"][value="path"]').attr("checked",!0),a(".subdomain-wrap input").attr("disabled",!0),a(".subdomain-wrap").addClass("disabled")}else a(".subdomain-wrap input").removeAttr("disabled"),a(".subdomain-wrap").removeClass("disabled")}),a(".url-preview").on("change","input",function(){e()}),a('.as3cf-setting input[type="text"]').keypress(function(a){return 13===a.which?(a.preventDefault(),!1):void 0}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),a("body").on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),a("body").on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList()}),a("body").on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),a("body").on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),a("body").on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),a("body").on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),a("body").on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),a("body").on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),a("body").on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),a("body").on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(){var c=a(this).val(),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(c)?d.find("button[type=submit]").removeAttr("disabled"):d.find("button[type=submit]").attr("disabled",!0),as3cf.buckets.updateNameNotice(c)}),a("body").on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?c.find("button[type=submit]").attr("disabled",!0):c.find("button[type=submit]").removeAttr("disabled")})})}(jQuery,as3cfModal);
1
+ !function(a,b){function c(b){return a("#"+b+" .as3cf-main-settings form").find("input:not(.no-compare)").serialize()}function d(b){var c=a("#"+b),d=c.find("input[type=checkbox]");c.toggleClass("on").find("span").toggleClass("checked");var e=c.find("span.on").hasClass("checked");d.attr("checked",e).trigger("change")}function e(){a(".as3cf-url-preview").html("Generating...");var b={_nonce:as3cf.nonces.get_url_preview};a.each(a("#tab-"+as3cf.tabs.defaultTab+" .as3cf-main-settings form").serializeArray(),function(c,d){var e=d.name,f=d.value;e=e.replace("[]",""),b[e]=void 0===b[e]?f:a.isArray(b[e])?b[e].concat(f):[b[e],f]}),b.action="as3cf-get-url-preview",a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:b,error:function(a,b,c){alert(as3cf.strings.get_url_preview_error+c)},success:function(b,c,d){"undefined"!=typeof b.success?a(".as3cf-url-preview").html(b.url):alert(as3cf.strings.get_url_preview_error+b.error)}})}function f(a){as3cf.buckets.bucketSelectLock=!1}var g,h={},i=/[^a-z0-9.-]/,j=a(".as3cf-tab");as3cf.tabs={defaultTab:"media",toggle:function(c,d){j.hide(),g=a("#tab-"+c),g.show(),a(".nav-tab").removeClass("nav-tab-active"),a('a.nav-tab[data-tab="'+c+'"]').addClass("nav-tab-active"),a(".aws-main").attr("data-tab",c),g.attr("data-prefix")&&(b.prefix=g.attr("data-prefix")),d||a(".as3cf-updated").removeClass("show")}},as3cf.buckets={validLength:3,bucketSelectLock:!1,loadList:function(c){"undefined"==typeof c&&(c=!1);var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-list"),e=a("#"+b.prefix+"-bucket").val();if(!1===c&&d.find("li").length>1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('<li class="loading">'+d.attr("data-working")+"</li>");var f={action:b.prefix+"-get-buckets",_nonce:window[b.prefix.replace(/-/g,"_")].nonces.get_buckets},g=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:f,error:function(a,b,c){d.html(""),g.showError(as3cf.strings.get_buckets_error,c,"as3cf-bucket-select")},success:function(b,c,f){d.html(""),"undefined"!=typeof b.success?(a(".as3cf-bucket-error").hide(),a(b.buckets).each(function(a,b){var c=b.Name===e?"selected":"";d.append('<li><a class="'+c+'" href="#" data-bucket="'+b.Name+'"><span class="bucket"><span class="dashicons dashicons-portfolio"></span> '+b.Name+'</span><span class="spinner"></span></span></a></li>')}),g.scrollToSelected()):g.showError(as3cf.strings.get_buckets_error,b.error,"as3cf-bucket-select")}})},scrollToSelected:function(){if(a(".as3cf-bucket-list a.selected").length){var b=a("ul.as3cf-bucket-list li").first().position().top+150;a(".as3cf-bucket-list").animate({scrollTop:a("ul.as3cf-bucket-list li a.selected").position().top-b})}},resetModal:function(){var c=a(".as3cf-bucket-container."+b.prefix);!1===g.hasClass("as3cf-has-bucket")||"manual"===a("#"+b.prefix+"-bucket-select").val()?(c.find(".as3cf-bucket-manual").show().siblings().hide(),c.find(".bucket-actions.manual").show().siblings(".bucket-actions").hide()):(c.find(".as3cf-bucket-select").show().siblings().hide(),c.find(".bucket-actions.select").show().siblings(".bucket-actions").hide(),this.loadList()),c.find(".as3cf-bucket-error").hide();var d=a("#"+b.prefix+"-bucket").val();c.find(".as3cf-bucket-manual .as3cf-bucket-name").val(d),this.bucketSelectLock=!1},saveManual:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find("button[type=submit]"),f=d.val(),h=e.first().text();if(f===a("#"+b.prefix+"-active-bucket").text())return a(".as3cf-bucket-error").hide(),g.addClass("as3cf-has-bucket"),void b.close();a(".as3cf-bucket-error").hide(),e.text(e.attr("data-working")),e.prop("disabled",!0);var i={action:b.prefix+"-manual-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.manual_bucket},j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){e.text(h),j.showError(as3cf.strings.save_bucket_error,c,"as3cf-bucket-manual")},success:function(c,d,g){e.text(h),e.prop("disabled",!1),"undefined"!=typeof c.success?(j.set(f,c.region,c.can_write),a("#"+b.prefix+"-bucket-select").val("manual"),a(".as3cf-bucket-list a").removeClass("selected").filter('[data-bucket="'+f+'"]').addClass("selected")):j.showError(as3cf.strings.save_bucket_error,c.error,"as3cf-bucket-manual")}})},saveSelected:function(c){var d=a(".as3cf-bucket-list");if(!this.bucketSelectLock){if(this.bucketSelectLock=!0,c.hasClass("selected"))return g.addClass("as3cf-has-bucket"),void b.close();var e=a(".as3cf-bucket-list a.selected").attr("data-bucket");a(".as3cf-bucket-list a").removeClass("selected"),c.addClass("selected"),d.addClass("saving"),c.find(".spinner").show().css("visibility","visible");var f=c.attr("data-bucket"),h={action:b.prefix+"-save-bucket",bucket_name:f,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.save_bucket},i=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:h,error:function(b,c,f){d.removeClass("saving"),i.showError(as3cf.strings.save_bucket_error,f,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected")},success:function(g,h,j){c.find(".spinner").hide().css("visibility","hidden"),d.removeClass("saving"),"undefined"!=typeof g.success?(i.set(f,g.region,g.can_write),a("#"+b.prefix+"-bucket-select").val("")):(i.showError(as3cf.strings.save_bucket_error,g.error,"as3cf-bucket-select"),a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"))}})}},disabledButtons:function(){if(0!==a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form").length){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");c.find(".as3cf-bucket-name").val().length<3?c.find("button[type=submit]").attr("disabled",!0):c.find("button[type=submit]").attr("disabled",!1),d.find(".as3cf-bucket-name").val().length<3?d.find("button[type=submit]").attr("disabled",!0):d.find("button[type=submit]").attr("disabled",!1)}},showError:function(b,c,d){var e=a(".as3cf-bucket-container").children(":visible"),f=e.find(".as3cf-bucket-error");d="undefined"==typeof d?null:d,(!d||e.hasClass(d))&&(f.find("span.title").html(b+" &mdash;"),f.find("span.message").html(c),f.show(),this.bucketSelectLock=!1)},set:function(i,j,k){var l=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form"),m=a("#"+b.prefix+"-active-bucket");if("as3cf"===b.prefix&&""===m.text()){d("copy-to-s3-wrap"),d("serve-from-s3-wrap");var n=g.attr("id");h[n]=c(n)}a(".as3cf-error.fatal").hide(),m.text(i),l.find(".as3cf-bucket-name").val(i),a("#"+b.prefix+"-bucket").val(i),a("#"+b.prefix+"-region").val(j),a(".updated").not(".as3cf-notice").show(),g.addClass("as3cf-has-bucket"),g.find(".as3cf-can-write-error").toggle(!k),g.find(".as3cf-bucket-error").hide(),"as3cf"===b.prefix&&e(),b.close(f)},create:function(){var c=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form"),d=c.find(".as3cf-bucket-name"),e=c.find(".bucket-create-region"),f=c.find("button[type=submit]"),g=d.val(),h=f.text();a(".as3cf-bucket-error").hide(),f.text(f.attr("data-working")),f.prop("disabled",!0);var i={action:b.prefix+"-create-bucket",bucket_name:g,_nonce:window[b.prefix.replace(/-/g,"_")].nonces.create_bucket};e.val()&&(i.region=e.val());var j=this;a.ajax({url:ajaxurl,type:"POST",dataType:"JSON",data:i,error:function(a,b,c){f.text(h),j.showError(as3cf.strings.create_bucket_error,c,"as3cf-bucket-create")},success:function(b,c,e){f.text(h),f.prop("disabled",!1),"undefined"!=typeof b.success?(j.set(g,b.region,b.can_write),a(".as3cf-bucket-select-region").hide(),a(".as3cf-bucket-select-region").removeAttr("selected"),d.val(""),f.attr("disabled",!0)):j.showError(as3cf.strings.create_bucket_error,b.error,"as3cf-bucket-create")}})},isValidName:function(a){return a.length<3||a.length>63?!1:!0===i.test(a)?!1:!0},updateNameNotice:function(b){var c=null;!0===i.test(b)?c=as3cf.strings.create_bucket_invalid_chars:b.length<3?c=as3cf.strings.create_bucket_name_short:b.length>63&&(c=as3cf.strings.create_bucket_name_long),c&&b.length>0?a(".as3cf-invalid-bucket-name").html(c):a(".as3cf-invalid-bucket-name").html("")}},a(document).ready(function(){var f=a(".wrap.aws-main .nav-tab-wrapper");if(a(".aws-compatibility-notice, div.updated, div.error, div.notice").not(".below-h2, .inline").insertAfter(f),window.location.hash){var i=window.location.hash.substring(1);as3cf.tabs.toggle(i,!0)}else g=a("#tab-"+as3cf.tabs.defaultTab),a(".aws-main").attr("data-tab",as3cf.tabs.defaultTab);a(".aws-main").on("click",".nav-tab",function(b){if(b.preventDefault(),!a(this).hasClass("nav-tab-active")){var c=a(this).attr("data-tab");as3cf.tabs.toggle(c),"media"===c?(window.location.hash="","function"==typeof window.history.replaceState&&"#"===window.location.href.slice(-1)&&history.replaceState({},"",window.location.href.slice(0,-1))):window.location.hash=c}}),j.length&&j.each(function(a,b){h[b.id]=c(b.id)}),a(window).on("beforeunload.as3cf-settings",function(){if(!a.isEmptyObject(h)){var b=g.attr("id");return c(b)!==h[b]?as3cf.strings.save_alert:void 0}}),a(document).on("submit",".as3cf-main-settings form",function(b){a(window).off("beforeunload.as3cf-settings")}),a(".as3cf-switch").on("click",function(b){a(this).hasClass("disabled")||d(a(this).attr("id"))}),j.on("change",".sub-toggle",function(b){var c=a(this).attr("id");a(".as3cf-setting."+c).toggleClass("hide")}),a(".as3cf-domain").on("change",'input[type="radio"]',function(b){var c=a(this).closest('input:radio[name="domain"]:checked'),d=c.val(),e=a(this).parents(".as3cf-domain").find(".as3cf-setting.cloudfront"),f="cloudfront"===d;e.toggleClass("hide",!f)}),a(".as3cf-ssl").on("change",'input[type="radio"]',function(b){var c=a('input:radio[name="ssl"]:checked').val();if("https"===c){var d=a('input:radio[name="domain"]:checked').val();"subdomain"===d&&a('input[name="domain"][value="path"]').attr("checked",!0),a(".subdomain-wrap input").attr("disabled",!0),a(".subdomain-wrap").addClass("disabled")}else a(".subdomain-wrap input").removeAttr("disabled"),a(".subdomain-wrap").removeClass("disabled")}),a(".url-preview").on("change","input",function(a){e()}),a('.as3cf-setting input[type="text"]').keypress(function(a){return 13===a.which?(a.preventDefault(),!1):void 0}),a("#tab-media > .as3cf-bucket-error").detach().insertAfter(".as3cf-bucket-container h3"),a("body").on("click",".bucket-action-manual",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-manual").show().siblings().hide()}),a("body").on("click",".bucket-action-browse",function(c){c.preventDefault(),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-select").show().siblings().hide(),as3cf.buckets.loadList()}),a("body").on("click",".bucket-action-create",function(c){c.preventDefault(),a(".as3cf-bucket-name").val(""),a(".as3cf-invalid-bucket-name").html(""),a(".as3cf-bucket-container."+b.prefix+" .as3cf-bucket-create").show().siblings().hide()}),a("body").on("click",".bucket-action-cancel",function(a){a.preventDefault(),as3cf.buckets.resetModal()}),a("body").on("click",".bucket-action-save",function(a){a.preventDefault(),as3cf.buckets.saveManual()}),a("body").on("click",'.as3cf-create-bucket-form button[type="submit"]',function(a){a.preventDefault(),as3cf.buckets.create()}),a("body").on("click",".bucket-action-refresh",function(a){a.preventDefault(),as3cf.buckets.loadList(!0)}),a("body").on("click",".as3cf-bucket-list a",function(b){b.preventDefault(),as3cf.buckets.saveSelected(a(this))}),a(".as3cf-bucket-container").on("click","a.js-link",function(b){return b.preventDefault(),window.open(a(this).attr("href")),!1}),a("body").on("as3cf-modal-open",function(c,d){if(".as3cf-bucket-container."+b.prefix===d){as3cf.buckets.resetModal();var e=a(".as3cf-bucket-manual h3").data("modal-title");a(".as3cf-bucket-manual h3").text(e),as3cf.buckets.disabledButtons()}}),as3cf.buckets.disabledButtons(),a("body").on("input keyup",".as3cf-create-bucket-form .as3cf-bucket-name",function(c){var d=a(this).val(),e=a(".as3cf-bucket-container."+b.prefix+" .as3cf-create-bucket-form");as3cf.buckets.isValidName(d)?e.find("button[type=submit]").removeAttr("disabled"):e.find("button[type=submit]").attr("disabled",!0),as3cf.buckets.updateNameNotice(d)}),a("body").on("input keyup",".as3cf-manual-save-bucket-form .as3cf-bucket-name",function(c){var d=a(".as3cf-bucket-container."+b.prefix+" .as3cf-manual-save-bucket-form");d.find(".as3cf-bucket-name").val().length<as3cf.buckets.validLength?d.find("button[type=submit]").attr("disabled",!0):d.find("button[type=submit]").removeAttr("disabled")})})}(jQuery,as3cfModal);
classes/amazon-s3-and-cloudfront.php CHANGED
@@ -81,8 +81,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
81
*/
82
function init( $plugin_file_path ) {
83
self::$plugin_page = $this->plugin_slug;
84
- $this->plugin_title = __( 'Offload S3', 'as3cf' );
85
- $this->plugin_menu_title = __( 'S3 and CloudFront', 'as3cf' );
86
87
new AS3CF_Upgrade_Region_Meta( $this );
88
new AS3CF_Upgrade_File_Sizes( $this );
@@ -113,7 +113,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
113
// include compatibility code for other plugins
114
new AS3CF_Plugin_Compatibility( $this );
115
116
- load_plugin_textdomain( 'as3cf', false, dirname( plugin_basename( $plugin_file_path ) ) . '/languages/' );
117
118
// Register modal scripts and styles
119
$this->register_modal_assets();
@@ -518,7 +518,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
518
519
// Check file exists locally before attempting upload
520
if ( ! file_exists( $file_path ) ) {
521
- return new WP_Error( 'exception', sprintf( __( 'File %s does not exist', 'as3cf' ), $file_path ) );
522
}
523
524
$file_name = basename( $file_path );
@@ -527,7 +527,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
527
528
// check mime type of file is in allowed S3 mime types
529
if ( ! in_array( $type, $allowed_types ) ) {
530
- return new WP_Error( 'exception', sprintf( __( 'Mime type %s is not allowed', 'as3cf' ), $type ) );
531
}
532
533
$acl = self::DEFAULT_ACL;
@@ -604,7 +604,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
604
$s3client->putObject( $args );
605
}
606
catch ( Exception $e ) {
607
- $error_msg = sprintf( __( 'Error uploading %s to S3: %s', 'as3cf' ), $file_path, $e->getMessage() );
608
error_log( $error_msg );
609
610
return new WP_Error( 'exception', $error_msg );
@@ -1244,17 +1244,17 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1244
1245
function verify_ajax_request() {
1246
if ( ! is_admin() || ! wp_verify_nonce( sanitize_key( $_POST['_nonce'] ), sanitize_key( $_POST['action'] ) ) ) { // input var okay
1247
- wp_die( __( 'Cheatin&#8217; eh?', 'as3cf' ) );
1248
}
1249
1250
if ( ! current_user_can( 'manage_options' ) ) {
1251
- wp_die( __( 'You do not have sufficient permissions to access this page.', 'as3cf' ) );
1252
}
1253
}
1254
1255
function ajax_check_bucket() {
1256
if ( ! isset( $_POST['bucket_name'] ) || ! ( $bucket = sanitize_text_field( $_POST['bucket_name'] ) ) ) { // input var okay
1257
- $out = array( 'error' => __( 'No bucket name provided.', 'as3cf' ) );
1258
1259
$this->end_ajax( $out );
1260
}
@@ -1529,8 +1529,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1529
try {
1530
$region = $this->get_s3client()->getBucketLocation( array( 'Bucket' => $bucket ) );
1531
} catch ( Exception $e ) {
1532
- $error_msg_title = '<strong>' . __( 'Error Getting Bucket Region', 'as3cf' ) . '</strong> &mdash;';
1533
- $error_msg = sprintf( __( 'There was an error attempting to get the region of the bucket %s: %s', 'as3cf' ), $bucket, $e->getMessage() );
1534
error_log( $error_msg );
1535
1536
return new WP_Error( 'exception', $error_msg_title . $error_msg );
@@ -1650,7 +1650,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1650
}
1651
1652
$file_name = 'as3cf-permission-check.txt';
1653
- $file_contents = __( 'This is a test file to check if the user has write permission to S3. Delete me if found.', 'as3cf' );
1654
1655
$path = $this->get_object_prefix();
1656
$key = $path . $file_name;
@@ -1682,7 +1682,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1682
} catch ( Exception $e ) {
1683
// if we encounter an error that isn't access denied, throw that error
1684
if ( ! $e instanceof Aws\Common\Exception\ServiceResponseException || 'AccessDenied' !== $e->getExceptionCode() ) {
1685
- $error_msg = sprintf( __( 'There was an error attempting to check the permissions of the bucket %s: %s', 'as3cf' ), $bucket, $e->getMessage() );
1686
error_log( $error_msg );
1687
1688
return new WP_Error( 'exception', $error_msg );
@@ -1740,14 +1740,14 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1740
'as3cf',
1741
array(
1742
'strings' => array(
1743
- 'create_bucket_error' => __( 'Error creating bucket', 'as3cf' ),
1744
- 'create_bucket_name_short' => __( 'Bucket name too short.', 'as3cf' ),
1745
- 'create_bucket_name_long' => __( 'Bucket name too long.', 'as3cf' ),
1746
- 'create_bucket_invalid_chars' => __( 'Invalid character. Bucket names can contain lowercase letters, numbers, periods and hyphens.', 'as3cf' ),
1747
- 'save_bucket_error' => __( 'Error saving bucket', 'as3cf' ),
1748
- 'get_buckets_error' => __( 'Error fetching buckets', 'as3cf' ),
1749
- 'get_url_preview_error' => __( 'Error getting URL preview: ', 'as3cf' ),
1750
- 'save_alert' => __( 'The changes you made will be lost if you navigate away from this page', 'as3cf' )
1751
),
1752
'nonces' => array(
1753
'create_bucket' => wp_create_nonce( 'as3cf-create-bucket' ),
@@ -1805,7 +1805,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1805
}
1806
1807
if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), $this->get_settings_nonce_key() ) ) { // input var okay
1808
- die( __( "Cheatin' eh?", 'as3cf' ) );
1809
}
1810
1811
do_action( 'as3cf_pre_save_settings' );
@@ -1908,8 +1908,8 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
1908
*/
1909
function get_settings_tabs() {
1910
$tabs = array(
1911
- 'media' => _x( 'Media Library', 'Show the media library tab', 'as3cf' ),
1912
- 'support' => _x( 'Support', 'Show the support tab', 'as3cf' )
1913
);
1914
1915
return apply_filters( 'as3cf_settings_tabs', $tabs );
@@ -2045,7 +2045,7 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2045
$filename = basename( $s3object['key'] );
2046
$acl = $this->get_acl_display_name( $s3object['acl'] );
2047
2048
- return sprintf( __( 'The file %s has been given %s permissions on Amazon S3.', 'as3cf' ), "<strong>{$filename}</strong>", "<strong>{$acl}</strong>" );
2049
}
2050
2051
/**
@@ -2546,11 +2546,11 @@ class Amazon_S3_And_CloudFront extends AWS_Plugin_Base {
2546
* @return string
2547
*/
2548
function get_access_denied_notice_message( $single = true ) {
2549
- $quick_start = sprintf( '<a class="js-link" href="%s">%s</a>', 'https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/', __( 'Quick Start Guide', 'as3cf' ) );
2550
2551
- $message = sprintf( __( "Looks like we don't have write access to this bucket. It's likely that the user you've provided access keys for hasn't been granted the correct permissions. Please see our %s for instructions on setting up permissions correctly.", 'as3cf' ), $quick_start );
2552
if ( ! $single ) {
2553
- $message = sprintf( __( "Looks like we don't have access to the buckets. It's likely that the user you've provided access keys for hasn't been granted the correct permissions. Please see our %s for instructions on setting up permissions correctly.", 'as3cf' ), $quick_start );
2554
2555
}
2556
81
*/
82
function init( $plugin_file_path ) {
83
self::$plugin_page = $this->plugin_slug;
84
+ $this->plugin_title = __( 'Offload S3', 'amazon-s3-and-cloudfront' );
85
+ $this->plugin_menu_title = __( 'S3 and CloudFront', 'amazon-s3-and-cloudfront' );
86
87
new AS3CF_Upgrade_Region_Meta( $this );
88
new AS3CF_Upgrade_File_Sizes( $this );
113
// include compatibility code for other plugins
114
new AS3CF_Plugin_Compatibility( $this );
115
116
+ load_plugin_textdomain( 'amazon-s3-and-cloudfront', false, dirname( plugin_basename( $plugin_file_path ) ) . '/languages/' );
117
118
// Register modal scripts and styles
119
$this->register_modal_assets();
518
519
// Check file exists locally before attempting upload
520
if ( ! file_exists( $file_path ) ) {
521
+ return new WP_Error( 'exception', sprintf( __( 'File %s does not exist', 'amazon-s3-and-cloudfront' ), $file_path ) );
522
}
523
524
$file_name = basename( $file_path );
527
528
// check mime type of file is in allowed S3 mime types
529
if ( ! in_array( $type, $allowed_types ) ) {
530
+ return new WP_Error( 'exception', sprintf( __( 'Mime type %s is not allowed', 'amazon-s3-and-cloudfront' ), $type ) );
531
}
532
533
$acl = self::DEFAULT_ACL;
604
$s3client->putObject( $args );
605
}
606
catch ( Exception $e ) {
607
+ $error_msg = sprintf( __( 'Error uploading %s to S3: %s', 'amazon-s3-and-cloudfront' ), $file_path, $e->getMessage() );
608
error_log( $error_msg );
609
610
return new WP_Error( 'exception', $error_msg );
1244
1245
function verify_ajax_request() {
1246
if ( ! is_admin() || ! wp_verify_nonce( sanitize_key( $_POST['_nonce'] ), sanitize_key( $_POST['action'] ) ) ) { // input var okay
1247
+ wp_die( __( 'Cheatin&#8217; eh?', 'amazon-s3-and-cloudfront' ) );
1248
}
1249
1250
if ( ! current_user_can( 'manage_options' ) ) {
1251
+ wp_die( __( 'You do not have sufficient permissions to access this page.', 'amazon-s3-and-cloudfront' ) );
1252
}
1253
}
1254
1255
function ajax_check_bucket() {
1256
if ( ! isset( $_POST['bucket_name'] ) || ! ( $bucket = sanitize_text_field( $_POST['bucket_name'] ) ) ) { // input var okay
1257
+ $out = array( 'error' => __( 'No bucket name provided.', 'amazon-s3-and-cloudfront' ) );
1258
1259
$this->end_ajax( $out );
1260
}
1529
try {
1530
$region = $this->get_s3client()->getBucketLocation( array( 'Bucket' => $bucket ) );
1531
} catch ( Exception $e ) {
1532
+ $error_msg_title = '<strong>' . __( 'Error Getting Bucket Region', 'amazon-s3-and-cloudfront' ) . '</strong> &mdash;';
1533
+ $error_msg = sprintf( __( 'There was an error attempting to get the region of the bucket %s: %s', 'amazon-s3-and-cloudfront' ), $bucket, $e->getMessage() );
1534
error_log( $error_msg );
1535
1536
return new WP_Error( 'exception', $error_msg_title . $error_msg );
1650
}
1651
1652
$file_name = 'as3cf-permission-check.txt';
1653
+ $file_contents = __( 'This is a test file to check if the user has write permission to S3. Delete me if found.', 'amazon-s3-and-cloudfront' );
1654
1655
$path = $this->get_object_prefix();
1656
$key = $path . $file_name;
1682
} catch ( Exception $e ) {
1683
// if we encounter an error that isn't access denied, throw that error
1684
if ( ! $e instanceof Aws\Common\Exception\ServiceResponseException || 'AccessDenied' !== $e->getExceptionCode() ) {
1685
+ $error_msg = sprintf( __( 'There was an error attempting to check the permissions of the bucket %s: %s', 'amazon-s3-and-cloudfront' ), $bucket, $e->getMessage() );
1686
error_log( $error_msg );
1687
1688
return new WP_Error( 'exception', $error_msg );
1740
'as3cf',
1741
array(
1742
'strings' => array(
1743
+ 'create_bucket_error' => __( 'Error creating bucket', 'amazon-s3-and-cloudfront' ),
1744
+ 'create_bucket_name_short' => __( 'Bucket name too short.', 'amazon-s3-and-cloudfront' ),
1745
+ 'create_bucket_name_long' => __( 'Bucket name too long.', 'amazon-s3-and-cloudfront' ),
1746
+ 'create_bucket_invalid_chars' => __( 'Invalid character. Bucket names can contain lowercase letters, numbers, periods and hyphens.', 'amazon-s3-and-cloudfront' ),
1747
+ 'save_bucket_error' => __( 'Error saving bucket', 'amazon-s3-and-cloudfront' ),
1748
+ 'get_buckets_error' => __( 'Error fetching buckets', 'amazon-s3-and-cloudfront' ),
1749
+ 'get_url_preview_error' => __( 'Error getting URL preview: ', 'amazon-s3-and-cloudfront' ),
1750
+ 'save_alert' => __( 'The changes you made will be lost if you navigate away from this page', 'amazon-s3-and-cloudfront' )
1751
),
1752
'nonces' => array(
1753
'create_bucket' => wp_create_nonce( 'as3cf-create-bucket' ),
1805
}
1806
1807
if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), $this->get_settings_nonce_key() ) ) { // input var okay
1808
+ die( __( "Cheatin' eh?", 'amazon-s3-and-cloudfront' ) );
1809
}
1810
1811
do_action( 'as3cf_pre_save_settings' );
1908
*/
1909
function get_settings_tabs() {
1910
$tabs = array(
1911
+ 'media' => _x( 'Media Library', 'Show the media library tab', 'amazon-s3-and-cloudfront' ),
1912
+ 'support' => _x( 'Support', 'Show the support tab', 'amazon-s3-and-cloudfront' )
1913
);
1914
1915
return apply_filters( 'as3cf_settings_tabs', $tabs );
2045
$filename = basename( $s3object['key'] );
2046
$acl = $this->get_acl_display_name( $s3object['acl'] );
2047
2048
+ return sprintf( __( 'The file %s has been given %s permissions on Amazon S3.', 'amazon-s3-and-cloudfront' ), "<strong>{$filename}</strong>", "<strong>{$acl}</strong>" );
2049
}
2050
2051
/**
2546
* @return string
2547
*/
2548
function get_access_denied_notice_message( $single = true ) {
2549
+ $quick_start = sprintf( '<a class="js-link" href="%s">%s</a>', 'https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/', __( 'Quick Start Guide', 'amazon-s3-and-cloudfront' ) );
2550
2551
+ $message = sprintf( __( "Looks like we don't have write access to this bucket. It's likely that the user you've provided access keys for hasn't been granted the correct permissions. Please see our %s for instructions on setting up permissions correctly.", 'amazon-s3-and-cloudfront' ), $quick_start );
2552
if ( ! $single ) {
2553
+ $message = sprintf( __( "Looks like we don't have access to the buckets. It's likely that the user you've provided access keys for hasn't been granted the correct permissions. Please see our %s for instructions on setting up permissions correctly.", 'amazon-s3-and-cloudfront' ), $quick_start );
2554
2555
}
2556
classes/as3cf-plugin-compatibility.php CHANGED
@@ -354,7 +354,7 @@ class AS3CF_Plugin_Compatibility {
354
)
355
);
356
} catch ( Exception $e ) {
357
- error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'as3cf' ), $s3_object['key'], $e->getMessage() ) );
358
359
return false;
360
}
354
)
355
);
356
} catch ( Exception $e ) {
357
+ error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'amazon-s3-and-cloudfront' ), $s3_object['key'], $e->getMessage() ) );
358
359
return false;
360
}
classes/as3cf-upgrade.php CHANGED
@@ -276,17 +276,17 @@ abstract class AS3CF_Upgrade {
276
277
switch ( $this->get_upgrade_status() ) {
278
case self::STATUS_RUNNING:
279
- $msg = sprintf( __( '<strong>Running %s Update</strong> &mdash; We&#8217;re going through all the Media Library items uploaded to S3 %s This will be done quietly in the background, processing a small batch of Media Library items every %d minutes. There should be no noticeable impact on your server&#8217;s performance.', 'as3cf' ), ucfirst( $this->upgrade_type ), $this->running_update_text, $this->cron_interval_in_minutes );
280
- $action_text = __( 'Pause Update', 'as3cf' );
281
$action_url = $this->as3cf->get_plugin_page_url( array( 'action' => 'pause_update', 'update' => $this->upgrade_name ), 'self' );
282
break;
283
case self::STATUS_PAUSED:
284
- $msg = sprintf( __( '<strong>%s Update Paused</strong> &mdash; Updating Media Library %s has been paused.', 'as3cf' ), ucfirst( $this->upgrade_type ), $this->upgrade_type );
285
- $action_text = __( 'Restart Update', 'as3cf' );
286
break;
287
case self::STATUS_ERROR:
288
- $msg = sprintf( __( '<strong>Error Updating %s</strong> &mdash; We ran into some errors attempting to update the %s for all your Media Library items that have been uploaded to S3. Please check your error log for details.', 'as3cf' ), ucfirst( $this->upgrade_type ), $this->upgrade_type );
289
- $action_text = __( 'Try Run It Again', 'as3cf' );
290
$msg_type = 'error';
291
break;
292
default:
@@ -388,7 +388,7 @@ abstract class AS3CF_Upgrade {
388
// Add the upgrade interval to the existing schedules.
389
$schedules[ $this->cron_schedule_key ] = array(
390
'interval' => $this->cron_interval_in_minutes * 60,
391
- 'display' => sprintf( __( 'Every %d Minutes', 'as3cf' ), $this->cron_interval_in_minutes ),
392
);
393
394
return $schedules;
276
277
switch ( $this->get_upgrade_status() ) {
278
case self::STATUS_RUNNING:
279
+ $msg = sprintf( __( '<strong>Running %s Update</strong> &mdash; We&#8217;re going through all the Media Library items uploaded to S3 %s This will be done quietly in the background, processing a small batch of Media Library items every %d minutes. There should be no noticeable impact on your server&#8217;s performance.', 'amazon-s3-and-cloudfront' ), ucfirst( $this->upgrade_type ), $this->running_update_text, $this->cron_interval_in_minutes );
280
+ $action_text = __( 'Pause Update', 'amazon-s3-and-cloudfront' );
281
$action_url = $this->as3cf->get_plugin_page_url( array( 'action' => 'pause_update', 'update' => $this->upgrade_name ), 'self' );
282
break;
283
case self::STATUS_PAUSED:
284
+ $msg = sprintf( __( '<strong>%s Update Paused</strong> &mdash; Updating Media Library %s has been paused.', 'amazon-s3-and-cloudfront' ), ucfirst( $this->upgrade_type ), $this->upgrade_type );
285
+ $action_text = __( 'Restart Update', 'amazon-s3-and-cloudfront' );
286
break;
287
case self::STATUS_ERROR:
288
+ $msg = sprintf( __( '<strong>Error Updating %s</strong> &mdash; We ran into some errors attempting to update the %s for all your Media Library items that have been uploaded to S3. Please check your error log for details.', 'amazon-s3-and-cloudfront' ), ucfirst( $this->upgrade_type ), $this->upgrade_type );
289
+ $action_text = __( 'Try Run It Again', 'amazon-s3-and-cloudfront' );
290
$msg_type = 'error';
291
break;
292
default:
388
// Add the upgrade interval to the existing schedules.
389
$schedules[ $this->cron_schedule_key ] = array(
390
'interval' => $this->cron_interval_in_minutes * 60,
391
+ 'display' => sprintf( __( 'Every %d Minutes', 'amazon-s3-and-cloudfront' ), $this->cron_interval_in_minutes ),
392
);
393
394
return $schedules;
classes/upgrades/as3cf-file-sizes.php CHANGED
@@ -34,7 +34,7 @@ class AS3CF_Upgrade_File_Sizes extends AS3CF_Upgrade {
34
$this->upgrade_name = 'file_sizes';
35
$this->upgrade_type = 'attachments';
36
37
- $this->running_update_text = __( 'and updating the metadata with the sizes of files that have been removed from the server. This will allow us to serve the correct size for media items and the total space used in Multisite subsites.', 'as3cf' );
38
39
parent::__construct( $as3cf );
40
}
34
$this->upgrade_name = 'file_sizes';
35
$this->upgrade_type = 'attachments';
36
37
+ $this->running_update_text = __( 'and updating the metadata with the sizes of files that have been removed from the server. This will allow us to serve the correct size for media items and the total space used in Multisite subsites.', 'amazon-s3-and-cloudfront' );
38
39
parent::__construct( $as3cf );
40
}
classes/upgrades/as3cf-meta-wp-error.php CHANGED
@@ -35,7 +35,7 @@ class AS3CF_Upgrade_Meta_WP_Error extends AS3CF_Upgrade {
35
$this->upgrade_name = 'meta_error';
36
$this->upgrade_type = 'attachments';
37
38
- $this->running_update_text = __( 'and rebuilding the metadata for attachments that may have been corrupted.', 'as3cf' );
39
40
parent::__construct( $as3cf );
41
}
@@ -69,7 +69,7 @@ class AS3CF_Upgrade_Meta_WP_Error extends AS3CF_Upgrade {
69
);
70
$this->as3cf->get_s3client( $s3object['region'], true )->getObject( $args );
71
} catch ( Exception $e ) {
72
- error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'as3cf' ), $s3object['key'], $e->getMessage() ) );
73
74
return false;
75
}
35
$this->upgrade_name = 'meta_error';
36
$this->upgrade_type = 'attachments';
37
38
+ $this->running_update_text = __( 'and rebuilding the metadata for attachments that may have been corrupted.', 'amazon-s3-and-cloudfront' );
39
40
parent::__construct( $as3cf );
41
}
69
);
70
$this->as3cf->get_s3client( $s3object['region'], true )->getObject( $args );
71
} catch ( Exception $e ) {
72
+ error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'amazon-s3-and-cloudfront' ), $s3object['key'], $e->getMessage() ) );
73
74
return false;
75
}
classes/upgrades/as3cf-region-meta.php CHANGED
@@ -33,7 +33,7 @@ class AS3CF_Upgrade_Region_Meta extends AS3CF_Upgrade {
33
$this->upgrade_name = 'meta_with_region';
34
$this->upgrade_type = 'metadata';
35
36
- $this->running_update_text = __( 'and updating the metadata with the bucket region it is served from. This will allow us to serve your files from the proper S3 region subdomain <span style="white-space:nowrap;">(e.g. s3-us-west-2.amazonaws.com)</span>.', 'as3cf' );
37
38
parent::__construct( $as3cf );
39
}
33
$this->upgrade_name = 'meta_with_region';
34
$this->upgrade_type = 'metadata';
35
36
+ $this->running_update_text = __( 'and updating the metadata with the bucket region it is served from. This will allow us to serve your files from the proper S3 region subdomain <span style="white-space:nowrap;">(e.g. s3-us-west-2.amazonaws.com)</span>.', 'amazon-s3-and-cloudfront' );
37
38
parent::__construct( $as3cf );
39
}
classes/wp-aws-compatibility-check.php CHANGED
@@ -307,26 +307,26 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
307
$parent_plugin_link_html = sprintf( '<a style="text-decoration:none;" href="%s">%s</a>', $this->get_parent_plugin_url(), $this->get_parent_plugin_name() );
308
309
$deactivate_url = $this->get_plugin_action_url( 'deactivate', $plugin_basename );
310
- $deactivate_link = sprintf( '<a style="text-decoration:none;" href="%s">%s</a>', $deactivate_url, __( 'deactivate', 'as3cf' ) );
311
- $hide_notice_msg = '<br><em>' . sprintf( __( 'You can %s the %s plugin to get rid of this notice.', 'as3cf' ), $deactivate_link, $this->plugin_name ) . '</em>';
312
313
if ( ! $this->is_parent_plugin_enabled() ) {
314
- $msg = sprintf( __( '%s has been disabled as it requires the %s plugin.', 'as3cf' ), $this->plugin_name, $parent_plugin_link_html );
315
316
if ( file_exists( WP_PLUGIN_DIR . '/' . $parent_basename ) ) {
317
if ( isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) && ! $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) {
318
- $msg = rtrim( $msg, '.' ) . ', ' . __( 'which is currently disabled.', 'as3cf' );
319
} else {
320
- $msg .= ' ' . __( 'It appears to be installed already.', 'as3cf' );
321
$activate_url = $this->get_plugin_action_url( 'activate', $parent_basename );
322
- $msg .= ' <a style="font-weight:bold;text-decoration:none;" href="' . $activate_url . '">' . _x( 'Activate it now.', 'Activate plugin', 'as3cf' ) . '</a>';
323
}
324
} else {
325
$install_url = 'https://deliciousbrains.com/my-account/';
326
if ( is_null( $this->parent_plugin_url ) ) {
327
$install_url = $this->get_plugin_action_url( 'install', $this->parent_plugin_slug );
328
}
329
- $msg .= ' ' . sprintf( __( '<a href="%s">Install</a> and activate it.', 'as3cf' ), $install_url );
330
}
331
332
$msg .= $hide_notice_msg;
@@ -337,17 +337,17 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
337
$current_parent_plugin_version = isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] ) ? $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] : 0;
338
339
if ( ! version_compare( $current_parent_plugin_version, $this->parent_plugin_required_version, '>=' ) ) {
340
- $msg = sprintf( __( '%s has been disabled as it requires version %s or later of the %s plugin.', 'as3cf' ), $this->plugin_name, $this->parent_plugin_required_version, $parent_plugin_link_html );
341
342
if ( $current_parent_plugin_version ) {
343
- $msg .= ' ' . sprintf( __( 'You currently have version %s installed.', 'as3cf' ), $current_parent_plugin_version );
344
}
345
346
global $as3cfpro;
347
if ( ! empty( $as3cfpro ) && $as3cfpro->get_plugin_slug() === $this->parent_plugin_slug ) {
348
// Don't show update link for addons of a licensed plugin where the license is invalid
349
if ( ! $as3cfpro->is_valid_licence() ) {
350
- $msg .= ' ' . sprintf( __( 'A valid license for %s is required to update.', 'as3cf' ), $this->get_parent_plugin_name() );
351
$msg .= $hide_notice_msg;
352
353
return $this->set_error_msg( $msg );
@@ -355,7 +355,7 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
355
}
356
357
$update_url = $this->get_plugin_action_url( 'upgrade', $parent_basename );
358
- $msg .= ' <a style="font-weight:bold;text-decoration:none;white-space:nowrap;" href="' . $update_url . '">' . __( 'Update to the latest version', 'as3cf' ) . '</a>';
359
360
$msg .= $hide_notice_msg;
361
@@ -367,7 +367,7 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
367
}
368
369
if ( ! isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['supported_addon_versions'][ $this->plugin_slug ] ) ) {
370
- $msg = sprintf( __( '%1$s has been disabled because it is not a supported addon of the %2$s plugin.', 'as3cf' ), $this->plugin_name, $this->get_parent_plugin_name() );
371
372
return $this->set_error_msg( $msg );
373
}
@@ -376,10 +376,10 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
376
$this_plugin_version = $GLOBALS['aws_meta'][ $this->plugin_slug ]['version'];
377
378
if ( ! version_compare( $this_plugin_version, $this_plugin_version_required, '>=' ) ) {
379
- $msg = sprintf( __( '%1$s has been disabled because it will not work with the version of the %2$s plugin installed. %1$s %3$s or later is required.', 'as3cf' ), $this->plugin_name, $this->get_parent_plugin_name(), $this_plugin_version_required );
380
381
$update_url = $this->get_plugin_action_url( 'upgrade', $plugin_basename );
382
- $msg .= ' <a style="font-weight:bold;text-decoration:none;white-space:nowrap;" href="' . $update_url . '">' . sprintf( __( 'Update %s to the latest version', 'as3cf' ), $this->plugin_name ) . '</a>';
383
384
$msg .= $hide_notice_msg;
385
@@ -439,7 +439,7 @@ if ( ! class_exists( 'WP_AWS_Compatibility_Check' ) ) {
439
}
440
441
if ( $this->deactivate_if_not_compatible ) {
442
- $deactivated_msg = sprintf( __( 'The %s plugin has been deactivated.', 'as3cf' ), $this->plugin_name );
443
444
$error_msg = $deactivated_msg . ' ' . $error_msg;
445
$this->render_notice( $error_msg );
307
$parent_plugin_link_html = sprintf( '<a style="text-decoration:none;" href="%s">%s</a>', $this->get_parent_plugin_url(), $this->get_parent_plugin_name() );
308
309
$deactivate_url = $this->get_plugin_action_url( 'deactivate', $plugin_basename );
310
+ $deactivate_link = sprintf( '<a style="text-decoration:none;" href="%s">%s</a>', $deactivate_url, __( 'deactivate', 'amazon-s3-and-cloudfront' ) );
311
+ $hide_notice_msg = '<br><em>' . sprintf( __( 'You can %s the %s plugin to get rid of this notice.', 'amazon-s3-and-cloudfront' ), $deactivate_link, $this->plugin_name ) . '</em>';
312
313
if ( ! $this->is_parent_plugin_enabled() ) {
314
+ $msg = sprintf( __( '%s has been disabled as it requires the %s plugin.', 'amazon-s3-and-cloudfront' ), $this->plugin_name, $parent_plugin_link_html );
315
316
if ( file_exists( WP_PLUGIN_DIR . '/' . $parent_basename ) ) {
317
if ( isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) && ! $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) {
318
+ $msg = rtrim( $msg, '.' ) . ', ' . __( 'which is currently disabled.', 'amazon-s3-and-cloudfront' );
319
} else {
320
+ $msg .= ' ' . __( 'It appears to be installed already.', 'amazon-s3-and-cloudfront' );
321
$activate_url = $this->get_plugin_action_url( 'activate', $parent_basename );
322
+ $msg .= ' <a style="font-weight:bold;text-decoration:none;" href="' . $activate_url . '">' . _x( 'Activate it now.', 'Activate plugin', 'amazon-s3-and-cloudfront' ) . '</a>';
323
}
324
} else {
325
$install_url = 'https://deliciousbrains.com/my-account/';
326
if ( is_null( $this->parent_plugin_url ) ) {
327
$install_url = $this->get_plugin_action_url( 'install', $this->parent_plugin_slug );
328
}
329
+ $msg .= ' ' . sprintf( __( '<a href="%s">Install</a> and activate it.', 'amazon-s3-and-cloudfront' ), $install_url );
330
}
331
332
$msg .= $hide_notice_msg;
337
$current_parent_plugin_version = isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] ) ? $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] : 0;
338
339
if ( ! version_compare( $current_parent_plugin_version, $this->parent_plugin_required_version, '>=' ) ) {
340
+ $msg = sprintf( __( '%s has been disabled as it requires version %s or later of the %s plugin.', 'amazon-s3-and-cloudfront' ), $this->plugin_name, $this->parent_plugin_required_version, $parent_plugin_link_html );
341
342
if ( $current_parent_plugin_version ) {
343
+ $msg .= ' ' . sprintf( __( 'You currently have version %s installed.', 'amazon-s3-and-cloudfront' ), $current_parent_plugin_version );
344
}
345
346
global $as3cfpro;
347
if ( ! empty( $as3cfpro ) && $as3cfpro->get_plugin_slug() === $this->parent_plugin_slug ) {
348
// Don't show update link for addons of a licensed plugin where the license is invalid
349
if ( ! $as3cfpro->is_valid_licence() ) {
350
+ $msg .= ' ' . sprintf( __( 'A valid license for %s is required to update.', 'amazon-s3-and-cloudfront' ), $this->get_parent_plugin_name() );
351
$msg .= $hide_notice_msg;
352
353
return $this->set_error_msg( $msg );
355
}
356
357
$update_url = $this->get_plugin_action_url( 'upgrade', $parent_basename );
358
+ $msg .= ' <a style="font-weight:bold;text-decoration:none;white-space:nowrap;" href="' . $update_url . '">' . __( 'Update to the latest version', 'amazon-s3-and-cloudfront' ) . '</a>';
359
360
$msg .= $hide_notice_msg;
361
367
}
368
369
if ( ! isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['supported_addon_versions'][ $this->plugin_slug ] ) ) {
370
+ $msg = sprintf( __( '%1$s has been disabled because it is not a supported addon of the %2$s plugin.', 'amazon-s3-and-cloudfront' ), $this->plugin_name, $this->get_parent_plugin_name() );
371
372
return $this->set_error_msg( $msg );
373
}
376
$this_plugin_version = $GLOBALS['aws_meta'][ $this->plugin_slug ]['version'];
377
378
if ( ! version_compare( $this_plugin_version, $this_plugin_version_required, '>=' ) ) {
379
+ $msg = sprintf( __( '%1$s has been disabled because it will not work with the version of the %2$s plugin installed. %1$s %3$s or later is required.', 'amazon-s3-and-cloudfront' ), $this->plugin_name, $this->get_parent_plugin_name(), $this_plugin_version_required );
380
381
$update_url = $this->get_plugin_action_url( 'upgrade', $plugin_basename );
382
+ $msg .= ' <a style="font-weight:bold;text-decoration:none;white-space:nowrap;" href="' . $update_url . '">' . sprintf( __( 'Update %s to the latest version', 'amazon-s3-and-cloudfront' ), $this->plugin_name ) . '</a>';
383
384
$msg .= $hide_notice_msg;
385
439
}
440
441
if ( $this->deactivate_if_not_compatible ) {
442
+ $deactivated_msg = sprintf( __( 'The %s plugin has been deactivated.', 'amazon-s3-and-cloudfront' ), $this->plugin_name );
443
444
$error_msg = $deactivated_msg . ' ' . $error_msg;
445
$this->render_notice( $error_msg );
languages/amazon-s3-and-cloudfront-en.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
msgstr ""
9
"Project-Id-Version: amazon-s3-and-cloudfront\n"
10
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
- "POT-Creation-Date: 2015-09-01 09:58+0100\n"
12
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
"Language-Team: LANGUAGE <LL@li.org>\n"
8
msgstr ""
9
"Project-Id-Version: amazon-s3-and-cloudfront\n"
10
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
+ "POT-Creation-Date: 2015-10-01 18:10+0100\n"
12
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
"Language-Team: LANGUAGE <LL@li.org>\n"
languages/{as3cf-pt-br.mo → amazon-s3-and-cloudfront-pt-br.mo} RENAMED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: bradt, deliciousbrains
3
Tags: uploads, amazon, s3, mirror, admin, media, cdn, cloudfront
4
Requires at least: 3.7
5
Tested up to: 4.3
6
- Stable tag: 0.9.5
7
License: GPLv3
8
9
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
@@ -63,6 +63,10 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
63
64
== Changelog ==
65
66
= 0.9.5 - 2015-09-01 =
67
* Bug fix: Fatal error: Cannot use object of type WP_Error as array
68
3
Tags: uploads, amazon, s3, mirror, admin, media, cdn, cloudfront
4
Requires at least: 3.7
5
Tested up to: 4.3
6
+ Stable tag: 0.9.6
7
License: GPLv3
8
9
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
63
64
== Changelog ==
65
66
+ = 0.9.6 - 2015-10-01 =
67
+
68
+ * Improvement: Update text domains for translate.wordpress.org integration
69
+
70
= 0.9.5 - 2015-09-01 =
71
* Bug fix: Fatal error: Cannot use object of type WP_Error as array
72
view/bucket-select.php CHANGED
@@ -1,49 +1,49 @@
1
<div class="as3cf-bucket-container <?php echo $prefix ;?>">
2
<div class="as3cf-bucket-manual">
3
- <h3 data-modal-title="<?php _e( 'Change bucket', 'as3cf' ); ?>"><?php _e( 'What bucket would you like to use?', 'as3cf' ); ?></h3>
4
<form method="post" class="as3cf-manual-save-bucket-form">
5
- <input type="text" class="as3cf-bucket-name" name="bucket_name" placeholder="<?php _e( 'Existing bucket name', 'as3cf' ); ?>" value="<?php echo $selected_bucket; ?>">
6
<p class="bucket-actions actions manual">
7
- <button type="submit" class="bucket-action-save button button-primary" data-working="<?php _e( 'Saving...', 'as3cf' ); ?>"><?php _e( 'Save Bucket', 'as3cf' ); ?></button>
8
- <span><a href="#" class="bucket-action-browse"><?php _e( 'Browse existing buckets', 'as3cf' ); ?></a></span>
9
- <span><a href="#" class="bucket-action-create"><?php _e( 'Create new bucket', 'as3cf' ); ?></a></span>
10
</p>
11
<p class="bucket-actions actions select">
12
- <button type="submit" class="bucket-action-save button button-primary" data-working="<?php _e( 'Saving...', 'as3cf' ); ?>"><?php _e( 'Save Bucket', 'as3cf' ); ?></button>
13
- <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'as3cf' ); ?></a></span>
14
</p>
15
</form>
16
</div>
17
<div class="as3cf-bucket-select">
18
- <h3><?php _e( 'Select bucket', 'as3cf' ); ?></h3>
19
- <ul class="as3cf-bucket-list" data-working="<?php _e( 'Loading...', 'as3cf' ); ?>"></ul>
20
<p class="bucket-actions actions manual">
21
- <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'as3cf' ); ?></a></span>
22
- <span class="right"><a href="#" class="bucket-action-refresh"><?php _e( 'Refresh', 'as3cf' ); ?></a></span>
23
</p>
24
<p class="bucket-actions actions select">
25
- <span><a href="#" class="bucket-action-manual"><?php _e( 'Enter bucket name', 'as3cf' ); ?></a></span>
26
- <span><a href="#" class="bucket-action-create"><?php _e( 'Create new bucket', 'as3cf' ); ?></a></span>
27
- <span class="right"><a href="#" class="bucket-action-refresh"><?php _e( 'Refresh', 'as3cf' ); ?></a></span>
28
</p>
29
</div>
30
<div class="as3cf-bucket-create">
31
- <h3><?php _e( 'Create new bucket', 'as3cf' ); ?></h3>
32
<form method="post" class="as3cf-create-bucket-form">
33
<?php wp_nonce_field( 'as3cf-save-settings' ) ?>
34
<table class="form-table">
35
<tr>
36
<td>
37
- <?php _e( 'Bucket Name:', 'as3cf' ); ?>
38
</td>
39
<td>
40
- <input type="text" class="as3cf-bucket-name" name="bucket_name" placeholder="<?php _e( 'Bucket Name', 'as3cf' ); ?>">
41
<p class="as3cf-invalid-bucket-name"></p>
42
</td>
43
</tr>
44
<tr>
45
<td>
46
- <?php _e( 'Region:', 'as3cf' ); ?>
47
</td>
48
<td>
49
<?php
@@ -57,14 +57,14 @@
57
<?php } else {
58
$region = AS3CF_REGION;
59
$region_name = isset( $aws_regions[ $region ] ) ? $aws_regions[ $region ] : $region;
60
- printf( __( '%s (defined in wp-config.php)', 'as3cf' ), $region_name );
61
} ?>
62
</td>
63
</tr>
64
</table>
65
<p class="bucket-actions actions">
66
- <button type="submit" class="button button-primary" data-working="<?php _e( 'Creating...', 'as3cf' ); ?>"><?php _e( 'Create New Bucket', 'as3cf' ); ?></button>
67
- <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'as3cf' ); ?></a></span>
68
</p>
69
</form>
70
</div>
1
<div class="as3cf-bucket-container <?php echo $prefix ;?>">
2
<div class="as3cf-bucket-manual">
3
+ <h3 data-modal-title="<?php _e( 'Change bucket', 'amazon-s3-and-cloudfront' ); ?>"><?php _e( 'What bucket would you like to use?', 'amazon-s3-and-cloudfront' ); ?></h3>
4
<form method="post" class="as3cf-manual-save-bucket-form">
5
+ <input type="text" class="as3cf-bucket-name" name="bucket_name" placeholder="<?php _e( 'Existing bucket name', 'amazon-s3-and-cloudfront' ); ?>" value="<?php echo $selected_bucket; ?>">
6
<p class="bucket-actions actions manual">
7
+ <button type="submit" class="bucket-action-save button button-primary" data-working="<?php _e( 'Saving...', 'amazon-s3-and-cloudfront' ); ?>"><?php _e( 'Save Bucket', 'amazon-s3-and-cloudfront' ); ?></button>
8
+ <span><a href="#" class="bucket-action-browse"><?php _e( 'Browse existing buckets', 'amazon-s3-and-cloudfront' ); ?></a></span>
9
+ <span><a href="#" class="bucket-action-create"><?php _e( 'Create new bucket', 'amazon-s3-and-cloudfront' ); ?></a></span>
10
</p>
11
<p class="bucket-actions actions select">
12
+ <button type="submit" class="bucket-action-save button button-primary" data-working="<?php _e( 'Saving...', 'amazon-s3-and-cloudfront' ); ?>"><?php _e( 'Save Bucket', 'amazon-s3-and-cloudfront' ); ?></button>
13
+ <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'amazon-s3-and-cloudfront' ); ?></a></span>
14
</p>
15
</form>
16
</div>
17
<div class="as3cf-bucket-select">
18
+ <h3><?php _e( 'Select bucket', 'amazon-s3-and-cloudfront' ); ?></h3>
19
+ <ul class="as3cf-bucket-list" data-working="<?php _e( 'Loading...', 'amazon-s3-and-cloudfront' ); ?>"></ul>
20
<p class="bucket-actions actions manual">
21
+ <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'amazon-s3-and-cloudfront' ); ?></a></span>
22
+ <span class="right"><a href="#" class="bucket-action-refresh"><?php _e( 'Refresh', 'amazon-s3-and-cloudfront' ); ?></a></span>
23
</p>
24
<p class="bucket-actions actions select">
25
+ <span><a href="#" class="bucket-action-manual"><?php _e( 'Enter bucket name', 'amazon-s3-and-cloudfront' ); ?></a></span>
26
+ <span><a href="#" class="bucket-action-create"><?php _e( 'Create new bucket', 'amazon-s3-and-cloudfront' ); ?></a></span>
27
+ <span class="right"><a href="#" class="bucket-action-refresh"><?php _e( 'Refresh', 'amazon-s3-and-cloudfront' ); ?></a></span>
28
</p>
29
</div>
30
<div class="as3cf-bucket-create">
31
+ <h3><?php _e( 'Create new bucket', 'amazon-s3-and-cloudfront' ); ?></h3>
32
<form method="post" class="as3cf-create-bucket-form">
33
<?php wp_nonce_field( 'as3cf-save-settings' ) ?>
34
<table class="form-table">
35
<tr>
36
<td>
37
+ <?php _e( 'Bucket Name:', 'amazon-s3-and-cloudfront' ); ?>
38
</td>
39
<td>
40
+ <input type="text" class="as3cf-bucket-name" name="bucket_name" placeholder="<?php _e( 'Bucket Name', 'amazon-s3-and-cloudfront' ); ?>">
41
<p class="as3cf-invalid-bucket-name"></p>
42
</td>
43
</tr>
44
<tr>
45
<td>
46
+ <?php _e( 'Region:', 'amazon-s3-and-cloudfront' ); ?>
47
</td>
48
<td>
49
<?php
57
<?php } else {
58
$region = AS3CF_REGION;
59
$region_name = isset( $aws_regions[ $region ] ) ? $aws_regions[ $region ] : $region;
60
+ printf( __( '%s (defined in wp-config.php)', 'amazon-s3-and-cloudfront' ), $region_name );
61
} ?>
62
</td>
63
</tr>
64
</table>
65
<p class="bucket-actions actions">
66
+ <button type="submit" class="button button-primary" data-working="<?php _e( 'Creating...', 'amazon-s3-and-cloudfront' ); ?>"><?php _e( 'Create New Bucket', 'amazon-s3-and-cloudfront' ); ?></button>
67
+ <span><a href="#" class="bucket-action-cancel"><?php _e( 'Cancel', 'amazon-s3-and-cloudfront' ); ?></a></span>
68
</p>
69
</form>
70
</div>
view/bucket-setting.php CHANGED
@@ -4,13 +4,13 @@ $tr_class = ( isset( $tr_class ) ) ? $tr_class : '';
4
?>
5
6
<tr class="<?php echo $tr_class; ?>">
7
- <td><h3><?php _e( 'Bucket', 'as3cf' ); ?></h3></td>
8
<td>
9
<span id="<?php echo $prefix; ?>-active-bucket" class="as3cf-active-bucket"><?php echo $selected_bucket; // xss ok ?></span>
10
<?php if ( ! defined( $constant ) ) { ?>
11
- <a href="#" class="as3cf-change-bucket" data-as3cf-modal=".as3cf-bucket-container"><?php _e( 'Change', 'as3cf' ); ?></a>
12
<?php } else {
13
- _e( '(defined in wp-config.php)', 'as3cf' );
14
} ?>
15
<input id="<?php echo $prefix; ?>-bucket" type="hidden" class="no-compare" name="bucket" value="<?php echo esc_attr( $selected_bucket ); ?>">
16
<?php
4
?>
5
6
<tr class="<?php echo $tr_class; ?>">
7
+ <td><h3><?php _e( 'Bucket', 'amazon-s3-and-cloudfront' ); ?></h3></td>
8
<td>
9
<span id="<?php echo $prefix; ?>-active-bucket" class="as3cf-active-bucket"><?php echo $selected_bucket; // xss ok ?></span>
10
<?php if ( ! defined( $constant ) ) { ?>
11
+ <a href="#" class="as3cf-change-bucket" data-as3cf-modal=".as3cf-bucket-container"><?php _e( 'Change', 'amazon-s3-and-cloudfront' ); ?></a>
12
<?php } else {
13
+ _e( '(defined in wp-config.php)', 'amazon-s3-and-cloudfront' );
14
} ?>
15
<input id="<?php echo $prefix; ?>-bucket" type="hidden" class="no-compare" name="bucket" value="<?php echo esc_attr( $selected_bucket ); ?>">
16
<?php
view/debug-info.php CHANGED
@@ -1,5 +1,5 @@
1
<div class="debug support-section">
2
- <h3><?php _e( 'Diagnostic Info', 'as3cf' ); ?></h3>
3
<textarea class="debug-log-textarea" autocomplete="off" readonly><?php $this->output_diagnostic_info(); ?></textarea>
4
<?php
5
$args = array(
@@ -8,5 +8,5 @@
8
'hash' => 'support',
9
);
10
$url = $this->get_plugin_page_url( $args, 'network', false ); ?>
11
- <a href="<?php echo esc_url( $url ); ?>" class="button"><?php _ex( 'Download', 'Download to your computer', 'as3cf' ); ?></a>
12
</div>
1
<div class="debug support-section">
2
+ <h3><?php _e( 'Diagnostic Info', 'amazon-s3-and-cloudfront' ); ?></h3>
3
<textarea class="debug-log-textarea" autocomplete="off" readonly><?php $this->output_diagnostic_info(); ?></textarea>
4
<?php
5
$args = array(
8
'hash' => 'support',
9
);
10
$url = $this->get_plugin_page_url( $args, 'network', false ); ?>
11
+ <a href="<?php echo esc_url( $url ); ?>" class="button"><?php _ex( 'Download', 'Download to your computer', 'amazon-s3-and-cloudfront' ); ?></a>
12
</div>
view/domain-setting.php CHANGED
@@ -2,7 +2,7 @@
2
$tr_class = ( isset( $tr_class ) ) ? $tr_class : ''; ?>
3
<tr class="<?php echo $tr_class; ?>">
4
<td>
5
- <h4><?php _e( 'Domain:', 'as3cf' ) ?></h4>
6
</td>
7
<td>
8
<?php
@@ -20,22 +20,22 @@ $tr_class = ( isset( $tr_class ) ) ? $tr_class : ''; ?>
20
<div class="as3cf-domain as3cf-radio-group">
21
<label class="subdomain-wrap <?php echo $subdomain_class; // xss ok?>">
22
<input type="radio" name="domain" value="subdomain" <?php checked( $domain, 'subdomain' ); ?> <?php echo $subdomain_disabled; // xss ok ?>>
23
- <?php _e( 'Bucket name as subdomain', 'as3cf' ); ?>
24
<p>http://bucket-name.s3.amazon.com/&hellip;</p>
25
</label>
26
<label>
27
<input type="radio" name="domain" value="path" <?php checked( $domain, 'path' ); ?>>
28
- <?php _e( 'Bucket name in path', 'as3cf' ); ?>
29
<p>http://s3.amazon.com/bucket-name/&hellip;</p>
30
</label>
31
<label>
32
<input type="radio" name="domain" value="virtual-host" <?php checked( $domain, 'virtual-host' ); ?>>
33
- <?php _e( 'Bucket name as domain', 'as3cf' ); ?>
34
<p>http://bucket-name/&hellip;</p>
35
</label>
36
<label>
37
<input id="cloudfront" type="radio" name="domain" value="cloudfront" <?php checked( $domain, 'cloudfront' ); ?>>
38
- <?php _e( 'CloudFront or custom domain', 'as3cf' ); ?>
39
<p class="as3cf-setting cloudfront <?php echo ( 'cloudfront' == $domain ) ? '' : 'hide'; // xss ok ?>">
40
<input type="text" name="cloudfront" value="<?php echo esc_attr( $this->get_setting( 'cloudfront' ) ); ?>" size="30" />
41
</p>
2
$tr_class = ( isset( $tr_class ) ) ? $tr_class : ''; ?>
3
<tr class="<?php echo $tr_class; ?>">
4
<td>
5
+ <h4><?php _e( 'Domain:', 'amazon-s3-and-cloudfront' ) ?></h4>
6
</td>
7
<td>
8
<?php
20
<div class="as3cf-domain as3cf-radio-group">
21
<label class="subdomain-wrap <?php echo $subdomain_class; // xss ok?>">
22
<input type="radio" name="domain" value="subdomain" <?php checked( $domain, 'subdomain' ); ?> <?php echo $subdomain_disabled; // xss ok ?>>
23
+ <?php _e( 'Bucket name as subdomain', 'amazon-s3-and-cloudfront' ); ?>
24
<p>http://bucket-name.s3.amazon.com/&hellip;</p>
25
</label>
26
<label>
27
<input type="radio" name="domain" value="path" <?php checked( $domain, 'path' ); ?>>
28
+ <?php _e( 'Bucket name in path', 'amazon-s3-and-cloudfront' ); ?>
29
<p>http://s3.amazon.com/bucket-name/&hellip;</p>
30
</label>
31
<label>
32
<input type="radio" name="domain" value="virtual-host" <?php checked( $domain, 'virtual-host' ); ?>>
33
+ <?php _e( 'Bucket name as domain', 'amazon-s3-and-cloudfront' ); ?>
34
<p>http://bucket-name/&hellip;</p>
35
</label>
36
<label>
37
<input id="cloudfront" type="radio" name="domain" value="cloudfront" <?php checked( $domain, 'cloudfront' ); ?>>
38
+ <?php _e( 'CloudFront or custom domain', 'amazon-s3-and-cloudfront' ); ?>
39
<p class="as3cf-setting cloudfront <?php echo ( 'cloudfront' == $domain ) ? '' : 'hide'; // xss ok ?>">
40
<input type="text" name="cloudfront" value="<?php echo esc_attr( $this->get_setting( 'cloudfront' ) ); ?>" size="30" />
41
</p>
view/error-access.php CHANGED
@@ -1,7 +1,7 @@
1
<div class="error inline as3cf-can-write-error as3cf-error" style="<?php echo ( $can_write ) ? 'display: none;' : ''; // xss ok ?>">
2
<p>
3
<strong>
4
- <?php _e( 'Access Denied to Bucket', 'as3cf' ); ?>
5
</strong>&mdash;
6
<?php echo $this->get_access_denied_notice_message(); ?>
7
</p>
1
<div class="error inline as3cf-can-write-error as3cf-error" style="<?php echo ( $can_write ) ? 'display: none;' : ''; // xss ok ?>">
2
<p>
3
<strong>
4
+ <?php _e( 'Access Denied to Bucket', 'amazon-s3-and-cloudfront' ); ?>
5
</strong>&mdash;
6
<?php echo $this->get_access_denied_notice_message(); ?>
7
</p>
view/settings.php CHANGED
@@ -7,7 +7,7 @@ $prefix = $this->get_plugin_prefix_slug();
7
?>
8
<div class="notice is-dismissible as3cf-updated updated inline <?php echo $updated_class; // xss ok ?>">
9
<p>
10
- <?php _e( 'Settings saved.', 'as3cf' ); ?>
11
</p>
12
</div>
13
<?php
@@ -41,15 +41,15 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
41
)
42
); ?>
43
<tr class="as3cf-setting-title">
44
- <td colspan="2"><h3><?php _e( 'Enable/Disable the Plugin', 'as3cf' ); ?></h3></td>
45
</tr>
46
<tr>
47
<td>
48
<?php $this->render_view( 'checkbox', array( 'key' => 'copy-to-s3' ) ); ?>
49
</td>
50
<td>
51
- <h4><?php _e( 'Copy Files to S3', 'as3cf' ) ?></h4>
52
- <p><?php _e( 'When a file is uploaded to the Media Library, copy it to S3. Existing files are <em>not</em> copied to S3.', 'as3cf' ) ?></p>
53
</td>
54
</tr>
55
<tr class="as3cf-border-bottom">
@@ -57,12 +57,12 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
57
<?php $this->render_view( 'checkbox', array( 'key' => 'serve-from-s3' ) ); ?>
58
</td>
59
<td>
60
- <h4><?php _e( 'Rewrite File URLs', 'as3cf' ) ?></h4>
61
- <p><?php _e( 'For Media Library files that have been copied to S3, rewrite the URLs so that they are served from S3/CloudFront instead of your server.', 'as3cf' ) ?></p>
62
</td>
63
</tr>
64
<tr class="configure-url as3cf-setting-title">
65
- <td colspan="2"><h3><?php _e( 'Configure File URLs', 'as3cf' ); ?></h3></td>
66
</tr>
67
<tr class="configure-url">
68
<td colspan="2">
@@ -80,9 +80,9 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
80
<?php $this->render_view( 'checkbox', array( 'key' => 'enable-object-prefix', 'class' => 'sub-toggle' ) ); ?>
81
</td>
82
<td>
83
- <h4><?php _e( 'Path', 'as3cf' ) ?></h4>
84
<p class="object-prefix-desc">
85
- <?php _e( 'By default the path is the same as your local WordPress files:', 'as3cf' ); ?>
86
<em><?php echo $this->get_default_object_prefix(); // xss ok ?></em>
87
</p>
88
<p class="as3cf-setting enable-object-prefix <?php echo ( $this->get_setting( 'enable-object-prefix' ) ) ? '' : 'hide'; // xss ok ?>">
@@ -95,7 +95,7 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
95
<?php $this->render_view( 'checkbox', array( 'key' => 'use-yearmonth-folders' ) ); ?>
96
</td>
97
<td>
98
- <h4><?php _e( 'Year/Month', 'as3cf' ) ?></h4>
99
<p>
100
<?php _e( 'Add the Year/Month in the URL.' ); ?>
101
</p>
@@ -103,7 +103,7 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
103
</tr>
104
<tr class="configure-url as3cf-border-bottom url-preview">
105
<td>
106
- <h4><?php _e( 'SSL:', 'as3cf' ) ?></h4>
107
</td>
108
<td>
109
<?php
@@ -111,33 +111,33 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
111
<div class="as3cf-ssl as3cf-radio-group">
112
<label>
113
<input type="radio" name="ssl" value="request" <?php checked( $ssl, 'request' ); ?>>
114
- <?php _e( 'Same as request', 'as3cf' ); ?>
115
- <p><?php _e( 'When the request is https://, use https:// for the file URL as well.', 'as3cf' ); ?></p>
116
</label>
117
<label>
118
<input type="radio" name="ssl" value="https" <?php checked( $ssl, 'https' ); ?>>
119
- <?php _e( 'Always SSL', 'as3cf' ); ?>
120
- <p><?php _e( 'Forces https:// to be used.', 'as3cf' ); ?></p>
121
- <p><?php _e( 'You cannot use the "Bucket as a subdomain" domain option when using SSL.', 'as3cf' ); ?></p>
122
</label>
123
<label>
124
<input type="radio" name="ssl" value="http" <?php checked( $ssl, 'http' ); ?>>
125
- <?php _e( 'Always non-SSL', 'as3cf' ); ?>
126
- <p><?php _e( 'Forces http:// to be used.', 'as3cf' ); ?></p>
127
</label>
128
</div>
129
</td>
130
</tr>
131
<tr class="advanced-options as3cf-setting-title">
132
- <td colspan="2"><h3><?php _e( 'Advanced Options', 'as3cf' ); ?></h3></td>
133
</tr>
134
<tr class="advanced-options">
135
<td>
136
<?php $this->render_view( 'checkbox', array( 'key' => 'remove-local-file' ) ); ?>
137
</td>
138
<td>
139
- <h4><?php _e( 'Remove Files From Server', 'as3cf' ) ?></h4>
140
- <p><?php _e( 'Once a file has been copied to S3, remove it from the local server.', 'as3cf' ) ?></p>
141
</td>
142
</tr>
143
<tr class="advanced-options url-preview">
@@ -145,11 +145,11 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
145
<?php $this->render_view( 'checkbox', array( 'key' => 'object-versioning' ) ); ?>
146
</td>
147
<td>
148
- <h4><?php _e( 'Object Versioning', 'as3cf' ) ?></h4>
149
<p>
150
<?php _e( 'Append a timestamp to the S3 file path. Recommended when using CloudFront so you don\'t have to worry about cache invalidation.' ); ?>
151
<a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ReplacingObjects.html">
152
- <?php _e( 'More info', 'as3cf' ) ?> &raquo;
153
</a>
154
</p>
155
</td>
@@ -159,10 +159,10 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
159
<?php $this->render_view( 'checkbox', array( 'key' => 'expires' ) ); ?>
160
</td>
161
<td>
162
- <h4><?php _e( 'Far Future Expiration Header', 'as3cf' ) ?></h4>
163
<p><?php _e( 'Implements a "Never Expire" caching policy for browsers by setting an Expires header for 10 years in the future. Should be used in conjunction with object versioning above.' ); ?>
164
<a href="http://developer.yahoo.com/performance/rules.html#expires">
165
- <?php _e( 'More info', 'as3cf' ) ?> &raquo;
166
</a>
167
</p>
168
</td>
@@ -172,14 +172,14 @@ $selected_bucket = $this->get_setting( 'bucket' ); ?>
172
<?php $this->render_view( 'checkbox', array( 'key' => 'hidpi-images' ) ); ?>
173
</td>
174
<td>
175
- <h4><?php _e( 'Copy HiDPI (@2x) Images', 'as3cf' ) ?></h4>
176
- <p> <?php printf( __( 'When uploading a file to S3, checks if there\'s a file of the same name with an @2x suffix and copies it to S3 as well. Works with the <a href="%s">WP Retina 2x</a> plugin.', 'as3cf' ), 'https://wordpress.org/plugins/wp-retina-2x/' ); ?></p>
177
</td>
178
</tr>
179
180
</table>
181
<p>
182
- <button type="submit" class="button button-primary"><?php _e( 'Save Changes', 'as3cf' ); ?></button>
183
</p>
184
</form>
185
</div>
7
?>
8
<div class="notice is-dismissible as3cf-updated updated inline <?php echo $updated_class; // xss ok ?>">
9
<p>
10
+ <?php _e( 'Settings saved.', 'amazon-s3-and-cloudfront' ); ?>
11
</p>
12
</div>
13
<?php
41
)
42
); ?>
43
<tr class="as3cf-setting-title">
44
+ <td colspan="2"><h3><?php _e( 'Enable/Disable the Plugin', 'amazon-s3-and-cloudfront' ); ?></h3></td>
45
</tr>
46
<tr>
47
<td>
48
<?php $this->render_view( 'checkbox', array( 'key' => 'copy-to-s3' ) ); ?>
49
</td>
50
<td>
51
+ <h4><?php _e( 'Copy Files to S3', 'amazon-s3-and-cloudfront' ) ?></h4>
52
+ <p><?php _e( 'When a file is uploaded to the Media Library, copy it to S3. Existing files are <em>not</em> copied to S3.', 'amazon-s3-and-cloudfront' ) ?></p>
53
</td>
54
</tr>
55
<tr class="as3cf-border-bottom">
57
<?php $this->render_view( 'checkbox', array( 'key' => 'serve-from-s3' ) ); ?>
58
</td>
59
<td>
60
+ <h4><?php _e( 'Rewrite File URLs', 'amazon-s3-and-cloudfront' ) ?></h4>
61
+ <p><?php _e( 'For Media Library files that have been copied to S3, rewrite the URLs so that they are served from S3/CloudFront instead of your server.', 'amazon-s3-and-cloudfront' ) ?></p>
62
</td>
63
</tr>
64
<tr class="configure-url as3cf-setting-title">
65
+ <td colspan="2"><h3><?php _e( 'Configure File URLs', 'amazon-s3-and-cloudfront' ); ?></h3></td>
66
</tr>
67
<tr class="configure-url">
68
<td colspan="2">
80
<?php $this->render_view( 'checkbox', array( 'key' => 'enable-object-prefix', 'class' => 'sub-toggle' ) ); ?>
81
</td>
82
<td>
83
+ <h4><?php _e( 'Path', 'amazon-s3-and-cloudfront' ) ?></h4>
84
<p class="object-prefix-desc">
85
+ <?php _e( 'By default the path is the same as your local WordPress files:', 'amazon-s3-and-cloudfront' ); ?>
86
<em><?php echo $this->get_default_object_prefix(); // xss ok ?></em>
87
</p>
88
<p class="as3cf-setting enable-object-prefix <?php echo ( $this->get_setting( 'enable-object-prefix' ) ) ? '' : 'hide'; // xss ok ?>">
95
<?php $this->render_view( 'checkbox', array( 'key' => 'use-yearmonth-folders' ) ); ?>
96
</td>
97
<td>
98
+ <h4><?php _e( 'Year/Month', 'amazon-s3-and-cloudfront' ) ?></h4>
99
<p>
100
<?php _e( 'Add the Year/Month in the URL.' ); ?>
101
</p>
103
</tr>
104
<tr class="configure-url as3cf-border-bottom url-preview">
105
<td>
106
+ <h4><?php _e( 'SSL:', 'amazon-s3-and-cloudfront' ) ?></h4>
107
</td>
108
<td>
109
<?php
111
<div class="as3cf-ssl as3cf-radio-group">
112
<label>
113
<input type="radio" name="ssl" value="request" <?php checked( $ssl, 'request' ); ?>>
114
+ <?php _e( 'Same as request', 'amazon-s3-and-cloudfront' ); ?>
115
+ <p><?php _e( 'When the request is https://, use https:// for the file URL as well.', 'amazon-s3-and-cloudfront' ); ?></p>
116
</label>
117
<label>
118
<input type="radio" name="ssl" value="https" <?php checked( $ssl, 'https' ); ?>>
119
+ <?php _e( 'Always SSL', 'amazon-s3-and-cloudfront' ); ?>
120
+ <p><?php _e( 'Forces https:// to be used.', 'amazon-s3-and-cloudfront' ); ?></p>
121
+ <p><?php _e( 'You cannot use the "Bucket as a subdomain" domain option when using SSL.', 'amazon-s3-and-cloudfront' ); ?></p>
122
</label>
123
<label>
124
<input type="radio" name="ssl" value="http" <?php checked( $ssl, 'http' ); ?>>
125
+ <?php _e( 'Always non-SSL', 'amazon-s3-and-cloudfront' ); ?>
126
+ <p><?php _e( 'Forces http:// to be used.', 'amazon-s3-and-cloudfront' ); ?></p>
127
</label>
128
</div>
129
</td>
130
</tr>
131
<tr class="advanced-options as3cf-setting-title">
132
+ <td colspan="2"><h3><?php _e( 'Advanced Options', 'amazon-s3-and-cloudfront' ); ?></h3></td>
133
</tr>
134
<tr class="advanced-options">
135
<td>
136
<?php $this->render_view( 'checkbox', array( 'key' => 'remove-local-file' ) ); ?>
137
</td>
138
<td>
139
+ <h4><?php _e( 'Remove Files From Server', 'amazon-s3-and-cloudfront' ) ?></h4>
140
+ <p><?php _e( 'Once a file has been copied to S3, remove it from the local server.', 'amazon-s3-and-cloudfront' ) ?></p>
141
</td>
142
</tr>
143
<tr class="advanced-options url-preview">
145
<?php $this->render_view( 'checkbox', array( 'key' => 'object-versioning' ) ); ?>
146
</td>
147
<td>
148
+ <h4><?php _e( 'Object Versioning', 'amazon-s3-and-cloudfront' ) ?></h4>
149
<p>
150
<?php _e( 'Append a timestamp to the S3 file path. Recommended when using CloudFront so you don\'t have to worry about cache invalidation.' ); ?>
151
<a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ReplacingObjects.html">
152
+ <?php _e( 'More info', 'amazon-s3-and-cloudfront' ) ?> &raquo;
153
</a>
154
</p>
155
</td>
159
<?php $this->render_view( 'checkbox', array( 'key' => 'expires' ) ); ?>
160
</td>
161
<td>
162
+ <h4><?php _e( 'Far Future Expiration Header', 'amazon-s3-and-cloudfront' ) ?></h4>
163
<p><?php _e( 'Implements a "Never Expire" caching policy for browsers by setting an Expires header for 10 years in the future. Should be used in conjunction with object versioning above.' ); ?>
164
<a href="http://developer.yahoo.com/performance/rules.html#expires">
165
+ <?php _e( 'More info', 'amazon-s3-and-cloudfront' ) ?> &raquo;
166
</a>
167
</p>
168
</td>
172
<?php $this->render_view( 'checkbox', array( 'key' => 'hidpi-images' ) ); ?>
173
</td>
174
<td>
175
+ <h4><?php _e( 'Copy HiDPI (@2x) Images', 'amazon-s3-and-cloudfront' ) ?></h4>
176
+ <p> <?php printf( __( 'When uploading a file to S3, checks if there\'s a file of the same name with an @2x suffix and copies it to S3 as well. Works with the <a href="%s">WP Retina 2x</a> plugin.', 'amazon-s3-and-cloudfront' ), 'https://wordpress.org/plugins/wp-retina-2x/' ); ?></p>
177
</td>
178
</tr>
179
180
</table>
181
<p>
182
+ <button type="submit" class="button button-primary"><?php _e( 'Save Changes', 'amazon-s3-and-cloudfront' ); ?></button>
183
</p>
184
</form>
185
</div>
view/sidebar.php CHANGED
@@ -7,49 +7,49 @@
7
<div class="as3cf-upgrade-details">
8
9
<ul>
10
- <li><?php echo wptexturize( __( 'Upload existing Media Library to S3', 'as3cf' ) ); // xss ok ?></li>
11
- <li><?php echo wptexturize( __( 'Find & replace file URLs in content', 'as3cf' ) ); // xss ok ?></li>
12
- <li><?php echo wptexturize( __( 'Manage S3 files in WordPress', 'as3cf' ) ); // xss ok ?></li>
13
- <li><?php echo wptexturize( __( 'Assets addon - Serve your CSS & JS from S3/CloudFront', 'as3cf' ) ); // xss ok ?></li>
14
- <li><?php echo wptexturize( __( 'WooCommerce addon', 'as3cf' ) ); // xss ok ?></li>
15
- <li><?php echo wptexturize( __( 'Easy Digital Downloads addon', 'as3cf' ) ); // xss ok ?></li>
16
- <li><?php echo wptexturize( __( 'PriorityExpert™ email support', 'as3cf' ) ); // xss ok ?></li>
17
</ul>
18
19
- <p><a href="https://deliciousbrains.com/wp-offload-s3/?utm_source=insideplugin&amp;utm_medium=web&amp;utm_content=sidebar&amp;utm_campaign=os3-free-plugin"><?php echo __( 'Visit deliciousbrains.com &rarr;', 'as3cf' ); ?></a></p>
20
21
</div>
22
23
<form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
24
<?php $user = wp_get_current_user(); ?>
25
26
- <h2><?php _e( 'Get 20% Off!', 'as3cf' ); ?></h2>
27
28
<p class="intro">
29
- <?php echo wptexturize( __( 'Submit your name and email and we’ll send you a coupon for 20% off your upgrade.', 'as3cf' ) ); // xss ok ?>
30
</p>
31
32
<div class="field">
33
- <input type="email" name="email" value="<?php echo esc_attr( $user->user_email ); ?>" placeholder="<?php _e( 'Your Email', 'as3cf' ); ?>"/>
34
</div>
35
36
<div class="field">
37
- <input type="text" name="first_name" value="<?php echo esc_attr( trim( $user->first_name ) ); ?>" placeholder="<?php _e( 'First Name', 'as3cf' ); ?>"/>
38
</div>
39
40
<div class="field">
41
- <input type="text" name="last_name" value="<?php echo esc_attr( trim( $user->last_name ) ); ?>" placeholder="<?php _e( 'Last Name', 'as3cf' ); ?>"/>
42
</div>
43
44
<input type="hidden" name="campaigns[]" value="5" />
45
<input type="hidden" name="source" value="1" />
46
47
<div class="field submit-button">
48
- <input type="submit" class="button" value="<?php _e( 'Send me the coupon', 'as3cf' ); ?>"/>
49
</div>
50
51
<p class="promise">
52
- <?php _e( 'We promise we will not use your email for anything else and you can unsubscribe with 1-click anytime.', 'as3cf' ); ?>
53
</p>
54
</form>
55
7
<div class="as3cf-upgrade-details">
8
9
<ul>
10
+ <li><?php echo wptexturize( __( 'Upload existing Media Library to S3', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
11
+ <li><?php echo wptexturize( __( 'Find & replace file URLs in content', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
12
+ <li><?php echo wptexturize( __( 'Manage S3 files in WordPress', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
13
+ <li><?php echo wptexturize( __( 'Assets addon - Serve your CSS & JS from S3/CloudFront', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
14
+ <li><?php echo wptexturize( __( 'WooCommerce addon', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
15
+ <li><?php echo wptexturize( __( 'Easy Digital Downloads addon', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
16
+ <li><?php echo wptexturize( __( 'PriorityExpert™ email support', 'amazon-s3-and-cloudfront' ) ); // xss ok ?></li>
17
</ul>
18
19
+ <p><a href="https://deliciousbrains.com/wp-offload-s3/?utm_source=insideplugin&amp;utm_medium=web&amp;utm_content=sidebar&amp;utm_campaign=os3-free-plugin"><?php echo __( 'Visit deliciousbrains.com &rarr;', 'amazon-s3-and-cloudfront' ); ?></a></p>
20
21
</div>
22
23
<form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
24
<?php $user = wp_get_current_user(); ?>
25
26
+ <h2><?php _e( 'Get 20% Off!', 'amazon-s3-and-cloudfront' ); ?></h2>
27
28
<p class="intro">
29
+ <?php echo wptexturize( __( 'Submit your name and email and we’ll send you a coupon for 20% off your upgrade.', 'amazon-s3-and-cloudfront' ) ); // xss ok ?>
30
</p>
31
32
<div class="field">
33
+ <input type="email" name="email" value="<?php echo esc_attr( $user->user_email ); ?>" placeholder="<?php _e( 'Your Email', 'amazon-s3-and-cloudfront' ); ?>"/>
34
</div>
35
36
<div class="field">
37
+ <input type="text" name="first_name" value="<?php echo esc_attr( trim( $user->first_name ) ); ?>" placeholder="<?php _e( 'First Name', 'amazon-s3-and-cloudfront' ); ?>"/>
38
</div>
39
40
<div class="field">
41
+ <input type="text" name="last_name" value="<?php echo esc_attr( trim( $user->last_name ) ); ?>" placeholder="<?php _e( 'Last Name', 'amazon-s3-and-cloudfront' ); ?>"/>
42
</div>
43
44
<input type="hidden" name="campaigns[]" value="5" />
45
<input type="hidden" name="source" value="1" />
46
47
<div class="field submit-button">
48
+ <input type="submit" class="button" value="<?php _e( 'Send me the coupon', 'amazon-s3-and-cloudfront' ); ?>"/>
49
</div>
50
51
<p class="promise">
52
+ <?php _e( 'We promise we will not use your email for anything else and you can unsubscribe with 1-click anytime.', 'amazon-s3-and-cloudfront' ); ?>
53
</p>
54
</form>
55
view/wordpress-org-support.php CHANGED
@@ -1,10 +1,10 @@
1
<div class="support support-section">
2
- <p><?php _e( 'As this is a free plugin, we do not provide support.', 'as3cf'); ?></p>
3
4
- <p><?php printf( __( 'You may ask the WordPress community for help by posting to the <a href="%s">WordPress.org support forum</a>. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'as3cf'), 'https://wordpress.org/plugins/amazon-s3-and-cloudfront/' ); ?></p>
5
6
- <p class="upgrade-to-pro"><?php printf( __( 'If you want a <strong>timely response via email from a developer</strong> who works on this plugin, <a href="%s">upgrade</a> and send us an email.', 'as3cf' ), 'https://deliciousbrains.com/wp-offload-s3/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-as3cf' ); ?></p>
7
8
- <p><?php printf( __( 'If you\'ve found a bug, please <a href="%s">submit an issue on GitHub</a>.', 'as3cf' ), 'https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/issues' ); ?></p>
9
10
</div>
1
<div class="support support-section">
2
+ <p><?php _e( 'As this is a free plugin, we do not provide support.', 'amazon-s3-and-cloudfront' ); ?></p>
3
4
+ <p><?php printf( __( 'You may ask the WordPress community for help by posting to the <a href="%s">WordPress.org support forum</a>. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'amazon-s3-and-cloudfront' ), 'https://wordpress.org/plugins/amazon-s3-and-cloudfront/' ); ?></p>
5
6
+ <p class="upgrade-to-pro"><?php printf( __( 'If you want a <strong>timely response via email from a developer</strong> who works on this plugin, <a href="%s">upgrade</a> and send us an email.', 'amazon-s3-and-cloudfront' ), 'https://deliciousbrains.com/wp-offload-s3/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-as3cf' ); ?></p>
7
8
+ <p><?php printf( __( 'If you\'ve found a bug, please <a href="%s">submit an issue on GitHub</a>.', 'amazon-s3-and-cloudfront' ), 'https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront/issues' ); ?></p>
9
10
</div>
wordpress-s3.php CHANGED
@@ -4,10 +4,10 @@ Plugin Name: WP Offload S3
4
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
5
Description: Automatically copies media uploads to Amazon S3 for storage and delivery. Optionally configure Amazon CloudFront for even faster delivery.
6
Author: Delicious Brains
7
- Version: 0.9.5
8
Author URI: http://deliciousbrains.com/
9
Network: True
10
- Text Domain: as3cf
11
Domain Path: /languages/
12
13
// Copyright (c) 2013 Delicious Brains. All rights reserved.
@@ -26,7 +26,7 @@ Domain Path: /languages/
26
// Then completely rewritten.
27
*/
28
29
- $GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '0.9.5';
30
31
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['supported_addon_versions'] = array(
32
'amazon-s3-and-cloudfront-pro' => '1.0b1',
4
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
5
Description: Automatically copies media uploads to Amazon S3 for storage and delivery. Optionally configure Amazon CloudFront for even faster delivery.
6
Author: Delicious Brains
7
+ Version: 0.9.6
8
Author URI: http://deliciousbrains.com/
9
Network: True
10
+ Text Domain: amazon-s3-and-cloudfront
11
Domain Path: /languages/
12
13
// Copyright (c) 2013 Delicious Brains. All rights reserved.
26
// Then completely rewritten.
27
*/
28
29
+ $GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '0.9.6';
30
31
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['supported_addon_versions'] = array(
32
'amazon-s3-and-cloudfront-pro' => '1.0b1',