updated plugin `Easy Digital Downloads` version 3.1.4

This commit is contained in:
KawaiiPunk 2023-07-19 21:08:59 +00:00 committed by Gitium
parent a7f6efbebb
commit 9a42dc17d2
109 changed files with 12446 additions and 5563 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=183)}({1:function(e,t){e.exports=jQuery},183:function(e,t,n){(function(e,t){var n={vars:{customer_card_wrap_editable:e("#edit-customer-info .editable"),customer_card_wrap_edit_item:e("#edit-customer-info .edit-item"),user_id:e('input[name="customerinfo[user_id]"]')},init:function(){this.edit_customer(),this.add_email(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.delete_checked()},edit_customer:function(){e(document.body).on("click","#edit-customer",(function(e){e.preventDefault(),n.vars.customer_card_wrap_editable.hide(),n.vars.customer_card_wrap_edit_item.show().css("display","block")}))},add_email:function(){e(document.body).on("click","#add-customer-email",(function(t){t.preventDefault();var n=e(this),i=n.parent().parent().parent().parent(),r={edd_action:"customer-add-email",customer_id:i.find('input[name="customer-id"]').val(),email:i.find('input[name="additional-email"]').val(),primary:i.find('input[name="make-additional-primary"]').is(":checked"),_wpnonce:i.find('input[name="add_email_nonce"]').val()};i.parent().find(".notice-container").remove(),i.find(".spinner").css("visibility","visible"),n.attr("disabled",!0),e.post(ajaxurl,r,(function(e){setTimeout((function(){!0===e.success?window.location.href=e.redirect:(n.attr("disabled",!1),i.before('<div class="notice-container"><div class="notice notice-error inline"><p>'+e.message+"</p></div></div>"),i.find(".spinner").css("visibility","hidden"))}),342)}),"json")}))},user_search:function(){e(document.body).on("click.eddSelectUser",".edd_user_search_results a",(function(t){t.preventDefault();var i=e(this).data("userid");n.vars.user_id.val(i)}))},remove_user:function(){e(document.body).on("click","#disconnect-customer",(function(t){if(t.preventDefault(),confirm(edd_vars.disconnect_customer)){var n={edd_action:"disconnect-userid",customer_id:e('input[name="customerinfo[id]"]').val(),_wpnonce:e("#edit-customer-info #_wpnonce").val()};e.post(ajaxurl,n,(function(e){window.location.href=window.location.href}),"json")}}))},cancel_edit:function(){e(document.body).on("click","#edd-edit-customer-cancel",(function(t){t.preventDefault(),n.vars.customer_card_wrap_edit_item.hide(),n.vars.customer_card_wrap_editable.show(),e(".edd_user_search_results").html("")}))},change_country:function(){e('select[name="customerinfo[country]"]').change((function(){var t=e(this),n=e(':input[name="customerinfo[region]"]'),i={action:"edd_get_shop_states",country:t.val(),nonce:t.data("nonce"),field_name:"customerinfo[region]"};return e.post(ajaxurl,i,(function(e){console.log(e),"nostates"===e?n.replaceWith('<input type="text" name="'+i.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):n.replaceWith(e)})),!1}))},delete_checked:function(){e("#edd-customer-delete-confirm").change((function(){var t=e("#edd-customer-delete-records"),n=e("#edd-delete-customer");e(this).prop("checked")?(t.attr("disabled",!1),n.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),n.attr("disabled",!0))}))}};t(document).ready((function(e){n.init()}))}).call(this,n(1),n(1))}});
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=183)}({1:function(e,t){e.exports=jQuery},183:function(e,t,n){(function(e,t){var n={vars:{customer_card_wrap_editable:e("#edit-customer-info .editable"),customer_card_wrap_edit_item:e("#edit-customer-info .edit-item"),user_id:e('input[name="customerinfo[user_id]"]')},init:function(){this.edit_customer(),this.add_email(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.delete_checked()},edit_customer:function(){e(document.body).on("click","#edit-customer",(function(e){e.preventDefault(),n.vars.customer_card_wrap_editable.hide(),n.vars.customer_card_wrap_edit_item.show().css("display","block")}))},add_email:function(){e(document.body).on("click","#add-customer-email",(function(t){t.preventDefault();var n=e(this),i=n.parent().parent().parent().parent(),r={edd_action:"customer-add-email",customer_id:i.find('input[name="customer-id"]').val(),email:i.find('input[name="additional-email"]').val(),primary:i.find('input[name="make-additional-primary"]').is(":checked"),_wpnonce:i.find('input[name="add_email_nonce"]').val()};i.parent().find(".notice-container").remove(),i.find(".spinner").css("visibility","visible"),n.attr("disabled",!0),e.post(ajaxurl,r,(function(e){setTimeout((function(){!0===e.success?window.location.href=e.redirect:(n.attr("disabled",!1),i.before('<div class="notice-container"><div class="notice notice-error inline"><p>'+e.message+"</p></div></div>"),i.find(".spinner").css("visibility","hidden"))}),342)}),"json")}))},user_search:function(){e(document.body).on("click.eddSelectUser",".edd_user_search_results a",(function(t){t.preventDefault();var i=e(this).data("userid");n.vars.user_id.val(i)}))},remove_user:function(){e(document.body).on("click","#disconnect-customer",(function(t){if(t.preventDefault(),confirm(edd_vars.disconnect_customer)){var n={edd_action:"disconnect-userid",customer_id:e('input[name="customerinfo[id]"]').val(),_wpnonce:e("#edit-customer-info #_wpnonce").val()};e.post(ajaxurl,n,(function(e){window.location.href=window.location.href}),"json")}}))},cancel_edit:function(){e(document.body).on("click","#edd-edit-customer-cancel",(function(t){t.preventDefault(),n.vars.customer_card_wrap_edit_item.hide(),n.vars.customer_card_wrap_editable.show(),e(".edd_user_search_results").html("")}))},change_country:function(){e('select[name="customerinfo[country]"]').on("change",(function(){var t=e(this),n=e(':input[name="customerinfo[region]"]'),i={action:"edd_get_shop_states",country:t.val(),nonce:t.data("nonce"),field_name:"customerinfo[region]"};return e.post(ajaxurl,i,(function(e){console.log(e),"nostates"===e?n.replaceWith('<input type="text" name="'+i.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):n.replaceWith(e)})),!1}))},delete_checked:function(){e("#edd-customer-delete-confirm").on("change",(function(){var t=e("#edd-customer-delete-records"),n=e("#edd-delete-customer");e(this).prop("checked")?(t.attr("disabled",!1),n.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),n.attr("disabled",!0))}))}};t(document).ready((function(e){n.init()}))}).call(this,n(1),n(1))}});

View File

@ -1 +1 @@
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=185)}({1:function(t,e){t.exports=jQuery},185:function(t,e,n){"use strict";n.r(e),function(t){var e=n(4);Object(e.a)((function(){var e=t("#edd_products");e&&e.change((function(){t("#edd-discount-product-conditions").toggle(null!==e.val())}))}))}.call(this,n(1))},4:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var r=function(e){t(e)}}).call(this,n(1))}});
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=185)}({1:function(t,e){t.exports=jQuery},185:function(t,e,n){"use strict";n.r(e),function(t){var e=n(4);Object(e.a)((function(){var e=t("#edd_products");e&&e.on("change",(function(){t("#edd-discount-product-conditions").toggle(null!==e.val())}))}))}.call(this,n(1))},4:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var r=function(e){t(e)}}).call(this,n(1))}});

View File

@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=248)}({248:function(e,t,n){"use strict";n.r(t);var r=function(e){return(e=e.toLowerCase()).trim()};document.addEventListener("DOMContentLoaded",(function(){var e,t,n,o=document.querySelector(".edd-email-tags-inserter");o&&(o.addEventListener("click",tb_position),(e=document.querySelectorAll(".edd-email-tags-list-button"))&&_.each(e,(function(e){e.addEventListener("click",(function(){tb_remove(),window.send_to_editor(e.dataset.to_insert)}))})),t=document.querySelector(".edd-email-tags-filter-search"),n=document.querySelectorAll(".edd-email-tags-list-item"),t&&t.addEventListener("keyup",(function(e){var t=e.target.value,o=function(e,t){var n=r(t),o=function(e){return-1!==r(e).indexOf(n)};return _.filter(e,(function(e){return o(e.title)||_.some(e.keywords,o)}))}(eddEmailTagsInserter.items,t);_.each(n,(function(e){var t=_.findWhere(o,{tag:e.dataset.tag});e.style.display=t?"block":"none"}))})))}))}});
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=249)}({249:function(e,t,n){"use strict";n.r(t);var r=function(e,t){var n=i(t),r=function(e){return-1!==i(e).indexOf(n)};return _.filter(e,(function(e){return r(e.title)||_.some(e.keywords,r)}))},i=function(e){return(e=e.toLowerCase()).trim()};function o(e){var t=document.querySelectorAll(".edd-email-tags-list-item");if(t.length){var n=document.activeElement;if(n&&(n.matches(".edd-email-tags-filter-search")||n.matches(".edd-email-tags-list-button"))){var r,i=!1;if(n.matches(".edd-email-tags-filter-search")){if("up"===e)return;r=_.find(t,(function(e){return"none"!==e.style.display})),i=!0}else r=n.parentElement;for(;!i;)i=!(r="down"===e?r.nextElementSibling:r.previousElementSibling)||"none"!==r.style.display;r?r.querySelector(".edd-email-tags-list-button").focus():"up"===e&&document.querySelector(".edd-email-tags-filter-search").focus()}}}document.addEventListener("DOMContentLoaded",(function(){var e,t,n,i=document.querySelector(".edd-email-tags-inserter");i&&(i.addEventListener("click",tb_position),(e=document.querySelectorAll(".edd-email-tags-list-button"))&&_.each(e,(function(e){e.addEventListener("click",(function(){tb_remove(),window.send_to_editor(e.dataset.to_insert)}))})),(n=document.querySelector(".edd-email-tags-filter-search"))&&n.addEventListener("input",(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.querySelectorAll(".edd-email-tags-list-item"),n=r(eddEmailTagsInserter.items,e);_.each(t,(function(e){var t=_.findWhere(n,{tag:e.dataset.tag});e.style.display=t?"block":"none"}))}(e.target.value)})),document.addEventListener("keydown",(function(e){var t=e.key||e.keyCode;t&&("ArrowDown"!==t&&40!==t?"ArrowUp"!==t&&38!==t||o("up"):o("down"))})),(t=document.querySelector(".edd-email-tags-inserter"))&&t.addEventListener("click",(function(){setTimeout((function(){var e=document.querySelector(".edd-email-tags-filter-search");e&&(e.value="",e.dispatchEvent(new Event("input")),e.focus())}),10)})))}))}});

View File

@ -1 +1 @@
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=226)}({1:function(e,t){e.exports=jQuery},226:function(e,t,n){(function(e){!function(e,t){"use strict";t(".edd-extension-manager__actions").on("click",".edd-extension-manager__action",(function(e){e.preventDefault();var n=t(this),a=n.attr("data-action"),i=n.attr("data-plugin"),d=n.attr("data-type"),s="",r="",o="",l=n.hasClass("edd-button__toggle");if(!n.attr("disabled")){switch(a){case"activate":s="edd_activate_extension",r="edd-plugin__inactive",o="edd-plugin__active",l||n.text(EDDExtensionManager.activating);break;case"install":s="edd_install_extension",o="edd-plugin__active",n.text(EDDExtensionManager.installing);break;case"deactivate":s="edd_deactivate_extension",r="edd-plugin__active",o="edd-plugin__inactive",l||n.text(EDDExtensionManager.deactivating);break;default:return}n.attr("disabled",!0).addClass("edd-updating"),n.hasClass("button-primary")&&n.removeClass("button-primary").addClass("updating-message");var c={action:s,nonce:EDDExtensionManager.extension_manager_nonce,plugin:i,type:d,pass:n.attr("data-pass"),id:n.attr("data-id"),product:n.attr("data-product")};t.post(ajaxurl,c).done((function(e){EDDExtensionManager.debug&&console.log(e);var t=n.closest(".edd-extension-manager__step");if(e.success)if(t.length){var a=t.next();a.length&&(t.fadeOut(),a.prepend('<div class="notice inline-notice notice-success"><p>'+e.data.message+"</p></div>"),a.fadeIn())}else n.attr("disabled",!1).removeClass("edd-updating"),n.closest(".edd-extension-manager__card").removeClass(r).addClass(o),e.data.button.length&&n.closest(".edd-extension-manager__control").empty().append(e.data.button);else{var i=e.data.message;i||(i="plugin"!==d?EDDExtensionManager.extension_install_failed:EDDExtensionManager.plugin_install_failed),t.length?(t.fadeOut(),t.after('<div class="notice inline-notice notice-warning"><p>'+i+"</p></div>")):n.closest(".edd-extension-manager__actions").empty().append('<div class="notice inline-notice notice-warning"><p>'+i+"</p></div>")}}))}}));var n,a=t("#edd-extension-manager__bar-search");function i(){clearTimeout(n),n=setTimeout(d,342)}function d(){var e=a.val().toLowerCase(),n=0;if(e.length)t(".edd-extension-manager__card").each((function(){var a=t(this).text().toLowerCase().includes(e),i=t(this).data("filter")&&t(this).data("filter").toLowerCase().includes(e);a||i?(n++,t(this).removeClass("edd-hidden")):t(this).addClass("edd-hidden")}));else{var i=t(".edd-extension-manager__card");i.removeClass("edd-hidden"),n=i.length}t(".edd-extension-manager__card:not(.edd-hidden)").hide().show(0),t(".edd-extension-manager__results").remove(),t("#edd-extension-manager__bar-search").after('<div role="status" class="edd-extension-manager__results screen-reader-text">'+n+" "+EDDExtensionManager.results+"</div>")}a&&(a.on("keyup",(function(e){i()})),a.on("search",(function(e){i()})))}(document,e)}).call(this,n(1))}});
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=226)}({1:function(e,t){e.exports=jQuery},226:function(e,t,n){(function(e){!function(e,t){"use strict";t(".edd-extension-manager__actions").on("click",".edd-extension-manager__action",(function(e){e.preventDefault();var n=t(this),a=n.attr("data-action"),i=n.attr("data-plugin"),d=n.attr("data-type"),r="",s="",o="",l=n.hasClass("edd-button__toggle");if(!n.attr("disabled")){switch(a){case"activate":r="edd_activate_extension",s="edd-plugin__inactive",o="edd-plugin__active",l||n.text(EDDExtensionManager.activating);break;case"install":r="edd_install_extension",o="edd-plugin__active",n.text(EDDExtensionManager.installing);break;case"deactivate":r="edd_deactivate_extension",s="edd-plugin__active",o="edd-plugin__inactive",l||n.text(EDDExtensionManager.deactivating);break;default:return}n.attr("disabled",!0).addClass("edd-updating"),n.hasClass("button-primary")&&n.removeClass("button-primary").addClass("updating-message");var c={action:r,nonce:EDDExtensionManager.extension_manager_nonce,plugin:i,type:d,pass:n.attr("data-pass"),id:n.attr("data-id"),product:n.attr("data-product")};t.post(ajaxurl,c).done((function(e){EDDExtensionManager.debug&&console.log(e);var t=n.closest(".edd-extension-manager__step");if(e.success)if(t.length){var a=t.next();a.length&&(t.fadeOut(),a.prepend('<div class="notice inline-notice notice-success"><p>'+e.data.message+"</p></div>"),a.fadeIn())}else n.attr("disabled",!1).removeClass("edd-updating"),n.closest(".edd-extension-manager__card").removeClass(s).addClass(o),e.data.button.length&&n.closest(".edd-extension-manager__control").empty().append(e.data.button);else{var i=e.data.message;i||(i="plugin"!==d?EDDExtensionManager.extension_install_failed:EDDExtensionManager.plugin_install_failed),t.length?(t.fadeOut(),t.after('<div class="notice inline-notice notice-warning"><p>'+i+"</p></div>")):n.closest(".edd-extension-manager__actions").empty().append('<div class="notice inline-notice notice-warning"><p>'+i+"</p></div>")}}))}}));var n,a=t("#edd-extension-manager__bar-search");function i(){clearTimeout(n),n=setTimeout(d,342)}function d(){var e=a.val().toLowerCase(),n=0;if(e.length)t(".edd-extension-manager__card").each((function(){var a=t(this).text().toLowerCase().includes(e),i=t(this).data("filter")&&t(this).data("filter").toLowerCase().includes(e);a||i?(n++,t(this).removeClass("edd-hidden")):t(this).addClass("edd-hidden")}));else{var i=t(".edd-extension-manager__card");i.removeClass("edd-hidden"),n=i.length}t(".edd-extension-manager__card:not(.edd-hidden)").hide().show(0),t(".edd-extension-manager__results").remove(),t("#edd-extension-manager__bar-search").after('<div role="status" class="edd-extension-manager__results screen-reader-text">'+n+" "+EDDExtensionManager.results+"</div>")}a&&(EDDExtensionManager.filter&&(a.val(EDDExtensionManager.filter),i()),a.on("keyup",(function(e){i()})),a.on("search",(function(e){i()})))}(document,e)}).call(this,n(1))}});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=230)}({1:function(t,e){t.exports=jQuery},230:function(t,e,n){(function(t){t(document).ready((function(t){eddPointers.pointers&&eddPointers.pointers.length>=1&&setTimeout((function(){!function e(n){var o=!1,r=eddPointers.pointers[n];t(r.target+":visible").length||!eddPointers.pointers[n+1]?(eddPointers.pointers[n+1]&&t(eddPointers.pointers[n+1].target+":visible").length&&(o=n+1),options=o?t.extend(r.options,{buttons:function(n,i){return button=t('<button id="edd-pointer-next" class="button button-secondary edd-pointer-next">'+eddPointers.next_label+"</button>"),button.bind("click.pointer",(function(n){n.preventDefault();var u={pointer:r.pointer_id,action:"dismiss-wp-pointer"};t.post(ajaxurl,u),i.element.pointer("close"),e(o)})),button}}):t.extend(r.options,{close:function(){t.post(ajaxurl,{pointer:r.pointer_id,action:"dismiss-wp-pointer"})}}),t(r.target).pointer(options).pointer("open")):e(n+1)}(0)}),500)}))}).call(this,n(1))}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
jQuery( document ).ready( function ( $ ) {
function edd_open_pointer ( i ) {
pointer = eddPointers.pointers[ i ];
options = $.extend( pointer.options, {
close: function () {
$.post( ajaxurl, {
pointer: pointer.pointer_id,
action: 'dismiss-wp-pointer'
} );
}
} );
$( pointer.target ).pointer( options ).pointer( 'open' );
}
for ( var i in eddPointers.pointers ) {
edd_open_pointer( i );
}
} );

View File

@ -5,7 +5,7 @@
* Description: The easiest way to sell digital products with WordPress.
* Author: Easy Digital Downloads
* Author URI: https://easydigitaldownloads.com
* Version: 3.1.3
* Version: 3.1.4
* Text Domain: easy-digital-downloads
* Domain Path: /languages
* Requires at least: 5.4
@ -27,7 +27,7 @@
* @package EDD
* @category Core
* @author Easy Digital Downloads
* @version 3.1.3
* @version 3.1.4
*/
// Exit if accessed directly.

View File

@ -0,0 +1,259 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'US' => __( 'United States', 'easy-digital-downloads' ),
'CA' => __( 'Canada', 'easy-digital-downloads' ),
'GB' => __( 'United Kingdom', 'easy-digital-downloads' ),
'AF' => __( 'Afghanistan', 'easy-digital-downloads' ),
'AX' => __( '&#197;land Islands', 'easy-digital-downloads' ),
'AL' => __( 'Albania', 'easy-digital-downloads' ),
'DZ' => __( 'Algeria', 'easy-digital-downloads' ),
'AS' => __( 'American Samoa', 'easy-digital-downloads' ),
'AD' => __( 'Andorra', 'easy-digital-downloads' ),
'AO' => __( 'Angola', 'easy-digital-downloads' ),
'AI' => __( 'Anguilla', 'easy-digital-downloads' ),
'AQ' => __( 'Antarctica', 'easy-digital-downloads' ),
'AG' => __( 'Antigua and Barbuda', 'easy-digital-downloads' ),
'AR' => __( 'Argentina', 'easy-digital-downloads' ),
'AM' => __( 'Armenia', 'easy-digital-downloads' ),
'AW' => __( 'Aruba', 'easy-digital-downloads' ),
'AU' => __( 'Australia', 'easy-digital-downloads' ),
'AT' => __( 'Austria', 'easy-digital-downloads' ),
'AZ' => __( 'Azerbaijan', 'easy-digital-downloads' ),
'BS' => __( 'Bahamas', 'easy-digital-downloads' ),
'BH' => __( 'Bahrain', 'easy-digital-downloads' ),
'BD' => __( 'Bangladesh', 'easy-digital-downloads' ),
'BB' => __( 'Barbados', 'easy-digital-downloads' ),
'BY' => __( 'Belarus', 'easy-digital-downloads' ),
'BE' => __( 'Belgium', 'easy-digital-downloads' ),
'BZ' => __( 'Belize', 'easy-digital-downloads' ),
'BJ' => __( 'Benin', 'easy-digital-downloads' ),
'BM' => __( 'Bermuda', 'easy-digital-downloads' ),
'BT' => __( 'Bhutan', 'easy-digital-downloads' ),
'BO' => __( 'Bolivia', 'easy-digital-downloads' ),
'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'easy-digital-downloads' ),
'BA' => __( 'Bosnia and Herzegovina', 'easy-digital-downloads' ),
'BW' => __( 'Botswana', 'easy-digital-downloads' ),
'BV' => __( 'Bouvet Island', 'easy-digital-downloads' ),
'BR' => __( 'Brazil', 'easy-digital-downloads' ),
'IO' => __( 'British Indian Ocean Territory', 'easy-digital-downloads' ),
'BN' => __( 'Brunei Darrussalam', 'easy-digital-downloads' ),
'BG' => __( 'Bulgaria', 'easy-digital-downloads' ),
'BF' => __( 'Burkina Faso', 'easy-digital-downloads' ),
'BI' => __( 'Burundi', 'easy-digital-downloads' ),
'KH' => __( 'Cambodia', 'easy-digital-downloads' ),
'CM' => __( 'Cameroon', 'easy-digital-downloads' ),
'CV' => __( 'Cape Verde', 'easy-digital-downloads' ),
'KY' => __( 'Cayman Islands', 'easy-digital-downloads' ),
'CF' => __( 'Central African Republic', 'easy-digital-downloads' ),
'TD' => __( 'Chad', 'easy-digital-downloads' ),
'CL' => __( 'Chile', 'easy-digital-downloads' ),
'CN' => __( 'China', 'easy-digital-downloads' ),
'CX' => __( 'Christmas Island', 'easy-digital-downloads' ),
'CC' => __( 'Cocos Islands', 'easy-digital-downloads' ),
'CO' => __( 'Colombia', 'easy-digital-downloads' ),
'KM' => __( 'Comoros', 'easy-digital-downloads' ),
'CD' => __( 'Congo, Democratic People\'s Republic', 'easy-digital-downloads' ),
'CG' => __( 'Congo, Republic of', 'easy-digital-downloads' ),
'CK' => __( 'Cook Islands', 'easy-digital-downloads' ),
'CR' => __( 'Costa Rica', 'easy-digital-downloads' ),
'CI' => __( 'Cote d\'Ivoire', 'easy-digital-downloads' ),
'HR' => __( 'Croatia/Hrvatska', 'easy-digital-downloads' ),
'CU' => __( 'Cuba', 'easy-digital-downloads' ),
'CW' => __( 'Cura&Ccedil;ao', 'easy-digital-downloads' ),
'CY' => __( 'Cyprus', 'easy-digital-downloads' ),
'CZ' => __( 'Czechia', 'easy-digital-downloads' ),
'DK' => __( 'Denmark', 'easy-digital-downloads' ),
'DJ' => __( 'Djibouti', 'easy-digital-downloads' ),
'DM' => __( 'Dominica', 'easy-digital-downloads' ),
'DO' => __( 'Dominican Republic', 'easy-digital-downloads' ),
'TP' => __( 'East Timor', 'easy-digital-downloads' ),
'EC' => __( 'Ecuador', 'easy-digital-downloads' ),
'EG' => __( 'Egypt', 'easy-digital-downloads' ),
'GQ' => __( 'Equatorial Guinea', 'easy-digital-downloads' ),
'SV' => __( 'El Salvador', 'easy-digital-downloads' ),
'ER' => __( 'Eritrea', 'easy-digital-downloads' ),
'EE' => __( 'Estonia', 'easy-digital-downloads' ),
'ET' => __( 'Ethiopia', 'easy-digital-downloads' ),
'FK' => __( 'Falkland Islands', 'easy-digital-downloads' ),
'FO' => __( 'Faroe Islands', 'easy-digital-downloads' ),
'FJ' => __( 'Fiji', 'easy-digital-downloads' ),
'FI' => __( 'Finland', 'easy-digital-downloads' ),
'FR' => __( 'France', 'easy-digital-downloads' ),
'GF' => __( 'French Guiana', 'easy-digital-downloads' ),
'PF' => __( 'French Polynesia', 'easy-digital-downloads' ),
'TF' => __( 'French Southern Territories', 'easy-digital-downloads' ),
'GA' => __( 'Gabon', 'easy-digital-downloads' ),
'GM' => __( 'Gambia', 'easy-digital-downloads' ),
'GE' => __( 'Georgia', 'easy-digital-downloads' ),
'DE' => __( 'Germany', 'easy-digital-downloads' ),
'GR' => __( 'Greece', 'easy-digital-downloads' ),
'GH' => __( 'Ghana', 'easy-digital-downloads' ),
'GI' => __( 'Gibraltar', 'easy-digital-downloads' ),
'GL' => __( 'Greenland', 'easy-digital-downloads' ),
'GD' => __( 'Grenada', 'easy-digital-downloads' ),
'GP' => __( 'Guadeloupe', 'easy-digital-downloads' ),
'GU' => __( 'Guam', 'easy-digital-downloads' ),
'GT' => __( 'Guatemala', 'easy-digital-downloads' ),
'GG' => __( 'Guernsey', 'easy-digital-downloads' ),
'GN' => __( 'Guinea', 'easy-digital-downloads' ),
'GW' => __( 'Guinea-Bissau', 'easy-digital-downloads' ),
'GY' => __( 'Guyana', 'easy-digital-downloads' ),
'HT' => __( 'Haiti', 'easy-digital-downloads' ),
'HM' => __( 'Heard and McDonald Islands', 'easy-digital-downloads' ),
'VA' => __( 'Holy See (City Vatican State)', 'easy-digital-downloads' ),
'HN' => __( 'Honduras', 'easy-digital-downloads' ),
'HK' => __( 'Hong Kong', 'easy-digital-downloads' ),
'HU' => __( 'Hungary', 'easy-digital-downloads' ),
'IS' => __( 'Iceland', 'easy-digital-downloads' ),
'IN' => __( 'India', 'easy-digital-downloads' ),
'ID' => __( 'Indonesia', 'easy-digital-downloads' ),
'IR' => __( 'Iran', 'easy-digital-downloads' ),
'IQ' => __( 'Iraq', 'easy-digital-downloads' ),
'IE' => __( 'Ireland', 'easy-digital-downloads' ),
'IM' => __( 'Isle of Man', 'easy-digital-downloads' ),
'IL' => __( 'Israel', 'easy-digital-downloads' ),
'IT' => __( 'Italy', 'easy-digital-downloads' ),
'JM' => __( 'Jamaica', 'easy-digital-downloads' ),
'JP' => __( 'Japan', 'easy-digital-downloads' ),
'JE' => __( 'Jersey', 'easy-digital-downloads' ),
'JO' => __( 'Jordan', 'easy-digital-downloads' ),
'KZ' => __( 'Kazakhstan', 'easy-digital-downloads' ),
'KE' => __( 'Kenya', 'easy-digital-downloads' ),
'KI' => __( 'Kiribati', 'easy-digital-downloads' ),
'KW' => __( 'Kuwait', 'easy-digital-downloads' ),
'KG' => __( 'Kyrgyzstan', 'easy-digital-downloads' ),
'LA' => __( 'Lao People\'s Democratic Republic', 'easy-digital-downloads' ),
'LV' => __( 'Latvia', 'easy-digital-downloads' ),
'LB' => __( 'Lebanon', 'easy-digital-downloads' ),
'LS' => __( 'Lesotho', 'easy-digital-downloads' ),
'LR' => __( 'Liberia', 'easy-digital-downloads' ),
'LY' => __( 'Libyan Arab Jamahiriya', 'easy-digital-downloads' ),
'LI' => __( 'Liechtenstein', 'easy-digital-downloads' ),
'LT' => __( 'Lithuania', 'easy-digital-downloads' ),
'LU' => __( 'Luxembourg', 'easy-digital-downloads' ),
'MO' => __( 'Macau', 'easy-digital-downloads' ),
'MK' => __( 'Macedonia', 'easy-digital-downloads' ),
'MG' => __( 'Madagascar', 'easy-digital-downloads' ),
'MW' => __( 'Malawi', 'easy-digital-downloads' ),
'MY' => __( 'Malaysia', 'easy-digital-downloads' ),
'MV' => __( 'Maldives', 'easy-digital-downloads' ),
'ML' => __( 'Mali', 'easy-digital-downloads' ),
'MT' => __( 'Malta', 'easy-digital-downloads' ),
'MH' => __( 'Marshall Islands', 'easy-digital-downloads' ),
'MQ' => __( 'Martinique', 'easy-digital-downloads' ),
'MR' => __( 'Mauritania', 'easy-digital-downloads' ),
'MU' => __( 'Mauritius', 'easy-digital-downloads' ),
'YT' => __( 'Mayotte', 'easy-digital-downloads' ),
'MX' => __( 'Mexico', 'easy-digital-downloads' ),
'FM' => __( 'Micronesia', 'easy-digital-downloads' ),
'MD' => __( 'Moldova, Republic of', 'easy-digital-downloads' ),
'MC' => __( 'Monaco', 'easy-digital-downloads' ),
'MN' => __( 'Mongolia', 'easy-digital-downloads' ),
'ME' => __( 'Montenegro', 'easy-digital-downloads' ),
'MS' => __( 'Montserrat', 'easy-digital-downloads' ),
'MA' => __( 'Morocco', 'easy-digital-downloads' ),
'MZ' => __( 'Mozambique', 'easy-digital-downloads' ),
'MM' => __( 'Myanmar', 'easy-digital-downloads' ),
'NA' => __( 'Namibia', 'easy-digital-downloads' ),
'NR' => __( 'Nauru', 'easy-digital-downloads' ),
'NP' => __( 'Nepal', 'easy-digital-downloads' ),
'NL' => __( 'Netherlands', 'easy-digital-downloads' ),
'AN' => __( 'Netherlands Antilles', 'easy-digital-downloads' ),
'NC' => __( 'New Caledonia', 'easy-digital-downloads' ),
'NZ' => __( 'New Zealand', 'easy-digital-downloads' ),
'NI' => __( 'Nicaragua', 'easy-digital-downloads' ),
'NE' => __( 'Niger', 'easy-digital-downloads' ),
'NG' => __( 'Nigeria', 'easy-digital-downloads' ),
'NU' => __( 'Niue', 'easy-digital-downloads' ),
'NF' => __( 'Norfolk Island', 'easy-digital-downloads' ),
'KP' => __( 'North Korea', 'easy-digital-downloads' ),
'MP' => __( 'Northern Mariana Islands', 'easy-digital-downloads' ),
'NO' => __( 'Norway', 'easy-digital-downloads' ),
'OM' => __( 'Oman', 'easy-digital-downloads' ),
'PK' => __( 'Pakistan', 'easy-digital-downloads' ),
'PW' => __( 'Palau', 'easy-digital-downloads' ),
'PS' => __( 'Palestinian Territories', 'easy-digital-downloads' ),
'PA' => __( 'Panama', 'easy-digital-downloads' ),
'PG' => __( 'Papua New Guinea', 'easy-digital-downloads' ),
'PY' => __( 'Paraguay', 'easy-digital-downloads' ),
'PE' => __( 'Peru', 'easy-digital-downloads' ),
'PH' => __( 'Philippines', 'easy-digital-downloads' ),
'PN' => __( 'Pitcairn Island', 'easy-digital-downloads' ),
'PL' => __( 'Poland', 'easy-digital-downloads' ),
'PT' => __( 'Portugal', 'easy-digital-downloads' ),
'PR' => __( 'Puerto Rico', 'easy-digital-downloads' ),
'QA' => __( 'Qatar', 'easy-digital-downloads' ),
'XK' => __( 'Republic of Kosovo', 'easy-digital-downloads' ),
'RE' => __( 'Reunion Island', 'easy-digital-downloads' ),
'RO' => __( 'Romania', 'easy-digital-downloads' ),
'RU' => __( 'Russian Federation', 'easy-digital-downloads' ),
'RW' => __( 'Rwanda', 'easy-digital-downloads' ),
'BL' => __( 'Saint Barth&eacute;lemy', 'easy-digital-downloads' ),
'SH' => __( 'Saint Helena', 'easy-digital-downloads' ),
'KN' => __( 'Saint Kitts and Nevis', 'easy-digital-downloads' ),
'LC' => __( 'Saint Lucia', 'easy-digital-downloads' ),
'MF' => __( 'Saint Martin (French)', 'easy-digital-downloads' ),
'SX' => __( 'Saint Martin (Dutch)', 'easy-digital-downloads' ),
'PM' => __( 'Saint Pierre and Miquelon', 'easy-digital-downloads' ),
'VC' => __( 'Saint Vincent and the Grenadines', 'easy-digital-downloads' ),
'SM' => __( 'San Marino', 'easy-digital-downloads' ),
'ST' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe', 'easy-digital-downloads' ),
'SA' => __( 'Saudi Arabia', 'easy-digital-downloads' ),
'SN' => __( 'Senegal', 'easy-digital-downloads' ),
'RS' => __( 'Serbia', 'easy-digital-downloads' ),
'SC' => __( 'Seychelles', 'easy-digital-downloads' ),
'SL' => __( 'Sierra Leone', 'easy-digital-downloads' ),
'SG' => __( 'Singapore', 'easy-digital-downloads' ),
'SK' => __( 'Slovak Republic', 'easy-digital-downloads' ),
'SI' => __( 'Slovenia', 'easy-digital-downloads' ),
'SB' => __( 'Solomon Islands', 'easy-digital-downloads' ),
'SO' => __( 'Somalia', 'easy-digital-downloads' ),
'ZA' => __( 'South Africa', 'easy-digital-downloads' ),
'GS' => __( 'South Georgia', 'easy-digital-downloads' ),
'KR' => __( 'South Korea', 'easy-digital-downloads' ),
'SS' => __( 'South Sudan', 'easy-digital-downloads' ),
'ES' => __( 'Spain', 'easy-digital-downloads' ),
'LK' => __( 'Sri Lanka', 'easy-digital-downloads' ),
'SD' => __( 'Sudan', 'easy-digital-downloads' ),
'SR' => __( 'Suriname', 'easy-digital-downloads' ),
'SJ' => __( 'Svalbard and Jan Mayen Islands', 'easy-digital-downloads' ),
'SZ' => __( 'Swaziland', 'easy-digital-downloads' ),
'SE' => __( 'Sweden', 'easy-digital-downloads' ),
'CH' => __( 'Switzerland', 'easy-digital-downloads' ),
'SY' => __( 'Syrian Arab Republic', 'easy-digital-downloads' ),
'TW' => __( 'Taiwan', 'easy-digital-downloads' ),
'TJ' => __( 'Tajikistan', 'easy-digital-downloads' ),
'TZ' => __( 'Tanzania', 'easy-digital-downloads' ),
'TH' => __( 'Thailand', 'easy-digital-downloads' ),
'TL' => __( 'Timor-Leste', 'easy-digital-downloads' ),
'TG' => __( 'Togo', 'easy-digital-downloads' ),
'TK' => __( 'Tokelau', 'easy-digital-downloads' ),
'TO' => __( 'Tonga', 'easy-digital-downloads' ),
'TT' => __( 'Trinidad and Tobago', 'easy-digital-downloads' ),
'TN' => __( 'Tunisia', 'easy-digital-downloads' ),
'TR' => __( 'Turkey', 'easy-digital-downloads' ),
'TM' => __( 'Turkmenistan', 'easy-digital-downloads' ),
'TC' => __( 'Turks and Caicos Islands', 'easy-digital-downloads' ),
'TV' => __( 'Tuvalu', 'easy-digital-downloads' ),
'UG' => __( 'Uganda', 'easy-digital-downloads' ),
'UA' => __( 'Ukraine', 'easy-digital-downloads' ),
'AE' => __( 'United Arab Emirates', 'easy-digital-downloads' ),
'UY' => __( 'Uruguay', 'easy-digital-downloads' ),
'UM' => __( 'US Minor Outlying Islands', 'easy-digital-downloads' ),
'UZ' => __( 'Uzbekistan', 'easy-digital-downloads' ),
'VU' => __( 'Vanuatu', 'easy-digital-downloads' ),
'VE' => __( 'Venezuela', 'easy-digital-downloads' ),
'VN' => __( 'Vietnam', 'easy-digital-downloads' ),
'VG' => __( 'Virgin Islands (British)', 'easy-digital-downloads' ),
'VI' => __( 'Virgin Islands (USA)', 'easy-digital-downloads' ),
'WF' => __( 'Wallis and Futuna Islands', 'easy-digital-downloads' ),
'EH' => __( 'Western Sahara', 'easy-digital-downloads' ),
'WS' => __( 'Western Samoa', 'easy-digital-downloads' ),
'YE' => __( 'Yemen', 'easy-digital-downloads' ),
'ZM' => __( 'Zambia', 'easy-digital-downloads' ),
'ZW' => __( 'Zimbabwe', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,71 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'BAG' => __( 'Bagerhat', 'easy-digital-downloads' ),
'BAN' => __( 'Bandarban', 'easy-digital-downloads' ),
'BAR' => __( 'Barguna', 'easy-digital-downloads' ),
'BARI' => __( 'Barisal', 'easy-digital-downloads' ),
'BHO' => __( 'Bhola', 'easy-digital-downloads' ),
'BOG' => __( 'Bogra', 'easy-digital-downloads' ),
'BRA' => __( 'Brahmanbaria', 'easy-digital-downloads' ),
'CHA' => __( 'Chandpur', 'easy-digital-downloads' ),
'CHI' => __( 'Chittagong', 'easy-digital-downloads' ),
'CHU' => __( 'Chuadanga', 'easy-digital-downloads' ),
'COM' => __( 'Comilla', 'easy-digital-downloads' ),
'COX' => __( 'Cox\'s Bazar', 'easy-digital-downloads' ),
'DHA' => __( 'Dhaka', 'easy-digital-downloads' ),
'DIN' => __( 'Dinajpur', 'easy-digital-downloads' ),
'FAR' => __( 'Faridpur', 'easy-digital-downloads' ),
'FEN' => __( 'Feni', 'easy-digital-downloads' ),
'GAI' => __( 'Gaibandha', 'easy-digital-downloads' ),
'GAZI' => __( 'Gazipur', 'easy-digital-downloads' ),
'GOP' => __( 'Gopalganj', 'easy-digital-downloads' ),
'HAB' => __( 'Habiganj', 'easy-digital-downloads' ),
'JAM' => __( 'Jamalpur', 'easy-digital-downloads' ),
'JES' => __( 'Jessore', 'easy-digital-downloads' ),
'JHA' => __( 'Jhalokati', 'easy-digital-downloads' ),
'JHE' => __( 'Jhenaidah', 'easy-digital-downloads' ),
'JOY' => __( 'Joypurhat', 'easy-digital-downloads' ),
'KHA' => __( 'Khagrachhari', 'easy-digital-downloads' ),
'KHU' => __( 'Khulna', 'easy-digital-downloads' ),
'KIS' => __( 'Kishoreganj', 'easy-digital-downloads' ),
'KUR' => __( 'Kurigram', 'easy-digital-downloads' ),
'KUS' => __( 'Kushtia', 'easy-digital-downloads' ),
'LAK' => __( 'Lakshmipur', 'easy-digital-downloads' ),
'LAL' => __( 'Lalmonirhat', 'easy-digital-downloads' ),
'MAD' => __( 'Madaripur', 'easy-digital-downloads' ),
'MAG' => __( 'Magura', 'easy-digital-downloads' ),
'MAN' => __( 'Manikganj', 'easy-digital-downloads' ),
'MEH' => __( 'Meherpur', 'easy-digital-downloads' ),
'MOU' => __( 'Moulvibazar', 'easy-digital-downloads' ),
'MUN' => __( 'Munshiganj', 'easy-digital-downloads' ),
'MYM' => __( 'Mymensingh', 'easy-digital-downloads' ),
'NAO' => __( 'Naogaon', 'easy-digital-downloads' ),
'NAR' => __( 'Narail', 'easy-digital-downloads' ),
'NARG' => __( 'Narayanganj', 'easy-digital-downloads' ),
'NARD' => __( 'Narsingdi', 'easy-digital-downloads' ),
'NAT' => __( 'Natore', 'easy-digital-downloads' ),
'NAW' => __( 'Nawabganj', 'easy-digital-downloads' ),
'NET' => __( 'Netrakona', 'easy-digital-downloads' ),
'NIL' => __( 'Nilphamari', 'easy-digital-downloads' ),
'NOA' => __( 'Noakhali', 'easy-digital-downloads' ),
'PAB' => __( 'Pabna', 'easy-digital-downloads' ),
'PAN' => __( 'Panchagarh', 'easy-digital-downloads' ),
'PAT' => __( 'Patuakhali', 'easy-digital-downloads' ),
'PIR' => __( 'Pirojpur', 'easy-digital-downloads' ),
'RAJB' => __( 'Rajbari', 'easy-digital-downloads' ),
'RAJ' => __( 'Rajshahi', 'easy-digital-downloads' ),
'RAN' => __( 'Rangamati', 'easy-digital-downloads' ),
'RANP' => __( 'Rangpur', 'easy-digital-downloads' ),
'SAT' => __( 'Satkhira', 'easy-digital-downloads' ),
'SHA' => __( 'Shariatpur', 'easy-digital-downloads' ),
'SHE' => __( 'Sherpur', 'easy-digital-downloads' ),
'SIR' => __( 'Sirajganj', 'easy-digital-downloads' ),
'SUN' => __( 'Sunamganj', 'easy-digital-downloads' ),
'SYL' => __( 'Sylhet', 'easy-digital-downloads' ),
'TAN' => __( 'Tangail', 'easy-digital-downloads' ),
'THA' => __( 'Thakurgaon', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,59 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'C' => __( 'A Coru&ntilde;a', 'easy-digital-downloads' ),
'VI' => __( 'Araba', 'easy-digital-downloads' ),
'AB' => __( 'Albacete', 'easy-digital-downloads' ),
'A' => __( 'Alicante', 'easy-digital-downloads' ),
'AL' => __( 'Almer&iacute;a', 'easy-digital-downloads' ),
'O' => __( 'Asturias', 'easy-digital-downloads' ),
'AV' => __( '&Aacute;vila', 'easy-digital-downloads' ),
'BA' => __( 'Badajoz', 'easy-digital-downloads' ),
'PM' => __( 'Baleares', 'easy-digital-downloads' ),
'B' => __( 'Barcelona', 'easy-digital-downloads' ),
'BU' => __( 'Burgos', 'easy-digital-downloads' ),
'CC' => __( 'C&aacute;ceres', 'easy-digital-downloads' ),
'CA' => __( 'C&aacute;diz', 'easy-digital-downloads' ),
'S' => __( 'Cantabria', 'easy-digital-downloads' ),
'CS' => __( 'Castell&oacute;n', 'easy-digital-downloads' ),
'CE' => __( 'Ceuta', 'easy-digital-downloads' ),
'CR' => __( 'Ciudad Real', 'easy-digital-downloads' ),
'CO' => __( 'C&oacute;rdoba', 'easy-digital-downloads' ),
'CU' => __( 'Cuenca', 'easy-digital-downloads' ),
'GI' => __( 'Girona', 'easy-digital-downloads' ),
'GR' => __( 'Granada', 'easy-digital-downloads' ),
'GU' => __( 'Guadalajara', 'easy-digital-downloads' ),
'SS' => __( 'Gipuzkoa', 'easy-digital-downloads' ),
'H' => __( 'Huelva', 'easy-digital-downloads' ),
'HU' => __( 'Huesca', 'easy-digital-downloads' ),
'J' => __( 'Ja&eacute;n', 'easy-digital-downloads' ),
'LO' => __( 'La Rioja', 'easy-digital-downloads' ),
'GC' => __( 'Las Palmas', 'easy-digital-downloads' ),
'LE' => __( 'Le&oacute;n', 'easy-digital-downloads' ),
'L' => __( 'Lleida', 'easy-digital-downloads' ),
'LU' => __( 'Lugo', 'easy-digital-downloads' ),
'M' => __( 'Madrid', 'easy-digital-downloads' ),
'MA' => __( 'M&aacute;laga', 'easy-digital-downloads' ),
'ML' => __( 'Melilla', 'easy-digital-downloads' ),
'MU' => __( 'Murcia', 'easy-digital-downloads' ),
'NA' => __( 'Navarra', 'easy-digital-downloads' ),
'OR' => __( 'Ourense', 'easy-digital-downloads' ),
'P' => __( 'Palencia', 'easy-digital-downloads' ),
'PO' => __( 'Pontevedra', 'easy-digital-downloads' ),
'SA' => __( 'Salamanca', 'easy-digital-downloads' ),
'TF' => __( 'Santa Cruz de Tenerife', 'easy-digital-downloads' ),
'SG' => __( 'Segovia', 'easy-digital-downloads' ),
'SE' => __( 'Sevilla', 'easy-digital-downloads' ),
'SO' => __( 'Soria', 'easy-digital-downloads' ),
'T' => __( 'Tarragona', 'easy-digital-downloads' ),
'TE' => __( 'Teruel', 'easy-digital-downloads' ),
'TO' => __( 'Toledo', 'easy-digital-downloads' ),
'V' => __( 'Valencia', 'easy-digital-downloads' ),
'VA' => __( 'Valladolid', 'easy-digital-downloads' ),
'BI' => __( 'Bizkaia', 'easy-digital-downloads' ),
'ZA' => __( 'Zamora', 'easy-digital-downloads' ),
'Z' => __( 'Zaragoza', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,224 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'GB-ABE' => __( 'Aberdeen City', 'easy-digital-downloads' ),
'GB-ABD' => __( 'Aberdeenshire', 'easy-digital-downloads' ),
'GB-ANS' => __( 'Angus', 'easy-digital-downloads' ),
'GB-ANN' => __( 'Antrim and Newtownabbey', 'easy-digital-downloads' ),
'GB-AND' => __( 'Ards and North Down', 'easy-digital-downloads' ),
'GB-AGB' => __( 'Argyll and Bute', 'easy-digital-downloads' ),
'GB-ABC' => __( 'Armagh, Banbridge and Craigavon', 'easy-digital-downloads' ),
'GB-BDG' => __( 'Barking and Dagenham', 'easy-digital-downloads' ),
'GB-BNE' => __( 'Barnet', 'easy-digital-downloads' ),
'GB-BNS' => __( 'Barnsley', 'easy-digital-downloads' ),
'GB-BAS' => __( 'Bath and North East Somerset', 'easy-digital-downloads' ),
'GB-BDF' => __( 'Bedford', 'easy-digital-downloads' ),
'GB-BFS' => __( 'Belfast', 'easy-digital-downloads' ),
'GB-BEX' => __( 'Bexley', 'easy-digital-downloads' ),
'GB-BIR' => __( 'Birmingham', 'easy-digital-downloads' ),
'GB-BBD' => __( 'Blackburn with Darwen', 'easy-digital-downloads' ),
'GB-BPL' => __( 'Blackpool', 'easy-digital-downloads' ),
'GB-BGW' => __( 'Blaenau Gwent', 'easy-digital-downloads' ),
'GB-BOL' => __( 'Bolton', 'easy-digital-downloads' ),
'GB-BMH' => __( 'Bournemouth', 'easy-digital-downloads' ),
'GB-BRC' => __( 'Bracknell Forest', 'easy-digital-downloads' ),
'GB-BRD' => __( 'Bradford', 'easy-digital-downloads' ),
'GB-BEN' => __( 'Brent', 'easy-digital-downloads' ),
'GB-BGE' => __( 'Bridgend', 'easy-digital-downloads' ),
'GB-BNH' => __( 'Brighton and Hove', 'easy-digital-downloads' ),
'GB-BST' => __( 'Bristol, City of', 'easy-digital-downloads' ),
'GB-BRY' => __( 'Bromley', 'easy-digital-downloads' ),
'GB-BKM' => __( 'Buckinghamshire', 'easy-digital-downloads' ),
'GB-BUR' => __( 'Bury', 'easy-digital-downloads' ),
'GB-CAY' => __( 'Caerphilly', 'easy-digital-downloads' ),
'GB-CLD' => __( 'Calderdale', 'easy-digital-downloads' ),
'GB-CAM' => __( 'Cambridgeshire', 'easy-digital-downloads' ),
'GB-CMD' => __( 'Camden', 'easy-digital-downloads' ),
'GB-CRF' => __( 'Cardiff', 'easy-digital-downloads' ),
'GB-CMN' => __( 'Carmarthenshire', 'easy-digital-downloads' ),
'GB-CCG' => __( 'Causeway Coast and Glens', 'easy-digital-downloads' ),
'GB-CBF' => __( 'Central Bedfordshire', 'easy-digital-downloads' ),
'GB-CGN' => __( 'Ceredigion', 'easy-digital-downloads' ),
'GB-CHE' => __( 'Cheshire East', 'easy-digital-downloads' ),
'GB-CHW' => __( 'Cheshire West and Chester', 'easy-digital-downloads' ),
'GB-CLK' => __( 'Clackmannanshire', 'easy-digital-downloads' ),
'GB-CWY' => __( 'Conwy', 'easy-digital-downloads' ),
'GB-CON' => __( 'Cornwall', 'easy-digital-downloads' ),
'GB-COV' => __( 'Coventry', 'easy-digital-downloads' ),
'GB-CRY' => __( 'Croydon', 'easy-digital-downloads' ),
'GB-CMA' => __( 'Cumbria', 'easy-digital-downloads' ),
'GB-DAL' => __( 'Darlington', 'easy-digital-downloads' ),
'GB-DEN' => __( 'Denbighshire', 'easy-digital-downloads' ),
'GB-DER' => __( 'Derby', 'easy-digital-downloads' ),
'GB-DBY' => __( 'Derbyshire', 'easy-digital-downloads' ),
'GB-DRS' => __( 'Derry and Strabane', 'easy-digital-downloads' ),
'GB-DEV' => __( 'Devon', 'easy-digital-downloads' ),
'GB-DNC' => __( 'Doncaster', 'easy-digital-downloads' ),
'GB-DOR' => __( 'Dorset', 'easy-digital-downloads' ),
'GB-DUD' => __( 'Dudley', 'easy-digital-downloads' ),
'GB-DGY' => __( 'Dumfries and Galloway', 'easy-digital-downloads' ),
'GB-DND' => __( 'Dundee City', 'easy-digital-downloads' ),
'GB-DUR' => __( 'Durham, County', 'easy-digital-downloads' ),
'GB-EAL' => __( 'Ealing', 'easy-digital-downloads' ),
'GB-EAY' => __( 'East Ayrshire', 'easy-digital-downloads' ),
'GB-EDU' => __( 'East Dunbartonshire', 'easy-digital-downloads' ),
'GB-ELN' => __( 'East Lothian', 'easy-digital-downloads' ),
'GB-ERW' => __( 'East Renfrewshire', 'easy-digital-downloads' ),
'GB-ERY' => __( 'East Riding of Yorkshire', 'easy-digital-downloads' ),
'GB-ESX' => __( 'East Sussex', 'easy-digital-downloads' ),
'GB-EDH' => __( 'Edinburgh, City of', 'easy-digital-downloads' ),
'GB-ELS' => __( 'Eilean Siar', 'easy-digital-downloads' ),
'GB-ENF' => __( 'Enfield', 'easy-digital-downloads' ),
'GB-ESS' => __( 'Essex', 'easy-digital-downloads' ),
'GB-FAL' => __( 'Falkirk', 'easy-digital-downloads' ),
'GB-FMO' => __( 'Fermanagh and Omagh', 'easy-digital-downloads' ),
'GB-FIF' => __( 'Fife', 'easy-digital-downloads' ),
'GB-FLN' => __( 'Flintshire', 'easy-digital-downloads' ),
'GB-GAT' => __( 'Gateshead', 'easy-digital-downloads' ),
'GB-GLG' => __( 'Glasgow City', 'easy-digital-downloads' ),
'GB-GLS' => __( 'Gloucestershire', 'easy-digital-downloads' ),
'GB-GRE' => __( 'Greenwich', 'easy-digital-downloads' ),
'GB-GWN' => __( 'Gwynedd', 'easy-digital-downloads' ),
'GB-HCK' => __( 'Hackney', 'easy-digital-downloads' ),
'GB-HAL' => __( 'Halton', 'easy-digital-downloads' ),
'GB-HMF' => __( 'Hammersmith and Fulham', 'easy-digital-downloads' ),
'GB-HAM' => __( 'Hampshire', 'easy-digital-downloads' ),
'GB-HRY' => __( 'Haringey', 'easy-digital-downloads' ),
'GB-HRW' => __( 'Harrow', 'easy-digital-downloads' ),
'GB-HPL' => __( 'Hartlepool', 'easy-digital-downloads' ),
'GB-HAV' => __( 'Havering', 'easy-digital-downloads' ),
'GB-HEF' => __( 'Herefordshire', 'easy-digital-downloads' ),
'GB-HRT' => __( 'Hertfordshire', 'easy-digital-downloads' ),
'GB-HLD' => __( 'Highland', 'easy-digital-downloads' ),
'GB-HIL' => __( 'Hillingdon', 'easy-digital-downloads' ),
'GB-HNS' => __( 'Hounslow', 'easy-digital-downloads' ),
'GB-IVC' => __( 'Inverclyde', 'easy-digital-downloads' ),
'GB-AGY' => __( 'Isle of Anglesey', 'easy-digital-downloads' ),
'GB-IOW' => __( 'Isle of Wight', 'easy-digital-downloads' ),
'GB-IOS' => __( 'Isles of Scilly', 'easy-digital-downloads' ),
'GB-ISL' => __( 'Islington', 'easy-digital-downloads' ),
'GB-KEC' => __( 'Kensington and Chelsea', 'easy-digital-downloads' ),
'GB-KEN' => __( 'Kent', 'easy-digital-downloads' ),
'GB-KHL' => __( 'Kingston upon Hull', 'easy-digital-downloads' ),
'GB-KTT' => __( 'Kingston upon Thames', 'easy-digital-downloads' ),
'GB-KIR' => __( 'Kirklees', 'easy-digital-downloads' ),
'GB-KWL' => __( 'Knowsley', 'easy-digital-downloads' ),
'GB-LBH' => __( 'Lambeth', 'easy-digital-downloads' ),
'GB-LAN' => __( 'Lancashire', 'easy-digital-downloads' ),
'GB-LDS' => __( 'Leeds', 'easy-digital-downloads' ),
'GB-LCE' => __( 'Leicester', 'easy-digital-downloads' ),
'GB-LEC' => __( 'Leicestershire', 'easy-digital-downloads' ),
'GB-LEW' => __( 'Lewisham', 'easy-digital-downloads' ),
'GB-LIN' => __( 'Lincolnshire', 'easy-digital-downloads' ),
'GB-LBC' => __( 'Lisburn and Castlereagh', 'easy-digital-downloads' ),
'GB-LIV' => __( 'Liverpool', 'easy-digital-downloads' ),
'GB-LND' => __( 'London, City of', 'easy-digital-downloads' ),
'GB-LUT' => __( 'Luton', 'easy-digital-downloads' ),
'GB-MAN' => __( 'Manchester', 'easy-digital-downloads' ),
'GB-MDW' => __( 'Medway', 'easy-digital-downloads' ),
'GB-MTY' => __( 'Merthyr Tydfil', 'easy-digital-downloads' ),
'GB-MRT' => __( 'Merton', 'easy-digital-downloads' ),
'GB-MEA' => __( 'Mid and East Antrim', 'easy-digital-downloads' ),
'GB-MUL' => __( 'Mid Ulster', 'easy-digital-downloads' ),
'GB-MDB' => __( 'Middlesbrough', 'easy-digital-downloads' ),
'GB-MLN' => __( 'Midlothian', 'easy-digital-downloads' ),
'GB-MIK' => __( 'Milton Keynes', 'easy-digital-downloads' ),
'GB-MON' => __( 'Monmouthshire', 'easy-digital-downloads' ),
'GB-MRY' => __( 'Moray', 'easy-digital-downloads' ),
'GB-NTL' => __( 'Neath Port Talbot', 'easy-digital-downloads' ),
'GB-NET' => __( 'Newcastle upon Tyne', 'easy-digital-downloads' ),
'GB-NWM' => __( 'Newham', 'easy-digital-downloads' ),
'GB-NWP' => __( 'Newport', 'easy-digital-downloads' ),
'GB-NMD' => __( 'Newry, Mourne and Down', 'easy-digital-downloads' ),
'GB-NFK' => __( 'Norfolk', 'easy-digital-downloads' ),
'GB-NAY' => __( 'North Ayrshire', 'easy-digital-downloads' ),
'GB-NEL' => __( 'North East Lincolnshire', 'easy-digital-downloads' ),
'GB-NLK' => __( 'North Lanarkshire', 'easy-digital-downloads' ),
'GB-NLN' => __( 'North Lincolnshire', 'easy-digital-downloads' ),
'GB-NSM' => __( 'North Somerset', 'easy-digital-downloads' ),
'GB-NTY' => __( 'North Tyneside', 'easy-digital-downloads' ),
'GB-NYK' => __( 'North Yorkshire', 'easy-digital-downloads' ),
'GB-NTH' => __( 'Northamptonshire', 'easy-digital-downloads' ),
'GB-NBL' => __( 'Northumberland', 'easy-digital-downloads' ),
'GB-NGM' => __( 'Nottingham', 'easy-digital-downloads' ),
'GB-NTT' => __( 'Nottinghamshire', 'easy-digital-downloads' ),
'GB-OLD' => __( 'Oldham', 'easy-digital-downloads' ),
'GB-ORK' => __( 'Orkney Islands', 'easy-digital-downloads' ),
'GB-OXF' => __( 'Oxfordshire', 'easy-digital-downloads' ),
'GB-PEM' => __( 'Pembrokeshire', 'easy-digital-downloads' ),
'GB-PKN' => __( 'Perth and Kinross', 'easy-digital-downloads' ),
'GB-PTE' => __( 'Peterborough', 'easy-digital-downloads' ),
'GB-PLY' => __( 'Plymouth', 'easy-digital-downloads' ),
'GB-POL' => __( 'Poole', 'easy-digital-downloads' ),
'GB-POR' => __( 'Portsmouth', 'easy-digital-downloads' ),
'GB-POW' => __( 'Powys', 'easy-digital-downloads' ),
'GB-RDG' => __( 'Reading', 'easy-digital-downloads' ),
'GB-RDB' => __( 'Redbridge', 'easy-digital-downloads' ),
'GB-RCC' => __( 'Redcar and Cleveland', 'easy-digital-downloads' ),
'GB-RFW' => __( 'Renfrewshire', 'easy-digital-downloads' ),
'GB-RCT' => __( 'Rhondda, Cynon, Taff', 'easy-digital-downloads' ),
'GB-RIC' => __( 'Richmond upon Thames', 'easy-digital-downloads' ),
'GB-RCH' => __( 'Rochdale', 'easy-digital-downloads' ),
'GB-ROT' => __( 'Rotherham', 'easy-digital-downloads' ),
'GB-RUT' => __( 'Rutland', 'easy-digital-downloads' ),
'GB-SLF' => __( 'Salford', 'easy-digital-downloads' ),
'GB-SAW' => __( 'Sandwell', 'easy-digital-downloads' ),
'GB-SCB' => __( 'Scottish Borders, The', 'easy-digital-downloads' ),
'GB-SFT' => __( 'Sefton', 'easy-digital-downloads' ),
'GB-SHF' => __( 'Sheffield', 'easy-digital-downloads' ),
'GB-ZET' => __( 'Shetland Islands', 'easy-digital-downloads' ),
'GB-SHR' => __( 'Shropshire', 'easy-digital-downloads' ),
'GB-SLG' => __( 'Slough', 'easy-digital-downloads' ),
'GB-SOL' => __( 'Solihull', 'easy-digital-downloads' ),
'GB-SOM' => __( 'Somerset', 'easy-digital-downloads' ),
'GB-SAY' => __( 'South Ayrshire', 'easy-digital-downloads' ),
'GB-SGC' => __( 'South Gloucestershire', 'easy-digital-downloads' ),
'GB-SLK' => __( 'South Lanarkshire', 'easy-digital-downloads' ),
'GB-STY' => __( 'South Tyneside', 'easy-digital-downloads' ),
'GB-STH' => __( 'Southampton', 'easy-digital-downloads' ),
'GB-SOS' => __( 'Southend-on-Sea', 'easy-digital-downloads' ),
'GB-SWK' => __( 'Southwark', 'easy-digital-downloads' ),
'GB-SHN' => __( 'St. Helens', 'easy-digital-downloads' ),
'GB-STS' => __( 'Staffordshire', 'easy-digital-downloads' ),
'GB-STG' => __( 'Stirling', 'easy-digital-downloads' ),
'GB-SKP' => __( 'Stockport', 'easy-digital-downloads' ),
'GB-STT' => __( 'Stockton-on-Tees', 'easy-digital-downloads' ),
'GB-STE' => __( 'Stoke-on-Trent', 'easy-digital-downloads' ),
'GB-SFK' => __( 'Suffolk', 'easy-digital-downloads' ),
'GB-SND' => __( 'Sunderland', 'easy-digital-downloads' ),
'GB-SRY' => __( 'Surrey', 'easy-digital-downloads' ),
'GB-STN' => __( 'Sutton', 'easy-digital-downloads' ),
'GB-SWA' => __( 'Swansea', 'easy-digital-downloads' ),
'GB-SWD' => __( 'Swindon', 'easy-digital-downloads' ),
'GB-TAM' => __( 'Tameside', 'easy-digital-downloads' ),
'GB-TFW' => __( 'Telford and Wrekin', 'easy-digital-downloads' ),
'GB-THR' => __( 'Thurrock', 'easy-digital-downloads' ),
'GB-TOB' => __( 'Torbay', 'easy-digital-downloads' ),
'GB-TOF' => __( 'Torfaen', 'easy-digital-downloads' ),
'GB-TWH' => __( 'Tower Hamlets', 'easy-digital-downloads' ),
'GB-TRF' => __( 'Trafford', 'easy-digital-downloads' ),
'GB-VGL' => __( 'Vale of Glamorgan, The', 'easy-digital-downloads' ),
'GB-WKF' => __( 'Wakefield', 'easy-digital-downloads' ),
'GB-WLL' => __( 'Walsall', 'easy-digital-downloads' ),
'GB-WFT' => __( 'Waltham Forest', 'easy-digital-downloads' ),
'GB-WND' => __( 'Wandsworth', 'easy-digital-downloads' ),
'GB-WRT' => __( 'Warrington', 'easy-digital-downloads' ),
'GB-WAR' => __( 'Warwickshire', 'easy-digital-downloads' ),
'GB-WBK' => __( 'West Berkshire', 'easy-digital-downloads' ),
'GB-WDU' => __( 'West Dunbartonshire', 'easy-digital-downloads' ),
'GB-WLN' => __( 'West Lothian', 'easy-digital-downloads' ),
'GB-WSX' => __( 'West Sussex', 'easy-digital-downloads' ),
'GB-WSM' => __( 'Westminster', 'easy-digital-downloads' ),
'GB-WGN' => __( 'Wigan', 'easy-digital-downloads' ),
'GB-WIL' => __( 'Wiltshire', 'easy-digital-downloads' ),
'GB-WNM' => __( 'Windsor and Maidenhead', 'easy-digital-downloads' ),
'GB-WRL' => __( 'Wirral', 'easy-digital-downloads' ),
'GB-WOK' => __( 'Wokingham', 'easy-digital-downloads' ),
'GB-WLV' => __( 'Wolverhampton', 'easy-digital-downloads' ),
'GB-WOR' => __( 'Worcestershire', 'easy-digital-downloads' ),
'GB-WRX' => __( 'Wrexham', 'easy-digital-downloads' ),
'GB-YOR' => __( 'York', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,43 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'AP' => __( 'Andhra Pradesh', 'easy-digital-downloads' ),
'AR' => __( 'Arunachal Pradesh', 'easy-digital-downloads' ),
'AS' => __( 'Assam', 'easy-digital-downloads' ),
'BR' => __( 'Bihar', 'easy-digital-downloads' ),
'CT' => __( 'Chhattisgarh', 'easy-digital-downloads' ),
'GA' => __( 'Goa', 'easy-digital-downloads' ),
'GJ' => __( 'Gujarat', 'easy-digital-downloads' ),
'HR' => __( 'Haryana', 'easy-digital-downloads' ),
'HP' => __( 'Himachal Pradesh', 'easy-digital-downloads' ),
'JK' => __( 'Jammu and Kashmir', 'easy-digital-downloads' ),
'JH' => __( 'Jharkhand', 'easy-digital-downloads' ),
'KA' => __( 'Karnataka', 'easy-digital-downloads' ),
'KL' => __( 'Kerala', 'easy-digital-downloads' ),
'MP' => __( 'Madhya Pradesh', 'easy-digital-downloads' ),
'MH' => __( 'Maharashtra', 'easy-digital-downloads' ),
'MN' => __( 'Manipur', 'easy-digital-downloads' ),
'ML' => __( 'Meghalaya', 'easy-digital-downloads' ),
'MZ' => __( 'Mizoram', 'easy-digital-downloads' ),
'NL' => __( 'Nagaland', 'easy-digital-downloads' ),
'OR' => __( 'Orissa', 'easy-digital-downloads' ),
'PB' => __( 'Punjab', 'easy-digital-downloads' ),
'RJ' => __( 'Rajasthan', 'easy-digital-downloads' ),
'SK' => __( 'Sikkim', 'easy-digital-downloads' ),
'TN' => __( 'Tamil Nadu', 'easy-digital-downloads' ),
'TG' => __( 'Telangana', 'easy-digital-downloads' ),
'TR' => __( 'Tripura', 'easy-digital-downloads' ),
'UT' => __( 'Uttarakhand', 'easy-digital-downloads' ),
'UP' => __( 'Uttar Pradesh', 'easy-digital-downloads' ),
'WB' => __( 'West Bengal', 'easy-digital-downloads' ),
'AN' => __( 'Andaman and Nicobar Islands', 'easy-digital-downloads' ),
'CH' => __( 'Chandigarh', 'easy-digital-downloads' ),
'DN' => __( 'Dadar and Nagar Haveli', 'easy-digital-downloads' ),
'DD' => __( 'Daman and Diu', 'easy-digital-downloads' ),
'DL' => __( 'Delhi', 'easy-digital-downloads' ),
'LD' => __( 'Lakshadweep', 'easy-digital-downloads' ),
'PY' => __( 'Pondicherry (Puducherry)', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,116 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'AG' => __( 'Agrigento', 'easy-digital-downloads' ),
'AL' => __( 'Alessandria', 'easy-digital-downloads' ),
'AN' => __( 'Ancona', 'easy-digital-downloads' ),
'AO' => __( 'Aosta', 'easy-digital-downloads' ),
'AR' => __( 'Arezzo', 'easy-digital-downloads' ),
'AP' => __( 'Ascoli Piceno', 'easy-digital-downloads' ),
'AT' => __( 'Asti', 'easy-digital-downloads' ),
'AV' => __( 'Avellino', 'easy-digital-downloads' ),
'BA' => __( 'Bari', 'easy-digital-downloads' ),
'BT' => __( 'Barletta-Andria-Trani', 'easy-digital-downloads' ),
'BL' => __( 'Belluno', 'easy-digital-downloads' ),
'BN' => __( 'Benevento', 'easy-digital-downloads' ),
'BG' => __( 'Bergamo', 'easy-digital-downloads' ),
'BI' => __( 'Biella', 'easy-digital-downloads' ),
'BO' => __( 'Bologna', 'easy-digital-downloads' ),
'BZ' => __( 'Bolzano', 'easy-digital-downloads' ),
'BS' => __( 'Brescia', 'easy-digital-downloads' ),
'BR' => __( 'Brindisi', 'easy-digital-downloads' ),
'CA' => __( 'Cagliari', 'easy-digital-downloads' ),
'CL' => __( 'Caltanissetta', 'easy-digital-downloads' ),
'CB' => __( 'Campobasso', 'easy-digital-downloads' ),
'CE' => __( 'Caserta', 'easy-digital-downloads' ),
'CT' => __( 'Catania', 'easy-digital-downloads' ),
'CZ' => __( 'Catanzaro', 'easy-digital-downloads' ),
'CH' => __( 'Chieti', 'easy-digital-downloads' ),
'CO' => __( 'Como', 'easy-digital-downloads' ),
'CS' => __( 'Cosenza', 'easy-digital-downloads' ),
'CR' => __( 'Cremona', 'easy-digital-downloads' ),
'KR' => __( 'Crotone', 'easy-digital-downloads' ),
'CN' => __( 'Cuneo', 'easy-digital-downloads' ),
'EN' => __( 'Enna', 'easy-digital-downloads' ),
'FM' => __( 'Fermo', 'easy-digital-downloads' ),
'FE' => __( 'Ferrara', 'easy-digital-downloads' ),
'FI' => __( 'Firenze', 'easy-digital-downloads' ),
'FG' => __( 'Foggia', 'easy-digital-downloads' ),
'FC' => __( 'Forli-Cesena', 'easy-digital-downloads' ),
'FR' => __( 'Frosinone', 'easy-digital-downloads' ),
'GE' => __( 'Genoa', 'easy-digital-downloads' ),
'GO' => __( 'Gorizia', 'easy-digital-downloads' ),
'GR' => __( 'Grosseto', 'easy-digital-downloads' ),
'IM' => __( 'Imperia', 'easy-digital-downloads' ),
'IS' => __( 'Isernia', 'easy-digital-downloads' ),
'SP' => __( 'La Spezia', 'easy-digital-downloads' ),
'AQ' => __( 'L&apos;Aquila', 'easy-digital-downloads' ),
'LT' => __( 'Latina', 'easy-digital-downloads' ),
'LE' => __( 'Lecce', 'easy-digital-downloads' ),
'LC' => __( 'Lecco', 'easy-digital-downloads' ),
'LI' => __( 'Livorno', 'easy-digital-downloads' ),
'LO' => __( 'Lodi', 'easy-digital-downloads' ),
'LU' => __( 'Lucca', 'easy-digital-downloads' ),
'MC' => __( 'Macerata', 'easy-digital-downloads' ),
'MN' => __( 'Mantova', 'easy-digital-downloads' ),
'MS' => __( 'Massa-Carrara', 'easy-digital-downloads' ),
'MT' => __( 'Matera', 'easy-digital-downloads' ),
'ME' => __( 'Messina', 'easy-digital-downloads' ),
'MI' => __( 'Milano', 'easy-digital-downloads' ),
'MO' => __( 'Modena', 'easy-digital-downloads' ),
'MB' => __( 'Monza e della Brianza', 'easy-digital-downloads' ),
'NA' => __( 'Napoli', 'easy-digital-downloads' ),
'NO' => __( 'Novara', 'easy-digital-downloads' ),
'NU' => __( 'Nuoro', 'easy-digital-downloads' ),
'OT' => __( 'Olbia-Tempio', 'easy-digital-downloads' ),
'OR' => __( 'Oristano', 'easy-digital-downloads' ),
'PD' => __( 'Padova', 'easy-digital-downloads' ),
'PA' => __( 'Palermo', 'easy-digital-downloads' ),
'PR' => __( 'Parma', 'easy-digital-downloads' ),
'PV' => __( 'Pavia', 'easy-digital-downloads' ),
'PG' => __( 'Perugia', 'easy-digital-downloads' ),
'PU' => __( 'Pesaro e Urbino', 'easy-digital-downloads' ),
'PE' => __( 'Pescara', 'easy-digital-downloads' ),
'PC' => __( 'Piacenza', 'easy-digital-downloads' ),
'PI' => __( 'Pisa', 'easy-digital-downloads' ),
'PT' => __( 'Pistoia', 'easy-digital-downloads' ),
'PN' => __( 'Pordenone', 'easy-digital-downloads' ),
'PZ' => __( 'Potenza', 'easy-digital-downloads' ),
'PO' => __( 'Prato', 'easy-digital-downloads' ),
'RG' => __( 'Ragusa', 'easy-digital-downloads' ),
'RA' => __( 'Ravenna', 'easy-digital-downloads' ),
'RC' => __( 'Reggio Calabria', 'easy-digital-downloads' ),
'RE' => __( 'Reggio Emilia', 'easy-digital-downloads' ),
'RI' => __( 'Rieti', 'easy-digital-downloads' ),
'RN' => __( 'Rimini', 'easy-digital-downloads' ),
'RM' => __( 'Roma', 'easy-digital-downloads' ),
'RO' => __( 'Rovigo', 'easy-digital-downloads' ),
'SA' => __( 'Salerno', 'easy-digital-downloads' ),
'VS' => __( 'Medio Campidano', 'easy-digital-downloads' ),
'SS' => __( 'Sassari', 'easy-digital-downloads' ),
'SV' => __( 'Savona', 'easy-digital-downloads' ),
'SI' => __( 'Siena', 'easy-digital-downloads' ),
'SR' => __( 'Siracusa', 'easy-digital-downloads' ),
'SO' => __( 'Sondrio', 'easy-digital-downloads' ),
'TA' => __( 'Taranto', 'easy-digital-downloads' ),
'TE' => __( 'Teramo', 'easy-digital-downloads' ),
'TR' => __( 'Terni', 'easy-digital-downloads' ),
'TO' => __( 'Torino', 'easy-digital-downloads' ),
'OG' => __( 'Ogliastra', 'easy-digital-downloads' ),
'TP' => __( 'Trapani', 'easy-digital-downloads' ),
'TN' => __( 'Trento', 'easy-digital-downloads' ),
'TV' => __( 'Treviso', 'easy-digital-downloads' ),
'TS' => __( 'Trieste', 'easy-digital-downloads' ),
'UD' => __( 'Udine', 'easy-digital-downloads' ),
'VA' => __( 'Varesa', 'easy-digital-downloads' ),
'VE' => __( 'Venezia', 'easy-digital-downloads' ),
'VB' => __( 'Verbano-Cusio-Ossola', 'easy-digital-downloads' ),
'VC' => __( 'Vercelli', 'easy-digital-downloads' ),
'VR' => __( 'Verona', 'easy-digital-downloads' ),
'VV' => __( 'Vibo Valentia', 'easy-digital-downloads' ),
'VI' => __( 'Vicenza', 'easy-digital-downloads' ),
'VT' => __( 'Viterbo', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,54 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'JP01' => __( 'Hokkaido', 'easy-digital-downloads' ),
'JP02' => __( 'Aomori', 'easy-digital-downloads' ),
'JP03' => __( 'Iwate', 'easy-digital-downloads' ),
'JP04' => __( 'Miyagi', 'easy-digital-downloads' ),
'JP05' => __( 'Akita', 'easy-digital-downloads' ),
'JP06' => __( 'Yamagata', 'easy-digital-downloads' ),
'JP07' => __( 'Fukushima', 'easy-digital-downloads' ),
'JP08' => __( 'Ibaraki', 'easy-digital-downloads' ),
'JP09' => __( 'Tochigi', 'easy-digital-downloads' ),
'JP10' => __( 'Gunma', 'easy-digital-downloads' ),
'JP11' => __( 'Saitama', 'easy-digital-downloads' ),
'JP12' => __( 'Chiba', 'easy-digital-downloads' ),
'JP13' => __( 'Tokyo', 'easy-digital-downloads' ),
'JP14' => __( 'Kanagawa', 'easy-digital-downloads' ),
'JP15' => __( 'Niigata', 'easy-digital-downloads' ),
'JP16' => __( 'Toyama', 'easy-digital-downloads' ),
'JP17' => __( 'Ishikawa', 'easy-digital-downloads' ),
'JP18' => __( 'Fukui', 'easy-digital-downloads' ),
'JP19' => __( 'Yamanashi', 'easy-digital-downloads' ),
'JP20' => __( 'Nagano', 'easy-digital-downloads' ),
'JP21' => __( 'Gifu', 'easy-digital-downloads' ),
'JP22' => __( 'Shizuoka', 'easy-digital-downloads' ),
'JP23' => __( 'Aichi', 'easy-digital-downloads' ),
'JP24' => __( 'Mie', 'easy-digital-downloads' ),
'JP25' => __( 'Shiga', 'easy-digital-downloads' ),
'JP26' => __( 'Kyouto', 'easy-digital-downloads' ),
'JP27' => __( 'Osaka', 'easy-digital-downloads' ),
'JP28' => __( 'Hyougo', 'easy-digital-downloads' ),
'JP29' => __( 'Nara', 'easy-digital-downloads' ),
'JP30' => __( 'Wakayama', 'easy-digital-downloads' ),
'JP31' => __( 'Tottori', 'easy-digital-downloads' ),
'JP32' => __( 'Shimane', 'easy-digital-downloads' ),
'JP33' => __( 'Okayama', 'easy-digital-downloads' ),
'JP34' => __( 'Hiroshima', 'easy-digital-downloads' ),
'JP35' => __( 'Yamaguchi', 'easy-digital-downloads' ),
'JP36' => __( 'Tokushima', 'easy-digital-downloads' ),
'JP37' => __( 'Kagawa', 'easy-digital-downloads' ),
'JP38' => __( 'Ehime', 'easy-digital-downloads' ),
'JP39' => __( 'Kochi', 'easy-digital-downloads' ),
'JP40' => __( 'Fukuoka', 'easy-digital-downloads' ),
'JP41' => __( 'Saga', 'easy-digital-downloads' ),
'JP42' => __( 'Nagasaki', 'easy-digital-downloads' ),
'JP43' => __( 'Kumamoto', 'easy-digital-downloads' ),
'JP44' => __( 'Oita', 'easy-digital-downloads' ),
'JP45' => __( 'Miyazaki', 'easy-digital-downloads' ),
'JP46' => __( 'Kagoshima', 'easy-digital-downloads' ),
'JP47' => __( 'Okinawa', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,82 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'ILL' => __( 'Illam', 'easy-digital-downloads' ),
'JHA' => __( 'Jhapa', 'easy-digital-downloads' ),
'PAN' => __( 'Panchthar', 'easy-digital-downloads' ),
'TAP' => __( 'Taplejung', 'easy-digital-downloads' ),
'BHO' => __( 'Bhojpur', 'easy-digital-downloads' ),
'DKA' => __( 'Dhankuta', 'easy-digital-downloads' ),
'MOR' => __( 'Morang', 'easy-digital-downloads' ),
'SUN' => __( 'Sunsari', 'easy-digital-downloads' ),
'SAN' => __( 'Sankhuwa', 'easy-digital-downloads' ),
'TER' => __( 'Terhathum', 'easy-digital-downloads' ),
'KHO' => __( 'Khotang', 'easy-digital-downloads' ),
'OKH' => __( 'Okhaldhunga', 'easy-digital-downloads' ),
'SAP' => __( 'Saptari', 'easy-digital-downloads' ),
'SIR' => __( 'Siraha', 'easy-digital-downloads' ),
'SOL' => __( 'Solukhumbu', 'easy-digital-downloads' ),
'UDA' => __( 'Udayapur', 'easy-digital-downloads' ),
'DHA' => __( 'Dhanusa', 'easy-digital-downloads' ),
'DLK' => __( 'Dolakha', 'easy-digital-downloads' ),
'MOH' => __( 'Mohottari', 'easy-digital-downloads' ),
'RAM' => __( 'Ramechha', 'easy-digital-downloads' ),
'SAR' => __( 'Sarlahi', 'easy-digital-downloads' ),
'SIN' => __( 'Sindhuli', 'easy-digital-downloads' ),
'BHA' => __( 'Bhaktapur', 'easy-digital-downloads' ),
'DHD' => __( 'Dhading', 'easy-digital-downloads' ),
'KTM' => __( 'Kathmandu', 'easy-digital-downloads' ),
'KAV' => __( 'Kavrepalanchowk', 'easy-digital-downloads' ),
'LAL' => __( 'Lalitpur', 'easy-digital-downloads' ),
'NUW' => __( 'Nuwakot', 'easy-digital-downloads' ),
'RAS' => __( 'Rasuwa', 'easy-digital-downloads' ),
'SPC' => __( 'Sindhupalchowk', 'easy-digital-downloads' ),
'BAR' => __( 'Bara', 'easy-digital-downloads' ),
'CHI' => __( 'Chitwan', 'easy-digital-downloads' ),
'MAK' => __( 'Makwanpur', 'easy-digital-downloads' ),
'PAR' => __( 'Parsa', 'easy-digital-downloads' ),
'RAU' => __( 'Rautahat', 'easy-digital-downloads' ),
'GOR' => __( 'Gorkha', 'easy-digital-downloads' ),
'KAS' => __( 'Kaski', 'easy-digital-downloads' ),
'LAM' => __( 'Lamjung', 'easy-digital-downloads' ),
'MAN' => __( 'Manang', 'easy-digital-downloads' ),
'SYN' => __( 'Syangja', 'easy-digital-downloads' ),
'TAN' => __( 'Tanahun', 'easy-digital-downloads' ),
'BAG' => __( 'Baglung', 'easy-digital-downloads' ),
'PBT' => __( 'Parbat', 'easy-digital-downloads' ),
'MUS' => __( 'Mustang', 'easy-digital-downloads' ),
'MYG' => __( 'Myagdi', 'easy-digital-downloads' ),
'AGR' => __( 'Agrghakanchi', 'easy-digital-downloads' ),
'GUL' => __( 'Gulmi', 'easy-digital-downloads' ),
'KAP' => __( 'Kapilbastu', 'easy-digital-downloads' ),
'NAW' => __( 'Nawalparasi', 'easy-digital-downloads' ),
'PAL' => __( 'Palpa', 'easy-digital-downloads' ),
'RUP' => __( 'Rupandehi', 'easy-digital-downloads' ),
'DAN' => __( 'Dang', 'easy-digital-downloads' ),
'PYU' => __( 'Pyuthan', 'easy-digital-downloads' ),
'ROL' => __( 'Rolpa', 'easy-digital-downloads' ),
'RUK' => __( 'Rukum', 'easy-digital-downloads' ),
'SAL' => __( 'Salyan', 'easy-digital-downloads' ),
'BAN' => __( 'Banke', 'easy-digital-downloads' ),
'BDA' => __( 'Bardiya', 'easy-digital-downloads' ),
'DAI' => __( 'Dailekh', 'easy-digital-downloads' ),
'JAJ' => __( 'Jajarkot', 'easy-digital-downloads' ),
'SUR' => __( 'Surkhet', 'easy-digital-downloads' ),
'DOL' => __( 'Dolpa', 'easy-digital-downloads' ),
'HUM' => __( 'Humla', 'easy-digital-downloads' ),
'JUM' => __( 'Jumla', 'easy-digital-downloads' ),
'KAL' => __( 'Kalikot', 'easy-digital-downloads' ),
'MUG' => __( 'Mugu', 'easy-digital-downloads' ),
'ACH' => __( 'Achham', 'easy-digital-downloads' ),
'BJH' => __( 'Bajhang', 'easy-digital-downloads' ),
'BJU' => __( 'Bajura', 'easy-digital-downloads' ),
'DOT' => __( 'Doti', 'easy-digital-downloads' ),
'KAI' => __( 'Kailali', 'easy-digital-downloads' ),
'BAI' => __( 'Baitadi', 'easy-digital-downloads' ),
'DAD' => __( 'Dadeldhura', 'easy-digital-downloads' ),
'DAR' => __( 'Darchula', 'easy-digital-downloads' ),
'KAN' => __( 'Kanchanpur', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,84 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'TH-37' => __( 'Amnat Charoen (&#3629;&#3635;&#3609;&#3634;&#3592;&#3648;&#3592;&#3619;&#3636;&#3597;)', 'easy-digital-downloads' ),
'TH-15' => __( 'Ang Thong (&#3629;&#3656;&#3634;&#3591;&#3607;&#3629;&#3591;)', 'easy-digital-downloads' ),
'TH-14' => __( 'Ayutthaya (&#3614;&#3619;&#3632;&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3629;&#3618;&#3640;&#3608;&#3618;&#3634;)', 'easy-digital-downloads' ),
'TH-10' => __( 'Bangkok (&#3585;&#3619;&#3640;&#3591;&#3648;&#3607;&#3614;&#3617;&#3627;&#3634;&#3609;&#3588;&#3619;)', 'easy-digital-downloads' ),
'TH-38' => __( 'Bueng Kan (&#3610;&#3638;&#3591;&#3585;&#3634;&#3628;)', 'easy-digital-downloads' ),
'TH-31' => __( 'Buri Ram (&#3610;&#3640;&#3619;&#3637;&#3619;&#3633;&#3617;&#3618;&#3660;)', 'easy-digital-downloads' ),
'TH-24' => __( 'Chachoengsao (&#3593;&#3632;&#3648;&#3594;&#3636;&#3591;&#3648;&#3607;&#3619;&#3634;)', 'easy-digital-downloads' ),
'TH-18' => __( 'Chai Nat (&#3594;&#3633;&#3618;&#3609;&#3634;&#3607;)', 'easy-digital-downloads' ),
'TH-36' => __( 'Chaiyaphum (&#3594;&#3633;&#3618;&#3616;&#3641;&#3617;&#3636;)', 'easy-digital-downloads' ),
'TH-22' => __( 'Chanthaburi (&#3592;&#3633;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-50' => __( 'Chiang Mai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3651;&#3627;&#3617;&#3656;)', 'easy-digital-downloads' ),
'TH-57' => __( 'Chiang Rai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3619;&#3634;&#3618;)', 'easy-digital-downloads' ),
'TH-20' => __( 'Chonburi (&#3594;&#3621;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-86' => __( 'Chumphon (&#3594;&#3640;&#3617;&#3614;&#3619;)', 'easy-digital-downloads' ),
'TH-46' => __( 'Kalasin (&#3585;&#3634;&#3628;&#3626;&#3636;&#3609;&#3608;&#3640;&#3660;)', 'easy-digital-downloads' ),
'TH-62' => __( 'Kamphaeng Phet (&#3585;&#3635;&#3649;&#3614;&#3591;&#3648;&#3614;&#3594;&#3619;)', 'easy-digital-downloads' ),
'TH-71' => __( 'Kanchanaburi (&#3585;&#3634;&#3597;&#3592;&#3609;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-40' => __( 'Khon Kaen (&#3586;&#3629;&#3609;&#3649;&#3585;&#3656;&#3609;)', 'easy-digital-downloads' ),
'TH-81' => __( 'Krabi (&#3585;&#3619;&#3632;&#3610;&#3637;&#3656;)', 'easy-digital-downloads' ),
'TH-52' => __( 'Lampang (&#3621;&#3635;&#3611;&#3634;&#3591;)', 'easy-digital-downloads' ),
'TH-51' => __( 'Lamphun (&#3621;&#3635;&#3614;&#3641;&#3609;)', 'easy-digital-downloads' ),
'TH-42' => __( 'Loei (&#3648;&#3621;&#3618;)', 'easy-digital-downloads' ),
'TH-16' => __( 'Lopburi (&#3621;&#3614;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-58' => __( 'Mae Hong Son (&#3649;&#3617;&#3656;&#3630;&#3656;&#3629;&#3591;&#3626;&#3629;&#3609;)', 'easy-digital-downloads' ),
'TH-44' => __( 'Maha Sarakham (&#3617;&#3627;&#3634;&#3626;&#3634;&#3619;&#3588;&#3634;&#3617;)', 'easy-digital-downloads' ),
'TH-49' => __( 'Mukdahan (&#3617;&#3640;&#3585;&#3604;&#3634;&#3627;&#3634;&#3619;)', 'easy-digital-downloads' ),
'TH-26' => __( 'Nakhon Nayok (&#3609;&#3588;&#3619;&#3609;&#3634;&#3618;&#3585;)', 'easy-digital-downloads' ),
'TH-73' => __( 'Nakhon Pathom (&#3609;&#3588;&#3619;&#3611;&#3600;&#3617;)', 'easy-digital-downloads' ),
'TH-48' => __( 'Nakhon Phanom (&#3609;&#3588;&#3619;&#3614;&#3609;&#3617;)', 'easy-digital-downloads' ),
'TH-30' => __( 'Nakhon Ratchasima (&#3609;&#3588;&#3619;&#3619;&#3634;&#3594;&#3626;&#3637;&#3617;&#3634;)', 'easy-digital-downloads' ),
'TH-60' => __( 'Nakhon Sawan (&#3609;&#3588;&#3619;&#3626;&#3623;&#3619;&#3619;&#3588;&#3660;)', 'easy-digital-downloads' ),
'TH-80' => __( 'Nakhon Si Thammarat (&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3608;&#3619;&#3619;&#3617;&#3619;&#3634;&#3594;)', 'easy-digital-downloads' ),
'TH-55' => __( 'Nan (&#3609;&#3656;&#3634;&#3609;)', 'easy-digital-downloads' ),
'TH-96' => __( 'Narathiwat (&#3609;&#3619;&#3634;&#3608;&#3636;&#3623;&#3634;&#3626;)', 'easy-digital-downloads' ),
'TH-39' => __( 'Nong Bua Lam Phu (&#3627;&#3609;&#3629;&#3591;&#3610;&#3633;&#3623;&#3621;&#3635;&#3616;&#3641;)', 'easy-digital-downloads' ),
'TH-43' => __( 'Nong Khai (&#3627;&#3609;&#3629;&#3591;&#3588;&#3634;&#3618;)', 'easy-digital-downloads' ),
'TH-12' => __( 'Nonthaburi (&#3609;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-13' => __( 'Pathum Thani (&#3611;&#3607;&#3640;&#3617;&#3608;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-94' => __( 'Pattani (&#3611;&#3633;&#3605;&#3605;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-82' => __( 'Phang Nga (&#3614;&#3633;&#3591;&#3591;&#3634;)', 'easy-digital-downloads' ),
'TH-93' => __( 'Phatthalung (&#3614;&#3633;&#3607;&#3621;&#3640;&#3591;)', 'easy-digital-downloads' ),
'TH-56' => __( 'Phayao (&#3614;&#3632;&#3648;&#3618;&#3634;)', 'easy-digital-downloads' ),
'TH-67' => __( 'Phetchabun (&#3648;&#3614;&#3594;&#3619;&#3610;&#3641;&#3619;&#3603;&#3660;)', 'easy-digital-downloads' ),
'TH-76' => __( 'Phetchaburi (&#3648;&#3614;&#3594;&#3619;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-66' => __( 'Phichit (&#3614;&#3636;&#3592;&#3636;&#3605;&#3619;)', 'easy-digital-downloads' ),
'TH-65' => __( 'Phitsanulok (&#3614;&#3636;&#3625;&#3603;&#3640;&#3650;&#3621;&#3585;)', 'easy-digital-downloads' ),
'TH-54' => __( 'Phrae (&#3649;&#3614;&#3619;&#3656;)', 'easy-digital-downloads' ),
'TH-83' => __( 'Phuket (&#3616;&#3641;&#3648;&#3585;&#3655;&#3605;)', 'easy-digital-downloads' ),
'TH-25' => __( 'Prachin Buri (&#3611;&#3619;&#3634;&#3592;&#3637;&#3609;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-77' => __( 'Prachuap Khiri Khan (&#3611;&#3619;&#3632;&#3592;&#3623;&#3610;&#3588;&#3637;&#3619;&#3637;&#3586;&#3633;&#3609;&#3608;&#3660;)', 'easy-digital-downloads' ),
'TH-85' => __( 'Ranong (&#3619;&#3632;&#3609;&#3629;&#3591;)', 'easy-digital-downloads' ),
'TH-70' => __( 'Ratchaburi (&#3619;&#3634;&#3594;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-21' => __( 'Rayong (&#3619;&#3632;&#3618;&#3629;&#3591;)', 'easy-digital-downloads' ),
'TH-45' => __( 'Roi Et (&#3619;&#3657;&#3629;&#3618;&#3648;&#3629;&#3655;&#3604;)', 'easy-digital-downloads' ),
'TH-27' => __( 'Sa Kaeo (&#3626;&#3619;&#3632;&#3649;&#3585;&#3657;&#3623;)', 'easy-digital-downloads' ),
'TH-47' => __( 'Sakon Nakhon (&#3626;&#3585;&#3621;&#3609;&#3588;&#3619;)', 'easy-digital-downloads' ),
'TH-11' => __( 'Samut Prakan (&#3626;&#3617;&#3640;&#3607;&#3619;&#3611;&#3619;&#3634;&#3585;&#3634;&#3619;)', 'easy-digital-downloads' ),
'TH-74' => __( 'Samut Sakhon (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3634;&#3588;&#3619;)', 'easy-digital-downloads' ),
'TH-75' => __( 'Samut Songkhram (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3591;&#3588;&#3619;&#3634;&#3617;)', 'easy-digital-downloads' ),
'TH-19' => __( 'Saraburi (&#3626;&#3619;&#3632;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-91' => __( 'Satun (&#3626;&#3605;&#3641;&#3621;)', 'easy-digital-downloads' ),
'TH-17' => __( 'Sing Buri (&#3626;&#3636;&#3591;&#3627;&#3660;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-33' => __( 'Sisaket (&#3624;&#3619;&#3637;&#3626;&#3632;&#3648;&#3585;&#3625;)', 'easy-digital-downloads' ),
'TH-90' => __( 'Songkhla (&#3626;&#3591;&#3586;&#3621;&#3634;)', 'easy-digital-downloads' ),
'TH-64' => __( 'Sukhothai (&#3626;&#3640;&#3650;&#3586;&#3607;&#3633;&#3618;)', 'easy-digital-downloads' ),
'TH-72' => __( 'Suphan Buri (&#3626;&#3640;&#3614;&#3619;&#3619;&#3603;&#3610;&#3640;&#3619;&#3637;)', 'easy-digital-downloads' ),
'TH-84' => __( 'Surat Thani (&#3626;&#3640;&#3619;&#3634;&#3625;&#3598;&#3619;&#3660;&#3608;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-32' => __( 'Surin (&#3626;&#3640;&#3619;&#3636;&#3609;&#3607;&#3619;&#3660;)', 'easy-digital-downloads' ),
'TH-63' => __( 'Tak (&#3605;&#3634;&#3585;)', 'easy-digital-downloads' ),
'TH-92' => __( 'Trang (&#3605;&#3619;&#3633;&#3591;)', 'easy-digital-downloads' ),
'TH-23' => __( 'Trat (&#3605;&#3619;&#3634;&#3604;)', 'easy-digital-downloads' ),
'TH-34' => __( 'Ubon Ratchathani (&#3629;&#3640;&#3610;&#3621;&#3619;&#3634;&#3594;&#3608;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-41' => __( 'Udon Thani (&#3629;&#3640;&#3604;&#3619;&#3608;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-61' => __( 'Uthai Thani (&#3629;&#3640;&#3607;&#3633;&#3618;&#3608;&#3634;&#3609;&#3637;)', 'easy-digital-downloads' ),
'TH-53' => __( 'Uttaradit (&#3629;&#3640;&#3605;&#3619;&#3604;&#3636;&#3605;&#3606;&#3660;)', 'easy-digital-downloads' ),
'TH-95' => __( 'Yala (&#3618;&#3632;&#3621;&#3634;)', 'easy-digital-downloads' ),
'TH-35' => __( 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,88 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'TR01' => __( 'Adana', 'easy-digital-downloads' ),
'TR02' => __( 'Ad&#305;yaman', 'easy-digital-downloads' ),
'TR03' => __( 'Afyon', 'easy-digital-downloads' ),
'TR04' => __( 'A&#287;r&#305;', 'easy-digital-downloads' ),
'TR05' => __( 'Amasya', 'easy-digital-downloads' ),
'TR06' => __( 'Ankara', 'easy-digital-downloads' ),
'TR07' => __( 'Antalya', 'easy-digital-downloads' ),
'TR08' => __( 'Artvin', 'easy-digital-downloads' ),
'TR09' => __( 'Ayd&#305;n', 'easy-digital-downloads' ),
'TR10' => __( 'Bal&#305;kesir', 'easy-digital-downloads' ),
'TR11' => __( 'Bilecik', 'easy-digital-downloads' ),
'TR12' => __( 'Bing&#246;l', 'easy-digital-downloads' ),
'TR13' => __( 'Bitlis', 'easy-digital-downloads' ),
'TR14' => __( 'Bolu', 'easy-digital-downloads' ),
'TR15' => __( 'Burdur', 'easy-digital-downloads' ),
'TR16' => __( 'Bursa', 'easy-digital-downloads' ),
'TR17' => __( '&#199;anakkale', 'easy-digital-downloads' ),
'TR18' => __( '&#199;ank&#305;kesir', 'easy-digital-downloads' ),
'TR19' => __( '&#199;orum', 'easy-digital-downloads' ),
'TR20' => __( 'Denizli', 'easy-digital-downloads' ),
'TR21' => __( 'Diyarbak&#305;r', 'easy-digital-downloads' ),
'TR22' => __( 'Edirne', 'easy-digital-downloads' ),
'TR23' => __( 'Elaz&#305;&#287;', 'easy-digital-downloads' ),
'TR24' => __( 'Erzincan', 'easy-digital-downloads' ),
'TR25' => __( 'Erzurum', 'easy-digital-downloads' ),
'TR26' => __( 'Eski&#351;ehir', 'easy-digital-downloads' ),
'TR27' => __( 'Gaziantep', 'easy-digital-downloads' ),
'TR28' => __( 'Giresun', 'easy-digital-downloads' ),
'TR29' => __( 'G&#252;m&#252;&#351;hane', 'easy-digital-downloads' ),
'TR30' => __( 'Hakkari', 'easy-digital-downloads' ),
'TR31' => __( 'Hatay', 'easy-digital-downloads' ),
'TR32' => __( 'Isparta', 'easy-digital-downloads' ),
'TR33' => __( '&#304;&#231;el', 'easy-digital-downloads' ),
'TR34' => __( '&#304;stanbul', 'easy-digital-downloads' ),
'TR35' => __( '&#304;zmir', 'easy-digital-downloads' ),
'TR36' => __( 'Kars', 'easy-digital-downloads' ),
'TR37' => __( 'Kastamonu', 'easy-digital-downloads' ),
'TR38' => __( 'Kayseri', 'easy-digital-downloads' ),
'TR39' => __( 'K&#305;rklareli', 'easy-digital-downloads' ),
'TR40' => __( 'K&#305;r&#351;ehir', 'easy-digital-downloads' ),
'TR41' => __( 'Kocaeli', 'easy-digital-downloads' ),
'TR42' => __( 'Konya', 'easy-digital-downloads' ),
'TR43' => __( 'K&#252;tahya', 'easy-digital-downloads' ),
'TR44' => __( 'Malatya', 'easy-digital-downloads' ),
'TR45' => __( 'Manisa', 'easy-digital-downloads' ),
'TR46' => __( 'Kahramanmara&#351;', 'easy-digital-downloads' ),
'TR47' => __( 'Mardin', 'easy-digital-downloads' ),
'TR48' => __( 'Mu&#287;la', 'easy-digital-downloads' ),
'TR49' => __( 'Mu&#351;', 'easy-digital-downloads' ),
'TR50' => __( 'Nev&#351;ehir', 'easy-digital-downloads' ),
'TR51' => __( 'Ni&#287;de', 'easy-digital-downloads' ),
'TR52' => __( 'Ordu', 'easy-digital-downloads' ),
'TR53' => __( 'Rize', 'easy-digital-downloads' ),
'TR54' => __( 'Sakarya', 'easy-digital-downloads' ),
'TR55' => __( 'Samsun', 'easy-digital-downloads' ),
'TR56' => __( 'Siirt', 'easy-digital-downloads' ),
'TR57' => __( 'Sinop', 'easy-digital-downloads' ),
'TR58' => __( 'Sivas', 'easy-digital-downloads' ),
'TR59' => __( 'Tekirda&#287;', 'easy-digital-downloads' ),
'TR60' => __( 'Tokat', 'easy-digital-downloads' ),
'TR61' => __( 'Trabzon', 'easy-digital-downloads' ),
'TR62' => __( 'Tunceli', 'easy-digital-downloads' ),
'TR63' => __( '&#350;anl&#305;urfa', 'easy-digital-downloads' ),
'TR64' => __( 'U&#351;ak', 'easy-digital-downloads' ),
'TR65' => __( 'Van', 'easy-digital-downloads' ),
'TR66' => __( 'Yozgat', 'easy-digital-downloads' ),
'TR67' => __( 'Zonguldak', 'easy-digital-downloads' ),
'TR68' => __( 'Aksaray', 'easy-digital-downloads' ),
'TR69' => __( 'Bayburt', 'easy-digital-downloads' ),
'TR70' => __( 'Karaman', 'easy-digital-downloads' ),
'TR71' => __( 'K&#305;r&#305;kkale', 'easy-digital-downloads' ),
'TR72' => __( 'Batman', 'easy-digital-downloads' ),
'TR73' => __( '&#350;&#305;rnak', 'easy-digital-downloads' ),
'TR74' => __( 'Bart&#305;n', 'easy-digital-downloads' ),
'TR75' => __( 'Ardahan', 'easy-digital-downloads' ),
'TR76' => __( 'I&#287;d&#305;r', 'easy-digital-downloads' ),
'TR77' => __( 'Yalova', 'easy-digital-downloads' ),
'TR78' => __( 'Karab&#252;k', 'easy-digital-downloads' ),
'TR79' => __( 'Kilis', 'easy-digital-downloads' ),
'TR80' => __( 'Osmaniye', 'easy-digital-downloads' ),
'TR81' => __( 'D&#252;zce', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,73 @@
<?php
defined( 'ABSPATH' ) || exit;
return array(
'' => '',
'AL' => __( 'Alabama', 'easy-digital-downloads' ),
'AK' => __( 'Alaska', 'easy-digital-downloads' ),
'AZ' => __( 'Arizona', 'easy-digital-downloads' ),
'AR' => __( 'Arkansas', 'easy-digital-downloads' ),
'CA' => __( 'California', 'easy-digital-downloads' ),
'CO' => __( 'Colorado', 'easy-digital-downloads' ),
'CT' => __( 'Connecticut', 'easy-digital-downloads' ),
'DE' => __( 'Delaware', 'easy-digital-downloads' ),
'DC' => __( 'District of Columbia', 'easy-digital-downloads' ),
'FL' => __( 'Florida', 'easy-digital-downloads' ),
'GA' => __( 'Georgia', 'easy-digital-downloads' ),
'HI' => __( 'Hawaii', 'easy-digital-downloads' ),
'ID' => __( 'Idaho', 'easy-digital-downloads' ),
'IL' => __( 'Illinois', 'easy-digital-downloads' ),
'IN' => __( 'Indiana', 'easy-digital-downloads' ),
'IA' => __( 'Iowa', 'easy-digital-downloads' ),
'KS' => __( 'Kansas', 'easy-digital-downloads' ),
'KY' => __( 'Kentucky', 'easy-digital-downloads' ),
'LA' => __( 'Louisiana', 'easy-digital-downloads' ),
'ME' => __( 'Maine', 'easy-digital-downloads' ),
'MD' => __( 'Maryland', 'easy-digital-downloads' ),
'MA' => __( 'Massachusetts', 'easy-digital-downloads' ),
'MI' => __( 'Michigan', 'easy-digital-downloads' ),
'MN' => __( 'Minnesota', 'easy-digital-downloads' ),
'MS' => __( 'Mississippi', 'easy-digital-downloads' ),
'MO' => __( 'Missouri', 'easy-digital-downloads' ),
'MT' => __( 'Montana', 'easy-digital-downloads' ),
'NE' => __( 'Nebraska', 'easy-digital-downloads' ),
'NV' => __( 'Nevada', 'easy-digital-downloads' ),
'NH' => __( 'New Hampshire', 'easy-digital-downloads' ),
'NJ' => __( 'New Jersey', 'easy-digital-downloads' ),
'NM' => __( 'New Mexico', 'easy-digital-downloads' ),
'NY' => __( 'New York', 'easy-digital-downloads' ),
'NC' => __( 'North Carolina', 'easy-digital-downloads' ),
'ND' => __( 'North Dakota', 'easy-digital-downloads' ),
'OH' => __( 'Ohio', 'easy-digital-downloads' ),
'OK' => __( 'Oklahoma', 'easy-digital-downloads' ),
'OR' => __( 'Oregon', 'easy-digital-downloads' ),
'PA' => __( 'Pennsylvania', 'easy-digital-downloads' ),
'RI' => __( 'Rhode Island', 'easy-digital-downloads' ),
'SC' => __( 'South Carolina', 'easy-digital-downloads' ),
'SD' => __( 'South Dakota', 'easy-digital-downloads' ),
'TN' => __( 'Tennessee', 'easy-digital-downloads' ),
'TX' => __( 'Texas', 'easy-digital-downloads' ),
'UT' => __( 'Utah', 'easy-digital-downloads' ),
'VT' => __( 'Vermont', 'easy-digital-downloads' ),
'VA' => __( 'Virginia', 'easy-digital-downloads' ),
'WA' => __( 'Washington', 'easy-digital-downloads' ),
'WV' => __( 'West Virginia', 'easy-digital-downloads' ),
'WI' => __( 'Wisconsin', 'easy-digital-downloads' ),
'WY' => __( 'Wyoming', 'easy-digital-downloads' ),
'AS' => __( 'American Samoa', 'easy-digital-downloads' ),
'CZ' => __( 'Canal Zone', 'easy-digital-downloads' ),
'CM' => __( 'Commonwealth of the Northern Mariana Islands', 'easy-digital-downloads' ),
'FM' => __( 'Federated States of Micronesia', 'easy-digital-downloads' ),
'GU' => __( 'Guam', 'easy-digital-downloads' ),
'MH' => __( 'Marshall Islands', 'easy-digital-downloads' ),
'MP' => __( 'Northern Mariana Islands', 'easy-digital-downloads' ),
'PW' => __( 'Palau', 'easy-digital-downloads' ),
'PI' => __( 'Philippine Islands', 'easy-digital-downloads' ),
'PR' => __( 'Puerto Rico', 'easy-digital-downloads' ),
'TT' => __( 'Trust Territory of the Pacific Islands', 'easy-digital-downloads' ),
'VI' => __( 'Virgin Islands', 'easy-digital-downloads' ),
'AA' => __( 'Armed Forces - Americas', 'easy-digital-downloads' ),
'AE' => __( 'Armed Forces - Europe, Canada, Middle East, Africa', 'easy-digital-downloads' ),
'AP' => __( 'Armed Forces - Pacific', 'easy-digital-downloads' ),
);

View File

@ -0,0 +1,395 @@
<?php
/**
* Array of countries with known regions.
*/
return array(
'US' => include EDD_PLUGIN_DIR . 'i18n/states-us.php',
'CA' => array(
'' => '',
'AB' => __( 'Alberta', 'easy-digital-downloads' ),
'BC' => __( 'British Columbia', 'easy-digital-downloads' ),
'MB' => __( 'Manitoba', 'easy-digital-downloads' ),
'NB' => __( 'New Brunswick', 'easy-digital-downloads' ),
'NL' => __( 'Newfoundland and Labrador', 'easy-digital-downloads' ),
'NS' => __( 'Nova Scotia', 'easy-digital-downloads' ),
'NT' => __( 'Northwest Territories', 'easy-digital-downloads' ),
'NU' => __( 'Nunavut', 'easy-digital-downloads' ),
'ON' => __( 'Ontario', 'easy-digital-downloads' ),
'PE' => __( 'Prince Edward Island', 'easy-digital-downloads' ),
'QC' => __( 'Quebec', 'easy-digital-downloads' ),
'SK' => __( 'Saskatchewan', 'easy-digital-downloads' ),
'YT' => __( 'Yukon', 'easy-digital-downloads' ),
),
'GB' => include EDD_PLUGIN_DIR . 'i18n/states-gb.php',
'AO' => array(
'' => '',
'BGO' => __( 'Bengo', 'easy-digital-downloads' ),
'BGU' => __( 'Benguela', 'easy-digital-downloads' ),
'BIE' => __( 'Bié', 'easy-digital-downloads' ),
'CAB' => __( 'Cabinda', 'easy-digital-downloads' ),
'CNN' => __( 'Cunene', 'easy-digital-downloads' ),
'HUA' => __( 'Huambo', 'easy-digital-downloads' ),
'HUI' => __( 'Huíla', 'easy-digital-downloads' ),
'CCU' => __( 'Kuando Kubango', 'easy-digital-downloads' ), // Cuando Cubango
'CNO' => __( 'Kwanza-Norte', 'easy-digital-downloads' ), // Cuanza Norte
'CUS' => __( 'Kwanza-Sul', 'easy-digital-downloads' ), // Cuanza Sul
'LUA' => __( 'Luanda', 'easy-digital-downloads' ),
'LNO' => __( 'Lunda-Norte', 'easy-digital-downloads' ), // Lunda Norte
'LSU' => __( 'Lunda-Sul', 'easy-digital-downloads' ), // Lunda Sul
'MAL' => __( 'Malanje', 'easy-digital-downloads' ), // Malanje
'MOX' => __( 'Moxico', 'easy-digital-downloads' ),
'NAM' => __( 'Namibe', 'easy-digital-downloads' ),
'UIG' => __( 'Uíge', 'easy-digital-downloads' ),
'ZAI' => __( 'Zaire', 'easy-digital-downloads' ),
),
'AU' => array(
'' => '',
'ACT' => __( 'Australian Capital Territory', 'easy-digital-downloads' ),
'NSW' => __( 'New South Wales', 'easy-digital-downloads' ),
'NT' => __( 'Northern Territory', 'easy-digital-downloads' ),
'QLD' => __( 'Queensland', 'easy-digital-downloads' ),
'SA' => __( 'South Australia', 'easy-digital-downloads' ),
'TAS' => __( 'Tasmania', 'easy-digital-downloads' ),
'VIC' => __( 'Victoria', 'easy-digital-downloads' ),
'WA' => __( 'Western Australia', 'easy-digital-downloads' ),
),
'BD' => include EDD_PLUGIN_DIR . 'i18n/states-bd.php',
'BR' => array(
'' => '',
'AC' => __( 'Acre', 'easy-digital-downloads' ),
'AL' => __( 'Alagoas', 'easy-digital-downloads' ),
'AP' => __( 'Amap&aacute;', 'easy-digital-downloads' ),
'AM' => __( 'Amazonas', 'easy-digital-downloads' ),
'BA' => __( 'Bahia', 'easy-digital-downloads' ),
'CE' => __( 'Cear&aacute;', 'easy-digital-downloads' ),
'DF' => __( 'Distrito Federal', 'easy-digital-downloads' ),
'ES' => __( 'Esp&iacute;rito Santo', 'easy-digital-downloads' ),
'GO' => __( 'Goi&aacute;s', 'easy-digital-downloads' ),
'MA' => __( 'Maranh&atilde;o', 'easy-digital-downloads' ),
'MT' => __( 'Mato Grosso', 'easy-digital-downloads' ),
'MS' => __( 'Mato Grosso do Sul', 'easy-digital-downloads' ),
'MG' => __( 'Minas Gerais', 'easy-digital-downloads' ),
'PA' => __( 'Par&aacute;', 'easy-digital-downloads' ),
'PB' => __( 'Para&iacute;ba', 'easy-digital-downloads' ),
'PR' => __( 'Paran&aacute;', 'easy-digital-downloads' ),
'PE' => __( 'Pernambuco', 'easy-digital-downloads' ),
'PI' => __( 'Piau&iacute;', 'easy-digital-downloads' ),
'RJ' => __( 'Rio de Janeiro', 'easy-digital-downloads' ),
'RN' => __( 'Rio Grande do Norte', 'easy-digital-downloads' ),
'RS' => __( 'Rio Grande do Sul', 'easy-digital-downloads' ),
'RO' => __( 'Rond&ocirc;nia', 'easy-digital-downloads' ),
'RR' => __( 'Roraima', 'easy-digital-downloads' ),
'SC' => __( 'Santa Catarina', 'easy-digital-downloads' ),
'SP' => __( 'S&atilde;o Paulo', 'easy-digital-downloads' ),
'SE' => __( 'Sergipe', 'easy-digital-downloads' ),
'TO' => __( 'Tocantins', 'easy-digital-downloads' ),
),
'BG' => array(
'' => '',
'BG-01' => __( 'Blagoevgrad', 'easy-digital-downloads' ),
'BG-02' => __( 'Burgas', 'easy-digital-downloads' ),
'BG-08' => __( 'Dobrich', 'easy-digital-downloads' ),
'BG-07' => __( 'Gabrovo', 'easy-digital-downloads' ),
'BG-26' => __( 'Haskovo', 'easy-digital-downloads' ),
'BG-09' => __( 'Kardzhali', 'easy-digital-downloads' ),
'BG-10' => __( 'Kyustendil', 'easy-digital-downloads' ),
'BG-11' => __( 'Lovech', 'easy-digital-downloads' ),
'BG-12' => __( 'Montana', 'easy-digital-downloads' ),
'BG-13' => __( 'Pazardzhik', 'easy-digital-downloads' ),
'BG-14' => __( 'Pernik', 'easy-digital-downloads' ),
'BG-15' => __( 'Pleven', 'easy-digital-downloads' ),
'BG-16' => __( 'Plovdiv', 'easy-digital-downloads' ),
'BG-17' => __( 'Razgrad', 'easy-digital-downloads' ),
'BG-18' => __( 'Ruse', 'easy-digital-downloads' ),
'BG-27' => __( 'Shumen', 'easy-digital-downloads' ),
'BG-19' => __( 'Silistra', 'easy-digital-downloads' ),
'BG-20' => __( 'Sliven', 'easy-digital-downloads' ),
'BG-21' => __( 'Smolyan', 'easy-digital-downloads' ),
'BG-23' => __( 'Sofia', 'easy-digital-downloads' ),
'BG-22' => __( 'Sofia-Grad', 'easy-digital-downloads' ),
'BG-24' => __( 'Stara Zagora', 'easy-digital-downloads' ),
'BG-25' => __( 'Targovishte', 'easy-digital-downloads' ),
'BG-03' => __( 'Varna', 'easy-digital-downloads' ),
'BG-04' => __( 'Veliko Tarnovo', 'easy-digital-downloads' ),
'BG-05' => __( 'Vidin', 'easy-digital-downloads' ),
'BG-06' => __( 'Vratsa', 'easy-digital-downloads' ),
'BG-28' => __( 'Yambol', 'easy-digital-downloads' ),
),
'CN' => array(
'' => '',
'CN1' => __( 'Yunnan / &#20113;&#21335;', 'easy-digital-downloads' ),
'CN2' => __( 'Beijing / &#21271;&#20140;', 'easy-digital-downloads' ),
'CN3' => __( 'Tianjin / &#22825;&#27941;', 'easy-digital-downloads' ),
'CN4' => __( 'Hebei / &#27827;&#21271;', 'easy-digital-downloads' ),
'CN5' => __( 'Shanxi / &#23665;&#35199;', 'easy-digital-downloads' ),
'CN6' => __( 'Inner Mongolia / &#20839;&#33945;&#21476;', 'easy-digital-downloads' ),
'CN7' => __( 'Liaoning / &#36797;&#23425;', 'easy-digital-downloads' ),
'CN8' => __( 'Jilin / &#21513;&#26519;', 'easy-digital-downloads' ),
'CN9' => __( 'Heilongjiang / &#40657;&#40857;&#27743;', 'easy-digital-downloads' ),
'CN10' => __( 'Shanghai / &#19978;&#28023;', 'easy-digital-downloads' ),
'CN11' => __( 'Jiangsu / &#27743;&#33487;', 'easy-digital-downloads' ),
'CN12' => __( 'Zhejiang / &#27993;&#27743;', 'easy-digital-downloads' ),
'CN13' => __( 'Anhui / &#23433;&#24509;', 'easy-digital-downloads' ),
'CN14' => __( 'Fujian / &#31119;&#24314;', 'easy-digital-downloads' ),
'CN15' => __( 'Jiangxi / &#27743;&#35199;', 'easy-digital-downloads' ),
'CN16' => __( 'Shandong / &#23665;&#19996;', 'easy-digital-downloads' ),
'CN17' => __( 'Henan / &#27827;&#21335;', 'easy-digital-downloads' ),
'CN18' => __( 'Hubei / &#28246;&#21271;', 'easy-digital-downloads' ),
'CN19' => __( 'Hunan / &#28246;&#21335;', 'easy-digital-downloads' ),
'CN20' => __( 'Guangdong / &#24191;&#19996;', 'easy-digital-downloads' ),
'CN21' => __( 'Guangxi Zhuang / &#24191;&#35199;&#22766;&#26063;', 'easy-digital-downloads' ),
'CN22' => __( 'Hainan / &#28023;&#21335;', 'easy-digital-downloads' ),
'CN23' => __( 'Chongqing / &#37325;&#24198;', 'easy-digital-downloads' ),
'CN24' => __( 'Sichuan / &#22235;&#24029;', 'easy-digital-downloads' ),
'CN25' => __( 'Guizhou / &#36149;&#24030;', 'easy-digital-downloads' ),
'CN26' => __( 'Shaanxi / &#38485;&#35199;', 'easy-digital-downloads' ),
'CN27' => __( 'Gansu / &#29976;&#32899;', 'easy-digital-downloads' ),
'CN28' => __( 'Qinghai / &#38738;&#28023;', 'easy-digital-downloads' ),
'CN29' => __( 'Ningxia Hui / &#23425;&#22799;', 'easy-digital-downloads' ),
'CN30' => __( 'Macau / &#28595;&#38376;', 'easy-digital-downloads' ),
'CN31' => __( 'Tibet / &#35199;&#34255;', 'easy-digital-downloads' ),
'CN32' => __( 'Xinjiang / &#26032;&#30086;', 'easy-digital-downloads' ),
),
'HK' => array(
'' => '',
'HONG KONG' => __( 'Hong Kong Island', 'easy-digital-downloads' ),
'KOWLOON' => __( 'Kowloon', 'easy-digital-downloads' ),
'NEW TERRITORIES' => __( 'New Territories', 'easy-digital-downloads' ),
),
'HU' => array(
'' => '',
'BK' => __( 'Bács-Kiskun', 'easy-digital-downloads' ),
'BE' => __( 'Békés', 'easy-digital-downloads' ),
'BA' => __( 'Baranya', 'easy-digital-downloads' ),
'BZ' => __( 'Borsod-Abaúj-Zemplén', 'easy-digital-downloads' ),
'BU' => __( 'Budapest', 'easy-digital-downloads' ),
'CS' => __( 'Csongrád', 'easy-digital-downloads' ),
'FE' => __( 'Fejér', 'easy-digital-downloads' ),
'GS' => __( 'Győr-Moson-Sopron', 'easy-digital-downloads' ),
'HB' => __( 'Hajdú-Bihar', 'easy-digital-downloads' ),
'HE' => __( 'Heves', 'easy-digital-downloads' ),
'JN' => __( 'Jász-Nagykun-Szolnok', 'easy-digital-downloads' ),
'KE' => __( 'Komárom-Esztergom', 'easy-digital-downloads' ),
'NO' => __( 'Nógrád', 'easy-digital-downloads' ),
'PE' => __( 'Pest', 'easy-digital-downloads' ),
'SO' => __( 'Somogy', 'easy-digital-downloads' ),
'SZ' => __( 'Szabolcs-Szatmár-Bereg', 'easy-digital-downloads' ),
'TO' => __( 'Tolna', 'easy-digital-downloads' ),
'VA' => __( 'Vas', 'easy-digital-downloads' ),
'VE' => __( 'Veszprém', 'easy-digital-downloads' ),
'ZA' => __( 'Zala', 'easy-digital-downloads' ),
),
'IN' => EDD_PLUGIN_DIR . 'i18n/states-in.php',
'ID' => array(
'' => '',
'AC' => __( 'Daerah Istimewa Aceh', 'easy-digital-downloads' ),
'SU' => __( 'Sumatera Utara', 'easy-digital-downloads' ),
'SB' => __( 'Sumatera Barat', 'easy-digital-downloads' ),
'RI' => __( 'Riau', 'easy-digital-downloads' ),
'KR' => __( 'Kepulauan Riau', 'easy-digital-downloads' ),
'JA' => __( 'Jambi', 'easy-digital-downloads' ),
'SS' => __( 'Sumatera Selatan', 'easy-digital-downloads' ),
'BB' => __( 'Bangka Belitung', 'easy-digital-downloads' ),
'BE' => __( 'Bengkulu', 'easy-digital-downloads' ),
'LA' => __( 'Lampung', 'easy-digital-downloads' ),
'JK' => __( 'DKI Jakarta', 'easy-digital-downloads' ),
'JB' => __( 'Jawa Barat', 'easy-digital-downloads' ),
'BT' => __( 'Banten', 'easy-digital-downloads' ),
'JT' => __( 'Jawa Tengah', 'easy-digital-downloads' ),
'JI' => __( 'Jawa Timur', 'easy-digital-downloads' ),
'YO' => __( 'Daerah Istimewa Yogyakarta', 'easy-digital-downloads' ),
'BA' => __( 'Bali', 'easy-digital-downloads' ),
'NB' => __( 'Nusa Tenggara Barat', 'easy-digital-downloads' ),
'NT' => __( 'Nusa Tenggara Timur', 'easy-digital-downloads' ),
'KB' => __( 'Kalimantan Barat', 'easy-digital-downloads' ),
'KT' => __( 'Kalimantan Tengah', 'easy-digital-downloads' ),
'KI' => __( 'Kalimantan Timur', 'easy-digital-downloads' ),
'KS' => __( 'Kalimantan Selatan', 'easy-digital-downloads' ),
'KU' => __( 'Kalimantan Utara', 'easy-digital-downloads' ),
'SA' => __( 'Sulawesi Utara', 'easy-digital-downloads' ),
'ST' => __( 'Sulawesi Tengah', 'easy-digital-downloads' ),
'SG' => __( 'Sulawesi Tenggara', 'easy-digital-downloads' ),
'SR' => __( 'Sulawesi Barat', 'easy-digital-downloads' ),
'SN' => __( 'Sulawesi Selatan', 'easy-digital-downloads' ),
'GO' => __( 'Gorontalo', 'easy-digital-downloads' ),
'MA' => __( 'Maluku', 'easy-digital-downloads' ),
'MU' => __( 'Maluku Utara', 'easy-digital-downloads' ),
'PA' => __( 'Papua', 'easy-digital-downloads' ),
'PB' => __( 'Papua Barat', 'easy-digital-downloads' ),
),
'IR' => array(
'' => '',
'KHZ' => __( 'Khuzestan', 'easy-digital-downloads' ),
'THR' => __( 'Tehran', 'easy-digital-downloads' ),
'ILM' => __( 'Ilaam', 'easy-digital-downloads' ),
'BHR' => __( 'Bushehr', 'easy-digital-downloads' ),
'ADL' => __( 'Ardabil', 'easy-digital-downloads' ),
'ESF' => __( 'Isfahan', 'easy-digital-downloads' ),
'YZD' => __( 'Yazd', 'easy-digital-downloads' ),
'KRH' => __( 'Kermanshah', 'easy-digital-downloads' ),
'KRN' => __( 'Kerman', 'easy-digital-downloads' ),
'HDN' => __( 'Hamadan', 'easy-digital-downloads' ),
'GZN' => __( 'Ghazvin', 'easy-digital-downloads' ),
'ZJN' => __( 'Zanjan', 'easy-digital-downloads' ),
'LRS' => __( 'Luristan', 'easy-digital-downloads' ),
'ABZ' => __( 'Alborz', 'easy-digital-downloads' ),
'EAZ' => __( 'East Azerbaijan', 'easy-digital-downloads' ),
'WAZ' => __( 'West Azerbaijan', 'easy-digital-downloads' ),
'CHB' => __( 'Chaharmahal and Bakhtiari', 'easy-digital-downloads' ),
'SKH' => __( 'South Khorasan', 'easy-digital-downloads' ),
'RKH' => __( 'Razavi Khorasan', 'easy-digital-downloads' ),
'NKH' => __( 'North Khorasan', 'easy-digital-downloads' ),
'SMN' => __( 'Semnan', 'easy-digital-downloads' ),
'FRS' => __( 'Fars', 'easy-digital-downloads' ),
'QHM' => __( 'Qom', 'easy-digital-downloads' ),
'KRD' => __( 'Kurdistan', 'easy-digital-downloads' ),
'KBD' => __( 'Kohgiluyeh and BoyerAhmad', 'easy-digital-downloads' ),
'GLS' => __( 'Golestan', 'easy-digital-downloads' ),
'GIL' => __( 'Gilan', 'easy-digital-downloads' ),
'MZN' => __( 'Mazandaran', 'easy-digital-downloads' ),
'MKZ' => __( 'Markazi', 'easy-digital-downloads' ),
'HRZ' => __( 'Hormozgan', 'easy-digital-downloads' ),
'SBN' => __( 'Sistan and Baluchestan', 'easy-digital-downloads' ),
),
'IT' => include EDD_PLUGIN_DIR . 'i18n/states-it.php',
'JP' => include EDD_PLUGIN_DIR . 'i18n/states-jp.php',
'MY' => array(
'' => '',
'JHR' => __( 'Johor', 'easy-digital-downloads' ),
'KDH' => __( 'Kedah', 'easy-digital-downloads' ),
'KTN' => __( 'Kelantan', 'easy-digital-downloads' ),
'MLK' => __( 'Melaka', 'easy-digital-downloads' ),
'NSN' => __( 'Negeri Sembilan', 'easy-digital-downloads' ),
'PHG' => __( 'Pahang', 'easy-digital-downloads' ),
'PRK' => __( 'Perak', 'easy-digital-downloads' ),
'PLS' => __( 'Perlis', 'easy-digital-downloads' ),
'PNG' => __( 'Pulau Pinang', 'easy-digital-downloads' ),
'SBH' => __( 'Sabah', 'easy-digital-downloads' ),
'SWK' => __( 'Sarawak', 'easy-digital-downloads' ),
'SGR' => __( 'Selangor', 'easy-digital-downloads' ),
'TRG' => __( 'Terengganu', 'easy-digital-downloads' ),
'KUL' => __( 'W.P. Kuala Lumpur', 'easy-digital-downloads' ),
'LBN' => __( 'W.P. Labuan', 'easy-digital-downloads' ),
'PJY' => __( 'W.P. Putrajaya', 'easy-digital-downloads' ),
),
'MX' => array(
'' => '',
'DIF' => __( 'Distrito Federal', 'easy-digital-downloads' ),
'JAL' => __( 'Jalisco', 'easy-digital-downloads' ),
'NLE' => __( 'Nuevo Le&oacute;n', 'easy-digital-downloads' ),
'AGU' => __( 'Aguascalientes', 'easy-digital-downloads' ),
'BCN' => __( 'Baja California Norte', 'easy-digital-downloads' ),
'BCS' => __( 'Baja California Sur', 'easy-digital-downloads' ),
'CAM' => __( 'Campeche', 'easy-digital-downloads' ),
'CHP' => __( 'Chiapas', 'easy-digital-downloads' ),
'CHH' => __( 'Chihuahua', 'easy-digital-downloads' ),
'COA' => __( 'Coahuila', 'easy-digital-downloads' ),
'COL' => __( 'Colima', 'easy-digital-downloads' ),
'DUR' => __( 'Durango', 'easy-digital-downloads' ),
'GUA' => __( 'Guanajuato', 'easy-digital-downloads' ),
'GRO' => __( 'Guerrero', 'easy-digital-downloads' ),
'HID' => __( 'Hidalgo', 'easy-digital-downloads' ),
'MEX' => __( 'Edo. de M&eacute;xico', 'easy-digital-downloads' ),
'MIC' => __( 'Michoac&aacute;n', 'easy-digital-downloads' ),
'MOR' => __( 'Morelos', 'easy-digital-downloads' ),
'NAY' => __( 'Nayarit', 'easy-digital-downloads' ),
'OAX' => __( 'Oaxaca', 'easy-digital-downloads' ),
'PUE' => __( 'Puebla', 'easy-digital-downloads' ),
'QUE' => __( 'Quer&eacute;taro', 'easy-digital-downloads' ),
'ROO' => __( 'Quintana Roo', 'easy-digital-downloads' ),
'SLP' => __( 'San Luis Potos&iacute;', 'easy-digital-downloads' ),
'SIN' => __( 'Sinaloa', 'easy-digital-downloads' ),
'SON' => __( 'Sonora', 'easy-digital-downloads' ),
'TAB' => __( 'Tabasco', 'easy-digital-downloads' ),
'TAM' => __( 'Tamaulipas', 'easy-digital-downloads' ),
'TLA' => __( 'Tlaxcala', 'easy-digital-downloads' ),
'VER' => __( 'Veracruz', 'easy-digital-downloads' ),
'YUC' => __( 'Yucat&aacute;n', 'easy-digital-downloads' ),
'ZAC' => __( 'Zacatecas', 'easy-digital-downloads' ),
),
'NP' => include EDD_PLUGIN_DIR . 'i18n/states-np.php',
'NL' => array(
'' => '',
'DR' => __( 'Drenthe', 'easy-digital-downloads' ),
'FL' => __( 'Flevoland', 'easy-digital-downloads' ),
'FR' => __( 'Friesland', 'easy-digital-downloads' ),
'GE' => __( 'Gelderland', 'easy-digital-downloads' ),
'GR' => __( 'Groningen', 'easy-digital-downloads' ),
'LI' => __( 'Limburg', 'easy-digital-downloads' ),
'NB' => __( 'North Brabant', 'easy-digital-downloads' ),
'NH' => __( 'North Holland', 'easy-digital-downloads' ),
'OV' => __( 'Overijssel', 'easy-digital-downloads' ),
'ZH' => __( 'South Holland', 'easy-digital-downloads' ),
'UT' => __( 'Utrecht', 'easy-digital-downloads' ),
'ZE' => __( 'Zeeland', 'easy-digital-downloads' ),
// Caribbean Netherland
'BO' => __( 'Bonaire', 'easy-digital-downloads' ),
'SA' => __( 'Saba', 'easy-digital-downloads' ),
'SE' => __( 'Sint Eustatius', 'easy-digital-downloads' ),
),
'NZ' => array(
'' => '',
'AK' => __( 'Auckland', 'easy-digital-downloads' ),
'BP' => __( 'Bay of Plenty', 'easy-digital-downloads' ),
'CT' => __( 'Canterbury', 'easy-digital-downloads' ),
'HB' => __( 'Hawke&rsquo;s Bay', 'easy-digital-downloads' ),
'MW' => __( 'Manawatu-Wanganui', 'easy-digital-downloads' ),
'MB' => __( 'Marlborough', 'easy-digital-downloads' ),
'NS' => __( 'Nelson', 'easy-digital-downloads' ),
'NL' => __( 'Northland', 'easy-digital-downloads' ),
'OT' => __( 'Otago', 'easy-digital-downloads' ),
'SL' => __( 'Southland', 'easy-digital-downloads' ),
'TK' => __( 'Taranaki', 'easy-digital-downloads' ),
'TM' => __( 'Tasman', 'easy-digital-downloads' ),
'WA' => __( 'Waikato', 'easy-digital-downloads' ),
'WR' => __( 'Wairarapa', 'easy-digital-downloads' ),
'WE' => __( 'Wellington', 'easy-digital-downloads' ),
'WC' => __( 'West Coast', 'easy-digital-downloads' ),
),
'PE' => array(
'' => '',
'CAL' => __( 'El Callao', 'easy-digital-downloads' ),
'LMA' => __( 'Municipalidad Metropolitana de Lima', 'easy-digital-downloads' ),
'AMA' => __( 'Amazonas', 'easy-digital-downloads' ),
'ANC' => __( 'Ancash', 'easy-digital-downloads' ),
'APU' => __( 'Apur&iacute;mac', 'easy-digital-downloads' ),
'ARE' => __( 'Arequipa', 'easy-digital-downloads' ),
'AYA' => __( 'Ayacucho', 'easy-digital-downloads' ),
'CAJ' => __( 'Cajamarca', 'easy-digital-downloads' ),
'CUS' => __( 'Cusco', 'easy-digital-downloads' ),
'HUV' => __( 'Huancavelica', 'easy-digital-downloads' ),
'HUC' => __( 'Hu&aacute;nuco', 'easy-digital-downloads' ),
'ICA' => __( 'Ica', 'easy-digital-downloads' ),
'JUN' => __( 'Jun&iacute;n', 'easy-digital-downloads' ),
'LAL' => __( 'La Libertad', 'easy-digital-downloads' ),
'LAM' => __( 'Lambayeque', 'easy-digital-downloads' ),
'LIM' => __( 'Lima', 'easy-digital-downloads' ),
'LOR' => __( 'Loreto', 'easy-digital-downloads' ),
'MDD' => __( 'Madre de Dios', 'easy-digital-downloads' ),
'MOQ' => __( 'Moquegua', 'easy-digital-downloads' ),
'PAS' => __( 'Pasco', 'easy-digital-downloads' ),
'PIU' => __( 'Piura', 'easy-digital-downloads' ),
'PUN' => __( 'Puno', 'easy-digital-downloads' ),
'SAM' => __( 'San Mart&iacute;n', 'easy-digital-downloads' ),
'TAC' => __( 'Tacna', 'easy-digital-downloads' ),
'TUM' => __( 'Tumbes', 'easy-digital-downloads' ),
'UCA' => __( 'Ucayali', 'easy-digital-downloads' ),
),
'ZA' => array(
'' => '',
'EC' => __( 'Eastern Cape', 'easy-digital-downloads' ),
'FS' => __( 'Free State', 'easy-digital-downloads' ),
'GP' => __( 'Gauteng', 'easy-digital-downloads' ),
'KZN' => __( 'KwaZulu-Natal', 'easy-digital-downloads' ),
'LP' => __( 'Limpopo', 'easy-digital-downloads' ),
'MP' => __( 'Mpumalanga', 'easy-digital-downloads' ),
'NC' => __( 'Northern Cape', 'easy-digital-downloads' ),
'NW' => __( 'North West', 'easy-digital-downloads' ),
'WC' => __( 'Western Cape', 'easy-digital-downloads' ),
),
'ES' => include EDD_PLUGIN_DIR . 'i18n/states-es.php',
'TH' => include EDD_PLUGIN_DIR . 'i18n/states-th.php',
'TR' => include EDD_PLUGIN_DIR . 'i18n/states-tr.php',
);

View File

@ -89,8 +89,9 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
$wp_admin_bar->add_menu( array(
'parent' => 'edd-store-menu',
'id' => 'edd-store-prodcuts',
/* translators: plural downlaods label */
'title' => sprintf( __( 'All %1$s', 'easy-digital-downloads' ), edd_get_label_plural() ),
'href' => edd_get_admin_url(),
'href' => edd_get_admin_url(),
) );
// String.
@ -106,8 +107,9 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
$wp_admin_bar->add_menu( array(
'parent' => 'edd-store-menu',
'id' => 'edd-store-status',
/* translators: %s: store status ("Test Mode" or "Live Mode") */
'title' => sprintf( __( 'Store Status: %s', 'easy-digital-downloads' ), '<span class="edd-mode edd-mode-' . esc_attr( $mode ) . '">' . $text . '</span>' ),
'href' => edd_get_admin_url(
'href' => edd_get_admin_url(
array(
'page' => 'edd-settings',
'tab' => 'gateways',
@ -140,9 +142,10 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
if ( ! empty( $is_dev ) ) {
$wp_admin_bar->add_menu( array(
'id' => 'edd-is-dev',
/* translators: %s: Whether this is a development domain (1 for true, 0 for false) */
'title' => sprintf( __( 'Development Domain %s', 'easy-digital-downloads' ), '<span class="edd-mode">' . $is_dev . '</span>' ),
'parent' => 'edd-store-menu',
'href' => edd_get_admin_url(
'href' => edd_get_admin_url(
array(
'page' => 'edd-settings',
'tab' => 'gateways',

View File

@ -23,8 +23,10 @@ if( !defined( 'ABSPATH' ) ) exit;
function edd_admin_rate_us( $footer_text ) {
global $typenow;
if ( $typenow == 'download' ) {
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Easy Digital Downloads</a>! Please <a href="%2$s" target="_blank">rate us on WordPress.org</a>', 'easy-digital-downloads' ),
if ( 'download' === $typenow ) {
$rate_text = sprintf(
/* translators: 1. link to EDD site; 2. link to wordpress.org to review */
__( 'Thank you for using <a href="%1$s" target="_blank">Easy Digital Downloads</a>! Please <a href="%2$s" target="_blank">rate us on WordPress.org</a>', 'easy-digital-downloads' ),
'https://easydigitaldownloads.com',
'https://wordpress.org/support/plugin/easy-digital-downloads/reviews/?rate=5#new-post'
);

View File

@ -269,9 +269,10 @@ class EDD_Notices {
if ( empty( $purchase_page ) || ( 'trash' === get_post_status( $purchase_page ) ) ) {
$this->add_notice( array(
'id' => 'edd-no-purchase-page',
/* translators: %s: URL to the settings page */
'message' => sprintf( __( 'No checkout page is configured. Set one in <a href="%s">Settings</a>.', 'easy-digital-downloads' ), esc_url( edd_get_admin_url( array( 'page' => 'edd-settings', 'tab' => 'general', 'section' => 'pages' ) ) ) ),
'class' => 'error',
'is_dismissible' => false
'is_dismissible' => false,
) );
}
}
@ -324,8 +325,10 @@ class EDD_Notices {
'class' => 'error',
'is_dismissible' => false,
'message' => array(
/* translators: %s: Uploads directory */
sprintf( __( 'The files in %s are not currently protected.', 'easy-digital-downloads' ), '<code>' . $upload_directory . '</code>' ),
__( 'To protect them, you must add this <a href="https://easydigitaldownloads.com/docs/download-files-not-protected-on-nginx/">NGINX redirect rule</a>.', 'easy-digital-downloads' ),
/* translators: %s: Dismiss notice URL */
sprintf( __( 'If you have already done this, or it does not apply to your site, you may permenently %s.', 'easy-digital-downloads' ), '<a href="' . esc_url( $dismiss_notice_url ) . '">' . __( 'dismiss this notice', 'easy-digital-downloads' ) . '</a>' )
)
) );
@ -366,7 +369,8 @@ class EDD_Notices {
'class' => 'error',
'is_dismissible' => false,
'message' => sprintf(
__( 'Easy Digital Downloads 2.5 contains a <a href="%s">built in recount tool</a>. Please <a href="%s">deactivate the Easy Digital Downloads - Recount Earnings plugin</a>', 'easy-digital-downloads' ),
/* translators: 1. link to the recount tool; 2. link to the plugins screen. */
__( 'Easy Digital Downloads 2.5 contains a <a href="%1$s">built in recount tool</a>. Please <a href="%2$s">deactivate the Easy Digital Downloads - Recount Earnings plugin</a>', 'easy-digital-downloads' ),
esc_url( edd_get_admin_url( array( 'page' => 'edd-tools', 'tab' => 'general' ) ) ),
esc_url( admin_url( 'plugins.php' ) )
)
@ -433,6 +437,24 @@ class EDD_Notices {
)
);
}
if ( 'accounting' === filter_input( INPUT_GET, 'section', FILTER_SANITIZE_STRING ) ) {
if ( ! empty( edd_get_option( 'sequential_start_update_failed', false ) ) ) {
$order_number = new \EDD\Orders\Number();
$this->add_notice(
array(
'id' => 'edd-sequential-order-numbers-not-updated',
'message' => sprintf(
/* translators: %s: Next order number */
__( 'The sequential starting number could not be updated because it could conflict with existing orders. The next assigned order number is %s.', 'easy-digital-downloads' ),
'<code>' . $order_number->format( (int) get_option( 'edd_next_order_number' ) ) . '</code>'
),
'class' => 'error',
)
);
edd_delete_option( 'sequential_start_update_failed' );
}
}
}
/**

View File

@ -66,12 +66,14 @@ function edd_edit_customer( $args = array() ) {
// Make sure we don't already have this user attached to a customer
if ( ! empty( $customer_info['user_id'] ) && false !== edd_get_customer_by( 'user_id', $customer_info['user_id'] ) ) {
/* translators: %d: user ID */
edd_set_error( 'edd-invalid-customer-user_id', sprintf( __( 'The User ID %d is already associated with a different customer.', 'easy-digital-downloads' ), $customer_info['user_id'] ) );
}
// Make sure it's actually a user
$user = get_user_by( 'id', $customer_info['user_id'] );
if ( ! empty( $customer_info['user_id'] ) && false === $user ) {
/* translators: %d: user ID */
edd_set_error( 'edd-invalid-user_id', sprintf( __( 'The User ID %d does not exist. Please assign an existing user.', 'easy-digital-downloads' ), $customer_info['user_id'] ) );
}
}
@ -98,6 +100,7 @@ function edd_edit_customer( $args = array() ) {
if ( $user ) {
$user_id = $user->ID;
} else {
/* translators: %s: user login or email address */
edd_set_error( 'edd-invalid-user-string', sprintf( __( 'Failed to attach user. The login or email address %s was not found.', 'easy-digital-downloads' ), $customer_info['user_login'] ) );
}
}
@ -259,13 +262,15 @@ function edd_add_customer_email( $args = array() ) {
'redirect' => $redirect . '#edd_general_emails',
);
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
$customer_note = sprintf( __( 'Email address %s added by %s', 'easy-digital-downloads' ), $email, $user_login );
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
/* translators: 1. email address; 2. username */
$customer_note = sprintf( __( 'Email address %1$s added by %2$s', 'easy-digital-downloads' ), $email, $user_login );
$customer->add_note( $customer_note );
if ( $primary ) {
$customer_note = sprintf( __( 'Email address %s set as primary by %s', 'easy-digital-downloads' ), $email, $user_login );
/* translators: 1. email address; 2. username */
$customer_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'easy-digital-downloads' ), $email, $user_login );
$customer->add_note( $customer_note );
}
}
@ -320,9 +325,10 @@ function edd_remove_customer_email() {
'edd-message' => 'email-removed',
)
);
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
$customer_note = sprintf( __( 'Email address %s removed by %s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login );
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
/* translators: 1. email address; 2. username */
$customer_note = sprintf( __( 'Email address %1$s removed by %2$s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login );
$customer->add_note( $customer_note );
} else {

View File

@ -104,8 +104,9 @@ function edd_maybe_remove_menu_profile_links() {
if ( edd_user_pending_verification() ) {
if( defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE ) {
$url = esc_url( edd_get_user_verification_request_url() );
if ( defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE ) {
$url = esc_url( edd_get_user_verification_request_url() );
/* translators: link to send an email */
$message = sprintf( __( 'Your account is pending verification. Please click the link in your email to activate your account. No email? <a href="%s">Click here</a> to send a new activation code.', 'easy-digital-downloads' ), esc_url( $url ) );
$title = __( 'Account Pending Verification', 'easy-digital-downloads' );
$args = array(

View File

@ -256,6 +256,7 @@ function edd_customers_list( $active_tab = 'customers' ) {
<form id="edd-customers-filter" method="get" action="<?php echo esc_url( $action_url ); ?>">
<?php
$customers_table->views();
/* translators: the active screen, eg "Search Customers" or "Search Customer Email Addresses" */
$customers_table->search_box( sprintf( __( 'Search %s', 'easy-digital-downloads' ), $name ), 'edd-customers' );
$customers_table->display();
?>
@ -560,6 +561,7 @@ function edd_customers_view( $customer = null ) {
<span data-key="user_id">
<?php if ( empty( $user_login ) ) :
/* translators: %s: user id */
printf( __( 'User %s missing', 'easy-digital-downloads' ), '<code>' . esc_html( $user_id ) . '</code>');
endif; ?>
<a href="<?php echo esc_url( admin_url( 'user-edit.php?user_id=' . absint( $user_id ) ) ); ?>"><?php echo esc_html( $user_login ); ?></a>
@ -776,7 +778,12 @@ function edd_customers_view( $customer = null ) {
</tbody>
</table>
<h3><?php printf( __( 'Purchased %s', 'easy-digital-downloads' ), edd_get_label_plural() ); ?></h3>
<h3>
<?php
/* translators: %s: plural downloads label */
printf( esc_html__( 'Purchased %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) );
?>
</h3>
<table class="wp-list-table widefat striped customer-downloads">
<thead>
<tr>
@ -796,7 +803,12 @@ function edd_customers_view( $customer = null ) {
<?php else: ?>
<tr><td class="no-items"><?php printf( __( 'No %s Found', 'easy-digital-downloads' ), edd_get_label_plural() ); ?></td></tr>
<tr><td class="no-items">
<?php
/* translators: %s: plural downloads label */
printf( esc_html__( 'No %s Found', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) );
?>
</td></tr>
<?php endif; ?>
</tbody>

View File

@ -96,9 +96,13 @@ function edd_admin_add_discount( $data = array() ) {
? intval( $data['start_date_minute'] )
: '00';
$start_date_string = EDD()->utils->get_date_string(
$start_date,
$start_date_hour,
$start_date_minute
);
// The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $start_date . ' ' . $start_date_hour . ':' . $start_date_minute . ':00', edd_get_timezone_id(), false ) );
$to_add['start_date'] = $date->format( 'Y-m-d H:i:s' );
$to_add['start_date'] = edd_get_utc_date_string( $start_date_string );
}
// End date.
@ -111,9 +115,13 @@ function edd_admin_add_discount( $data = array() ) {
? intval( $data['end_date_minute'] )
: '59';
$end_date_string = EDD()->utils->get_date_string(
$end_date,
$end_date_hour,
$end_date_minute,
);
// The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $end_date . ' ' . $end_date_hour . ':' . $end_date_minute . ':00', edd_get_timezone_id(), false ) );
$to_add['end_date'] = $date->format( 'Y-m-d H:i:s' );
$to_add['end_date'] = edd_get_utc_date_string( $end_date_string );
}
// Meta values.
@ -229,9 +237,14 @@ function edd_admin_edit_discount( $data = array() ) {
? intval( $data['start_date_minute'] )
: '00';
$start_date_string = EDD()->utils->get_date_string(
$start_date,
$start_date_hour,
$start_date_minute,
);
// The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $start_date . ' ' . $start_date_hour . ':' . $start_date_minute . ':00', edd_get_timezone_id(), false ) );
$to_update['start_date'] = $date->format( 'Y-m-d H:i:s' );
$to_update['start_date'] = edd_get_utc_date_string( $start_date_string );
} else {
$to_update['start_date'] = null;
}
@ -246,9 +259,14 @@ function edd_admin_edit_discount( $data = array() ) {
? intval( $data['end_date_minute'] )
: '59';
$end_date_string = EDD()->utils->get_date_string(
$end_date,
$end_date_hour,
$end_date_minute
);
// The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $end_date . ' ' . $end_date_hour . ':' . $end_date_minute . ':00', edd_get_timezone_id(), false ) );
$to_update['end_date'] = $date->format( 'Y-m-d H:i:s' );
$to_update['end_date'] = edd_get_utc_date_string( $end_date_string );
} else {
$to_update['end_date'] = null;
}

View File

@ -94,10 +94,7 @@ function edd_update_payment_details( $data = array() ) {
);
// The date is entered in the WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $date_string, edd_get_timezone_id(), false ) );
$date = $date->format( 'Y-m-d H:i:s' );
$order_update_args['date_created'] = $date;
$order_update_args['date_created'] = edd_get_utc_date_string( $date_string );
// Customer
$curr_customer_id = sanitize_text_field( $data['current-customer-id'] );

View File

@ -879,24 +879,18 @@ class EDD_Payment_History_Table extends List_Table {
// Start (of day)
if ( ! empty( $start_date ) ) {
$start_date_obj = EDD()->utils->date( $start_date, edd_get_timezone_id(), false )->copy()->startOfDay();
$query_start_date = edd_get_utc_equivalent_date( $start_date_obj->copy() );
$args['date_query'][] = array(
'column' => 'date_created',
'after' => $query_start_date->format( 'mysql' ),
'after' => edd_get_utc_date_string( $start_date, 'mysql' ),
);
}
// End (of day)
if ( ! empty( $end_date ) ) {
$end_date_obj = EDD()->utils->date( $end_date, edd_get_timezone_id(), false )->copy()->endOfDay();
$query_end_date = edd_get_utc_equivalent_date( $end_date_obj->copy() );
$end_date_string = EDD()->utils->get_date_string( $end_date, 23, 59, 59 );
$args['date_query'][] = array(
'column' => 'date_created',
'before' => $query_end_date->format( 'mysql' ),
'column' => 'date_created',
'before' => edd_get_utc_date_string( $end_date_string, 'mysql' ),
);
}
}

View File

@ -307,6 +307,10 @@ function edd_order_details_email( $order ) {
$customer = edd_get_customer( $order->customer_id );
$all_emails = array( 'primary' => $customer->email );
if ( $customer->email !== $order->email ) {
$all_emails['order'] = $order->email;
}
foreach ( $customer->emails as $key => $email ) {
if ( $customer->email === $email ) {
continue;
@ -315,59 +319,63 @@ function edd_order_details_email( $order ) {
$all_emails[ $key ] = $email;
}
$help = __( 'Send a new copy of the purchase receipt to the email address used for this order. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' );
$help = sprintf(
/* translators: email type */
__('Send a new copy of the purchase receipt to the %s email address. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' ),
count( $all_emails ) > 1 ? __( 'selected', 'easy-digital-downloads' ) : __( 'customer', 'easy-digital-downloads' )
);
$is_multiselect = count( $all_emails ) > 1;
$label_text = $is_multiselect ? __( 'Send email receipt to', 'easy-digital-downloads' ) : __( 'Email Address', 'easy-digital-downloads' );
?>
<div>
<?php
if ( ! empty( $customer->emails ) && count( (array) $customer->emails ) > 1 ) : ?>
<fieldset class="edd-form-group">
<legend class="edd-form-group__label">
<?php _e( 'Send email receipt to', 'easy-digital-downloads' ); ?>
</legend>
<div class="edd-form-group">
<label class="edd-form-group__label <?php echo esc_attr( ! $is_multiselect ? 'screen-reader-text' : '' ); ?>"
for="edd-order-receipt-email"
>
<?php echo esc_html( $label_text ); ?>
</label>
<?php foreach ( $all_emails as $key => $email ) : ?>
<div class="edd-form-group__control is-radio">
<input id="<?php echo rawurlencode( sanitize_email( $email ) ); ?>" class="edd-form-group__input edd-order-resend-receipt-email" name="edd-order-resend-receipt-address" type="radio" value="<?php echo rawurlencode( sanitize_email( $email ) ); ?>" <?php checked( true, ( 'primary' === $key ) ); ?> />
<label for="<?php echo rawurlencode( sanitize_email( $email ) ); ?>">
<?php echo esc_attr( $email ); ?>
</label>
</div>
<?php endforeach; ?>
<p class="edd-form-group__help description">
<?php echo esc_html( $help ); ?>
</p>
</fieldset>
<?php else : ?>
<div class="edd-form-group">
<label class="edd-form-group__label screen-reader-text" for="<?php echo esc_attr( $order->email ); ?>">
<?php esc_html_e( 'Email Address', 'easy-digital-downloads' ); ?>
</label>
<div class="edd-form-group__control">
<input readonly type="email" id="<?php echo esc_attr( $order->email ); ?>" class="edd-form-group__input regular-text" value="<?php echo esc_attr( $order->email ); ?>" />
</div>
<p class="edd-form-group__help description">
<?php echo esc_html( $help ); ?>
</p>
<div class="edd-form-group__control">
<?php if ( $is_multiselect ) : ?>
<select class="edd-form-group__input edd-order-resend-receipt-email" name="edd-select-receipt-email" id="edd-order-receipt-email">
<?php foreach ( $all_emails as $key => $email ) : ?>
<option
value="<?php echo rawurlencode( sanitize_email( $email ) ); ?>"
<?php selected( 'primary', $key ); ?>
>
<?php
echo sprintf(
'%1$s (%2$s)',
esc_attr( $email ),
esc_html(
$key === 'primary' ? __( 'Customer Primary', 'easy-digital-downloads' ) :
(
$key === 'order' ? __( 'Order Email', 'easy-digital-downloads' ) :
__( 'Customer Email', 'easy-digital-downloads' )
)
)
);
?>
</option>
<?php endforeach; ?>
</select>
<?php else : ?>
<input readonly type="email" id="edd-order-receipt-email" class="edd-form-group__input regular-text" value="<?php echo esc_attr( $order->email ); ?>" />
<?php endif; ?>
</div>
<?php endif; ?>
<p class="edd-form-group__help description">
<?php echo esc_html( $help ); ?>
</p>
</div>
<p>
<a href="<?php echo esc_url( add_query_arg( array(
'edd-action' => 'email_links',
'purchase_id' => absint( $order->id ),
) ) ); ?>" id="<?php if ( ! empty( $customer->emails ) && count( (array) $customer->emails ) > 1 ) {
echo esc_attr( 'edd-select-receipt-email' );
} else {
echo esc_attr( 'edd-resend-receipt' );
} ?>" class="button button-secondary"><?php esc_html_e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
) ) ); ?>" id="<?php echo esc_attr( 'edd-resend-receipt' ); ?>" class="button button-secondary"><?php esc_html_e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
</p>
<?php do_action( 'edd_view_order_details_resend_receipt_after', $order->id ); ?>
@ -1121,21 +1129,45 @@ function edd_is_add_order_page() {
* @return string
*/
function edd_get_order_status_badge( $order_status ) {
switch( $order_status ) {
case 'refunded' :
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-undo"></span>';
$icon = '';
$status = $order_status;
switch ( $order_status ) {
case 'refunded':
$icon = 'undo';
break;
case 'failed' :
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-no-alt"></span>';
case 'failed':
$icon = 'no-alt';
$status = 'error';
break;
case 'complete' :
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-yes"></span>';
case 'complete':
case 'partially_refunded':
$icon = 'yes';
$status = 'success';
break;
case 'pending':
$status = 'warning';
break;
default:
$icon = '';
}
/**
* Filters the arguments for the order status badge.
*
* @since 3.1.4
* @param array $status_badge_args Array of arguments for the status badge.
* @param string $order_status Order status slug.
*/
$status_badge_args = apply_filters(
'edd_get_order_status_badge_args',
array(
'status' => $status,
'label' => edd_get_payment_status_label( $order_status ),
'icon' => $icon,
'class' => "edd-admin-order-status-badge--{$order_status}",
),
$order_status
);
$status_badge = new EDD\Utils\StatusBadge( $status_badge_args );
/**
* Filters the markup for the order status badge icon.
*
@ -1143,54 +1175,7 @@ function edd_get_order_status_badge( $order_status ) {
*
* @param string $icon Icon HTML markup.
*/
$icon = apply_filters( 'edd_get_order_status_badge_icon', $icon, $order_status );
$icon = apply_filters( 'edd_get_order_status_badge_icon', $status_badge->get_icon(), $order_status );
ob_start();
?>
<span class="edd-admin-order-status-badge edd-admin-order-status-badge--<?php echo esc_attr( $order_status ); ?>">
<span class="edd-admin-order-status-badge__text">
<?php echo edd_get_payment_status_label( $order_status ); ?>
</span>
<span class="edd-admin-order-status-badge__icon">
<?php
echo wp_kses(
$icon,
array(
'span' => array(
'class' => true,
),
'svg' => array(
'class' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'viewbox' => true,
'aria-hidden' => true,
'role' => true,
'focusable' => true,
),
'path' => array(
'fill' => true,
'fill-rule' => true,
'd' => true,
'transform' => true,
),
'polygon' => array(
'fill' => true,
'fill-rule' => true,
'points' => true,
'transform' => true,
'focusable' => true,
),
)
);
?>
</span>
</span>
<?php
return ob_get_clean();
return $status_badge->get( $icon );
}

View File

@ -149,8 +149,9 @@ class EDD_File_Downloads_Log_Table extends EDD_Base_Log_List_Table {
*/
$file_id = apply_filters( 'edd_log_file_download_file_id', $file_id, $log );
$file_name = '';
if ( ! empty( $files ) && is_numeric( $file_id ) && isset( $files[ $file_id ] ) ) {
$file_name = edd_get_file_download_log_meta( $log->id, 'file_name', true );
if ( empty( $file_name ) && is_array( $files ) && isset( $files[ $file_id ] ) ) {
$file_name = ! empty( $files[ $file_id ]['name'] )
? $files[ $file_id ]['name']
: edd_get_file_name( $files[ $file_id ] );

View File

@ -328,7 +328,6 @@ class EDD_Batch_Export extends EDD_Export {
* @return array
*/
protected function get_date_query() {
$time_zone = edd_get_timezone_id();
$date_query = array(
'after' => '',
'before' => '',
@ -336,13 +335,13 @@ class EDD_Batch_Export extends EDD_Export {
);
if ( $this->start ) {
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $this->start . '00:00:00', $time_zone, false ) );
$date_query['after'] = $date->format( 'Y-m-d H:i:s' );
$start_date_string = EDD()->utils->get_date_string( $this->start );
$date_query['after'] = edd_get_utc_date_string( $start_date_string );
}
if ( $this->end ) {
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $this->end . '23:59:59', $time_zone, false ) );
$date_query['before'] = $date->format( 'Y-m-d H:i:s' );
$end_date_string = EDD()->utils->get_date_string( $this->end, 23, 59, 59 );
$date_query['before'] = edd_get_utc_date_string( $end_date_string );
}
return array( $date_query );

View File

@ -27,6 +27,7 @@ function edd_media_button() {
// Setup the icon
$icon = '<span class="wp-media-buttons-icon dashicons dashicons-download" id="edd-media-button"></span>';
/* translators: singular download label */
$text = sprintf( __( 'Insert %s', 'easy-digital-downloads' ), edd_get_label_singular() );
// Output the thickbox button

View File

@ -152,9 +152,19 @@ function edd_tools_recount_stats_display() {
<option data-type="recount-store"
value="EDD_Tools_Recount_Store_Earnings"><?php esc_html_e( 'Recount Store Earnings and Sales', 'easy-digital-downloads' ); ?></option>
<option data-type="recount-download"
value="EDD_Tools_Recount_Download_Stats"><?php printf( __( 'Recount Earnings and Sales for a %s', 'easy-digital-downloads' ), edd_get_label_singular( true ) ); ?></option>
value="EDD_Tools_Recount_Download_Stats">
<?php
/* translators: %s: Singular download label, lowercase */
printf( esc_html__( 'Recount Earnings and Sales for a %s', 'easy-digital-downloads' ), esc_html( edd_get_label_singular( true ) ) );
?>
</option>
<option data-type="recount-all"
value="EDD_Tools_Recount_All_Stats"><?php printf( __( 'Recount Earnings and Sales for All %s', 'easy-digital-downloads' ), edd_get_label_plural( true ) ); ?></option>
value="EDD_Tools_Recount_All_Stats">
<?php
/* translators: %s: Plural download label, lowercase */
printf( esc_html__( 'Recount Earnings and Sales for All %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural( true ) ) );
?>
</option>
<option data-type="recount-customer-stats"
value="EDD_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recount Customer Stats', 'easy-digital-downloads' ); ?></option>
<?php do_action( 'edd_recount_tool_options' ); ?>
@ -180,11 +190,21 @@ function edd_tools_recount_stats_display() {
<span class="edd-recount-stats-descriptions">
<span id="recount-store"><?php _e( 'Recalculates the total store earnings and sales.', 'easy-digital-downloads' ); ?></span>
<span id="recount-download"><?php printf( __( 'Recalculates the earnings and sales stats for a specific %s.', 'easy-digital-downloads' ), edd_get_label_singular( true ) ); ?></span>
<span id="recount-all"><?php printf( __( 'Recalculates the earnings and sales stats for all %s.', 'easy-digital-downloads' ), edd_get_label_plural( true ) ); ?></span>
<span id="recount-customer-stats"><?php _e( 'Recalculates the lifetime value and purchase counts for all customers.', 'easy-digital-downloads' ); ?></span>
<span id="recount-download">
<?php
/* translators: %s: Singular wownload label, lowercase */
printf( esc_html__( 'Recalculates the earnings and sales stats for a specific %s.', 'easy-digital-downloads' ), esc_html( edd_get_label_singular( true ) ) );
?>
</span>
<span id="recount-all">
<?php
/* translators: %s: Pural download label, lowercase */
printf( esc_html__( 'Recalculates the earnings and sales stats for all %s.', 'easy-digital-downloads' ), esc_html( edd_get_label_plural( true ) ) );
?>
</span>
<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and purchase counts for all customers.', 'easy-digital-downloads' ); ?></span>
<?php do_action( 'edd_recount_tool_descriptions' ); ?>
<span id="reset-stats"><?php _e( '<strong>Deletes</strong> all payment records, customers, and related log entries.', 'easy-digital-downloads' ); ?></span>
<span id="reset-stats"><?php echo wp_kses_post( __( '<strong>Deletes</strong> all payment records, customers, and related log entries.', 'easy-digital-downloads' ) ); ?></span>
</span>
<span class="spinner"></span>
@ -270,12 +290,16 @@ function edd_tools_api_keys_display() {
<p>
<?php
printf(
__( 'These API keys allow you to use the <a href="%s">EDD REST API</a> to retrieve store data in JSON or XML for external applications or devices, such as the <a href="%s">EDD mobile app</a>.', 'easy-digital-downloads' ),
$docs_link,
$ios_link
wp_kses_post(
/* translators: %1$s: API documentation linktag , %2$s: iOS app link tag, %3$s: closing link tag */
__( 'These API keys allow you to use the %1$sEDD REST API%3$s to retrieve store data in JSON or XML for external applications or devices, such as the %2$sEDD mobile app%3$s.', 'easy-digital-downloads' )
),
'<a href="' . esc_url( $docs_link ) . '">',
'<a href="' . esc_url( $ios_link ) . '">',
'</a>'
);
?>
</p>
</p>
<?php
do_action( 'edd_tools_api_keys_after' );
@ -315,7 +339,12 @@ function edd_tools_betas_display() {
<input type="checkbox" name="enabled_betas[<?php echo esc_attr( $slug ); ?>]"
id="enabled_betas[<?php echo esc_attr( $slug ); ?>]"<?php echo checked( $checked, true, false ); ?>
value="1"/>
<label for="enabled_betas[<?php echo esc_attr( $slug ); ?>]"><?php printf( __( 'Get updates for pre-release versions of %s', 'easy-digital-downloads' ), esc_html( $product ) ); ?></label>
<label for="enabled_betas[<?php echo esc_attr( $slug ); ?>]">
<?php
/* translators: %s: Product name */
printf( esc_html__( 'Get updates for pre-release versions of %s', 'easy-digital-downloads' ), esc_html( $product ) );
?>
</label>
</td>
</tr>
<?php endforeach; ?>
@ -483,7 +512,7 @@ function edd_tools_import_export_display() {
<input name="edd-import-file" id="edd-payments-import-file" type="file" accept=".csv" required/>
</p>
<span>
<input type="submit" value="<?php _e( 'Import CSV', 'easy-digital-downloads' ); ?>"
<input type="submit" value="<?php esc_html_e( 'Import CSV', 'easy-digital-downloads' ); ?>"
class="button-secondary"/>
<span class="spinner"></span>
</span>
@ -494,8 +523,12 @@ function edd_tools_import_export_display() {
<p>
<?php
printf(
__( 'Each column loaded from the CSV needs to be mapped to an order field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing payment records.', 'easy-digital-downloads' ),
'https://easydigitaldownloads.com/docs/importing-exporting-orders/'
wp_kses_post(
/* translators: %1$s opening anchor tag, %2$s closing anchor tag */
__( 'Each column loaded from the CSV needs to be mapped to an order field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See %1$sthis guide%2$s for assistance with importing payment records.', 'easy-digital-downloads' )
),
'<a href="https://easydigitaldownloads.com/docs/importing-exporting-orders/" target="_blank">',
'</a>'
);
?>
</p>
@ -809,8 +842,12 @@ function edd_tools_import_export_display() {
<p>
<?php
printf(
__( 'Each column loaded from the CSV needs to be mapped to a Download product field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing Download products.', 'easy-digital-downloads' ),
'https://easydigitaldownloads.com/docs/importing-exporting-products/'
wp_kses_post(
/* translators: %1$s and %2$s opening and closing anchor tags respectively */
__( 'Each column loaded from the CSV needs to be mapped to a Download product field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See %1$sthis guide%2$s for assistance with importing Download products.', 'easy-digital-downloads' ),
'<a href="https://easydigitaldownloads.com/docs/importing-exporting-products/" target="_blank">',
'</a>'
)
);
?>
</p>
@ -1005,13 +1042,18 @@ function edd_tools_import_export_display() {
<p>
<?php
printf(
__( 'To export shop data (purchases, customers, etc), visit the <a href="%s">Reports</a> page.', 'easy-digital-downloads' ),
esc_url( edd_get_admin_url(
array(
'page' => 'edd-reports',
'view' => 'export',
wp_kses_post(
/* translators: %s: Reports page URL */
__( 'To export shop data (purchases, customers, etc), visit the <a href="%s">Reports</a> page.', 'easy-digital-downloads' )
),
esc_url(
edd_get_admin_url(
array(
'page' => 'edd-reports',
'view' => 'export',
)
)
) )
)
);
?>
</p>
@ -1188,23 +1230,36 @@ function edd_tools_debug_log_display() {
: esc_html__( 'No File', 'easy-digital-downloads' );
$log_output = ! empty( $log )
? wp_normalize_path( $log )
: esc_html__( 'Log is Empty', 'easy-digital-downloads' ); ?>
: esc_html__( 'Log is Empty', 'easy-digital-downloads' );
?>
<div class="postbox">
<h3><span><?php esc_html_e( 'Debug Log', 'easy-digital-downloads' ); ?></span></h3>
<div class="inside">
<form id="edd-debug-log" method="post">
<p><?php _e( 'When debug mode is enabled, specific information will be logged here. (<a href="https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/class-edd-logging.php">Learn how</a> to use <code>EDD_Logging</code> in your own code.)', 'easy-digital-downloads' ); ?></p>
<textarea
<div class="postbox">
<h3><span><?php esc_html_e( 'Debug Log', 'easy-digital-downloads' ); ?></span></h3>
<div class="inside">
<form id="edd-debug-log" method="post">
<p>
<?php
printf(
wp_kses_post(
/* translators: 1. opening anchor tag, do not translate; 2. function name, do not translate; 3. closing anchor tag, do not translate */
__( 'When debug mode is enabled, specific information will be logged here. (%1$sLearn how to use %2$s in your own code.%3$s)', 'easy-digital-downloads' )
),
'<a href="https://easydigitaldownloads.com/docs/edd-debug-log">',
'<code>edd_debug_log</code>',
'</a>'
);
?>
</p>
<textarea
readonly="readonly"
class="edd-tools-textarea"
rows="15"
name="edd-debug-log-contents"><?php echo esc_textarea( $log_output ); ?></textarea>
<p>
<input type="hidden" name="edd_action" value="submit_debug_log"/>
<p>
<input type="hidden" name="edd_action" value="submit_debug_log"/>
<?php
submit_button( __( 'Download Debug Log File', 'easy-digital-downloads' ), 'primary', 'edd-download-debug-log', false );
submit_button( __( 'Copy to Clipboard', 'easy-digital-downloads' ), 'secondary edd-inline-button', 'edd-copy-debug-log', false, array( 'onclick' => "this.form['edd-debug-log-contents'].focus();this.form['edd-debug-log-contents'].select();document.execCommand('copy');return false;" ) );
submit_button( __( 'Download Debug Log File', 'easy-digital-downloads' ), 'primary', 'edd-download-debug-log', false );
submit_button( __( 'Copy to Clipboard', 'easy-digital-downloads' ), 'secondary edd-inline-button', 'edd-copy-debug-log', false, array( 'onclick' => "this.form['edd-debug-log-contents'].focus();this.form['edd-debug-log-contents'].select();document.execCommand('copy');return false;" ) );
// Only show the "Clear Log" button if there is a log to clear
if ( ! empty( $log ) ) {
@ -1212,16 +1267,16 @@ function edd_tools_debug_log_display() {
}
?>
</p>
</p>
<?php wp_nonce_field( 'edd-debug-log-action' ); ?>
</form>
</form>
<p>
<?php _e( 'Log file', 'easy-digital-downloads' ); ?>:
<code><?php echo esc_html( $path_output ); ?></code>
<p>
<?php esc_html_e( 'Log file', 'easy-digital-downloads' ); ?>:
<code><?php echo esc_html( $path_output ); ?></code>
</p>
</div><!-- .inside -->
</div><!-- .postbox -->
</div><!-- .inside -->
</div><!-- .postbox -->
<?php
}

View File

@ -1,6 +1,8 @@
<?php
/**
* Upgrade Functions
* Note: Do not move, rename, or delete this file as many extensions will attempt
* to require it during an installation or upgrade process.
*
* @package EDD
* @subpackage Admin/Upgrades
@ -12,28 +14,7 @@
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Perform automatic database upgrades when necessary
*
* @since 2.6
* @return void
*/
function edd_do_automatic_upgrades() {
$edd_version = edd_get_db_version();
if ( version_compare( $edd_version, EDD_VERSION, '>=' ) ) {
return;
}
// Existing stores should set the upgraded version and the onboarding wizard as complete.
if ( ! empty( $edd_version ) ) {
update_option( 'edd_version_upgraded_from', $edd_version, false );
if ( ! get_option( 'edd_onboarding_completed', false ) && ! get_option( 'edd_onboarding_started', false ) ) {
update_option( 'edd_onboarding_completed', true, false );
}
}
edd_update_db_version();
}
// edd_do_automatic upgrades is defined in includes/upgrades/functions.php
add_action( 'admin_init', 'edd_do_automatic_upgrades' );
/**
@ -214,7 +195,7 @@ function edd_show_upgrade_notices() {
* NOTICE:
*
* When adding new upgrade notices, please be sure to put the action
* into the upgrades array during install: /includes/install.php @ Appox Line 156
* into the upgrades array in `edd_get_all_upgrades`.
*/
// End 'Stepped' upgrade process notices
@ -269,80 +250,8 @@ function edd_maybe_resume_upgrade() {
return $doing_upgrade;
}
/**
* Adds an upgrade action to the completed upgrades array
*
* @since 2.3
* @param string $upgrade_action The action to add to the copmleted upgrades array
* @return bool If the function was successfully added
*/
function edd_set_upgrade_complete( $upgrade_action = '' ) {
if ( empty( $upgrade_action ) ) {
return false;
}
$completed_upgrades = edd_get_completed_upgrades();
$completed_upgrades[] = $upgrade_action;
// Remove any blanks, and only show uniques
$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
return update_option( 'edd_completed_upgrades', $completed_upgrades );
}
/** 3.0 Upgrades *************************************************************/
/**
* Returns an array of upgrades for 3.0
*
* Key is the name of the upgrade, which can be used in `edd_has_upgrade_completed()` completed functions.
* The value is the name of the associated batch processor class for that upgrade.
*
* @since 3.0
* @return array
*/
function edd_get_v30_upgrades() {
return array(
'migrate_tax_rates' => array(
'name' => __( 'Tax Rates', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Tax_Rates'
),
'migrate_discounts' => array(
'name' => __( 'Discounts', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Discounts'
),
'migrate_orders' => array(
'name' => __( 'Orders', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Orders'
),
'migrate_customer_addresses' => array(
'name' => __( 'Customer Addresses', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Addresses'
),
'migrate_customer_email_addresses' => array(
'name' => __( 'Customer Email Addresses', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Email_Addresses'
),
'migrate_customer_notes' => array(
'name' => __( 'Customer Notes', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Notes'
),
'migrate_logs' => array(
'name' => __( 'Logs', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Logs'
),
'migrate_order_notes' => array(
'name' => __( 'Order Notes', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Order_Notes'
),
'v30_legacy_data_removed' => array(
'name' => __( 'Remove Legacy Data', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Remove_Legacy_Data'
)
);
}
/**
* Render 3.0 upgrade page.
*

View File

@ -10,7 +10,7 @@
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
defined( 'ABSPATH' ) || exit;
/**
* Builds the Cart by providing hooks and calling all the hooks for the Cart
@ -20,13 +20,20 @@ if ( !defined( 'ABSPATH' ) ) exit;
*/
function edd_checkout_cart() {
if ( function_exists( '\\EDD\\Blocks\\Checkout\\Functions\\checkout_has_blocks' ) && \EDD\Blocks\Checkout\Functions\checkout_has_blocks() ) {
$cart_items = edd_get_cart_contents();
include EDD_BLOCKS_DIR . 'views/checkout/cart/cart.php';
return;
}
// Check if the Update cart button should be shown
if( edd_item_quantities_enabled() ) {
if ( edd_item_quantities_enabled() ) {
add_action( 'edd_cart_footer_buttons', 'edd_update_cart_button' );
}
// Check if the Save Cart button should be shown
if( ! edd_is_cart_saving_disabled() ) {
if ( ! edd_is_cart_saving_disabled() ) {
add_action( 'edd_cart_footer_buttons', 'edd_save_cart_button' );
}

View File

@ -799,7 +799,7 @@ function edd_terms_agreement() {
?>
<div class="edd-terms-agreement">
<input name="edd_agree_to_terms" class="required" type="checkbox" id="edd_agree_to_terms" value="1"/>
<input name="edd_agree_to_terms" class="required" type="checkbox" id="edd_agree_to_terms" value="1" required/>
<label for="edd_agree_to_terms"><?php echo stripslashes( $agree_label ); ?></label>
</div>
</fieldset>
@ -874,7 +874,7 @@ function edd_privacy_agreement() {
if ( '1' === $show_privacy_policy_checkbox ) {
?>
<div class="edd-privacy-policy-agreement">
<input name="edd_agree_to_privacy_policy" class="required" type="checkbox" id="edd-agree-to-privacy-policy" value="1"/>
<input name="edd_agree_to_privacy_policy" class="required" type="checkbox" id="edd-agree-to-privacy-policy" value="1" required/>
<label for="edd-agree-to-privacy-policy"><?php echo stripslashes( $agree_label ); ?></label>
</div>
<?php

View File

@ -355,7 +355,7 @@ final class Easy_Digital_Downloads {
// Plugin version.
if ( ! defined( 'EDD_VERSION' ) ) {
define( 'EDD_VERSION', '3.1.3' );
define( 'EDD_VERSION', '3.1.4' );
}
// Make sure CAL_GREGORIAN is defined.
@ -723,9 +723,6 @@ final class Easy_Digital_Downloads {
require_once EDD_PLUGIN_DIR . 'includes/emails/email-summary/class-edd-email-summary.php';
require_once EDD_PLUGIN_DIR . 'includes/emails/email-summary/class-edd-email-summary-blurb.php';
// Structured Data
require_once EDD_PLUGIN_DIR . 'includes/class-structured-data.php';
// Stats
require_once EDD_PLUGIN_DIR . 'includes/class-stats.php';
@ -778,6 +775,7 @@ final class Easy_Digital_Downloads {
require_once EDD_PLUGIN_DIR . 'includes/users/register.php';
require_once EDD_PLUGIN_DIR . 'includes/shortcodes.php';
require_once EDD_PLUGIN_DIR . 'includes/install.php';
require_once EDD_PLUGIN_DIR . 'includes/upgrades/functions.php';
// Admin files to load globally (cron, bar, etc...)
require_once EDD_PLUGIN_DIR . 'includes/admin/tracking.php';

View File

@ -2138,16 +2138,15 @@ class EDD_CLI extends WP_CLI_Command {
$file_id_key = array_rand( $download_ids_with_files[ $product_id ], 1 );
$file_key = $download_ids_with_files[ $product_id ][ $file_id_key ];
edd_add_file_download_log( array(
'product_id' => absint( $product_id ),
'file_id' => absint( $file_key ),
'order_id' => absint( $order_id ),
'price_id' => absint( $price_id ),
'customer_id' => $order->customer_id,
'ip' => edd_get_ip(),
'user_agent' => 'EDD; WPCLI; download_logs;',
'date_created' => $order->date_completed,
) );
edd_record_download_in_log(
absint( $product_id ),
absint( $file_key ),
array(),
edd_get_ip(),
absint( $order_id ),
absint( $price_id ),
'EDD; WPCLI; download_logs;'
);
$progress->tick();
$i ++;

View File

@ -283,3 +283,15 @@ function edd_get_minute_values() {
'59' => '59'
) );
}
/**
* Gets the UTC equivalent of a date in the local timezone.
*
* @since 3.1.4
* @param string $date_string The date string to convert.
* @param string $format The format to return the date in.
* @return string
*/
function edd_get_utc_date_string( $date_string = 'now', $format = 'Y-m-d H:i:s' ) {
return EDD()->utils->date( $date_string, edd_get_timezone_id(), false )->get_utc_from_local( $format );
}

View File

@ -709,31 +709,53 @@ function edd_get_download_sales_stats( $download_id = 0 ) {
* @param int $download_id Download ID.
* @param int $file_id File ID.
* @param array $user_info User information (deprecated).
* @param string $ip User IP.
* @param string $ip Optional. IP address.
* @param int $order_id Order ID.
* @param int $price_id Optional. Price ID,
* @param string $user_agent Optional. User agent.
* @return void
*/
function edd_record_download_in_log( $download_id = 0, $file_id = 0, $user_info = array(), $ip = '', $order_id = 0, $price_id = 0 ) {
function edd_record_download_in_log( $download_id = 0, $file_id = 0, $user_info = array(), $ip = '', $order_id = 0, $price_id = 0, $user_agent = '' ) {
$order = edd_get_order( $order_id );
if ( ! class_exists( 'Browser' ) ) {
require_once EDD_PLUGIN_DIR . 'includes/libraries/browser.php';
if ( empty( $user_agent ) ) {
if ( ! class_exists( 'Browser' ) ) {
require_once EDD_PLUGIN_DIR . 'includes/libraries/browser.php';
}
$browser = new Browser();
$user_agent = $browser->getBrowser() . ' ' . $browser->getVersion() . '/' . $browser->getPlatform();
}
$browser = new Browser();
if ( empty( $ip ) ) {
$ip = edd_get_ip();
}
$user_agent = $browser->getBrowser() . ' ' . $browser->getVersion() . '/' . $browser->getPlatform();
$file_id = absint( $file_id );
$files = edd_get_download_files( $download_id );
$file_name = '';
edd_add_file_download_log( array(
if ( is_array( $files ) ) {
foreach ( $files as $key => $file ) {
if ( absint( $key ) === $file_id ) {
$file_name = edd_get_file_name( $file );
break;
}
}
}
$log_id = edd_add_file_download_log( array(
'product_id' => absint( $download_id ),
'file_id' => absint( $file_id ),
'file_id' => $file_id,
'order_id' => absint( $order_id ),
'price_id' => absint( $price_id ),
'customer_id' => $order->customer_id,
'ip' => sanitize_text_field( $ip ),
'user_agent' => $user_agent,
) );
if ( $log_id && ! empty( $file_name ) ) {
edd_add_file_download_log_meta( $log_id, 'file_name', $file_name );
}
}
/**

View File

@ -60,7 +60,7 @@ function edd_resend_purchase_receipt( $data ) {
wp_die( __( 'You do not have permission to edit this payment record', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
}
$email = ! empty( $_GET['email'] ) ? sanitize_email( $_GET['email'] ) : '';
$email = ! empty( $data['email'] ) ? sanitize_email( $data['email'] ) : '';
if( empty( $email ) ) {
$customer = new EDD_Customer( edd_get_payment_customer_id( $purchase_id ) );
@ -88,6 +88,7 @@ function edd_resend_purchase_receipt( $data ) {
'edd-message' => $sent ? 'email_sent' : 'email_send_failed',
'edd-action' => false,
'purchase_id' => false,
'email' => false,
)
)
);

View File

@ -506,7 +506,7 @@ function get_account_info() {
wp_send_json_success( array(
'status' => $status,
'account_status' => '<ul class="edd-paypal-account-status">' . $account_status . '</ul>',
'account_status' => '<ul class="edd-paypal-account-status edd-settings__list--disc">' . $account_status . '</ul>',
'webhook_object' => isset( $validator ) ? $validator->webhook : null,
'actions' => array_values( $actions ),
'disconnect_links' => array_values( $disconnect_links ),

View File

@ -3,7 +3,7 @@
* Plugin Name: Easy Digital Downloads - Stripe Pro Payment Gateway
* Plugin URI: https://easydigitaldownloads.com/downloads/stripe-gateway/
* Description: Adds support for pre-authorized credit card payments and removes additional transaction fees.
* Version: 2.9.5.1
* Version: 2.9.6
* Requires at least: 5.4
* Requires PHP: 7.1
* Author: Easy Digital Downloads
@ -44,7 +44,7 @@ function edd_stripe_core_bootstrap() {
}
if ( ! defined( 'EDD_STRIPE_VERSION' ) ) {
define( 'EDD_STRIPE_VERSION', '2.9.5.1' );
define( 'EDD_STRIPE_VERSION', '2.9.6' );
}
if ( ! defined( 'EDD_STRIPE_API_VERSION' ) ) {

View File

@ -161,8 +161,10 @@ function edds_add_settings( $settings ) {
'id' => 'stripe_allow_prepaid_elements_note',
'name' => __( 'Prepaid Cards', 'easy-digital-downloads' ),
'desc' => sprintf(
__( 'Prepaid card allowance can now be managed in your <a href="%s" target="_blank">Stripe Radar Rules</a>.', 'easy-digital-downloads' ),
$radar_rules_url
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */
__( 'Prepaid card allowance can now be managed in your %1$sStripe Radar Rules%2$s.', 'easy-digital-downloads' ),
'<a href="' . $radar_rules_url . '" target="_blank">',
'</a>'
),
'type' => 'descriptive_text',
'class' => 'payment-elements' === $elements_mode ? 'payment-elements-feature' : 'edd-hidden payment-elements-feature',
@ -188,8 +190,10 @@ function edds_add_settings( $settings ) {
'id' => 'stripe_use_existing_cards_elements_note',
'name' => __( 'Show Previously Used Cards', 'easy-digital-downloads' ),
'desc' => sprintf(
__( 'Previously used cards are now managed by <a href="%s" target="_blank">Link by Stripe</a>, for even better conversions and security.', 'easy-digital-downloads' ),
'https://link.co/'
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */
__( 'Previously used cards are now managed by %1$sLink by Stripe%2$s, for even better conversions and security.', 'easy-digital-downloads' ),
'<a href="https://link.co/" target="_blank">',
'</a>'
),
'type' => 'descriptive_text',
'class' => 'payment-elements' === $elements_mode ? 'payment-elements-feature' : 'edd-hidden payment-elements-feature',
@ -353,7 +357,7 @@ function edd_stripe_requirements_not_met_callback() {
echo '<p>';
echo wp_kses(
sprintf(
/* translators: %1$s Future PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */
/* translators: %1$s PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */
__(
'Processing credit cards with Stripe requires PHP version %1$s or higher. It looks like you\'re using version %2$s, which means you will need to %3$supgrade your version of PHP before acceping credit card payments%4$s.',
'easy-digital-downloads'

View File

@ -568,9 +568,9 @@ function edds_stripe_connect_account_info_ajax_response() {
)
. ' ' .
sprintf(
/** Translators: Replacements are for the html wrappers for the phrse Upgrade to Pro and should not be translated. */
esc_html__(
'%sUpgrade to Pro%s and install the Stripe Pro Gateway to remove transaction fees.', 'easy-digital-downloads'
/* Translators: Replacements are for the html wrappers for the phrase Upgrade to Pro and should not be translated. */
'%1$sUpgrade to Pro%2$s and install the Stripe Pro Gateway to remove transaction fees.', 'easy-digital-downloads'
),
'<span class="edd-pro-upgrade"><a href="' . edd_link_helper( 'https://easydigitaldownloads.com/pricing/', array( 'utm_medium' => 'stripe-settings', 'utm_content' => 'upgrade-to-pro' ) ) . '" target="_blank">',
'</a></span>'
@ -772,94 +772,3 @@ function edds_stripe_connect_admin_notices_print() {
} catch( Exception $e ) {}
}
add_action( 'admin_notices', 'edds_stripe_connect_admin_notices_print' );
/**
* Adds a Stripe Connect site health test.
*
* @since 2.9.3
* @param array $tests The array of Site Health tests.
* @return array
*/
function edds_stripe_connect_site_health_test( $tests ) {
$active_gateways = edd_get_enabled_payment_gateways();
if ( ! empty( $active_gateways['stripe'] ) && current_user_can( 'manage_shop_settings' ) ) {
$tests['direct']['edds_stripe_connect'] = array(
'label' => __( 'Stripe Connect', 'easy-digital-downloads' ),
'test' => 'edds_get_test_stripe_connect',
);
}
return $tests;
}
add_filter( 'site_status_tests', 'edds_stripe_connect_site_health_test' );
/**
* Adds the Stripe Connect Site Health test.
*
* @since 2.9.3
* @return array
*/
function edds_get_test_stripe_connect() {
$result = array(
'label' => __( 'You are securely connected to Stripe', 'easy-digital-downloads' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Easy Digital Downloads: Stripe', 'easy-digital-downloads' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'Stripe Connect helps ensure easy setup and security.', 'easy-digital-downloads' )
),
'actions' => '',
'test' => 'edds_stripe_connect',
);
$elements_mode = edds_get_elements_mode();
if ( edd_stripe()->connect()->is_connected ) {
if ( 'payment-elements' === $elements_mode ) {
return $result;
}
// User is connected but on the Card Elements, we should give them a recommendation to use the Payment Elements.
$result['label'] = __( 'You are using the legacy Card Elements fields', 'easy-digital-downloads' );
$result['status'] = 'recommended';
$result['badge']['color'] = 'orange';
$result['description'] = sprintf(
'<p>%s</p>',
esc_html__( 'Increase conversions, security, and reliability by using the Payment Elements integration for Stripe.', 'easy-digital-downloads' )
);
$result['actions'] = sprintf(
'<a href="%s" class="button button-primary"><span>%s</span></a>',
esc_url(
edd_get_admin_url(
array(
'page' => 'edd-settings',
'tab' => 'gateways',
'section' => 'edd-stripe',
)
)
),
esc_html__( 'Switch to Payment Elements', 'easy-digital-downloads' )
);
} else {
$result['label'] = __( 'You are using manually managed Stripe API keys', 'easy-digital-downloads' );
$result['status'] = 'critical';
$result['badge']['color'] = 'red';
$result['description'] = sprintf(
'<p>%s</p>',
esc_html__( 'By securely connecting your Easy Digital Downloads store with Stripe Connect, you\'ll get access to more reliable payments and use managed API keys which are more secure.', 'easy-digital-downloads' )
);
$result['actions'] = sprintf(
'<a href="%s" class="edd-stripe-connect"><span>%s</span></a>',
esc_url( edds_stripe_connect_url() ),
esc_html__( 'Connect with Stripe', 'easy-digital-downloads' )
);
}
edd_stripe_connect_admin_style();
return $result;
}

View File

@ -0,0 +1,144 @@
<?php
/*
* Site Health
*
* @package EDD_Stripe\Admin\SiteHealth
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 2.9.6
*/
defined( 'ABSPATH' ) || exit;
/**
* Adds a Stripe Connect site health test.
*
* @since 2.9.3
* @param array $tests The array of Site Health tests.
* @return array
*/
function edds_stripe_connect_site_health_test( $tests ) {
$active_gateways = edd_get_enabled_payment_gateways();
if ( ! empty( $active_gateways['stripe'] ) && current_user_can( 'manage_shop_settings' ) ) {
$tests['direct']['edds_stripe_connect'] = array(
'label' => __( 'Stripe Connect', 'easy-digital-downloads' ),
'test' => 'edds_get_test_stripe_connect',
);
}
return $tests;
}
add_filter( 'site_status_tests', 'edds_stripe_connect_site_health_test' );
/**
* Adds the Stripe Connect Site Health test.
*
* @since 2.9.3
* @return array
*/
function edds_get_test_stripe_connect() {
$result = array(
'label' => __( 'You are securely connected to Stripe', 'easy-digital-downloads' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Easy Digital Downloads: Stripe', 'easy-digital-downloads' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'Stripe Connect helps ensure easy setup and security.', 'easy-digital-downloads' )
),
'actions' => '',
'test' => 'edds_stripe_connect',
);
$elements_mode = edds_get_elements_mode();
if ( edd_stripe()->connect()->is_connected ) {
if ( 'payment-elements' === $elements_mode ) {
return $result;
}
// User is connected but on the Card Elements, we should give them a recommendation to use the Payment Elements.
$result['label'] = __( 'You are using the legacy Card Elements fields', 'easy-digital-downloads' );
$result['status'] = 'recommended';
$result['badge']['color'] = 'orange';
$result['description'] = sprintf(
'<p>%s</p>',
esc_html__( 'Increase conversions, security, and reliability by using the Payment Elements integration for Stripe.', 'easy-digital-downloads' )
);
$result['actions'] = sprintf(
'<a href="%s" class="button button-primary"><span>%s</span></a>',
esc_url(
edd_get_admin_url(
array(
'page' => 'edd-settings',
'tab' => 'gateways',
'section' => 'edd-stripe',
)
)
),
esc_html__( 'Switch to Payment Elements', 'easy-digital-downloads' )
);
} else {
$result['label'] = __( 'You are using manually managed Stripe API keys', 'easy-digital-downloads' );
$result['status'] = 'critical';
$result['badge']['color'] = 'red';
$result['description'] = sprintf(
'<p>%s</p>',
esc_html__( 'By securely connecting your Easy Digital Downloads store with Stripe Connect, you\'ll get access to more reliable payments and use managed API keys which are more secure.', 'easy-digital-downloads' )
);
$result['actions'] = sprintf(
'<a href="%s" class="edd-stripe-connect"><span>%s</span></a>',
esc_url( edds_stripe_connect_url() ),
esc_html__( 'Connect with Stripe', 'easy-digital-downloads' )
);
}
edd_stripe_connect_admin_style();
return $result;
}
add_filter( 'edd_debug_information', 'edds_debug_information' );
/**
* Add Stripe debugging information to the EDD information.
*
* @since 2.9.6
* @param array $information The EDD debug information.
* @return array
*/
function edds_debug_information( $information ) {
$stripe = array(
'edd_stripe' => array(
'label' => __( 'Easy Digital Downloads &mdash; Stripe', 'easy-digital-downloads' ),
'fields' => array(
'connect' => array(
'label' => 'Stripe Connect',
'value' => edd_stripe()->connect()->is_connected ? 'Connected' : 'Not Connected',
),
'mode' => array(
'label' => 'Elements Mode',
'value' => 'payment-elements' === edds_get_elements_mode() ? 'Payment Elements' : 'Legacy Card Elements',
),
'preapproved_payments' => array(
'label' => 'Preapproved Payments',
'value' => edds_is_preapprove_enabled() ? 'Enabled' : 'Disabled',
),
'assets' => array(
'label' => 'Stripe Assets',
'value' => edd_get_option( 'stripe_restrict_assets', false ) ? 'Limited' : 'Global',
),
),
),
);
$position = array_search( 'edd_gateways', array_keys( $information ), true );
return array_merge(
array_slice( $information, 0, $position + 1 ),
$stripe,
array_slice( $information, $position + 1 )
);
}

View File

@ -74,18 +74,6 @@ class EDD_Stripe {
self::$instance->setup_classes();
self::$instance->actions();
self::$instance->filters();
if ( true === edds_is_pro() ) {
add_action( 'edd_extension_license_init', function( \EDD\Extensions\ExtensionRegistry $registry ) {
$registry->addExtension(
EDD_STRIPE_PLUGIN_FILE,
'Stripe Pro Payment Gateway',
167,
EDD_STRIPE_VERSION,
'stripe_license_key'
);
} );
}
}
return self::$instance;
@ -170,6 +158,7 @@ class EDD_Stripe {
require_once EDDS_PLUGIN_DIR . '/includes/admin/settings/stripe-connect.php';
require_once EDDS_PLUGIN_DIR . '/includes/admin/settings.php';
require_once EDDS_PLUGIN_DIR . '/includes/admin/upgrade-functions.php';
require_once EDDS_PLUGIN_DIR . '/includes/admin/site-health.php';
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {

View File

@ -616,6 +616,8 @@ function edds_stripe_connect_account_country_supports_application_fees() {
$blocked_countries = array(
'br',
'in',
'mx',
);
return ! in_array( $account_country, $blocked_countries, true );
@ -776,4 +778,4 @@ function edds_get_tokenizer_input( $custom_id = '' ) {
esc_attr( $timestamp ),
esc_attr( \EDD\Utils\Tokenizer::tokenize( $timestamp ) )
);
}
}

View File

@ -68,29 +68,30 @@ function edds_process_purchase_form( $purchase_data ) {
*/
do_action( 'edds_pre_process_purchase_form', $purchase_data );
if ( edds_is_zero_decimal_currency() ) {
$amount = $purchase_data['price'];
} else {
$amount = round( $purchase_data['price'] * 100, 0 );
}
/**
* We need to unhook some of the Recurring Payments actions here as we're handling captures ourselves.
*
* We're also going to attempt to restrict this to a single subscription and no mixed carts, for the time being.
*/
$cart_contains_subscription = false;
$cart_contains_subscription = (bool) ( function_exists( 'edd_recurring' ) && edd_recurring()->cart_contains_recurring() );
if ( function_exists( 'edd_recurring' ) ) {
$cart_contains_subscription = edd_recurring()->cart_contains_recurring();
if ( ( count( edd_get_cart_contents() ) > 1 && $cart_contains_subscription ) || edd_recurring()->cart_is_mixed() ) {
if ( $cart_contains_subscription ) {
if ( count( edd_get_cart_contents() ) > 1 || edd_recurring()->cart_is_mixed() ) {
throw new \EDD_Stripe_Gateway_Exception( edds_get_single_subscription_cart_error() );
}
if ( edd_recurring()->cart_has_free_trial() ) {
$amount = 0;
}
global $edd_recurring_stripe;
remove_filter( 'edds_create_payment_intent_args', array( $edd_recurring_stripe, 'create_payment_intent_args' ), 10, 2 );
remove_filter( 'edds_capture_payment_intent', array( $edd_recurring_stripe, 'capture_payment_intent' ) );
}
if ( edds_is_zero_decimal_currency() ) {
$amount = $purchase_data['price'];
} else {
$amount = round( $purchase_data['price'] * 100, 0 );
}
$existing_intent = false;
@ -477,6 +478,8 @@ function edds_create_and_complete_order() {
// Retrieve the relevant Intent.
if ( 'setup_intent' === $intent->object ) {
$order_transaction_id = false;
$intent = edds_api_request( 'SetupIntent', 'update', $intent->id, array(
'metadata' => array(
'edd_payment_id' => $order->id,
@ -518,20 +521,20 @@ function edds_create_and_complete_order() {
'_edds_stripe_payment_intent_id',
$intent->id
);
}
// Use Intent ID for temporary transaction ID.
// It will be updated when a charge is available.
$order_transaction_id = edd_add_order_transaction(
array(
'object_id' => $order->id,
'object_type' => 'order',
'transaction_id' => sanitize_text_field( $intent->id ),
'gateway' => 'stripe',
'status' => 'pending',
'total' => $order->total,
)
);
// Use Intent ID for temporary transaction ID.
// It will be updated when a charge is available.
$order_transaction_id = edd_add_order_transaction(
array(
'object_id' => $order->id,
'object_type' => 'order',
'transaction_id' => sanitize_text_field( $intent->id ),
'gateway' => 'stripe',
'status' => 'pending',
'total' => $order->total,
)
);
}
// Retrieves or creates a Stripe Customer.
edd_update_order_meta( $order->id, '_edds_stripe_customer_id', $intent->customer );
@ -627,15 +630,14 @@ function edds_create_and_complete_order() {
)
);
edd_update_order_transaction(
$order_transaction_id,
array(
'transaction_id' => sanitize_text_field( $charge_id ),
'gateway' => 'stripe',
'status' => 'complete',
'total' => $order->total,
)
);
if ( ! empty( $order_transaction_id ) ) {
edd_update_order_transaction(
$order_transaction_id,
array(
'transaction_id' => sanitize_text_field( $charge_id ),
)
);
}
}
if ( has_action( 'edds_payment_complete' ) ) {

View File

@ -50,7 +50,7 @@ function edds_prb_add_settings( $settings ) {
'desc' => wp_kses(
(
sprintf(
/* translators: %1$s Opening anchor tag, do not translate. %2$s Opening anchor tag, do not translate. %3$s Closing anchor tag, do not translate. */
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. %3$s Closing anchor tag, do not translate. */
__( '"Express Checkout" via Apple Pay, Google Pay, or Microsoft Pay digital wallets. By using Apple Pay, you agree to %1$sStripe%3$s and %2$sApple\'s%3$s terms of service.', 'easy-digital-downloads' ),
'<a href="https://stripe.com/apple-pay/legal" target="_blank" rel="noopener noreferrer">',
'<a href="https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/" target="_blank" rel="noopener noreferrer">',
@ -58,7 +58,7 @@ function edds_prb_add_settings( $settings ) {
) . (
edd_is_test_mode()
? '<br /><strong>' . __( 'Apple Pay is not available in Test Mode.', 'easy-digital-downloads' ) . '</strong> ' . sprintf(
/* translators: %1$s Opening anchor tag, do not translate. %2$s Opening anchor tag, do not translate. */
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */
__( 'See our %1$sdocumentation%2$s for more information.', 'easy-digital-downloads' ),
'<a href="' . esc_url( edds_documentation_route( 'stripe-express-checkout-apple-pay-google-pay' ) ) . '" target="_blank" rel="noopener noreferrer">',
'</a>'
@ -78,15 +78,16 @@ function edds_prb_add_settings( $settings ) {
),
'type' => 'multicheck',
'options' => array(
/** translators: %s Download noun */
'single' => sprintf(
/* translators: %s Download noun */
__( 'Single %s', 'easy-digital-downloads' ),
edd_get_label_singular()
),
/** translators: %s Download noun */
'archive' => sprintf(
__( '%s Archive (includes <code>[downloads]</code> shortcode)', 'easy-digital-downloads' ),
edd_get_label_singular()
/* translators: 1. Download noun; 2. shortcode tag wrapped in <code> span */
__( '%1$s Archive (includes %2$s shortcode)', 'easy-digital-downloads' ),
edd_get_label_singular(),
'<code>[downloads]</code>'
),
'checkout' => __( 'Checkout', 'easy-digital-downloads' ),
),

View File

@ -162,6 +162,7 @@ function edds_prb_get_download_data( $download_id, $price_id = false, $quantity
'label' => sprintf(
'%s%s',
strip_tags( $name ),
/* translators: %d: Quantity.*/
( $quantity > 1 ? sprintf( __( ' × %d', 'easy-digital-downloads' ), $quantity ) : '' )
),
'amount' => $price,

View File

@ -110,6 +110,7 @@ abstract class EDD_Stripe_Region_Base {
<p>
<?php
printf(
/* translators: %s: The country name. */
esc_html__( 'Based on your store\'s base country of %s, it is recommended to set your Billing Address Display to use the "Full Address" option to ensure payments are completed successfully.', 'easy-digital-downloads' ),
edd_get_country_name( edd_get_option( 'base_country', 'US' ) )
);

View File

@ -12,81 +12,6 @@
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Get the current database version
*
* @since 3.0
*
* @return string
*/
function edd_get_db_version() {
$db_version = get_option( 'edd_version' );
$retval = ! empty( $db_version )
? edd_format_db_version( $db_version )
: false;
return $retval;
}
/**
* Update the EDD version in the options table
*
* @since 3.0
*/
function edd_update_db_version() {
if ( defined( 'EDD_VERSION' ) ) {
update_option( 'edd_version', edd_format_db_version( EDD_VERSION ) );
}
}
/**
* Format the EDD version (going into or coming from the database.)
*
* @since 3.0
*
* @param string $version
* @return string
*/
function edd_format_db_version( $version = '' ) {
return preg_replace( '/[^0-9.].*/', '', $version );
}
/**
* Check if the upgrade routine has been run for a specific action
*
* @since 2.3
* @param string $upgrade_action The upgrade action to check completion for
* @return bool If the action has been added to the copmleted actions array
*/
function edd_has_upgrade_completed( $upgrade_action = '' ) {
// Bail if no upgrade action to check
if ( empty( $upgrade_action ) ) {
return false;
}
// Get completed upgrades
$completed_upgrades = edd_get_completed_upgrades();
// Return true if in array, false if not
return in_array( $upgrade_action, $completed_upgrades, true );
}
/**
* Get's the array of completed upgrade actions
*
* @since 2.3
* @return array The array of completed upgrades
*/
function edd_get_completed_upgrades() {
// Get the completed upgrades for this site
$completed_upgrades = get_option( 'edd_completed_upgrades', array() );
// Return array of completed upgrades
return (array) $completed_upgrades;
}
/**
* Install
*
@ -244,21 +169,8 @@ function edd_set_all_upgrades_complete() {
return;
}
// Maybe include an admin-area only file/function
if ( ! function_exists( 'edd_set_upgrade_complete' ) ) {
require_once EDD_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
}
// When new upgrade routines are added, mark them as complete on fresh install
$upgrade_routines = array(
'upgrade_payment_taxes',
'upgrade_customer_payments_association',
'upgrade_user_api_keys',
'remove_refunded_sale_logs',
'update_file_download_log_data',
);
$edd_30_upgrades = edd_get_v30_upgrades();
$upgrade_routines = array_merge( $upgrade_routines, array_keys( $edd_30_upgrades ) );
$upgrade_routines = edd_get_all_upgrades();
// Loop through upgrade routines and mark them as complete
foreach ( $upgrade_routines as $upgrade ) {

View File

@ -1871,6 +1871,36 @@ function edd_link_helper( $base_url = 'https://easydigitaldownloads.com/', $quer
$args = wp_parse_args( $query_args, $default_args );
if ( empty( $args['utm_medium'] ) ) {
if ( is_admin() ) {
$screen = get_current_screen();
if ( $screen ) {
$args['utm_medium'] = $screen->id;
}
} else {
$template = '';
if ( is_home() ) {
$template = get_home_template();
} elseif ( is_front_page() ) {
$template = get_front_page_template();
} elseif ( is_search() ) {
$template = get_search_template();
} elseif ( is_single() ) {
$template = get_single_template();
} elseif ( is_page() ) {
$template = get_page_template();
} elseif ( is_post_type_archive() ) {
$template = get_post_type_archive_template();
} elseif ( is_archive() ) {
$template = get_archive_template();
}
$args['utm_medium'] = wp_basename( $template, 'php' );
}
}
// Ensure we sanitize the medium and content.
$args['utm_medium'] = str_replace( '_', '-', sanitize_title( $args['utm_medium'] ) );
$args['utm_content'] = str_replace( '_', '-', sanitize_title( $args['utm_content'] ) );

View File

@ -136,8 +136,7 @@ function edd_add_manual_order( $args = array() ) {
);
// The date is entered in the WP timezone. We need to convert it to UTC prior to saving now.
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $date_string, edd_get_timezone_id(), false ) );
$date = $date->format( 'Y-m-d H:i:s' );
$date = edd_get_utc_date_string( $date_string );
// Get mode
$mode = edd_is_test_mode()

View File

@ -586,4 +586,4 @@ function edd_add_custom_roles_rest_user_query( $prepared_args, $request ) {
return $prepared_args;
}
add_filter( 'rest_user_query', 'edd_add_custom_roles_rest_user_query', 5, 2 );
add_filter( 'rest_user_query', 'edd_add_custom_roles_rest_user_query', 15, 2 );

View File

@ -163,17 +163,7 @@ function edd_process_download() {
*/
do_action( 'edd_process_download_pre_record_log', $requested_file, $args, $method );
// Record this file download in the log
$user_info = array();
$user_info['email'] = $args['email'];
if ( is_user_logged_in() ) {
$user_data = get_userdata( get_current_user_id() );
$user_info['id'] = get_current_user_id();
$user_info['name'] = $user_data->display_name;
}
edd_record_download_in_log( $args['download'], $args['file_key'], $user_info, edd_get_ip(), $args['payment'], $args['price_id'] );
edd_record_download_in_log( $args['download'], $args['file_key'], array(), edd_get_ip(), $args['payment'], $args['price_id'] );
$file_extension = edd_get_file_extension( $requested_file );
$ctype = edd_get_file_ctype( $file_extension );

View File

@ -788,7 +788,7 @@ function parse_relative_dates_for_range( $range = null, $relative_range = null,
case 'previous_month':
$dates = array(
'start' => $dates['start']->copy()->subMonth( 1 ),
'end' => $dates['end']->copy()->subMonth( 1 ),
'end' => $dates['end']->copy()->subMonthNoOverflow( 1 ),
);
break;
case 'previous_quarter':

View File

@ -514,9 +514,13 @@ function edd_localize_admin_scripts() {
'resend_receipt' => __( 'Are you sure you want to resend the purchase receipt?', 'easy-digital-downloads' ),
'disconnect_customer' => __( 'Are you sure you want to disconnect the WordPress user from this customer record?', 'easy-digital-downloads' ),
'copy_download_link_text' => __( 'Copy these links to your clipboard and give them to your customer', 'easy-digital-downloads' ),
/* translators: singular download label */
'delete_payment_download' => sprintf( __( 'Are you sure you want to delete this %s?', 'easy-digital-downloads' ), edd_get_label_singular() ),
'type_to_search' => sprintf( __( 'Type to search %s', 'easy-digital-downloads' ), edd_get_label_plural() ),
'one_option' => sprintf( __( 'Choose a %s', 'easy-digital-downloads' ), edd_get_label_singular() ),
/* translators: plural download label */
'type_to_search' => sprintf( __( 'Type to search %s', 'easy-digital-downloads' ), edd_get_label_plural() ),
/* translators: singular download label */
'one_option' => sprintf( __( 'Choose a %s', 'easy-digital-downloads' ), edd_get_label_singular() ),
/* translators: plural download label */
'one_or_more_option' => sprintf( __( 'Choose one or more %s', 'easy-digital-downloads' ), edd_get_label_plural() ),
'one_price_min' => __( 'You must have at least one price', 'easy-digital-downloads' ),
'one_field_min' => __( 'You must have at least one field', 'easy-digital-downloads' ),

View File

@ -610,8 +610,9 @@ function edd_downloads_query( $atts, $content = null ) {
<?php
else:
printf( _x( 'No %s found', 'download post type name', 'easy-digital-downloads' ), edd_get_label_plural() );
else :
/* translators: plural download label */
printf( _x( 'No %s found', 'download post type name', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) );
endif;
do_action( 'edd_downloads_list_after', $atts, $downloads, $query );
@ -984,9 +985,10 @@ function edd_process_profile_editor_remove_email( $data ) {
$url = add_query_arg( 'updated', true, $data['redirect'] );
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
$customer_note = sprintf( __( 'Email address %s removed by %s', 'easy-digital-downloads' ), sanitize_email( $data['email'] ), $user_login );
$user = wp_get_current_user();
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
/* translators: 1. email address; 2. user who removed email. */
$customer_note = sprintf( __( 'Email address %1$s removed by %2$s', 'easy-digital-downloads' ), sanitize_email( $data['email'] ), $user_login );
$customer->add_note( $customer_note );
} else {

View File

@ -60,6 +60,7 @@ function edd_get_purchase_link( $args = array() ) {
edd_set_error(
'set_checkout',
sprintf(
/* translators: the settings screen URL */
__( 'No checkout page has been configured. Visit <a href="%s">Settings</a> to set one.', 'easy-digital-downloads' ),
esc_url( edd_get_admin_url( array(
'page' => 'edd-settings',

View File

@ -0,0 +1,201 @@
<?php
/**
* General upgrade helper functions.
*
* @package easy-digital-downloads
* @subpackage Upgrades
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license GPL2+
*/
defined( 'ABSPATH' ) || exit;
/**
* Get the current database version
*
* @since 3.0
*
* @return string
*/
function edd_get_db_version() {
$db_version = get_option( 'edd_version' );
$retval = ! empty( $db_version )
? edd_format_db_version( $db_version )
: false;
return $retval;
}
/**
* Update the EDD version in the options table
*
* @since 3.0
*/
function edd_update_db_version() {
if ( defined( 'EDD_VERSION' ) ) {
update_option( 'edd_version', edd_format_db_version( EDD_VERSION ) );
}
}
/**
* Format the EDD version (going into or coming from the database.)
*
* @since 3.0
*
* @param string $version
* @return string
*/
function edd_format_db_version( $version = '' ) {
return preg_replace( '/[^0-9.].*/', '', $version );
}
/**
* Check if the upgrade routine has been run for a specific action
*
* @since 2.3
* @param string $upgrade_action The upgrade action to check completion for
* @return bool If the action has been added to the copmleted actions array
*/
function edd_has_upgrade_completed( $upgrade_action = '' ) {
// Bail if no upgrade action to check
if ( empty( $upgrade_action ) ) {
return false;
}
// Get completed upgrades
$completed_upgrades = edd_get_completed_upgrades();
// Return true if in array, false if not
return in_array( $upgrade_action, $completed_upgrades, true );
}
/**
* Adds an upgrade action to the completed upgrades array
*
* @since 2.3
* @param string $upgrade_action The action to add to the copmleted upgrades array
* @return bool If the function was successfully added
*/
function edd_set_upgrade_complete( $upgrade_action = '' ) {
if ( empty( $upgrade_action ) ) {
return false;
}
$completed_upgrades = edd_get_completed_upgrades();
$completed_upgrades[] = $upgrade_action;
// Remove any blanks, and only show uniques
$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
return update_option( 'edd_completed_upgrades', $completed_upgrades );
}
/**
* Gets the array of completed upgrade actions
*
* @since 2.3
* @return array The array of completed upgrades
*/
function edd_get_completed_upgrades() {
// Get the completed upgrades for this site
$completed_upgrades = get_option( 'edd_completed_upgrades', array() );
// Return array of completed upgrades
return (array) $completed_upgrades;
}
/**
* Defines all EDD core upgrades.
* When a new upgrade routine is added, it should be registered here.
*
* @since 3.1.4
* @return array
*/
function edd_get_all_upgrades() {
$upgrade_routines = array(
'upgrade_payment_taxes',
'upgrade_customer_payments_association',
'upgrade_user_api_keys',
'remove_refunded_sale_logs',
'update_file_download_log_data',
);
$edd_30_upgrades = edd_get_v30_upgrades();
return array_merge( $upgrade_routines, array_keys( $edd_30_upgrades ) );
}
/**
* Returns an array of upgrades for 3.0
*
* Key is the name of the upgrade, which can be used in `edd_has_upgrade_completed()` completed functions.
* The value is the name of the associated batch processor class for that upgrade.
*
* @since 3.0
* @return array
*/
function edd_get_v30_upgrades() {
return array(
'migrate_tax_rates' => array(
'name' => __( 'Tax Rates', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Tax_Rates',
),
'migrate_discounts' => array(
'name' => __( 'Discounts', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Discounts',
),
'migrate_orders' => array(
'name' => __( 'Orders', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Orders',
),
'migrate_customer_addresses' => array(
'name' => __( 'Customer Addresses', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Addresses',
),
'migrate_customer_email_addresses' => array(
'name' => __( 'Customer Email Addresses', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Email_Addresses',
),
'migrate_customer_notes' => array(
'name' => __( 'Customer Notes', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Notes',
),
'migrate_logs' => array(
'name' => __( 'Logs', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Logs',
),
'migrate_order_notes' => array(
'name' => __( 'Order Notes', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Order_Notes',
),
'v30_legacy_data_removed' => array(
'name' => __( 'Remove Legacy Data', 'easy-digital-downloads' ),
'class' => 'EDD\\Admin\\Upgrades\\v3\\Remove_Legacy_Data',
),
);
}
/**
* Perform automatic database upgrades when necessary
*
* @since 2.6
* @return void
*/
function edd_do_automatic_upgrades() {
$edd_version = edd_get_db_version();
if ( version_compare( $edd_version, EDD_VERSION, '>=' ) ) {
return;
}
// Existing stores should set the upgraded version and the onboarding wizard as complete.
if ( ! empty( $edd_version ) ) {
update_option( 'edd_version_upgraded_from', $edd_version, false );
if ( ! get_option( 'edd_onboarding_completed', false ) && ! get_option( 'edd_onboarding_started', false ) ) {
update_option( 'edd_onboarding_completed', true, false );
}
}
edd_update_db_version();
}

View File

@ -581,10 +581,13 @@ function edd_new_user_notification( $user_id = 0, $user_data = array() ) {
$emails->__set( 'from_name', $from_name );
$emails->__set( 'from_email', $from_email );
$admin_subject = apply_filters( 'edd_user_registration_admin_email_subject', sprintf( __('[%s] New User Registration', 'easy-digital-downloads' ), $from_name ), $user_data );
/* translators: Site name */
$admin_subject = apply_filters( 'edd_user_registration_admin_email_subject', sprintf( __( '[%s] New User Registration', 'easy-digital-downloads' ), $from_name ), $user_data );
$admin_heading = apply_filters( 'edd_user_registration_admin_email_heading', __( 'New user registration', 'easy-digital-downloads' ), $user_data );
$admin_message = sprintf( __( 'Username: %s', 'easy-digital-downloads'), $user_data['user_login'] ) . "\r\n\r\n";
$admin_message .= sprintf( __( 'E-mail: %s', 'easy-digital-downloads'), $user_data['user_email'] ) . "\r\n";
/* translators: the username */
$admin_message = sprintf( __( 'Username: %s', 'easy-digital-downloads' ), $user_data['user_login'] ) . "\r\n\r\n";
/* translators: the user email */
$admin_message .= sprintf( __( 'E-mail: %s', 'easy-digital-downloads' ), $user_data['user_email'] ) . "\r\n";
$admin_message = apply_filters( 'edd_user_registration_admin_email_message', $admin_message, $user_data );
@ -593,6 +596,7 @@ function edd_new_user_notification( $user_id = 0, $user_data = array() ) {
$emails->send( get_option( 'admin_email' ), $admin_subject, $admin_message );
// Setup and send the new user email for the end user.
/* translators: Site name */
$user_subject = apply_filters( 'edd_user_registration_email_subject', sprintf( __( '[%s] Your username and password', 'easy-digital-downloads' ), $from_name ), $user_data );
$user_heading = apply_filters( 'edd_user_registration_email_heading', __( 'Your account info', 'easy-digital-downloads' ), $user_data );
$user_message = apply_filters( 'edd_user_registration_email_username', sprintf( __( 'Username: %s', 'easy-digital-downloads' ), $user_data['user_login'] ) . "\r\n", $user_data );
@ -603,6 +607,7 @@ function edd_new_user_notification( $user_id = 0, $user_data = array() ) {
$password_message = __( 'Password entered at registration', 'easy-digital-downloads' );
}
/* translators: %s: password message */
$user_message .= apply_filters( 'edd_user_registration_email_password', sprintf( __( 'Password: %s', 'easy-digital-downloads' ), '[' . $password_message . ']' ) . "\r\n" );
$login_url = apply_filters( 'edd_user_registration_email_login_url', wp_login_url() );
@ -611,9 +616,8 @@ function edd_new_user_notification( $user_id = 0, $user_data = array() ) {
$user_message .= '<a href="' . esc_url( $login_url ) . '"> ' . esc_attr__( 'Click here to log in', 'easy-digital-downloads' ) . ' &rarr;</a>' . "\r\n";
} else {
/* translators: %s: login URL */
$user_message .= sprintf( __( 'To log in, visit: %s', 'easy-digital-downloads' ), esc_url( $login_url ) ) . "\r\n";
}
$user_message = apply_filters( 'edd_user_registration_email_message', $user_message, $user_data );
@ -769,6 +773,7 @@ function edd_send_user_verification_email( $user_id = 0 ) {
$subject = apply_filters( 'edd_user_verification_email_subject', __( 'Verify your account', 'easy-digital-downloads' ), $user_id );
$heading = apply_filters( 'edd_user_verification_email_heading', __( 'Verify your account', 'easy-digital-downloads' ), $user_id );
$message = sprintf(
/* translators: 1: User display name, 2: Site name, 3: Verification URL */
__( 'Hello %1$s,
Your account with %2$s needs to be verified before you can access your purchase history. <a href="%3$s">Click here</a> to verify your account.
@ -899,6 +904,7 @@ function edd_validate_user_verification_token( $url = '' ) {
do_action( 'edd_user_verification_token_expired' );
$link_text = sprintf(
/* translators: %s: URL to request a new verification link */
__( 'Sorry but your account verification link has expired. <a href="%s">Click here</a> to request a new verification URL.', 'easy-digital-downloads' ),
esc_url( edd_get_user_verification_request_url() )
);
@ -1137,7 +1143,10 @@ function edd_show_user_api_key_field( $user ) {
<tbody>
<tr>
<th>
<?php printf( __( 'Easy Digital Downloads <a href="%s">iOS App</a>', 'easy-digital-downloads' ), 'https://itunes.apple.com/us/app/easy-digital-downloads-2/id1169488828?ls=1&mt=8' ); ?>
<?php
/* translators: %s: iOS App URL */
printf( __( 'Easy Digital Downloads <a href="%s">iOS App</a>', 'easy-digital-downloads' ), 'https://itunes.apple.com/us/app/easy-digital-downloads-2/id1169488828?ls=1&mt=8' );
?>
</th>
<td>
<?php

View File

@ -112,4 +112,18 @@ final class Date extends \Carbon\Carbon {
public function getWPTimestamp() {
return $this->getTimestamp() + EDD()->utils->get_gmt_offset();
}
/**
* Converts a localized date string to UTC.
*
* @since 3.1.4
* @param $format string
* @return string
*/
public function get_utc_from_local( $format = 'Y-m-d H:i:s' ) {
$utc_timezone = new \DateTimeZone( 'utc' );
$this->setTimezone( $utc_timezone );
return $this->format( $format );
}
}

View File

@ -6,7 +6,7 @@ Tags: ecommerce, payments, sell, digital store, stripe
Requires at least: 5.4
Tested up to: 6.2
Requires PHP: 7.1
Stable Tag: 3.1.3
Stable Tag: 3.1.4
License: GNU Version 2 or Any Later Version
Sell your digital products with the #1 eCommerce plugin written for digital creators by digital creators.
@ -226,23 +226,35 @@ Yes, with an Extended Pass you get access to [Recurring Payments](https://easydi
== Changelog ==
= 3.1.3 =
* Improvement: Licensing messages for third party extensions no longer link to the main EDD site.
* Improvement: The default number of tax rates to query has been increased.
* Fix: Using a custom `straight_to_gateway` link did not add a product to the cart.
* Fix: Products which are marked as having variable prices, but which don't have any prices, could cause a PHP notice or error.
* Fix: Duplicate purchase receipt emails could be sent when editing an order.
* Fix: The product sales export was not respecting the end date when set.
* Fix: The product sales export was showing incorrect amounts for orders with multiple items, or partially refunded orders.
* Fix: For stores which collect sales tax, tax exempt fees sometimes had tax applied.
* Fix: `edd_store_discount` now accepts times for start/expiration dates.
* Fix: Users who are not also customers were unable to update their profile using the EDD profile editor.
* Fix: The pass ID for pro licenses could be incorrect in some cases.
* Fix: If EDD settings were removed, the telemetry data could cause a PHP notice.
* Fix: Prevent a JavaScript error that could occur if the cart widget was present on the checkout page when taxes are enabled.
* Dev: Third party developers who use EDD's licensing screen can now customize licensing messages.
= 3.1.4 =
* Improvement: The checkout cart markup is now aware if the cart is using the shortcode or the block.
* Improvement: A filter has been added to the structured data for products to allow extensions to add additional offers.
* Improvement: The email marker (tagging) experience has been updated to be more accessible and easier to use.
* Improvement: EDD's admin JavaScript has been updated to prevent deprecation notices.
* Improvement: It is now possible to update the sequential start number as long as it does not conflict with existing orders.
* Improvement: The current file name is now stored with the file download log.
* Improvement: The emails on the order details screen has been updated to always include the customer's primary address, even if it wasn't used on an order.
* Fix: When the "last month" had fewer days than "month to date", reporting could incorrectly cross months.
* Fix: The `edd_link_helper` function could sometimes have an empty UTM medium attribute.
* Fix: Checkbox inputs for privacy/terms are now marked required with the HTML5 attribute.
* Fix: The Recapture onbording process could inconsistently fail to install or connect.
* Fix - Stripe: Recurring products with free trials were immediately creating an invoice with Payment Elements.
* Fix - Stripe: When using Payment Elements, clicking the purchase button did not show the loading animation.
* Fix - Stripe: Stripe data will be included in the Site Health debug information with EDD 3.1.4.
* Fix - Stripe: The list of countries which do not allow application fees has been updated.
* i18n: All countries and states are now translation ready.
* i18n: We have started the process of updating strings to add comments for translators where recommended.
* Dev: Hooks have been added to the license update/delete methods.
* Dev: EDD's pointer registration has been updated so that extensions can hook into it.
* Dev: EDD now has a status badge utility class to allow order status badges to be more universally used.
* Dev: The `edd_set_upgrade_complete` function is now in a file that's loaded outside of the admin, so it can be used in cron upgrades.
* Dev: The EDD debugging information under Site Health can now be filtered so that extensions can add key data.
* Dev: Extensions which use the EDD extension registry will attempt to validate the pro pass license before the individual extension license.
* Dev: The EDD debug log description has been updated to link to a support doc explaining the `edd_debug_log` function.
* Dev: The `edd_get_utc_date_string` helper function has been created to simplify getting a formatted UTC date.
* Dev: The EDD settings have been refactored for readability.
View the full changelog at [https://easydigitaldownloads.com/changelog/](https://easydigitaldownloads.com/changelog/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_term=description)
View the full changelog at [https://easydigitaldownloads.com/changelogs/plugin/easy-digital-downloads/](https://easydigitaldownloads.com/changelogs/plugin/easy-digital-downloads/?utm_medium=readme&utm_source=wporg&utm_campaign=edd-plugin&utm_term=description)
== Upgrade Notice ==
IMPORTANT: Upgrading from Easy Digital Downloads 2.9.x to 3.0+ is a major release that includes many improvements and changes. You will be asked to perform database maintenance once installed. Please ensure you make a backup of your site prior to upgrading. Your site should remain functional during this maintenance, but as with all updates, it is best to make a backup of your site prior to updating.
IMPORTANT: Upgrading from Easy Digital Downloads 2.x to 3.0+ is a major release that includes many improvements and changes. You will be asked to perform database maintenance once installed. Please ensure you make a backup of your site prior to upgrading. Your site should remain functional during this maintenance, but as with all updates, it is best to make a backup of your site prior to updating.

View File

@ -84,6 +84,7 @@ class Extension_Manager implements SubscriberInterface {
'results' => __( 'extensions found', 'easy-digital-downloads' ),
'deactivating' => __( 'Deactivating', 'easy-digital-downloads' ),
'debug' => edd_doing_script_debug(),
'filter' => filter_input( INPUT_GET, 'filter', FILTER_SANITIZE_STRING ),
)
);
}

View File

@ -81,16 +81,17 @@ class Ajax implements SubscriberInterface {
*/
private function get_verification_response( $license_key ) {
$oth = hash( 'sha512', wp_rand() );
$endpoint = admin_url( 'admin-ajax.php' );
$redirect = edd_get_admin_url( array( 'page' => 'edd-settings' ) );
$oth = hash( 'sha512', wp_rand() );
$hashed_oth = hash_hmac( 'sha512', $oth, wp_salt() );
$endpoint = admin_url( 'admin-ajax.php' );
$redirect = edd_get_admin_url( array( 'page' => 'edd-settings' ) );
update_option( 'edd_connect_token', $oth );
$url = add_query_arg(
array(
'key' => $license_key,
'oth' => $oth,
'oth' => $hashed_oth,
'endpoint' => $endpoint,
'version' => EDD_VERSION,
'siteurl' => admin_url(),
@ -107,7 +108,7 @@ class Ajax implements SubscriberInterface {
'back_url' => add_query_arg(
array(
'action' => 'edd_connect',
'oth' => $oth,
'oth' => $hashed_oth,
),
$endpoint
),

View File

@ -180,7 +180,7 @@ class Settings implements SubscriberInterface {
sprintf(
/* translators: 1. opening link tag; do not translate; 2. closing link tag; do not translate. */
__( 'To unlock more features, consider %1$supgrading to Pro%2$s.', 'easy-digital-downloads' ),
'<strong><a href="' . $url . '">',
'<strong><a href="' . $url . '" class="edd-pro-upgrade">',
'</a></strong>'
)
);

View File

@ -0,0 +1,128 @@
<?php
/**
* Class for registering all EDD Pointers.
*
* @since 3.1.4
*/
namespace EDD\Admin;
defined( 'ABSPATH' ) || exit;
use \EDD\EventManagement\SubscriberInterface;
class Pointers implements SubscriberInterface {
public static function get_subscribed_events() {
return array(
'admin_enqueue_scripts' => 'enqueue',
);
}
/**
* Enqueue the pointer scripts if there are any pointers to show.
*
* @since 3.1.4
* @return void
*/
public function enqueue() {
$pointers = $this->get_valid_pointers();
if ( empty( $pointers ) ) {
return;
}
wp_enqueue_style( 'wp-pointer' );
wp_enqueue_script( 'edd-pointers', EDD_PLUGIN_URL . 'assets/js/edd-admin-pointers.js', array( 'wp-pointer' ), EDD_VERSION, true );
wp_localize_script(
'edd-pointers',
'eddPointers',
array(
'pointers' => $pointers,
'next_label' => __( 'Next', 'easy-digital-downloads' ),
'close_label' => __( 'Close', 'easy-digital-downloads' ),
)
);
}
/**
* Gets the dismissed_wp_pointers user meta.
*
* @since 3.1.4
* @param int $user_id THe current user ID.
* @return array
*/
private function get_user_dismissals( $user_id ) {
return explode( ',', (string) get_user_meta( $user_id, 'dismissed_wp_pointers', true ) );
}
/**
* Gets the pointers that have not been dismissed by the user.
*
* @since 3.1.4
* @return array
*/
private function get_valid_pointers() {
$pointers = $this->get_pointers();
if ( empty( $pointers ) ) {
return array();
}
$valid_pointers = array();
$dismissed = $this->get_user_dismissals( get_current_user_id() );
foreach ( $pointers as $pointer ) {
if (
empty( $pointer ) ||
empty( $pointer['pointer_id'] ) ||
empty( $pointer['target'] ) ||
empty( $pointer['options'] ) ||
in_array( $pointer['pointer_id'], $dismissed, true )
) {
continue;
}
$valid_pointers[] = $pointer;
}
return $valid_pointers;
}
/**
* Gets all EDD pointers.
*
* @since 3.1.4
* @return false|array
*/
private function get_pointers() {
if ( ! $this->can_register() ) {
return false;
}
/**
* Allows adding pointers for registration within the EDD Ecosystem.
*
* @since 3.1.1
* @param array $pointers The registered pointers for EDD to load.
*/
return apply_filters( 'edd_pointers', array() );
}
/**
* Determine whether pointers can be registered.
* Currently this just checks for excluded pages.
* Individual pointers should do their own capability checks.
*
* @since 3.1.4
* @return bool
*/
private function can_register() {
// Exclude some pages from showing our pointers so we don't interfeer with user behavior.
$excluded_pages = array(
'update-core.php',
'plugin-install.php',
);
global $pagenow;
return ! in_array( $pagenow, $excluded_pages, true );
}
}

View File

@ -107,7 +107,7 @@ class Recurring extends Extension implements SubscriberInterface {
return $sections;
}
$sections[ $this->settings_section ] = __( 'Recurring Payments', 'easy-digital-downloads' );
$sections[ $this->settings_section ] = __( 'Subscriptions', 'easy-digital-downloads' );
return $sections;
}

View File

@ -0,0 +1,89 @@
<?php
/**
* Easy Digital Downloads Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings;
defined( 'ABSPATH' ) || exit;
class Register {
/**
* The array of registered settings.
*
* @since 3.1.4
* @var array
*/
private $settings;
/**
* Get the registered settings.
*
* @since 3.1.4
* @return array
*/
public function get() {
if ( is_null( $this->settings ) ) {
$this->settings = $this->register();
}
return apply_filters( 'edd_registered_settings', $this->settings );
}
/**
* Register the settings.
*
* @since 3.1.4
* @return array
*/
private function register() {
$tabs = array(
'general' => new Tabs\General(),
'gateways' => new Tabs\Gateways(),
'emails' => new Tabs\Emails(),
'marketing' => new Tabs\Marketing(),
'taxes' => new Tabs\Taxes(),
'extensions' => new Tabs\Extensions(),
'licenses' => new Tabs\Licenses(),
'misc' => new Tabs\Misc(),
'privacy' => new Tabs\Privacy(),
);
$settings = array();
foreach ( $tabs as $key => $tab ) {
$settings[ $key ] = $tab->get();
}
if ( has_filter( 'edd_settings_styles' ) ) {
$settings['styles'] = $this->get_styles();
}
return $settings;
}
/**
* Allow registered settings to surface the deprecated "Styles" tab.
*
* @since 3.1.4
* @return array
*/
private function get_styles() {
return edd_apply_filters_deprecated(
'edd_settings_styles',
array(
array(
'main' => array(),
'buttons' => array(),
),
),
'3.0',
'edd_settings_misc'
);
}
}

View File

@ -0,0 +1,105 @@
<?php
/**
* Sanitizes settings.
*
* @since 3.1.4
* @package EDD
*/
namespace EDD\Admin\Settings;
defined( 'ABSPATH' ) || exit;
use EDD\EventManagement\SubscriberInterface;
class Sanitize implements SubscriberInterface {
/**
* Returns an array of events that this subscriber wants to listen to.
*
* @since 3.1.4
* @return array
*/
public static function get_subscribed_events() {
if ( ! current_user_can( 'manage_shop_settings' ) ) {
return array();
}
return array(
'edd_settings_gateways-accounting_sanitize' => 'sanitize_sequential_order_numbers',
);
}
/**
* Sanitizes the sequential order number starting number.
*
* @since 3.1.4
* @param array $input The input.
* @return array
*/
public function sanitize_sequential_order_numbers( $input ) {
// If no starting number was entered return the input.
if ( empty( $input['sequential_start'] ) ) {
return $input;
}
// If the next order number isn't set, return the input.
$next_order_number = get_option( 'edd_next_order_number', false );
if ( ! $next_order_number ) {
return $input;
}
// If the next order number is the same as the original, return the input.
$start = (int) $input['sequential_start'];
$original_start = (int) edd_get_option( 'sequential_start', $start );
if ( $start === $original_start ) {
return $input;
}
$can_update = true;
// If the next order number is less than the original, we need to make sure the most recent order number is not less than the new starting number.
if ( $start < (int) $next_order_number ) {
$most_recent_order_number = $this->get_most_recent_order_number();
if ( ! empty( $most_recent_order_number ) && $start < (int) $most_recent_order_number ) {
$can_update = false;
}
}
// If order number cannot be updated, return the original value and set a flag.
if ( ! $can_update ) {
$input['sequential_start'] = edd_get_option( 'sequential_start' );
edd_update_option( 'sequential_start_update_failed', true );
} else {
// Update the next order number.
update_option( 'edd_next_order_number', $start );
}
return $input;
}
/**
* Gets the most recent order number.
*
* @since 3.1.4
* @return int|bool
*/
private function get_most_recent_order_number() {
$orders = edd_get_orders(
array(
'number' => 1,
'orderby' => 'ID',
'order' => 'DESC',
'fields' => 'order_number',
)
);
if ( empty( $orders ) ) {
return false;
}
$last_order_number = reset( $orders );
$order_number = new \EDD\Orders\Number();
return $order_number->unformat( $last_order_number );
}
}

View File

@ -0,0 +1,220 @@
<?php
/**
* Easy Digital Downloads Email Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Emails extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'emails';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array(
'main' => array(
'email_header' => array(
'id' => 'email_header',
'name' => '<strong>' . __( 'Email Configuration', 'easy-digital-downloads' ) . '</strong>',
'type' => 'header',
),
'email_template' => array(
'id' => 'email_template',
'name' => __( 'Template', 'easy-digital-downloads' ),
'desc' => __( 'Choose a template. Click "Save Changes" then "Preview Purchase Receipt" to see the new template.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => edd_get_email_templates(),
),
'email_logo' => array(
'id' => 'email_logo',
'name' => __( 'Logo', 'easy-digital-downloads' ),
'desc' => __( 'Upload or choose a logo to be displayed at the top of sales receipt emails. Displayed on HTML emails only.', 'easy-digital-downloads' ),
'type' => 'upload',
),
'from_name' => array(
'id' => 'from_name',
'name' => __( 'From Name', 'easy-digital-downloads' ),
'desc' => __( 'This should be your site or shop name. Defaults to Site Title if empty.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => $this->get_site_name(),
'placeholder' => $this->get_site_name(),
),
'from_email' => array(
'id' => 'from_email',
'name' => __( 'From Email', 'easy-digital-downloads' ),
'desc' => __( 'This will act as the "from" and "reply-to" addresses.', 'easy-digital-downloads' ),
'type' => 'email',
'std' => $this->get_admin_email(),
'placeholder' => $this->get_admin_email(),
),
'email_settings' => array(
'id' => 'email_settings',
'name' => '',
'desc' => '',
'type' => 'hook',
),
),
'purchase_receipts' => array(
'purchase_receipt_email_settings' => array(
'id' => 'purchase_receipt_email_settings',
'name' => '',
'desc' => '',
'type' => 'hook',
),
'purchase_subject' => array(
'id' => 'purchase_subject',
'name' => __( 'Purchase Email Subject', 'easy-digital-downloads' ),
'desc' => __( 'Enter the subject line for the purchase receipt email.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Purchase Receipt', 'easy-digital-downloads' ),
),
'purchase_heading' => array(
'id' => 'purchase_heading',
'name' => __( 'Purchase Email Heading', 'easy-digital-downloads' ),
'desc' => __( 'Enter the heading for the purchase receipt email.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Purchase Receipt', 'easy-digital-downloads' ),
),
'purchase_receipt' => array(
'id' => 'purchase_receipt',
'name' => __( 'Purchase Receipt', 'easy-digital-downloads' ),
'desc' => __( 'Text to email customers after completing a purchase. Personalize with HTML and <code>{tag}</code> markers.', 'easy-digital-downloads' ) . '<br/><br/>' . edd_get_emails_tags_list(),
'type' => 'rich_editor',
'std' => __( 'Dear', 'easy-digital-downloads' ) . " {name},\n\n" . __( 'Thank you for your purchase. Please click on the link(s) below to download your files.', 'easy-digital-downloads' ) . "\n\n{download_list}\n\n{sitename}",
),
),
'sale_notifications' => array(
'sale_notification_subject' => array(
'id' => 'sale_notification_subject',
'name' => __( 'Sale Notification Subject', 'easy-digital-downloads' ),
'desc' => __( 'Enter the subject line for the sale notification email.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => 'New download purchase - Order #{payment_id}',
),
'sale_notification_heading' => array(
'id' => 'sale_notification_heading',
'name' => __( 'Sale Notification Heading', 'easy-digital-downloads' ),
'desc' => __( 'Enter the heading for the sale notification email.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'New Sale!', 'easy-digital-downloads' ),
),
'sale_notification' => array(
'id' => 'sale_notification',
'name' => __( 'Sale Notification', 'easy-digital-downloads' ),
'desc' => __( 'Text to email as a notification for every completed purchase. Personalize with HTML and <code>{tag}</code> markers.', 'easy-digital-downloads' ) . '<br/><br/>' . edd_get_emails_tags_list(),
'type' => 'rich_editor',
'std' => edd_get_default_sale_notification_email(),
),
'admin_notice_emails' => array(
'id' => 'admin_notice_emails',
'name' => __( 'Sale Notification Emails', 'easy-digital-downloads' ),
'desc' => __( 'Enter the email address(es) that should receive a notification anytime a sale is made. One per line.', 'easy-digital-downloads' ),
'type' => 'textarea',
'std' => $this->get_admin_email(),
),
'disable_admin_notices' => array(
'id' => 'disable_admin_notices',
'name' => __( 'Disable Admin Notifications', 'easy-digital-downloads' ),
'desc' => __( 'Check this box if you do not want to receive sales notification emails.', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
),
'email_summaries' => $this->get_email_summaries(),
);
}
/**
* Gets the email summaries settings.
*
* @since 3.1.4
* @return array
*/
private function get_email_summaries() {
$email_summary_recipient = edd_get_option( 'email_summary_recipient', 'admin' );
$email_summary_trigger_url = wp_nonce_url(
edd_get_admin_url(
array(
'page' => 'edd-settings',
'tab' => 'emails',
'section' => 'email_summaries',
'edd_action' => 'trigger_email_summary',
)
),
'edd_trigger_email_summary'
);
$email_summary_schedule = wp_next_scheduled( \EDD_Email_Summary_Cron::CRON_EVENT_NAME );
$email_summary_schedule_text = '<span><span class="dashicons dashicons-warning"></span> ' . esc_html( __( 'The summary email is not yet scheduled. Save the settings to manually schedule it.', 'easy-digital-downloads' ) ) . '</span>';
if ( $email_summary_schedule ) {
$email_summary_schedule_date = \Carbon\Carbon::createFromTimestamp( $email_summary_schedule )->setTimezone( edd_get_timezone_id() );
/* Translators: formatted date */
$email_summary_schedule_text = sprintf( __( 'The next summary email is scheduled to send on %s.', 'easy-digital-downloads' ), $email_summary_schedule_date->format( get_option( 'date_format' ) ) );
}
return array(
'email_summary_frequency' => array(
'id' => 'email_summary_frequency',
'name' => __( 'Email Frequency', 'easy-digital-downloads' ),
'type' => 'select',
'std' => 'weekly',
'desc' => $email_summary_schedule_text,
'options' => array(
'weekly' => __( 'Weekly', 'easy-digital-downloads' ),
'monthly' => __( 'Monthly', 'easy-digital-downloads' ),
),
),
'email_summary_recipient' => array(
'id' => 'email_summary_recipient',
'name' => __( 'Email Recipient', 'easy-digital-downloads' ),
'type' => 'select',
'std' => 'admin',
'options' => array(
/* Translators: email */
'admin' => sprintf( __( 'Administrator: %s', 'easy-digital-downloads' ), $this->get_admin_email() ),
'custom' => __( 'Custom Recipients', 'easy-digital-downloads' ),
),
),
'email_summary_custom_recipients' => array(
'id' => 'email_summary_custom_recipients',
'class' => ( 'admin' === $email_summary_recipient ) ? 'hidden' : '',
'name' => __( 'Custom Recipients', 'easy-digital-downloads' ),
'desc' => __( 'Enter the email address(es) that should receive Email Summaries. One per line.', 'easy-digital-downloads' ),
'type' => 'textarea',
),
'email_summary_buttons' => array(
'id' => 'email_summary_buttons',
'name' => '',
'desc' => '
<a href="' . esc_url( $email_summary_trigger_url ) . '" class="button" id="edd-send-test-summary">' . esc_html( __( 'Send Test Email', 'easy-digital-downloads' ) ) . '</a>
<div id="edd-send-test-summary-save-changes-notice"></div>
<div id="edd-send-test-summary-notice"></div>
',
'type' => 'descriptive_text',
),
'disable_email_summary' => array(
'id' => 'disable_email_summary',
'name' => __( 'Disable Email Summary', 'easy-digital-downloads' ),
'desc' => '<a target="_blank" href="https://easydigitaldownloads.com/docs/email-settings/#summaries">' . __( 'Learn more about Email Summaries.', 'easy-digital-downloads' ) . '</a>',
'check' => __( 'Check this box to disable Email Summaries.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
);
}
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Extensions tab.
*
* @package easy-digital-downlaods
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Extensions extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'extensions';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array();
}
}

View File

@ -0,0 +1,324 @@
<?php
/**
* Easy Digital Downloads Gateway Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Gateways extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'gateways';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
$gateways = edd_get_payment_gateways();
return array(
'main' => array(
'test_mode' => $this->get_test_mode(),
'gateways' => array(
'id' => 'gateways',
'name' => __( 'Active Gateways', 'easy-digital-downloads' ),
'desc' => __( 'Choose the payment gateways you want to enable.', 'easy-digital-downloads' ),
'type' => 'gateways',
'options' => $gateways,
),
'default_gateway' => array(
'id' => 'default_gateway',
'name' => __( 'Default Gateway', 'easy-digital-downloads' ),
'desc' => __( 'Choose the gateway your checkout will use by default.<br />If you choose Automatic, the first enabled gateway from the Active Gateways will be used.', 'easy-digital-downloads' ),
'type' => 'gateway_select',
'options' => $gateways,
),
'accepted_cards' => array(
'id' => 'accepted_cards',
'name' => __( 'Payment Method Icons', 'easy-digital-downloads' ),
'desc' => __( 'Display icons for the selected payment methods.', 'easy-digital-downloads' ) . '<br/>' . __( 'You will also need to configure your gateway settings if you are accepting credit cards.', 'easy-digital-downloads' ),
'type' => 'payment_icons',
'options' => apply_filters(
'edd_accepted_payment_icons',
array(
'mastercard' => 'Mastercard',
'visa' => 'Visa',
'americanexpress' => 'American Express',
'discover' => 'Discover',
'paypal' => 'PayPal',
)
),
),
),
'checkout' => array(
'enforce_ssl' => array(
'id' => 'enforce_ssl',
'name' => __( 'Enforce SSL on Checkout', 'easy-digital-downloads' ),
'check' => __( 'Enforced', 'easy-digital-downloads' ),
'desc' => __( 'Redirect all customers to the secure checkout page. You must have an SSL certificate installed to use this option.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'redirect_on_add' => array(
'id' => 'redirect_on_add',
'name' => __( 'Redirect to Checkout', 'easy-digital-downloads' ),
'desc' => __( 'Immediately redirect to checkout after adding an item to the cart?', 'easy-digital-downloads' ),
'type' => 'checkbox',
'tooltip_title' => __( 'Redirect to Checkout', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'When enabled, once an item has been added to the cart, the customer will be redirected directly to your checkout page. This is useful for stores that sell single items.', 'easy-digital-downloads' ),
),
'logged_in_only' => array(
'id' => 'logged_in_only',
'name' => __( 'Require Login', 'easy-digital-downloads' ),
'desc' => __( 'Require that users be logged-in to purchase files.', 'easy-digital-downloads' ),
'type' => 'checkbox',
'tooltip_title' => __( 'Require Login', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'You can require that customers create and login to user accounts prior to purchasing from your store by enabling this option. When unchecked, users can purchase without being logged in by using their name and email address.', 'easy-digital-downloads' ),
),
'show_register_form' => array(
'id' => 'show_register_form',
'name' => __( 'Show Register / Login Form', 'easy-digital-downloads' ),
'desc' => __( 'Display the registration and login forms on the checkout page for non-logged-in users.', 'easy-digital-downloads' ),
'type' => 'select',
'std' => 'none',
'options' => array(
'both' => __( 'Registration and Login Forms', 'easy-digital-downloads' ),
'registration' => __( 'Registration Form Only', 'easy-digital-downloads' ),
'login' => __( 'Login Form Only', 'easy-digital-downloads' ),
'none' => __( 'None', 'easy-digital-downloads' ),
),
),
'enable_cart_saving' => array(
'id' => 'enable_cart_saving',
'name' => __( 'Enable Cart Saving', 'easy-digital-downloads' ),
'desc' => __( 'Check this to enable cart saving on the checkout.', 'easy-digital-downloads' ),
'type' => 'checkbox',
'tooltip_title' => __( 'Cart Saving', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Cart saving allows shoppers to create a temporary link to their current shopping cart so they can come back to it later, or share it with someone.', 'easy-digital-downloads' ),
),
'moderation_settings' => array(
'id' => 'moderation_settings',
'name' => '<h3>' . __( 'Moderation', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Moderation', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'It is sometimes necessary to temporarily prevent certain potential customers from checking out. Use these settings to control who can make purchases.', 'easy-digital-downloads' ),
),
'banned_emails' => array(
'id' => 'banned_emails',
'name' => __( 'Banned Emails', 'easy-digital-downloads' ),
'desc' => __( 'Emails placed in the box above will not be allowed to make purchases.', 'easy-digital-downloads' ) . '<br>' . __( 'One per line, enter: email addresses, domains (<code>@example.com</code>), or TLDs (<code>.gov</code>).', 'easy-digital-downloads' ),
'type' => 'textarea',
'placeholder' => __( '@example.com', 'easy-digital-downloads' ),
),
),
'refunds' => array(
'refunds_settings' => array(
'id' => 'refunds_settings',
'name' => '<h3>' . __( 'Refunds', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Refunds', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'As a shop owner, sometimes refunds are necessary. Use these settings to decide how refunds will work in your shop.', 'easy-digital-downloads' ),
),
'refundability' => array(
'id' => 'refundability',
'name' => __( 'Default Status', 'easy-digital-downloads' ),
'desc' => __( 'This will be the store default. It can be changed at a per-product level.', 'easy-digital-downloads' ),
'type' => 'select',
'std' => 'refundable',
'options' => edd_get_refundability_types(),
),
'refund_window' => array(
'id' => 'refund_window',
'name' => __( 'Refund Window', 'easy-digital-downloads' ),
'desc' => __( 'Number of days (after a sale) when refunds can be processed.<br>Default is <code>30</code> days. Set to <code>0</code> for infinity. It can be changed at a per-product level.', 'easy-digital-downloads' ),
'std' => 30,
'type' => 'number',
'size' => 'small',
'max' => 3650, // Ten year maximum, because why explicitly support longer
'min' => 0,
'step' => 1,
),
),
'accounting' => $this->get_accounting_settings(),
);
}
/**
* Get the test mode setting.
*
* @since 3.1.4
* @return array
*/
private function get_test_mode() {
$test_mode = array(
'id' => 'test_mode',
'name' => __( 'Test Mode', 'easy-digital-downloads' ),
'check' => __( 'Enabled', 'easy-digital-downloads' ),
'desc' => __( 'While test mode is enabled, no live transactions are processed.<br>Use test mode in conjunction with the sandbox/test account for the payment gateways to test.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
);
// If test_mode is being forced to true, alter the setting so it cannot be modified.
if ( ! edd_is_test_mode_forced() ) {
return $test_mode;
}
return array_merge(
array(
'options' => array(
'disabled' => true,
'readonly' => true,
),
'tooltip_title' => __( 'Forced Test Mode', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'You currently cannot modify the Test Mode setting, as the \'EDD_TEST_MODE\' constant has been defined as \'true\' or the edd_is_test_mode filter is being forced to \'true\'.', 'easy-digital-downloads' ),
),
$test_mode
);
}
/**
* Gets the accounting settings.
*
* @since 3.1.4
* @return array
*/
private function get_accounting_settings() {
$settings = array(
'enable_skus' => array(
'id' => 'enable_skus',
'name' => __( 'Enable SKU Entry', 'easy-digital-downloads' ),
'check' => __( 'Check this box to allow entry of product SKUs.', 'easy-digital-downloads' ),
'desc' => __( 'SKUs will be shown on purchase receipt and exported purchase histories.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'enable_sequential' => array(
'id' => 'enable_sequential',
'name' => __( 'Enable Sequental Numbering', 'easy-digital-downloads' ),
'check' => __( 'Check this box to enable sequential order numbers.', 'easy-digital-downloads' ),
'desc' => __( 'Does not impact previous orders. Future orders will be sequential.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'sequential_start' => $this->get_sequential_start(),
'sequential_prefix' => array(
'id' => 'sequential_prefix',
'name' => __( 'Sequential Number Prefix', 'easy-digital-downloads' ),
'desc' => __( 'A prefix to prepend to all sequential order numbers.', 'easy-digital-downloads' ),
'type' => 'text',
),
'sequential_postfix' => array(
'id' => 'sequential_postfix',
'name' => __( 'Sequential Number Postfix', 'easy-digital-downloads' ),
'desc' => __( 'A postfix to append to all sequential order numbers.', 'easy-digital-downloads' ),
'type' => 'text',
),
);
if ( ! defined( 'EDD_SON_VERSION' ) ) {
$settings['sequential_help'] = array(
'id' => 'sequential_help',
'name' => __( 'Advanced Order Numbers', 'easy-digital-downloads' ),
'desc' => $this->get_sequential_help_text(),
'type' => 'descriptive_text',
);
}
return $settings;
}
/**
* Gets the sequential starting number setting.
*
* @since 3.1.4
* @return array
*/
private function get_sequential_start() {
$setting = array(
'id' => 'sequential_start',
'name' => __( 'Sequential Starting Number', 'easy-digital-downloads' ),
'desc' => __( 'The number at which the sequence should begin.', 'easy-digital-downloads' ),
'type' => 'number',
'size' => 'small',
'std' => 1,
);
if ( (bool) get_option( 'edd_next_order_number' ) ) {
$order_number = new \EDD\Orders\Number();
$setting['desc'] = __( 'Once sequential order numbering is active, the starting number cannot be updated to an order number that\'s smaller than the highest order number. Update this with care.', 'easy-digital-downloads' ) .
'<br />' .
sprintf(
/* translators: %s: next order number, wrapped in code tags */
__( 'The next order number will be %s.', 'easy-digital-downloads' ),
'<code>' . $order_number->format( get_option( 'edd_next_order_number' ) ) . '</code>'
);
}
return $setting;
}
/**
* Gets the sequential help text.
*
* @since 3.1.4
* @return string
*/
private function get_sequential_help_text() {
$text = __( 'Gain access to even more control over your order numbering!', 'easy-digital-downloads' );
$benefits = array(
__( 'Track free orders in a separate sequential series', 'easy-digital-downloads' ),
__( 'Assign temporary numbers to incomplete orders', 'easy-digital-downloads' ),
__( 'Abandoned orders do not interrupt the complete order series', 'easy-digital-downloads' ),
);
$text .= '<ul class="edd-settings__list--disc">';
foreach ( $benefits as $benefit ) {
$text .= '<li>' . $benefit . '</li>';
}
$text .= '</ul>';
if ( ! edd_is_pro() ) {
$url = edd_link_helper(
'https://easydigitaldownloads.com/lite-upgrade/',
array(
'utm_medium' => 'accounting-settings',
'utm_content' => 'upgrade-to-pro',
)
);
$text .= sprintf( '<a href="%s" target="_blank" class="edd-pro-upgrade">' . __( 'Upgrade to Pro', 'easy-digital-downloads' ) . '</a>', $url );
} else {
$text .= sprintf(
/* translators: %1$s: opening anchor tag, %2$s: closing anchor tag */
__( 'Access %1$sAdvanced Sequential Order Numbers%2$s today.', 'easy-digital-downloads' ),
'<a href="' . esc_url(
edd_get_admin_url(
array(
'page' => 'edd-addons',
'filter' => 'sequential',
)
)
) . '">',
'</a>'
);
}
return $text;
}
}

View File

@ -0,0 +1,250 @@
<?php
/**
* Easy Digital Downloads General Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class General extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'general';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
$pages = edd_get_pages();
return array(
'main' => array(
'business_settings' => array(
'id' => 'business_settings',
'name' => '<h3>' . __( 'Business Info', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Business Information', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Easy Digital Downloads uses the following business information for things like pre-populating tax fields, and connecting third-party services with the same information.', 'easy-digital-downloads' ),
),
'entity_name' => array(
'id' => 'entity_name',
'name' => __( 'Business Name', 'easy-digital-downloads' ),
'desc' => __( 'The official (legal) name of your store. Defaults to Site Title if empty.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => $this->get_site_name(),
'placeholder' => $this->get_site_name(),
),
'entity_type' => array(
'id' => 'entity_type',
'name' => __( 'Business Type', 'easy-digital-downloads' ),
'desc' => __( 'Choose "Individual" if you do not have an official/legal business ID, or "Company" if a registered business entity exists.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => array(
'individual' => esc_html__( 'Individual', 'easy-digital-downloads' ),
'company' => esc_html__( 'Company', 'easy-digital-downloads' ),
),
),
'business_address' => array(
'id' => 'business_address',
'name' => __( 'Business Address', 'easy-digital-downloads' ),
'type' => 'text',
'placeholder' => '',
),
'business_address_2' => array(
'id' => 'business_address_2',
'name' => __( 'Business Address (Extra)', 'easy-digital-downloads' ),
'type' => 'text',
'placeholder' => '',
),
'business_city' => array(
'id' => 'business_city',
'name' => __( 'Business City', 'easy-digital-downloads' ),
'type' => 'text',
'placeholder' => '',
),
'business_postal_code' => array(
'id' => 'business_postal_code',
'name' => __( 'Business Postal Code', 'easy-digital-downloads' ),
'type' => 'text',
'size' => 'medium',
'placeholder' => '',
),
'base_country' => array(
'id' => 'base_country',
'name' => __( 'Business Country', 'easy-digital-downloads' ),
'type' => 'select',
'options' => edd_get_country_list(),
'chosen' => true,
'field_class' => 'edd_countries_filter',
'placeholder' => __( 'Select a country', 'easy-digital-downloads' ),
'data' => array(
'nonce' => wp_create_nonce( 'edd-country-field-nonce' ),
),
),
'base_state' => array(
'id' => 'base_state',
'name' => __( 'Business Region', 'easy-digital-downloads' ),
'type' => 'shop_states',
'chosen' => true,
'field_class' => 'edd_regions_filter',
'placeholder' => __( 'Select a region', 'easy-digital-downloads' ),
),
),
'pages' => array(
'page_settings' => array(
'id' => 'page_settings',
'name' => '<h3>' . __( 'Pages', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Page Settings', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Easy Digital Downloads uses the pages below for handling the display of checkout, purchase confirmation, purchase history, and purchase failures. If pages are deleted or removed in some way, they can be recreated manually from the Pages menu. When re-creating the pages, enter the shortcode shown in the page content area.', 'easy-digital-downloads' ),
),
'purchase_page' => array(
'id' => 'purchase_page',
'name' => __( 'Primary Checkout Page', 'easy-digital-downloads' ),
'desc' => __( 'This is the checkout page where buyers will complete their purchases.<br>The <code>[download_checkout]</code> shortcode must be on this page.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => $pages,
'chosen' => true,
'placeholder' => __( 'Select a page', 'easy-digital-downloads' ),
),
'success_page' => array(
'id' => 'success_page',
'name' => __( 'Success Page', 'easy-digital-downloads' ),
'desc' => __( 'This is the page buyers are sent to after completing their purchases.<br>The <code>[edd_receipt]</code> shortcode should be on this page.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => $pages,
'chosen' => true,
'placeholder' => __( 'Select a page', 'easy-digital-downloads' ),
),
'failure_page' => array(
'id' => 'failure_page',
'name' => __( 'Failed Transaction Page', 'easy-digital-downloads' ),
'desc' => __( 'This is the page buyers are sent to if their transaction is cancelled or fails.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => $pages,
'chosen' => true,
'placeholder' => __( 'Select a page', 'easy-digital-downloads' ),
),
'purchase_history_page' => array(
'id' => 'purchase_history_page',
'name' => __( 'Purchase History Page', 'easy-digital-downloads' ),
'desc' => __( 'This page shows a complete purchase history for the current user, including download links.<br>The <code>[purchase_history]</code> shortcode should be on this page.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => $pages,
'chosen' => true,
'placeholder' => __( 'Select a page', 'easy-digital-downloads' ),
),
'login_redirect_page' => array(
'id' => 'login_redirect_page',
'name' => __( 'Login Redirect Page', 'easy-digital-downloads' ),
'desc' => sprintf(
/* translators: %s: home URL */
__( 'If a customer logs in using the <code>[edd_login]</code> shortcode, this is the page they will be redirected to.<br>Note: override using the redirect shortcode attribute: <code>[edd_login redirect="%s"]</code>.', 'easy-digital-downloads' ),
trailingslashit( home_url() )
),
'type' => 'select',
'options' => $pages,
'chosen' => true,
'placeholder' => __( 'Select a page', 'easy-digital-downloads' ),
),
),
'currency' => array(
'currency_settings' => array(
'id' => 'currency_settings',
'name' => '<h3>' . __( 'Currency', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Currency Settings', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Different countries use different formatting for their currency. You will want to pick what most of your users will expect to use.', 'easy-digital-downloads' ),
),
'currency' => array(
'id' => 'currency',
'name' => __( 'Currency', 'easy-digital-downloads' ),
'desc' => __( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'easy-digital-downloads' ),
'type' => 'select',
'chosen' => true,
'options' => edd_get_currencies(),
),
'currency_position' => array(
'id' => 'currency_position',
'name' => __( 'Currency Position', 'easy-digital-downloads' ),
'desc' => __( 'Choose the location of the currency sign.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => array(
'before' => __( 'Before ($10)', 'easy-digital-downloads' ),
'after' => __( 'After (10$)', 'easy-digital-downloads' ),
),
),
'thousands_separator' => array(
'id' => 'thousands_separator',
'name' => __( 'Thousandths Separator', 'easy-digital-downloads' ),
'desc' => __( 'The symbol to separate thousandths. Usually <code>,</code> or <code>.</code>.', 'easy-digital-downloads' ),
'type' => 'text',
'size' => 'small',
'field_class' => 'code',
'std' => ',',
'placeholder' => ',',
),
'decimal_separator' => array(
'id' => 'decimal_separator',
'name' => __( 'Decimal Separator', 'easy-digital-downloads' ),
'desc' => __( 'The symbol to separate decimal points. Usually <code>,</code> or <code>.</code>.', 'easy-digital-downloads' ),
'type' => 'text',
'size' => 'small',
'field_class' => 'code',
'std' => '.',
'placeholder' => '.',
),
),
'api' => array(
'api_settings' => array(
'id' => 'api_settings',
'name' => '<h3>' . __( 'API', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'API Settings', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'The Easy Digital Downloads REST API provides access to store data through our API endpoints. Enable this setting if you would like all user accounts to be able to generate their own API keys.', 'easy-digital-downloads' ),
),
'api_allow_user_keys' => array(
'id' => 'api_allow_user_keys',
'name' => __( 'Allow User Keys', 'easy-digital-downloads' ),
'check' => __( 'Check this box to allow all users to generate API keys.', 'easy-digital-downloads' ),
'desc' => __( 'Users who can <code>manage_shop_settings</code> are always allowed to generate keys.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'api_help' => array(
'id' => 'api_help',
'desc' => sprintf(
/* translators: %s: API documentation URL */
__( 'Visit the <a href="%s" target="_blank">REST API documentation</a> for further information.', 'easy-digital-downloads' ),
edd_link_helper(
'https://easydigitaldownloads.com/categories/docs/api-reference/',
array(
'utm_medium' => 'settings',
'utm_content' => 'api-documentation',
)
)
),
'type' => 'descriptive_text',
),
),
);
}
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Licenses tab.
*
* @package easy-digital-downlaods
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Licenses extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'licenses';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array();
}
}

View File

@ -0,0 +1,49 @@
<?php
/**
* Easy Digital Downloads Marketing Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Marketing extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'marketing';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array(
'main' => array(
'recapture' => array(
'id' => 'recapture',
'name' => __( 'Abandoned Cart Recovery', 'easy-digital-downloads' ),
'desc' => '',
'type' => 'recapture',
),
'allow_multiple_discounts' => array(
'id' => 'allow_multiple_discounts',
'name' => __( 'Multiple Discounts', 'easy-digital-downloads' ),
'desc' => __( 'Allow customers to use multiple discounts on the same purchase?', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
),
);
}
}

View File

@ -0,0 +1,212 @@
<?php
/**
* Easy Digital Downloads Miscellaneous Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Misc extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'misc';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array(
'main' => array(
'debug_mode' => array(
'id' => 'debug_mode',
'name' => __( 'Debug Mode', 'easy-digital-downloads' ),
'check' => __( 'Enabled', 'easy-digital-downloads' ),
'desc' => __( 'Check this box to enable Debug Mode.', 'easy-digital-downloads' ) . ' ' . $this->get_debug_log_link(),
'type' => 'checkbox_description',
),
'disable_styles' => array(
'id' => 'disable_styles',
'name' => __( 'Disable Styles', 'easy-digital-downloads' ),
'check' => __( 'Check this box to disable all included styling.', 'easy-digital-downloads' ),
'desc' => __( 'This includes buttons, checkout fields, product pages, and all other elements', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
'tooltip_title' => __( 'Disabling Styles', 'easy-digital-downloads' ),
'tooltip_desc' => __( "If your theme has a complete custom CSS file for Easy Digital Downloads, you may wish to disable our default styles. This is not recommended unless you're sure your theme has a complete custom CSS.", 'easy-digital-downloads' ),
),
'item_quantities' => array(
'id' => 'item_quantities',
'name' => __( 'Cart Item Quantities', 'easy-digital-downloads' ),
/* translators: %s is the plural label for downloads */
'desc' => sprintf( __( 'Allow quantities to be adjusted when adding %s to the cart, and while viewing the checkout cart.', 'easy-digital-downloads' ), edd_get_label_plural( true ) ),
'type' => 'checkbox',
),
'uninstall_on_delete' => array(
'id' => 'uninstall_on_delete',
'name' => __( 'Remove Data on Uninstall', 'easy-digital-downloads' ),
'desc' => __( 'Check this box if you would like EDD to completely remove all of its data when the plugin is deleted.', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
),
'button_text' => array(
'button_style' => array(
'id' => 'button_style',
'name' => __( 'Default Button Style', 'easy-digital-downloads' ),
'desc' => __( 'Choose the style you want to use for the buttons.', 'easy-digital-downloads' ),
'type' => 'select',
'options' => edd_get_button_styles(),
),
'checkout_color' => array(
'id' => 'checkout_color',
'name' => __( 'Default Button Color', 'easy-digital-downloads' ),
'desc' => __( 'Choose the color you want to use for the buttons.', 'easy-digital-downloads' ),
'type' => 'color_select',
'options' => edd_get_button_colors(),
'std' => 'blue',
),
'checkout_label' => array(
'id' => 'checkout_label',
'name' => __( 'Complete Purchase Text', 'easy-digital-downloads' ),
'desc' => __( 'The button label for completing a purchase.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Purchase', 'easy-digital-downloads' ),
),
'free_checkout_label' => array(
'id' => 'free_checkout_label',
'name' => __( 'Complete Free Purchase Text', 'easy-digital-downloads' ),
'desc' => __( 'The button label for completing a free purchase.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Free Download', 'easy-digital-downloads' ),
),
'add_to_cart_text' => array(
'id' => 'add_to_cart_text',
'name' => __( 'Add to Cart Text', 'easy-digital-downloads' ),
'desc' => __( 'Text shown on the Add to Cart Buttons.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Add to Cart', 'easy-digital-downloads' ),
),
'checkout_button_text' => array(
'id' => 'checkout_button_text',
'name' => __( 'Checkout Button Text', 'easy-digital-downloads' ),
'desc' => __( 'Text shown on the Add to Cart Button when the product is already in the cart.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => _x( 'Checkout', 'text shown on the Add to Cart Button when the product is already in the cart', 'easy-digital-downloads' ),
),
'buy_now_text' => $this->get_buy_now_text(),
),
'file_downloads' => array(
'require_login_to_download' => array(
'id' => 'require_login_to_download',
'name' => __( 'Require Login', 'easy-digital-downloads' ),
'desc' => __( 'Require a user to login before file download links deliver the file.', 'easy-digital-downloads' ),
'tooltip_title' => __( 'Require Login', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Download links expire after the link expiration setting, but you can restrict file downloads to only logged in users. Note: This may affect links from purchase receipts and customers if you have guest checkout enabled.', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
'download_method' => array(
'id' => 'download_method',
'name' => __( 'Download Method', 'easy-digital-downloads' ),
'desc' => sprintf( __( 'Select the file download method. Note, not all methods work on all servers.', 'easy-digital-downloads' ), edd_get_label_singular() ),
'type' => 'select',
'tooltip_title' => __( 'Download Method', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Due to its consistency in multiple platforms and better file protection, \'forced\' is the default method. Because Easy Digital Downloads uses PHP to process the file with the \'forced\' method, larger files can cause problems with delivery, resulting in hitting the \'max execution time\' of the server. If users are getting 404 or 403 errors when trying to access their purchased files when using the \'forced\' method, changing to the \'redirect\' method can help resolve this.', 'easy-digital-downloads' ),
'options' => array(
'direct' => __( 'Forced', 'easy-digital-downloads' ),
'redirect' => __( 'Redirect', 'easy-digital-downloads' ),
),
),
'symlink_file_downloads' => array(
'id' => 'symlink_file_downloads',
'name' => __( 'Symbolically Link Files', 'easy-digital-downloads' ),
'desc' => __( 'Check this if you are delivering really large files or having problems with file downloads completing.', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
'file_download_limit' => array(
'id' => 'file_download_limit',
'name' => __( 'File Download Limit', 'easy-digital-downloads' ),
/* translators: %s is the singular label for a download */
'desc' => sprintf( __( 'The maximum number of times files can be downloaded for purchases. Can be overwritten for each %s.', 'easy-digital-downloads' ), edd_get_label_singular() ),
'type' => 'number',
'size' => 'small',
'tooltip_title' => __( 'File Download Limits', 'easy-digital-downloads' ),
/* translators: %s is the singular label for a download */
'tooltip_desc' => sprintf( __( 'Set the global default for the number of times a customer can download items they purchase. Using a value of 0 is unlimited. This can be defined on a %s-specific level as well. Download limits can also be reset for an individual purchase.', 'easy-digital-downloads' ), edd_get_label_singular( true ) ),
),
'download_link_expiration' => array(
'id' => 'download_link_expiration',
'name' => __( 'Download Link Expiration', 'easy-digital-downloads' ),
'desc' => __( 'How long should download links be valid for? Default is 24 hours from the time they are generated. Enter a time in hours.', 'easy-digital-downloads' ),
'tooltip_title' => __( 'Download Link Expiration', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'When a customer receives a link to their downloads via email, in their receipt, or in their purchase history, the link will only be valid for the timeframe (in hours) defined in this setting. Sending a new purchase receipt or visiting the account page will re-generate a valid link for the customer.', 'easy-digital-downloads' ),
'type' => 'number',
'size' => 'small',
'std' => '24',
'min' => '0',
),
'disable_redownload' => array(
'id' => 'disable_redownload',
'name' => __( 'Disable Redownload', 'easy-digital-downloads' ),
'desc' => __( 'Check this if you do not want to allow users to redownload items from their purchase history.', 'easy-digital-downloads' ),
'type' => 'checkbox',
),
),
);
}
/**
* Gets the buy now text setting.
*
* @since 3.1.4
* @return array
*/
private function get_buy_now_text() {
$text = array(
'id' => 'buy_now_text',
'name' => __( 'Buy Now Text', 'easy-digital-downloads' ),
'desc' => __( 'Text shown on the Buy Now Buttons.', 'easy-digital-downloads' ),
'type' => 'text',
'std' => __( 'Buy Now', 'easy-digital-downloads' ),
);
if ( edd_shop_supports_buy_now() ) {
return $text;
}
$text['disabled'] = true;
$text['tooltip_title'] = __( 'Buy Now Disabled', 'easy-digital-downloads' );
$text['tooltip_desc'] = __( 'Buy Now buttons are only available for stores that have a single supported gateway active and that do not use taxes.', 'easy-digital-downloads' );
return $text;
}
/**
* Gets the link for the debug log.
*
* @since 3.1.4
* @return string
*/
private function get_debug_log_link() {
$debug_log_url = edd_get_admin_url(
array(
'page' => 'edd-tools',
'tab' => 'debug_log',
)
);
return '<a href="' . esc_url( $debug_log_url ) . '">' . __( 'View the Log', 'easy-digital-downloads' ) . '</a>';
}
}

View File

@ -0,0 +1,187 @@
<?php
/**
* Easy Digital Downloads Privacy Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Privacy extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected $id = 'privacy';
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array(
'main' => array(
'' => array(
'id' => 'privacy_settings',
'name' => '<h3>' . __( 'Privacy Policy', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Privacy Policy Settings', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Depending on legal and regulatory requirements, it may be necessary for your site to show a checkbox for agreement to a privacy policy.', 'easy-digital-downloads' ),
),
'show_agree_to_privacy_policy' => array(
'id' => 'show_agree_to_privacy_policy',
'name' => __( 'Agreement', 'easy-digital-downloads' ),
'check' => __( 'Check this box to show an "Agree to Privacy Policy" checkbox on checkout.', 'easy-digital-downloads' ),
'desc' => __( 'Customers must agree to your privacy policy before purchasing.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'agree_privacy_label' => array(
'id' => 'privacy_agree_label',
'name' => __( 'Agreement Label', 'easy-digital-downloads' ),
'desc' => __( 'Label for the "Agree to Privacy Policy" checkbox.', 'easy-digital-downloads' ),
'type' => 'text',
'placeholder' => __( 'I agree to the privacy policy', 'easy-digital-downloads' ),
'size' => 'regular',
),
'show_privacy_policy_on_checkout' => array(
'id' => 'show_privacy_policy_on_checkout',
'name' => __( 'Privacy Policy on Checkout', 'easy-digital-downloads' ),
'check' => __( 'Display the entire Privacy Policy at checkout.', 'easy-digital-downloads' ) . ' <a href="' . esc_url( admin_url( 'options-privacy.php' ) ) . '">' . __( 'Set your Privacy Policy here', 'easy-digital-downloads' ) . '</a>.',
'desc' =>
__( 'Display your Privacy Policy on checkout.', 'easy-digital-downloads' ) . ' <a href="' . esc_url( admin_url( 'options-privacy.php' ) ) . '">' . __( 'Set your Privacy Policy here', 'easy-digital-downloads' ) . '</a>.' .
/* translators: %1$s: Opening anchor tag, %2$s: Closing anchor tag. */
'<p>' . sprintf( __( 'Need help creating a Privacy Policy? We recommend %1$sTermageddon%2$s.', 'easy-digital-downloads' ), '<a href="https://termageddon.com/i/easy-digital-downloads-edd-termageddon-promotion/" target="_blank" rel="noopener noreferrer">', '</a>' ) . '</p>',
'type' => 'checkbox',
),
),
'site_terms' => array(
'' => array(
'id' => 'terms_settings',
'name' => '<h3>' . __( 'Terms & Agreements', 'easy-digital-downloads' ) . '</h3>',
'desc' => '',
'type' => 'header',
'tooltip_title' => __( 'Terms & Agreements Settings', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'Depending on legal and regulatory requirements, it may be necessary for your site to show checkbox for agreement to terms.', 'easy-digital-downloads' ),
),
'show_agree_to_terms' => array(
'id' => 'show_agree_to_terms',
'name' => __( 'Agreement', 'easy-digital-downloads' ),
'check' => __( 'Check this box to show an "Agree to Terms" checkbox on checkout.', 'easy-digital-downloads' ),
'desc' =>
__( 'Check this to show an agree to terms on checkout that users must agree to before purchasing.', 'easy-digital-downloads' ) .
'<p>' .
sprintf(
/* translators: 1: Opening anchor tag, 2: Closing anchor tag. */
__( 'Need help creating a Terms of Agreement? We recommend using %1$sTermageddon%2$s.', 'easy-digital-downloads' ),
'<a href="https://termageddon.com/i/easy-digital-downloads-edd-termageddon-promotion/" target="_blank" rel="noopener noreferrer">',
'</a>'
) .
'</p>',
'type' => 'checkbox_description',
),
'agree_label' => array(
'id' => 'agree_label',
'name' => __( 'Agreement Label', 'easy-digital-downloads' ),
'desc' => __( 'Label for the "Agree to Terms" checkbox.', 'easy-digital-downloads' ),
'placeholder' => __( 'I agree to the terms', 'easy-digital-downloads' ),
'type' => 'text',
'size' => 'regular',
),
'agree_text' => array(
'id' => 'agree_text',
'name' => __( 'Agreement Text', 'easy-digital-downloads' ),
'type' => 'rich_editor',
),
),
'export_erase' => $this->get_export_erase(),
);
}
/**
* Get the export and erase settings.
*
* @since 3.1.4
* @return array
*/
private function get_export_erase() {
$export_erase = array(
array(
'id' => 'payment_privacy_status_action_header',
'name' => '<h3>' . __( 'Order Statuses', 'easy-digital-downloads' ) . '</h3>',
'type' => 'header',
'desc' => __( 'When a user requests to be anonymized or removed from a site, these are the actions that will be taken on payments associated with their customer, by status.', 'easy-digital-downloads' ),
'tooltip_title' => __( 'What settings should I use?', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'By default, Easy Digital Downloads sets suggested actions based on the Payment Status. These are purely recommendations, and you may need to change them to suit your store\'s needs. If you are unsure, you can safely leave these settings as is.', 'easy-digital-downloads' ),
),
array(
'id' => 'payment_privacy_status_action_text',
'name' => __( 'Rules', 'easy-digital-downloads' ),
'type' => 'descriptive_text',
'desc' => __( 'When a user wants their order history anonymized or removed, the following rules will be used:', 'easy-digital-downloads' ),
),
);
$options = array(
'none' => __( 'Do Nothing', 'easy-digital-downloads' ),
'anonymize' => __( 'Anonymize', 'easy-digital-downloads' ),
'delete' => __( 'Delete', 'easy-digital-downloads' ),
);
$payment_statuses = edd_get_payment_statuses();
// Add Privacy settings for statuses
foreach ( $payment_statuses as $status => $label ) {
$export_erase[] = array(
'id' => "payment_privacy_status_action_{$status}",
'name' => $label,
'desc' => '',
'type' => 'select',
'std' => $this->get_action( $status ),
'options' => $options,
);
}
return $export_erase;
}
/**
* Get the default action to take for a given status.
*
* @since 3.1.4
* @param string $status The status to get the action for.
* @return string
*/
private function get_action( $status ) {
switch ( $status ) {
case 'complete':
case 'refunded':
case 'revoked':
$action = 'anonymize';
break;
case 'failed':
case 'abandoned':
$action = 'delete';
break;
case 'pending':
case 'processing':
default:
$action = 'none';
break;
}
return $action;
}
}

View File

@ -0,0 +1,81 @@
<?php
/**
* Easy Digital Downloads Settings Tabs
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
abstract class Tab {
/**
* The ID for this tab.
*
* @since 3.1.4
* @var string
*/
protected $id;
/**
* Get the settings for this tab.
*
* @since 3.1.4
* @return array
*/
public function get() {
return apply_filters( 'edd_settings_' . $this->get_id(), $this->register() );
}
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected function get_id() {
try {
if ( empty( $this->id ) ) {
// translators: %s: Tab class name.
throw new \Exception( sprintf( __( 'The %s settings class is missing the required ID property.', 'easy-digital-downloads' ), get_class( $this ) ) );
}
} catch ( \Exception $e ) {
wp_die( esc_html( $e->getMessage() ) );
}
return $this->id;
}
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
abstract protected function register();
/**
* Gets the site name.
*
* @since 3.1.4
* @return string
*/
protected function get_site_name() {
return get_bloginfo( 'name' );
}
/**
* Gets the admin email address.
*
* @since 3.1.4
* @return string
*/
protected function get_admin_email() {
return get_bloginfo( 'admin_email' );
}
}

View File

@ -0,0 +1,126 @@
<?php
/**
* Easy Digital Downloads Taxes Settings
*
* @package EDD
* @subpackage Settings
* @copyright Copyright (c) 2023, Easy Digital Downloads
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.1.4
*/
namespace EDD\Admin\Settings\Tabs;
defined( 'ABSPATH' ) || exit;
class Taxes extends Tab {
/**
* Get the ID for this tab.
*
* @since 3.1.4
* @return string
*/
protected function get_id() {
return 'taxes';
}
/**
* Register the settings for this tab.
*
* @since 3.1.4
* @return array
*/
protected function register() {
return array(
'main' => array(
'enable_taxes' => array(
'id' => 'enable_taxes',
'name' => __( 'Taxes', 'easy-digital-downloads' ),
'check' => __( 'Enabled', 'easy-digital-downloads' ),
'desc' => __( 'Check this to enable taxes on purchases.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
'tooltip_title' => __( 'Enabling Taxes', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'With taxes enabled, customers will be taxed based on the rates you define, and are required to input their address on checkout so rates can be calculated accordingly.', 'easy-digital-downloads' ),
),
'tax_help' => array(
'id' => 'tax_help',
'name' => '',
/* translators: %s - tax setup documentation URL. */
'desc' => sprintf( __( 'Visit the <a href="%s" target="_blank">Tax setup documentation</a> for further information. <p class="description">If you need VAT support, there are options listed on the documentation page.</p>', 'easy-digital-downloads' ), 'https://easydigitaldownloads.com/docs/tax-settings/' ),
'type' => 'descriptive_text',
),
'prices_include_tax' => array(
'id' => 'prices_include_tax',
'name' => __( 'Prices Include Tax', 'easy-digital-downloads' ),
'desc' => __( 'This option affects how you enter prices.', 'easy-digital-downloads' ),
'type' => 'radio',
'std' => 'no',
'options' => array(
'yes' => __( 'Yes, I will enter prices inclusive of tax', 'easy-digital-downloads' ),
'no' => __( 'No, I will enter prices exclusive of tax', 'easy-digital-downloads' ),
),
'tooltip_title' => __( 'Prices Inclusive of Tax', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'When using prices inclusive of tax, you will be entering your prices as the total amount you want a customer to pay for the download, including tax. Easy Digital Downloads will calculate the proper amount to tax the customer for the defined total price.', 'easy-digital-downloads' ),
),
'display_tax_rate' => array(
'id' => 'display_tax_rate',
'name' => __( 'Show Tax Rate on Prices', 'easy-digital-downloads' ),
'check' => __( 'Show', 'easy-digital-downloads' ),
'desc' => __( 'Some countries require a notice that product prices include tax.', 'easy-digital-downloads' ),
'type' => 'checkbox_description',
),
'checkout_include_tax' => array(
'id' => 'checkout_include_tax',
'name' => __( 'Show in Checkout', 'easy-digital-downloads' ),
'desc' => __( 'Should prices on the checkout page be shown with or without tax?', 'easy-digital-downloads' ),
'type' => 'select',
'std' => 'no',
'options' => array(
'yes' => __( 'Including tax', 'easy-digital-downloads' ),
'no' => __( 'Excluding tax', 'easy-digital-downloads' ),
),
'tooltip_title' => __( 'Taxes Displayed for Products on Checkout', 'easy-digital-downloads' ),
'tooltip_desc' => __( 'This option will determine whether the product price displays with or without tax on checkout.', 'easy-digital-downloads' ),
),
),
'rates' => $this->get_rates(),
);
}
/**
* Get the tax rates settings.
*
* @since 3.1.4
* @return array
*/
private function get_rates() {
$rates = array(
'tax_rates' => array(
'id' => 'tax_rates',
'name' => '<strong>' . __( 'Regional Rates', 'easy-digital-downloads' ) . '</strong>',
'desc' => __( 'Configure rates for each region you wish to collect sales tax in.', 'easy-digital-downloads' ),
'type' => 'tax_rates',
),
);
if ( false === edd_get_option( 'tax_rate' ) ) {
return $rates;
}
// Show a disabled "Default Rate" in "Tax Rates" if the value is not 0.
return array_merge(
array(
'tax_rate' => array(
'id' => 'tax_rate',
'type' => 'tax_rate',
'name' => __( 'Default Rate', 'easy-digital-downloads' ),
'desc' => (
'<div class="notice inline notice-error"><p>' . __( 'This setting is no longer used in this version of Easy Digital Downloads. We have migrated any fallback tax rates for you to verify below. Click "Save Changes" to dismiss this notice.', 'easy-digital-downloads' ) . '</p></div>'
),
),
),
$rates
);
}
}

View File

@ -94,6 +94,7 @@ class Direct extends Test {
$result['description'] = wpautop(
sprintf(
/* translators: %1$s - opening <code> tag, %2$s - closing <code> tag */
__( 'Your checkout page is configured; however, it is currently using the legacy %1$s[download_checkout]%2$s shortcode. We recommend changing your checkout to use the EDD Checkout Block.', 'easy-digital-downloads' ),
'<code>',
'</code>'

View File

@ -50,7 +50,16 @@ class Information implements \EDD\EventManagement\SubscriberInterface {
* @return array
*/
public function get_data( $information ) {
return array_merge( $information, $this->get_edd_data() );
}
/**
* Gets all of the EDD data for the Site Health.
*
* @since 3.1.4
* @return array
*/
private function get_edd_data() {
$collectors = array(
'edd_general' => new General(),
'edd_tables' => new Tables(),
@ -61,10 +70,17 @@ class Information implements \EDD\EventManagement\SubscriberInterface {
'edd_sessions' => new Sessions(),
);
$information = array();
foreach ( $collectors as $key => $class ) {
$information[ $key ] = $class->get();
}
return $information;
/**
* Allow extensions to add their own debug information that's specific to EDD.
*
* @since 3.1.4
* @param array $information The debug information.
*/
return apply_filters( 'edd_debug_information', $information );
}
}

View File

@ -51,6 +51,8 @@ class Core extends EventManagement\Subscribers {
new Licensing\Ajax(),
new Admin\SiteHealth\Tests(),
new Admin\SiteHealth\Information(),
new Admin\Pointers(),
new Admin\Settings\Sanitize(),
);
}

View File

@ -99,16 +99,9 @@ class Handler {
$this->item_name = $_item_name;
$this->item_shortname = $this->get_shortname();
$this->version = $_version;
$this->edd_license = new License( $this->item_name, $_optname );
$this->pass_manager = new Pass_Manager();
if ( empty( $this->edd_license->key ) || empty( $this->edd_license->license ) ) {
$pro_license = new License( 'pro' );
if ( ! empty( $pro_license->key ) && $this->is_included_in_pass() ) {
$this->is_pro_license = true;
$this->edd_license = $pro_license;
}
}
$this->license_key = $this->edd_license->key;
$this->edd_license = $this->get_license( $_optname );
$this->license_key = $this->edd_license->key;
$this->hooks();
$this->update_global();
@ -384,6 +377,10 @@ class Handler {
return false;
}
if ( ! edd_is_admin_page() ) {
return false;
}
// Not a pro license, but valid.
if ( ! $this->is_pro_license && $this->is_license_valid() ) {
return false;
@ -395,10 +392,28 @@ class Handler {
}
// It's the licenses tab.
if ( ! empty( $_GET['tab'] ) && 'licenses' === $_GET['tab'] ) {
if ( ! empty( $_GET['tab'] ) && 'licenses' === $_GET['tab'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return false;
}
return true;
}
/**
* Gets the license object.
* The pro license is preferred; the individual extension license is used as a fallback.
*
* @since 3.1.4
* @param null|string $option_name The custom option name for the license key.
* @return \EDD\Licensing\License
*/
private function get_license( $option_name ) {
$pro_license = new License( 'pro' );
if ( ! empty( $pro_license->key ) && $this->is_included_in_pass() ) {
$this->is_pro_license = true;
return $pro_license;
}
return new License( $this->item_name, $option_name );
}
}

Some files were not shown because too many files have changed in this diff Show More