From 87bd0a03451f6d236d10b7ed7e7ccfc6f8282db4 Mon Sep 17 00:00:00 2001 From: Ashley Rich Date: Thu, 1 Oct 2015 18:13:09 +0100 Subject: [PATCH] Deploying version 0.9.6 --- README.md | 6 +- assets/js/notice.min.js | 1 + assets/js/script.min.js | 2 +- classes/amazon-s3-and-cloudfront.php | 56 +++++++++--------- classes/as3cf-plugin-compatibility.php | 2 +- classes/as3cf-upgrade.php | 14 ++--- classes/upgrades/as3cf-file-sizes.php | 2 +- classes/upgrades/as3cf-meta-wp-error.php | 4 +- classes/upgrades/as3cf-region-meta.php | 2 +- classes/wp-aws-compatibility-check.php | 30 +++++----- languages/amazon-s3-and-cloudfront-en.pot | 2 +- ...r.mo => amazon-s3-and-cloudfront-pt-br.mo} | Bin readme.txt | 6 +- view/bucket-select.php | 42 ++++++------- view/bucket-setting.php | 6 +- view/debug-info.php | 4 +- view/domain-setting.php | 10 ++-- view/error-access.php | 2 +- view/settings.php | 56 +++++++++--------- view/sidebar.php | 30 +++++----- view/wordpress-org-support.php | 8 +-- wordpress-s3.php | 6 +- 22 files changed, 150 insertions(+), 141 deletions(-) create mode 100644 assets/js/notice.min.js rename languages/{as3cf-pt-br.mo => amazon-s3-and-cloudfront-pt-br.mo} (100%) diff --git a/README.md b/README.md index 9f6e8fb4..9ca4aae9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **Tags:** uploads, amazon, s3, mirror, admin, media, cdn, cloudfront **Requires at least:** 3.7 **Tested up to:** 4.3 -**Stable tag:** 0.9.5 +**Stable tag:** 0.9.6 **License:** GPLv3 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 ## Changelog ## +### 0.9.6 - 2015-10-01 ### + +* Improvement: Update text domains for translate.wordpress.org integration + ### 0.9.5 - 2015-09-01 ### * Bug fix: Fatal error: Cannot use object of type WP_Error as array diff --git a/assets/js/notice.min.js b/assets/js/notice.min.js new file mode 100644 index 00000000..305c357d --- /dev/null +++ b/assets/js/notice.min.js @@ -0,0 +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); \ No newline at end of file diff --git a/assets/js/script.min.js b/assets/js/script.min.js index 07bce0c7..52c14f3e 100644 --- a/assets/js/script.min.js +++ b/assets/js/script.min.js @@ -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('
  • '+d.attr("data-working")+"
  • ");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('
  • '+b.Name+'
  • ')}),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+" —"),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().length1)return a(".as3cf-bucket-list a").removeClass("selected"),a('.as3cf-bucket-list a[data-bucket="'+e+'"]').addClass("selected"),void this.scrollToSelected();d.html('
  • '+d.attr("data-working")+"
  • ");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('
  • '+b.Name+'
  • ')}),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+" —"),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().lengthplugin_slug; - $this->plugin_title = __( 'Offload S3', 'as3cf' ); - $this->plugin_menu_title = __( 'S3 and CloudFront', 'as3cf' ); + $this->plugin_title = __( 'Offload S3', 'amazon-s3-and-cloudfront' ); + $this->plugin_menu_title = __( 'S3 and CloudFront', 'amazon-s3-and-cloudfront' ); new AS3CF_Upgrade_Region_Meta( $this ); new AS3CF_Upgrade_File_Sizes( $this ); @@ -113,7 +113,7 @@ function init( $plugin_file_path ) { // include compatibility code for other plugins new AS3CF_Plugin_Compatibility( $this ); - load_plugin_textdomain( 'as3cf', false, dirname( plugin_basename( $plugin_file_path ) ) . '/languages/' ); + load_plugin_textdomain( 'amazon-s3-and-cloudfront', false, dirname( plugin_basename( $plugin_file_path ) ) . '/languages/' ); // Register modal scripts and styles $this->register_modal_assets(); @@ -518,7 +518,7 @@ function upload_attachment_to_s3( $post_id, $data = null, $file_path = null, $fo // Check file exists locally before attempting upload if ( ! file_exists( $file_path ) ) { - return new WP_Error( 'exception', sprintf( __( 'File %s does not exist', 'as3cf' ), $file_path ) ); + return new WP_Error( 'exception', sprintf( __( 'File %s does not exist', 'amazon-s3-and-cloudfront' ), $file_path ) ); } $file_name = basename( $file_path ); @@ -527,7 +527,7 @@ function upload_attachment_to_s3( $post_id, $data = null, $file_path = null, $fo // check mime type of file is in allowed S3 mime types if ( ! in_array( $type, $allowed_types ) ) { - return new WP_Error( 'exception', sprintf( __( 'Mime type %s is not allowed', 'as3cf' ), $type ) ); + return new WP_Error( 'exception', sprintf( __( 'Mime type %s is not allowed', 'amazon-s3-and-cloudfront' ), $type ) ); } $acl = self::DEFAULT_ACL; @@ -604,7 +604,7 @@ function upload_attachment_to_s3( $post_id, $data = null, $file_path = null, $fo $s3client->putObject( $args ); } catch ( Exception $e ) { - $error_msg = sprintf( __( 'Error uploading %s to S3: %s', 'as3cf' ), $file_path, $e->getMessage() ); + $error_msg = sprintf( __( 'Error uploading %s to S3: %s', 'amazon-s3-and-cloudfront' ), $file_path, $e->getMessage() ); error_log( $error_msg ); return new WP_Error( 'exception', $error_msg ); @@ -1244,17 +1244,17 @@ function end_ajax( $return = array() ) { function verify_ajax_request() { if ( ! is_admin() || ! wp_verify_nonce( sanitize_key( $_POST['_nonce'] ), sanitize_key( $_POST['action'] ) ) ) { // input var okay - wp_die( __( 'Cheatin’ eh?', 'as3cf' ) ); + wp_die( __( 'Cheatin’ eh?', 'amazon-s3-and-cloudfront' ) ); } if ( ! current_user_can( 'manage_options' ) ) { - wp_die( __( 'You do not have sufficient permissions to access this page.', 'as3cf' ) ); + wp_die( __( 'You do not have sufficient permissions to access this page.', 'amazon-s3-and-cloudfront' ) ); } } function ajax_check_bucket() { if ( ! isset( $_POST['bucket_name'] ) || ! ( $bucket = sanitize_text_field( $_POST['bucket_name'] ) ) ) { // input var okay - $out = array( 'error' => __( 'No bucket name provided.', 'as3cf' ) ); + $out = array( 'error' => __( 'No bucket name provided.', 'amazon-s3-and-cloudfront' ) ); $this->end_ajax( $out ); } @@ -1529,8 +1529,8 @@ function get_bucket_region( $bucket ) { try { $region = $this->get_s3client()->getBucketLocation( array( 'Bucket' => $bucket ) ); } catch ( Exception $e ) { - $error_msg_title = '' . __( 'Error Getting Bucket Region', 'as3cf' ) . ' —'; - $error_msg = sprintf( __( 'There was an error attempting to get the region of the bucket %s: %s', 'as3cf' ), $bucket, $e->getMessage() ); + $error_msg_title = '' . __( 'Error Getting Bucket Region', 'amazon-s3-and-cloudfront' ) . ' —'; + $error_msg = sprintf( __( 'There was an error attempting to get the region of the bucket %s: %s', 'amazon-s3-and-cloudfront' ), $bucket, $e->getMessage() ); error_log( $error_msg ); return new WP_Error( 'exception', $error_msg_title . $error_msg ); @@ -1650,7 +1650,7 @@ function check_write_permission( $bucket = null, $region = null ) { } $file_name = 'as3cf-permission-check.txt'; - $file_contents = __( 'This is a test file to check if the user has write permission to S3. Delete me if found.', 'as3cf' ); + $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' ); $path = $this->get_object_prefix(); $key = $path . $file_name; @@ -1682,7 +1682,7 @@ function check_write_permission( $bucket = null, $region = null ) { } catch ( Exception $e ) { // if we encounter an error that isn't access denied, throw that error if ( ! $e instanceof Aws\Common\Exception\ServiceResponseException || 'AccessDenied' !== $e->getExceptionCode() ) { - $error_msg = sprintf( __( 'There was an error attempting to check the permissions of the bucket %s: %s', 'as3cf' ), $bucket, $e->getMessage() ); + $error_msg = sprintf( __( 'There was an error attempting to check the permissions of the bucket %s: %s', 'amazon-s3-and-cloudfront' ), $bucket, $e->getMessage() ); error_log( $error_msg ); return new WP_Error( 'exception', $error_msg ); @@ -1740,14 +1740,14 @@ function plugin_load() { 'as3cf', array( 'strings' => array( - 'create_bucket_error' => __( 'Error creating bucket', 'as3cf' ), - 'create_bucket_name_short' => __( 'Bucket name too short.', 'as3cf' ), - 'create_bucket_name_long' => __( 'Bucket name too long.', 'as3cf' ), - 'create_bucket_invalid_chars' => __( 'Invalid character. Bucket names can contain lowercase letters, numbers, periods and hyphens.', 'as3cf' ), - 'save_bucket_error' => __( 'Error saving bucket', 'as3cf' ), - 'get_buckets_error' => __( 'Error fetching buckets', 'as3cf' ), - 'get_url_preview_error' => __( 'Error getting URL preview: ', 'as3cf' ), - 'save_alert' => __( 'The changes you made will be lost if you navigate away from this page', 'as3cf' ) + 'create_bucket_error' => __( 'Error creating bucket', 'amazon-s3-and-cloudfront' ), + 'create_bucket_name_short' => __( 'Bucket name too short.', 'amazon-s3-and-cloudfront' ), + 'create_bucket_name_long' => __( 'Bucket name too long.', 'amazon-s3-and-cloudfront' ), + 'create_bucket_invalid_chars' => __( 'Invalid character. Bucket names can contain lowercase letters, numbers, periods and hyphens.', 'amazon-s3-and-cloudfront' ), + 'save_bucket_error' => __( 'Error saving bucket', 'amazon-s3-and-cloudfront' ), + 'get_buckets_error' => __( 'Error fetching buckets', 'amazon-s3-and-cloudfront' ), + 'get_url_preview_error' => __( 'Error getting URL preview: ', 'amazon-s3-and-cloudfront' ), + 'save_alert' => __( 'The changes you made will be lost if you navigate away from this page', 'amazon-s3-and-cloudfront' ) ), 'nonces' => array( 'create_bucket' => wp_create_nonce( 'as3cf-create-bucket' ), @@ -1805,7 +1805,7 @@ function handle_post_request() { } if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['_wpnonce'] ), $this->get_settings_nonce_key() ) ) { // input var okay - die( __( "Cheatin' eh?", 'as3cf' ) ); + die( __( "Cheatin' eh?", 'amazon-s3-and-cloudfront' ) ); } do_action( 'as3cf_pre_save_settings' ); @@ -1908,8 +1908,8 @@ function render_page() { */ function get_settings_tabs() { $tabs = array( - 'media' => _x( 'Media Library', 'Show the media library tab', 'as3cf' ), - 'support' => _x( 'Support', 'Show the support tab', 'as3cf' ) + 'media' => _x( 'Media Library', 'Show the media library tab', 'amazon-s3-and-cloudfront' ), + 'support' => _x( 'Support', 'Show the support tab', 'amazon-s3-and-cloudfront' ) ); return apply_filters( 'as3cf_settings_tabs', $tabs ); @@ -2045,7 +2045,7 @@ function make_acl_admin_notice_text( $s3object ) { $filename = basename( $s3object['key'] ); $acl = $this->get_acl_display_name( $s3object['acl'] ); - return sprintf( __( 'The file %s has been given %s permissions on Amazon S3.', 'as3cf' ), "{$filename}", "{$acl}" ); + return sprintf( __( 'The file %s has been given %s permissions on Amazon S3.', 'amazon-s3-and-cloudfront' ), "{$filename}", "{$acl}" ); } /** @@ -2546,11 +2546,11 @@ public function get_attachment_file_paths( $attachment_id, $exists_locally = tru * @return string */ function get_access_denied_notice_message( $single = true ) { - $quick_start = sprintf( '%s', 'https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/', __( 'Quick Start Guide', 'as3cf' ) ); + $quick_start = sprintf( '%s', 'https://deliciousbrains.com/wp-offload-s3/doc/quick-start-guide/', __( 'Quick Start Guide', 'amazon-s3-and-cloudfront' ) ); - $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 ); + $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 ); if ( ! $single ) { - $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 ); + $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 ); } diff --git a/classes/as3cf-plugin-compatibility.php b/classes/as3cf-plugin-compatibility.php index 09f7c163..7d1f49d7 100644 --- a/classes/as3cf-plugin-compatibility.php +++ b/classes/as3cf-plugin-compatibility.php @@ -354,7 +354,7 @@ protected function copy_s3_file_to_server( $s3_object, $file ) { ) ); } catch ( Exception $e ) { - error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'as3cf' ), $s3_object['key'], $e->getMessage() ) ); + 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() ) ); return false; } diff --git a/classes/as3cf-upgrade.php b/classes/as3cf-upgrade.php index e63aba3c..9a02a55c 100644 --- a/classes/as3cf-upgrade.php +++ b/classes/as3cf-upgrade.php @@ -276,17 +276,17 @@ function maybe_display_notices() { switch ( $this->get_upgrade_status() ) { case self::STATUS_RUNNING: - $msg = sprintf( __( 'Running %s Update — We’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’s performance.', 'as3cf' ), ucfirst( $this->upgrade_type ), $this->running_update_text, $this->cron_interval_in_minutes ); - $action_text = __( 'Pause Update', 'as3cf' ); + $msg = sprintf( __( 'Running %s Update — We’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’s performance.', 'amazon-s3-and-cloudfront' ), ucfirst( $this->upgrade_type ), $this->running_update_text, $this->cron_interval_in_minutes ); + $action_text = __( 'Pause Update', 'amazon-s3-and-cloudfront' ); $action_url = $this->as3cf->get_plugin_page_url( array( 'action' => 'pause_update', 'update' => $this->upgrade_name ), 'self' ); break; case self::STATUS_PAUSED: - $msg = sprintf( __( '%s Update Paused — Updating Media Library %s has been paused.', 'as3cf' ), ucfirst( $this->upgrade_type ), $this->upgrade_type ); - $action_text = __( 'Restart Update', 'as3cf' ); + $msg = sprintf( __( '%s Update Paused — Updating Media Library %s has been paused.', 'amazon-s3-and-cloudfront' ), ucfirst( $this->upgrade_type ), $this->upgrade_type ); + $action_text = __( 'Restart Update', 'amazon-s3-and-cloudfront' ); break; case self::STATUS_ERROR: - $msg = sprintf( __( 'Error Updating %s — 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 ); - $action_text = __( 'Try Run It Again', 'as3cf' ); + $msg = sprintf( __( 'Error Updating %s — 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 ); + $action_text = __( 'Try Run It Again', 'amazon-s3-and-cloudfront' ); $msg_type = 'error'; break; default: @@ -388,7 +388,7 @@ function cron_schedules( $schedules ) { // Add the upgrade interval to the existing schedules. $schedules[ $this->cron_schedule_key ] = array( 'interval' => $this->cron_interval_in_minutes * 60, - 'display' => sprintf( __( 'Every %d Minutes', 'as3cf' ), $this->cron_interval_in_minutes ), + 'display' => sprintf( __( 'Every %d Minutes', 'amazon-s3-and-cloudfront' ), $this->cron_interval_in_minutes ), ); return $schedules; diff --git a/classes/upgrades/as3cf-file-sizes.php b/classes/upgrades/as3cf-file-sizes.php index c70764ac..33931691 100644 --- a/classes/upgrades/as3cf-file-sizes.php +++ b/classes/upgrades/as3cf-file-sizes.php @@ -34,7 +34,7 @@ public function __construct( $as3cf ) { $this->upgrade_name = 'file_sizes'; $this->upgrade_type = 'attachments'; - $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' ); + $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' ); parent::__construct( $as3cf ); } diff --git a/classes/upgrades/as3cf-meta-wp-error.php b/classes/upgrades/as3cf-meta-wp-error.php index 2b23d725..a70d547e 100644 --- a/classes/upgrades/as3cf-meta-wp-error.php +++ b/classes/upgrades/as3cf-meta-wp-error.php @@ -35,7 +35,7 @@ public function __construct( $as3cf ) { $this->upgrade_name = 'meta_error'; $this->upgrade_type = 'attachments'; - $this->running_update_text = __( 'and rebuilding the metadata for attachments that may have been corrupted.', 'as3cf' ); + $this->running_update_text = __( 'and rebuilding the metadata for attachments that may have been corrupted.', 'amazon-s3-and-cloudfront' ); parent::__construct( $as3cf ); } @@ -69,7 +69,7 @@ function upgrade_attachment( $attachment ) { ); $this->as3cf->get_s3client( $s3object['region'], true )->getObject( $args ); } catch ( Exception $e ) { - error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'as3cf' ), $s3object['key'], $e->getMessage() ) ); + error_log( sprintf( __( 'There was an error attempting to download the file %s from S3: %s', 'amazon-s3-and-cloudfront' ), $s3object['key'], $e->getMessage() ) ); return false; } diff --git a/classes/upgrades/as3cf-region-meta.php b/classes/upgrades/as3cf-region-meta.php index 4c4c3653..228329b8 100644 --- a/classes/upgrades/as3cf-region-meta.php +++ b/classes/upgrades/as3cf-region-meta.php @@ -33,7 +33,7 @@ public function __construct( $as3cf ) { $this->upgrade_name = 'meta_with_region'; $this->upgrade_type = 'metadata'; - $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 (e.g. s3-us-west-2.amazonaws.com).', 'as3cf' ); + $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 (e.g. s3-us-west-2.amazonaws.com).', 'amazon-s3-and-cloudfront' ); parent::__construct( $as3cf ); } diff --git a/classes/wp-aws-compatibility-check.php b/classes/wp-aws-compatibility-check.php index 3838d926..e07356a1 100644 --- a/classes/wp-aws-compatibility-check.php +++ b/classes/wp-aws-compatibility-check.php @@ -307,26 +307,26 @@ function get_error_msg() { $parent_plugin_link_html = sprintf( '%s', $this->get_parent_plugin_url(), $this->get_parent_plugin_name() ); $deactivate_url = $this->get_plugin_action_url( 'deactivate', $plugin_basename ); - $deactivate_link = sprintf( '%s', $deactivate_url, __( 'deactivate', 'as3cf' ) ); - $hide_notice_msg = '
    ' . sprintf( __( 'You can %s the %s plugin to get rid of this notice.', 'as3cf' ), $deactivate_link, $this->plugin_name ) . ''; + $deactivate_link = sprintf( '%s', $deactivate_url, __( 'deactivate', 'amazon-s3-and-cloudfront' ) ); + $hide_notice_msg = '
    ' . sprintf( __( 'You can %s the %s plugin to get rid of this notice.', 'amazon-s3-and-cloudfront' ), $deactivate_link, $this->plugin_name ) . ''; if ( ! $this->is_parent_plugin_enabled() ) { - $msg = sprintf( __( '%s has been disabled as it requires the %s plugin.', 'as3cf' ), $this->plugin_name, $parent_plugin_link_html ); + $msg = sprintf( __( '%s has been disabled as it requires the %s plugin.', 'amazon-s3-and-cloudfront' ), $this->plugin_name, $parent_plugin_link_html ); if ( file_exists( WP_PLUGIN_DIR . '/' . $parent_basename ) ) { if ( isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) && ! $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['compatible'] ) { - $msg = rtrim( $msg, '.' ) . ', ' . __( 'which is currently disabled.', 'as3cf' ); + $msg = rtrim( $msg, '.' ) . ', ' . __( 'which is currently disabled.', 'amazon-s3-and-cloudfront' ); } else { - $msg .= ' ' . __( 'It appears to be installed already.', 'as3cf' ); + $msg .= ' ' . __( 'It appears to be installed already.', 'amazon-s3-and-cloudfront' ); $activate_url = $this->get_plugin_action_url( 'activate', $parent_basename ); - $msg .= ' ' . _x( 'Activate it now.', 'Activate plugin', 'as3cf' ) . ''; + $msg .= ' ' . _x( 'Activate it now.', 'Activate plugin', 'amazon-s3-and-cloudfront' ) . ''; } } else { $install_url = 'https://deliciousbrains.com/my-account/'; if ( is_null( $this->parent_plugin_url ) ) { $install_url = $this->get_plugin_action_url( 'install', $this->parent_plugin_slug ); } - $msg .= ' ' . sprintf( __( 'Install and activate it.', 'as3cf' ), $install_url ); + $msg .= ' ' . sprintf( __( 'Install and activate it.', 'amazon-s3-and-cloudfront' ), $install_url ); } $msg .= $hide_notice_msg; @@ -337,17 +337,17 @@ function get_error_msg() { $current_parent_plugin_version = isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] ) ? $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['version'] : 0; if ( ! version_compare( $current_parent_plugin_version, $this->parent_plugin_required_version, '>=' ) ) { - $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 ); + $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 ); if ( $current_parent_plugin_version ) { - $msg .= ' ' . sprintf( __( 'You currently have version %s installed.', 'as3cf' ), $current_parent_plugin_version ); + $msg .= ' ' . sprintf( __( 'You currently have version %s installed.', 'amazon-s3-and-cloudfront' ), $current_parent_plugin_version ); } global $as3cfpro; if ( ! empty( $as3cfpro ) && $as3cfpro->get_plugin_slug() === $this->parent_plugin_slug ) { // Don't show update link for addons of a licensed plugin where the license is invalid if ( ! $as3cfpro->is_valid_licence() ) { - $msg .= ' ' . sprintf( __( 'A valid license for %s is required to update.', 'as3cf' ), $this->get_parent_plugin_name() ); + $msg .= ' ' . sprintf( __( 'A valid license for %s is required to update.', 'amazon-s3-and-cloudfront' ), $this->get_parent_plugin_name() ); $msg .= $hide_notice_msg; return $this->set_error_msg( $msg ); @@ -355,7 +355,7 @@ function get_error_msg() { } $update_url = $this->get_plugin_action_url( 'upgrade', $parent_basename ); - $msg .= ' ' . __( 'Update to the latest version', 'as3cf' ) . ''; + $msg .= ' ' . __( 'Update to the latest version', 'amazon-s3-and-cloudfront' ) . ''; $msg .= $hide_notice_msg; @@ -367,7 +367,7 @@ function get_error_msg() { } if ( ! isset( $GLOBALS['aws_meta'][ $this->parent_plugin_slug ]['supported_addon_versions'][ $this->plugin_slug ] ) ) { - $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() ); + $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() ); return $this->set_error_msg( $msg ); } @@ -376,10 +376,10 @@ function get_error_msg() { $this_plugin_version = $GLOBALS['aws_meta'][ $this->plugin_slug ]['version']; if ( ! version_compare( $this_plugin_version, $this_plugin_version_required, '>=' ) ) { - $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 ); + $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 ); $update_url = $this->get_plugin_action_url( 'upgrade', $plugin_basename ); - $msg .= ' ' . sprintf( __( 'Update %s to the latest version', 'as3cf' ), $this->plugin_name ) . ''; + $msg .= ' ' . sprintf( __( 'Update %s to the latest version', 'amazon-s3-and-cloudfront' ), $this->plugin_name ) . ''; $msg .= $hide_notice_msg; @@ -439,7 +439,7 @@ function get_admin_notice() { } if ( $this->deactivate_if_not_compatible ) { - $deactivated_msg = sprintf( __( 'The %s plugin has been deactivated.', 'as3cf' ), $this->plugin_name ); + $deactivated_msg = sprintf( __( 'The %s plugin has been deactivated.', 'amazon-s3-and-cloudfront' ), $this->plugin_name ); $error_msg = $deactivated_msg . ' ' . $error_msg; $this->render_notice( $error_msg ); diff --git a/languages/amazon-s3-and-cloudfront-en.pot b/languages/amazon-s3-and-cloudfront-en.pot index 4844d90f..917ecdd1 100644 --- a/languages/amazon-s3-and-cloudfront-en.pot +++ b/languages/amazon-s3-and-cloudfront-en.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: amazon-s3-and-cloudfront\n" "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n" -"POT-Creation-Date: 2015-09-01 09:58+0100\n" +"POT-Creation-Date: 2015-10-01 18:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/languages/as3cf-pt-br.mo b/languages/amazon-s3-and-cloudfront-pt-br.mo similarity index 100% rename from languages/as3cf-pt-br.mo rename to languages/amazon-s3-and-cloudfront-pt-br.mo diff --git a/readme.txt b/readme.txt index 565d7562..49f97dd5 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: bradt, deliciousbrains Tags: uploads, amazon, s3, mirror, admin, media, cdn, cloudfront Requires at least: 3.7 Tested up to: 4.3 -Stable tag: 0.9.5 +Stable tag: 0.9.6 License: GPLv3 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 == Changelog == += 0.9.6 - 2015-10-01 = + +* Improvement: Update text domains for translate.wordpress.org integration + = 0.9.5 - 2015-09-01 = * Bug fix: Fatal error: Cannot use object of type WP_Error as array diff --git a/view/bucket-select.php b/view/bucket-select.php index 4d87a3af..90003e5d 100644 --- a/view/bucket-select.php +++ b/view/bucket-select.php @@ -1,49 +1,49 @@
    -

    +

    - +

    - - - + + +

    - - + +

    -

    -
      +

      +

        - - + +

        - - - + + +

        -

        +

        - + - +

        - +

        - - + +

        diff --git a/view/bucket-setting.php b/view/bucket-setting.php index 3b501982..2be3031c 100644 --- a/view/bucket-setting.php +++ b/view/bucket-setting.php @@ -4,13 +4,13 @@ ?> -

        +

        - + -

        +

        'support', ); $url = $this->get_plugin_page_url( $args, 'network', false ); ?> - +
        \ No newline at end of file diff --git a/view/domain-setting.php b/view/domain-setting.php index 3cdd9391..44019c34 100644 --- a/view/domain-setting.php +++ b/view/domain-setting.php @@ -2,7 +2,7 @@ $tr_class = ( isset( $tr_class ) ) ? $tr_class : ''; ?> -

        +