Easy Digital Downloads - Version 2.6.12

Version Description

Download this release

Release Info

Developer cklosows
Plugin Icon 128x128 Easy Digital Downloads
Version 2.6.12
Comparing to
See all releases

Code changes from version 2.6.11 to 2.6.12

assets/js/admin-scripts.js CHANGED
@@ -213,12 +213,15 @@ jQuery(document).ready(function ($) {
213
 
214
  prices : function() {
215
  $( document.body ).on( 'change', '#edd_variable_pricing', function(e) {
216
- var checked = $(this).is(':checked');
217
- var target = $( '.edd_pricing_fields,.edd_repeatable_table .pricing' );
 
218
  if ( checked ) {
219
- target.show();
 
220
  } else {
221
- target.hide();
 
222
  }
223
  });
224
  },
213
 
214
  prices : function() {
215
  $( document.body ).on( 'change', '#edd_variable_pricing', function(e) {
216
+ var checked = $(this).is(':checked');
217
+ var single = $( '#edd_regular_price_field' );
218
+ var variable = $( '#edd_variable_price_fields,.edd_repeatable_table .pricing' );
219
  if ( checked ) {
220
+ single.hide();
221
+ variable.show();
222
  } else {
223
+ single.show();
224
+ variable.hide();
225
  }
226
  });
227
  },
assets/js/admin-scripts.min.js CHANGED
@@ -1,2 +1,2 @@
1
- jQuery(document).ready(function(a){a(".edd-help-tip").tooltip({content:function(){return a(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}});var b={init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices()},clone_repeatable:function(b){var c=highest=1;return b.parent().find("tr.edd_repeatable_row").each(function(){var b=a(this).data("key");parseInt(b)>highest&&(highest=b)}),c=highest+=1,clone=b.clone(),clone.find("select").each(function(){a(this).val(b.find('select[name="'+a(this).attr("name")+'"]').val())}),clone.removeClass("edd_add_blank"),clone.attr("data-key",c),clone.find("td input, td select, textarea").val(""),clone.find("input, select, textarea").each(function(){var b=a(this).attr("name"),d=a(this).attr("id");b&&(b=b.replace(/\[(\d+)\]/,"["+parseInt(c)+"]"),a(this).attr("name",b)),a(this).attr("data-key",c),"undefined"!=typeof d&&(d=d.replace(/(\d+)/,parseInt(c)),a(this).attr("id",d))}),clone.find("span.edd_price_id").each(function(){a(this).text(parseInt(c))}),clone.find("span.edd_file_id").each(function(){a(this).text(parseInt(c))}),clone.find(".edd_repeatable_default_input").each(function(){a(this).val(parseInt(c)).removeAttr("checked")}),clone.find(".search-choice").remove(),clone.find(".chosen-container").remove(),clone},add:function(){a(document.body).on("click",".submit .edd_add_repeatable",function(c){c.preventDefault();var d=a(this),e=d.parent().parent().prev("tr"),f=b.clone_repeatable(e);f.insertAfter(e).find("input, textarea, select").filter(":visible").eq(0).focus(),f.find(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),f.find(".edd-select-chosen").css("width","100%"),f.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)})},move:function(){a(".edd_repeatable_table tbody").sortable({handle:".edd_draghandle",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var b=0;a(this).find("tr").each(function(){a(this).find("input.edd_repeatable_index").each(function(){a(this).val(b)}),b++})}})},remove:function(){a(document.body).on("click",".edd_remove_repeatable",function(b){b.preventDefault();var g,h,i,c=a(this).parent().parent("tr"),d=c.parent().find("tr").length-1,e=a(this).data("type"),f="tr.edd_repeatable_"+e+"s";if(g=a(this).is(".ui-sortable tr:first-child .edd_remove_repeatable:first-child")?c.next("tr"):c.prev("tr"),h=g.find("select, input, textarea, button").filter(":visible"),i=h.eq(0),"price"===e){var j=c.data("key");a('.edd_repeatable_condition_field option[value="'+j+'"]').remove()}if(d>1)a("input, select",c).val(""),c.fadeOut("fast").remove(),i.focus();else switch(e){case"price":alert(edd_vars.one_price_min);break;case"file":a("input, select",c).val("");break;default:alert(edd_vars.one_field_min)}a(f).each(function(b){a(this).find("input, select").each(function(){var c=a(this).attr("name");c=c.replace(/\[(\d+)\]/,"["+b+"]"),a(this).attr("name",c).attr("id",c)})})})},type:function(){a(document.body).on("change","#_edd_product_type",function(b){var c=a("#edd_products"),d=a("#edd_download_files"),e=a("#edd_download_limit_wrap");"bundle"===a(this).val()?(c.show(),d.hide(),e.hide()):(c.hide(),d.show(),e.show())})},prices:function(){a(document.body).on("change","#edd_variable_pricing",function(b){var c=a(this).is(":checked"),d=a(".edd_pricing_fields,.edd_repeatable_table .pricing");c?d.show():d.hide()})},files:function(){if("undefined"==typeof wp||"1"!==edd_vars.new_media_ui)a(".edd_upload_file_button").length>0&&(window.formfield="",a(document.body).on("click",".edd_upload_file_button",function(b){if(b.preventDefault(),window.formfield=a(this).parent().prev(),window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3),null!=edd_vars.post_id)var c="post_id="+edd_vars.post_id+"&";tb_show(edd_vars.add_new_download,"media-upload.php?"+c+"TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(b){window.formfield?(imgurl=a("a","<div>"+b+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(b),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1});else{var c;window.formfield="",a(document.body).on("click",".edd_upload_file_button",function(d){d.preventDefault();var e=a(this);return window.formfield=a(this).closest(".edd_repeatable_upload_wrapper"),c?void c.open():(c=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:e.data("uploader-title"),button:{text:e.data("uploader-button-text")},multiple:"0"==a(this).data("multiple")?!1:!0}),c.on("menu:render:default",function(a){var b={};a.unset("library-separator"),a.unset("gallery"),a.unset("featured-image"),a.unset("embed"),a.set(b)}),c.on("insert",function(){var a=c.state().get("selection");a.each(function(a,c){if(a=a.toJSON(),0===c)window.formfield.find(".edd_repeatable_attachment_id_field").val(a.id),window.formfield.find(".edd_repeatable_upload_field").val(a.url),window.formfield.find(".edd_repeatable_name_field").val(a.title);else{var d=window.formfield,e=b.clone_repeatable(d);e.find(".edd_repeatable_attachment_id_field").val(a.id),e.find(".edd_repeatable_upload_field").val(a.url),a.title.length>0?e.find(".edd_repeatable_name_field").val(a.title):e.find(".edd_repeatable_name_field").val(a.filename),e.insertAfter(d)}})}),void c.open())});var c;window.formfield=""}},updatePrices:function(){a("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var b=a(this).parents("tr").data("key"),c=a(this).val(),d=a(".edd_repeatable_condition_field option[value="+b+"]");d.length>0?d.text(c):a(".edd_repeatable_condition_field").append(a("<option></option>").attr("value",b).text(c))})}};b.init();var c=a(".edd_datepicker");if(c.length>0){var d="mm/dd/yy";c.datepicker({dateFormat:d})}var e={init:function(){this.edit_address(),this.remove_download(),this.add_download(),this.new_customer(),this.recalculate_total(),this.variable_prices_check(),this.add_note(),this.remove_note(),this.resend_receipt(),this.copy_download_link()},edit_address:function(){a('select[name="edd-payment-address[0][country]"]').change(function(){var b=a(this);return data={action:"edd_get_shop_states",country:b.val(),field_name:"edd-payment-address[0][state]"},a.post(ajaxurl,data,function(b){var c=a("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");a("#edd-order-address-state-wrap .chosen-container").remove(),"nostates"==b?c.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>'):c.replaceWith(b)}),!1})},remove_download:function(){a("#edd-purchased-files").on("click",".edd-order-remove-download",function(){var b=a(document.body).find("#edd-purchased-files > .row").length;if(1===b)return alert(edd_vars.one_download_min),!1;if(confirm(edd_vars.delete_payment_download)){var c=a(this).data("key"),e=(a(".edd-payment-id").val(),a('input[name="edd-payment-details-downloads['+c+'][id]"]').val()),f=a('input[name="edd-payment-details-downloads['+c+'][price_id]"]').val(),g=a('input[name="edd-payment-details-downloads['+c+'][quantity]"]').val(),h=a('input[name="edd-payment-details-downloads['+c+'][amount]"]').val();if(a('input[name="edd-payment-details-downloads['+c+'][fees]"]'))var i=a.parseJSON(a('input[name="edd-payment-details-downloads['+c+'][fees]"]').val());var j=a('input[name="edd-payment-removed"]').val();j=a.parseJSON(j),j.length<1&&(j={});var k=[{id:e,price_id:f,quantity:g,amount:h,cart_index:c}];j[c]=k,a('input[name="edd-payment-removed"]').val(JSON.stringify(j)),a(this).parent().parent().parent().remove(),i&&i.length&&a.each(i,function(b,c){a('*li[data-fee-id="'+c+'"]').remove()}),a("#edd-payment-downloads-changed").val(1),a(".edd-order-payment-recalc-totals").show()}return!1})},new_customer:function(){a("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(b){b.preventDefault();var c=a(this).hasClass("edd-payment-new-customer"),d=a(this).hasClass("edd-payment-new-customer-cancel");c?(a(".customer-info").hide(),a(".new-customer").show()):d&&(a(".customer-info").show(),a(".new-customer").hide());var c=a("#edd-new-customer");a(".new-customer").is(":visible")?c.val(1):c.val(0)})},add_download:function(){a("#edd-purchased-files").on("click","#edd-order-add-download",function(b){b.preventDefault();var c=a("#edd_order_download_select"),d=a("#edd-order-download-quantity"),e=a("#edd-order-download-amount"),f=a(".edd_price_options_select option:selected"),g=c.val(),h=c.find(":selected").text(),i=d.val(),j=e.val(),k=f.val(),l=f.text();if(1>g)return!1;if(j||(j=0),j=parseFloat(j),isNaN(j))return alert(edd_vars.numeric_item_price),!1;var m=j;if("1"===edd_vars.quantities_enabled){if(isNaN(parseInt(i)))return alert(edd_vars.numeric_quantity),!1;j*=i}j=j.toFixed(edd_vars.currency_decimals);var n=j+edd_vars.currency_sign;"before"===edd_vars.currency_pos&&(n=edd_vars.currency_sign+j),l&&(h=h+" - "+l);var o=a("#edd-purchased-files div.row").length,p=a("#edd-purchased-files div.row:last").clone();p.find(".download span").html('<a href="post.php?post='+g+'&action=edit"></a>'),p.find(".download span a").text(h),p.find(".price-text").text(n),p.find(".item-quantity").text(i),p.find(".item-price").text(edd_vars.currency_sign+(j/i).toFixed(edd_vars.currency_decimals)),p.find("input.edd-payment-details-download-id").val(g),p.find("input.edd-payment-details-download-price-id").val(k),p.find("input.edd-payment-details-download-item-price").val(m),p.find("input.edd-payment-details-download-amount").val(j),p.find("input.edd-payment-details-download-quantity").val(i),p.find("input.edd-payment-details-download-has-log").val(0),p.find("input").each(function(){var b=a(this).attr("name");b=b.replace(/\[(\d+)\]/,"["+parseInt(o)+"]"),a(this).attr("name",b).attr("id",b)}),a("#edd-payment-downloads-changed").val(1),a(p).insertAfter("#edd-purchased-files div.row:last"),a(".edd-order-payment-recalc-totals").show()})},recalculate_total:function(){a("#edd-order-recalc-total").on("click",function(b){b.preventDefault();var c=0,d=a("#edd-purchased-files .row .edd-payment-details-download-amount");d.length&&d.each(function(){c+=parseFloat(a(this).val())}),a(".edd-payment-fees").length&&a(".edd-payment-fees span.fee-amount").each(function(){c+=parseFloat(a(this).data("fee"))}),a("input[name=edd-payment-total]").val(c.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){a("#edd-purchased-files").on("change","select#edd_order_download_select",function(){var b=a(this),c=b.val();if(parseInt(c)>0){var d={action:"edd_check_for_download_price_variations",download_id:c};a.ajax({type:"POST",data:d,url:ajaxurl,success:function(c){a(".edd_price_options_select").remove(),a(c).insertAfter(b.next())}}).fail(function(a){window.console&&window.console.log&&console.log(a)})}})},add_note:function(){a("#edd-add-payment-note").on("click",function(b){b.preventDefault();var c={action:"edd_insert_payment_note",payment_id:a(this).data("payment-id"),note:a("#edd-payment-note").val()};if(c.note)a.ajax({type:"POST",data:c,url:ajaxurl,success:function(b){a("#edd-payment-notes-inner").append(b),a(".edd-no-payment-notes").hide(),a("#edd-payment-note").val("")}}).fail(function(a){window.console&&window.console.log&&console.log(a)});else{var d=a("#edd-payment-note").css("border-color");a("#edd-payment-note").css("border-color","red"),setTimeout(function(){a("#edd-payment-note").css("border-color",d)},500)}})},remove_note:function(){a(document.body).on("click",".edd-delete-payment-note",function(b){if(b.preventDefault(),confirm(edd_vars.delete_payment_note)){var c={action:"edd_delete_payment_note",payment_id:a(this).data("payment-id"),note_id:a(this).data("note-id")};return a.ajax({type:"POST",data:c,url:ajaxurl,success:function(b){return a("#edd-payment-note-"+c.note_id).remove(),a(".edd-payment-note").length||a(".edd-no-payment-notes").show(),!1}}).fail(function(a){window.console&&window.console.log&&console.log(a)}),!0}})},resend_receipt:function(){var b=a(".edd-order-resend-receipt-addresses");a(document.body).on("click","#edd-select-receipt-email",function(a){a.preventDefault(),b.slideDown()}),a(document.body).on("change",".edd-order-resend-receipt-email",function(){var b=a("#edd-select-receipt-email").prop("href")+"&email="+a(this).val();confirm(edd_vars.resend_receipt)&&(window.location=b)}),a(document.body).on("click","#edd-resend-receipt",function(a){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){a(document.body).on("click",".edd-copy-download-link",function(b){b.preventDefault();var c=a(this),d={action:"edd_get_file_download_link",payment_id:a('input[name="edd_payment_id"]').val(),download_id:c.data("download-id"),price_id:c.data("price-id")};a.ajax({type:"POST",data:d,url:ajaxurl,success:function(b){return a("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+b+"</textarea>"),a("#edd-download-link-textarea").focus().select(),!1}}).fail(function(a){window.console&&window.console.log&&console.log(a)})})}};e.init();var f={init:function(){this.type_select(),this.product_requirements()},type_select:function(){a("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){var b=a(this).val();a(".edd-amount-description").hide(),a(".edd-amount-description."+b+"-discount").show()})},product_requirements:function(){a("#products").change(function(){var b=a("#edd-discount-product-conditions");a(this).val()?b.show():b.hide()})}};f.init();var g={init:function(){this.date_options(),this.customers_export()},date_options:function(){a("#edd-graphs-date-options").change(function(){var b=a(this),c=a("#edd-date-range-options");"other"===b.val()?c.show():c.hide()})},customers_export:function(){a("#edd_customer_export_download").change(function(){var b=a(this),c=a("option:selected",b).val(),d=a("#edd_customer_export_option");if("0"===b.val()?d.show():d.hide(),0!=parseInt(c)){var e={action:"edd_check_for_download_price_variations",download_id:c,all_prices:!0},f=a(".edd_price_options_select");a.post(ajaxurl,e,function(b){f.remove(),a("#edd_customer_export_download_chosen").after(b)})}else f.remove()})}};g.init();var h={init:function(){this.general(),this.taxes(),this.emails(),this.misc()},general:function(){var b=a(".edd-color-picker");if(b.length&&b.wpColorPicker(),"undefined"==typeof wp||"1"!==edd_vars.new_media_ui){var c=a(".edd_settings_upload_button");c.length>0&&(window.formfield="",a(document.body).on("click",c,function(b){b.preventDefault(),window.formfield=a(this).parent().prev(),window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3),tb_show(edd_vars.add_new_download,"media-upload.php?TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(b){window.formfield?(imgurl=a("a","<div>"+b+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(b),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1})}else{var d;window.formfield="",a(document.body).on("click",".edd_settings_upload_button",function(b){b.preventDefault();var c=a(this);return window.formfield=a(this).parent().prev(),d?void d.open():(d=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:c.data("uploader_title"),button:{text:c.data("uploader_button_text")},multiple:!1}),d.on("menu:render:default",function(a){var b={};a.unset("library-separator"),a.unset("gallery"),a.unset("featured-image"),a.unset("embed"),a.set(b)}),d.on("insert",function(){var a=d.state().get("selection");a.each(function(a,b){a=a.toJSON(),window.formfield.val(a.url)})}),void d.open())});var d;window.formfield=""}},taxes:function(){var b=a("select.edd-no-states");b.length&&b.closest("tr").hide(),a('select[name="edd_settings[base_country]"]').change(function(){var b=a(this),c=b.closest("tr");return data={action:"edd_get_shop_states",country:a(this).val(),field_name:"edd_settings[base_state]"},a.post(ajaxurl,data,function(a){"nostates"==a?c.next().hide():(c.next().show(),c.next().find("select").replaceWith(a))}),!1}),a(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var b=a(this);return data={action:"edd_get_shop_states",country:a(this).val(),field_name:b.attr("name").replace("country","state")},a.post(ajaxurl,data,function(a){if("nostates"==a){var c='<input type="text" name="'+data.field_name+'" value=""/>';b.parent().next().find("select").replaceWith(c)}else b.parent().next().find("input,select").show(),b.parent().next().find("input,select").replaceWith(a)}),!1}),a("#edd_add_tax_rate").on("click",function(){var b=a("#edd_tax_rates tr:last"),c=b.clone(),d=b.parent().find("tr").length;return c.find("td input").not(":input[type=checkbox]").val(""),c.find('td [type="checkbox"]').attr("checked",!1),c.find("input, select").each(function(){var b=a(this).attr("name");b=b.replace(/\[(\d+)\]/,"["+parseInt(d)+"]"),a(this).attr("name",b).attr("id",b)}),c.find("label").each(function(){var b=a(this).attr("for");b=b.replace(/\[(\d+)\]/,"["+parseInt(d)+"]"),a(this).attr("for",b)}),c.insertAfter(b),!1}),a(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){if(confirm(edd_vars.delete_tax_rate)){var b=a("#edd_tax_rates tr:visible"),c=b.length;2===c?(a("#edd_tax_rates select").val(""),a('#edd_tax_rates input[type="text"]').val(""),a('#edd_tax_rates input[type="number"]').val(""),a('#edd_tax_rates input[type="checkbox"]').attr("checked",!1)):a(this).closest("tr").remove(),a("#edd_tax_rates tr").each(function(b){a(this).children().find("input, select").each(function(){var c=a(this).attr("name");c=c.replace(/\[(\d+)\]/,"["+(b-1)+"]"),a(this).attr("name",c).attr("id",c)})})}return!1})},emails:function(){var b=a("#email-preview-wrap");if(b.length){var c=a("#email-preview");b.colorbox({inline:!0,href:c,width:"80%",height:"auto"})}},misc:function(){var b=a('select[name="edd_settings[download_method]"]'),c=b.parent().parent().next();"direct"==b.val()&&(c.hide(),c.find("input").prop("checked",!1)),b.on("change",function(){"direct"==a(this).val()?(c.hide(),c.find("input").prop("checked",!1)):c.show()})}};h.init(),a(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){return confirm(edd_vars.delete_payment)?!0:!1}),a("#the-list").on("click",".editinline",function(){var b=a(this).closest("tr").attr("id");b=b.replace("post-","");var c=a("#post-"+b),d=c.find(".column-price .downloadprice-"+b).val();d!=a("#post-"+b+".column-price .downloadprice-"+b).val()?a(".regprice","#edd-download-data").val(d).attr("disabled",!1):a(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}),a(document.body).on("click","#bulk_edit",function(){var b=a("#bulk-edit"),c=new Array;b.find("#bulk-titles").children().each(function(){c.push(a(this).attr("id").replace(/^(ttle)/i,""))});var d=a('#edd-download-data input[name="_edd_regprice"]').val(),e={action:"edd_save_bulk_edit",edd_bulk_nonce:c,post_ids:c,price:d};a.post(ajaxurl,e)}),a(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),a(".edd-select-chosen .chosen-search input").each(function(){var b=a(this).parent().parent().parent().prev("select.edd-select-chosen").data("search-type"),c="";if("download"===b)c=edd_vars.search_placeholder;else{var b="search_placeholder_"+b;edd_vars[b]&&(c=edd_vars[b])}a(this).attr("placeholder",c)}),a(".chosen-choices").on("click",function(){a(this).children("li").children("input").attr("placeholder",edd_vars.type_to_search)});var i,j=342;a(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(b){var c=a(this).val(),d=a(this).closest(".edd-select-chosen"),e=d.attr("id").replace("_chosen",""),f=d.hasClass("no-bundles"),g=d.hasClass("variations"),h=b.which,k="edd_download_search";if(d.prev().data("search-type")){if("no_ajax"==d.prev().data("search-type"))return;k="edd_"+d.prev().data("search-type")+"_search"}c.length<=3&&"edd_download_search"==k||16==h||13==h||91==h||17==h||37==h||38==h||39==h||40==h||(clearTimeout(i),i=setTimeout(function(){a.ajax({type:"GET",url:ajaxurl,data:{action:k,s:c,no_bundles:f,variations:g},dataType:"json",beforeSend:function(){a("ul.chosen-results").empty()},success:function(b){a("#"+e+" option:not(:selected)").remove(),a.each(b,function(b,c){a("#"+e+' option[value="'+c.id+'"]').length||a("#"+e).prepend('<option value="'+c.id+'">'+c.name+"</option>")}),a(".edd-select-chosen").trigger("chosen:updated"),a("#"+e).next().find("input").val(c)}}).fail(function(a){window.console&&window.console.log&&console.log(a)}).done(function(a){})},j))}),a("#post").on("click",".edd-thickbox",function(){a(".edd-select-chosen","#choose-download").css("width","100%")});var k={init:function(){this.revoke_api_key(),this.regenerate_api_key(),this.create_api_key(),this.recount_stats()},revoke_api_key:function(){a(document.body).on("click",".edd-revoke-api-key",function(a){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){a(document.body).on("click",".edd-regenerate-api-key",function(a){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){a(document.body).on("submit","#api-key-generate-form",function(b){var c=a('input[type="text"][name="user_id"]');c.css("border-color","#ddd");var d=c.val();return d.length<1||0==d?(c.css("border-color","#ff0000"),!1):void 0})},recount_stats:function(){a("body").on("change","#recount-stats-type",function(){var b=a("#edd-tools-recount-form"),c=a("option:selected",this).data("type"),d=a("#recount-stats-submit"),e=a("#tools-product-dropdown");if(b.find(".notice-wrap").remove(),d.removeClass("button-disabled").attr("disabled",!1),e.hide(),a(".edd-recount-stats-descriptions span").hide(),"recount-download"===c)e.show(),e.find(".edd-select-chosen").css("width","auto");else if("reset-stats"===c){b.append('<div class="notice-wrap"></div>');var f=b.find(".notice-wrap");f.html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+edd_vars.reset_stats_warn+"</label></p></div>"),a("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}else e.hide(),e.val(0);a("#"+c).show()}),a("body").on("change","#confirm-reset",function(){var b=a(this).is(":checked");b?a("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):a("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),a("#edd-tools-recount-form").submit(function(b){var c=a("#recount-stats-type").val(),d=a(this),e=a("option:selected",this).data("type");if("reset-stats"===e){var f=a("#confirm-reset").is(":checked");if(f)return!0;h=!0}d.find(".notice-wrap").remove(),d.append('<div class="notice-wrap"></div>');var g=d.find(".notice-wrap"),h=!1;if((null===c||0===c)&&(g.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>"),h=!0),"recount-download"===e){var i=a('select[name="download_id"]').val();0==i&&(g.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>"),h=!0)}return h?(d.find(".button-disabled").removeClass("button-disabled"),!1):void 0})}};k.init();var l={init:function(){this.submit(),this.dismiss_message()},submit:function(){var b=this;a(document.body).on("submit",".edd-export-form",function(c){c.preventDefault();var d=a(this).find('input[type="submit"]');if(!d.hasClass("button-disabled")){var e=a(this).serialize();d.addClass("button-disabled"),a(this).find(".notice-wrap").remove(),a(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),b.process_step(1,e,b)}})},process_step:function(b,c,d){a.ajax({type:"POST",url:ajaxurl,data:{form:c,action:"edd_do_ajax_export",step:b},dataType:"json",success:function(b){if("done"==b.step||b.error||b.success){var e=a(".edd-export-form").find(".edd-progress").parent().parent(),f=e.find(".notice-wrap");if(e.find(".button-disabled").removeClass("button-disabled"),b.error){var g=b.message;f.html('<div class="updated error"><p>'+g+"</p></div>")}else if(b.success){var h=b.message;f.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+h+'<span class="notice-dismiss"></span></p></div>')}else f.remove(),window.location=b.url}else a(".edd-progress div").animate({width:b.percentage+"%"},50,function(){}),d.process_step(parseInt(b.step),c,d)}}).fail(function(a){window.console&&window.console.log&&console.log(a)})},dismiss_message:function(){a("body").on("click","#edd-batch-success .notice-dismiss",function(){a("#edd-batch-success").parent().slideUp("fast")})}};l.init();var m={init:function(){this.submit()},submit:function(){var b=this;a(".edd-import-form").ajaxForm({beforeSubmit:b.before_submit,success:b.success,complete:b.complete,dataType:"json",error:b.error})},before_submit:function(b,c,d){if(c.find(".notice-wrap").remove(),c.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),!(window.File&&window.FileReader&&window.FileList&&window.Blob)){var e=a(".edd-import-form").find(".edd-progress").parent().parent(),f=e.find(".notice-wrap");return e.find(".button-disabled").removeClass("button-disabled"),f.html('<div class="update error"><p>'+edd_vars.unsupported_browser+"</p></div>"),!1}},success:function(a,b,c,d){},complete:function(b){var c=jQuery.parseJSON(b.responseText);if(c.success){var d=a(".edd-import-form .notice-wrap").parent();d.find(".edd-import-file-wrap,.notice-wrap").remove(),d.find(".edd-import-options").slideDown();var e=d.find("select.edd-import-csv-column"),g=(e.parent().parent(),""),h=c.data.columns.sort(function(a,b){return b>a?-1:a>b?1:0});a.each(h,function(a,b){g+='<option value="'+b+'">'+b+"</option>"}),e.append(g),e.on("change",function(){var b=a(this).val();b&&0!=c.data.first_row[b]?a(this).parent().next().html(c.data.first_row[b]):a(this).parent().next().html("")}),a("body").on("click",".edd-import-proceed",function(a){a.preventDefault(),d.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),c.data.mapping=d.serialize(),m.process_step(1,c.data,self)})}else m.error(b)},error:function(b){var c=jQuery.parseJSON(b.responseText),d=a(".edd-import-form").find(".edd-progress").parent().parent(),e=d.find(".notice-wrap");d.find(".button-disabled").removeClass("button-disabled"),c.data.error?e.html('<div class="update error"><p>'+c.data.error+"</p></div>"):e.remove()},process_step:function(b,c,d){a.ajax({type:"POST",url:ajaxurl,data:{form:c.form,nonce:c.nonce,"class":c["class"],upload:c.upload,mapping:c.mapping,action:"edd_do_ajax_import",step:b},dataType:"json",success:function(b){if("done"==b.data.step||b.data.error){var e=a(".edd-import-form").find(".edd-progress").parent().parent(),f=e.find(".notice-wrap");e.find(".button-disabled").removeClass("button-disabled"),b.data.error?f.html('<div class="update error"><p>'+b.data.error+"</p></div>"):(e.find(".edd-import-options").hide(),a("html, body").animate({scrollTop:e.parent().offset().top},500),f.html('<div class="updated"><p>'+b.data.message+"</p></div>"))}else a(".edd-progress div").animate({width:b.data.percentage+"%"},50,function(){}),m.process_step(parseInt(b.data.step),c,d)}}).fail(function(a){window.console&&window.console.log&&console.log(a)})}};m.init();var n={vars:{customer_card_wrap_editable:a(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:a(".edd-customer-card-wrapper .edit-item"),user_id:a('input[name="customerinfo[user_id]"]'),state_input:a(':input[name="customerinfo[state]"]'),note:a("#customer-note")},init:function(){this.edit_customer(),this.add_email(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.add_note(),this.delete_checked()},edit_customer:function(){a(document.body).on("click","#edit-customer",function(a){a.preventDefault(),n.vars.customer_card_wrap_editable.hide(),n.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},add_email:function(){a(document.body).on("click","#add-customer-email",function(b){b.preventDefault();var c=a(this),d=c.parent();d.parent().find(".notice-wrap").remove(),d.find(".spinner").css("visibility","visible"),c.attr("disabled",!0);var e=d.find('input[name="customer-id"]').val(),f=d.find('input[name="additional-email"]').val(),g=d.find('input[name="make-additional-primary"]').is(":checked"),h=d.find('input[name="add_email_nonce"]').val(),i={edd_action:"customer-add-email",customer_id:e,email:f,primary:g,_wpnonce:h};a.post(ajaxurl,i,function(a){!0===a.success?window.location.href=a.redirect:(c.attr("disabled",!1),d.after('<div class="notice-wrap"><div class="notice notice-error inline"><p>'+a.message+"</p></div></div>"),d.find(".spinner").css("visibility","hidden"))},"json")})},user_search:function(){a(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(b){b.preventDefault();var c=a(this).data("userid");n.vars.user_id.val(c)})},remove_user:function(){a(document.body).on("click","#disconnect-customer",function(b){b.preventDefault();var c=a('input[name="customerinfo[id]"]').val(),d={edd_action:"disconnect-userid",customer_id:c,_wpnonce:a("#edit-customer-info #_wpnonce").val()};a.post(ajaxurl,d,function(a){window.location.href=window.location.href},"json")})},cancel_edit:function(){a(document.body).on("click","#edd-edit-customer-cancel",function(b){b.preventDefault(),n.vars.customer_card_wrap_edit_item.hide(),n.vars.customer_card_wrap_editable.show(),a(".edd_user_search_results").html("")})},change_country:function(){a('select[name="customerinfo[country]"]').change(function(){var b=a(this);return data={action:"edd_get_shop_states",country:b.val(),field_name:"customerinfo[state]"},a.post(ajaxurl,data,function(a){"nostates"==a?n.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):n.vars.state_input.replaceWith(a)}),!1})},add_note:function(){a(document.body).on("click","#add-customer-note",function(b){b.preventDefault();var c={edd_action:"add-customer-note",customer_id:a("#customer-id").val(),customer_note:n.vars.note.val(),add_customer_note_nonce:a("#add_customer_note_nonce").val()};if(c.customer_note)a.ajax({type:"POST",data:c,url:ajaxurl,success:function(b){a("#edd-customer-notes").prepend(b),a(".edd-no-customer-notes").hide(),n.vars.note.val("")}}).fail(function(a){window.console&&window.console.log&&console.log(a)});else{var d=n.vars.note.css("border-color");n.vars.note.css("border-color","red"),setTimeout(function(){n.vars.note.css("border-color",d)},500)}})},delete_checked:function(){a("#edd-customer-delete-confirm").change(function(){var b=a("#edd-customer-delete-records"),c=a("#edd-delete-customer");a(this).prop("checked")?(b.attr("disabled",!1),c.attr("disabled",!1)):(b.attr("disabled",!0),b.prop("checked",!1),c.attr("disabled",!0))})}};n.init(),a(".edd-ajax-user-search").keyup(function(){var b=a(this).val(),c="";a(this).data("exclude")&&(c=a(this).data("exclude")),a(".edd-ajax").show(),data={action:"edd_search_users",user_name:b,exclude:c},document.body.style.cursor="wait",
2
- a.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(b){a(".edd-ajax").hide(),a(".edd_user_search_results").removeClass("hidden"),a(".edd_user_search_results span").html(""),a(b.results).appendTo(".edd_user_search_results span"),document.body.style.cursor="default"}})}),a(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(b){b.preventDefault();var c=a(this).data("login");a(".edd-ajax-user-search").val(c),a(".edd_user_search_results").addClass("hidden"),a(".edd_user_search_results span").html("")}),a(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(b){b.preventDefault(),a(".edd-ajax-user-search").val(""),a(".edd_user_search_results").addClass("hidden"),a(".edd_user_search_results span").html("")}),a("#edd_dashboard_sales").length&&a.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(b){a("#edd_dashboard_sales .inside").html(b)}}),a(document).on("keydown",".customer-note-input",function(b){13==b.keyCode&&(b.metaKey||b.ctrlKey)&&a("#add-customer-note").click()})});var eddFormatCurrency=function(a){var b=parseFloat(a),c=edd_vars.currency,d=edd_vars.currency_decimals;return b.toLocaleString(c,{style:"currency",currency:c,minimumFractionDigits:d,maximumFractionDigits:d})},eddFormatNumber=function(a){var b=parseFloat(a),c=edd_vars.currency;edd_vars.currency_decimals;return b.toLocaleString(c,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})},eddLabelFormatter=function(a,b){return'<div style="font-size:12px; text-align:center; padding:2px">'+a+"</div>"},eddLegendFormatterSales=function(a,b){var c=a.toLowerCase().replace(/\s/g,"-"),d='<div class="edd-legend-color" style="background-color: '+b.color+'"></div>',e='<div class="edd-pie-legend-item">'+a+": "+Math.round(b.percent)+"% ("+eddFormatNumber(b.data[0][1])+")</div>",f='<div id="'+b.edd_vars.id+c+'" class="edd-legend-item-wrapper">'+d+e+"</div>";return jQuery("#edd-pie-legend-"+b.edd_vars.id).append(f),f},eddLegendFormatterEarnings=function(a,b){var c=a.toLowerCase().replace(/\s/g,"-"),d='<div class="edd-legend-color" style="background-color: '+b.color+'"></div>',e='<div class="edd-pie-legend-item">'+a+": "+Math.round(b.percent)+"% ("+eddFormatCurrency(b.data[0][1])+")</div>",f='<div id="'+b.edd_vars.id+c+'" class="edd-legend-item-wrapper">'+d+e+"</div>";return jQuery("#edd-pie-legend-"+b.edd_vars.id).append(f),f};
1
+ jQuery(document).ready(function($){$(".edd-help-tip").tooltip({content:function(){return $(this).prop("title")},tooltipClass:"edd-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}});var EDD_Download_Configuration={init:function(){this.add();this.move();this.remove();this.type();this.prices();this.files();this.updatePrices()},clone_repeatable:function(row){var key=highest=1;row.parent().find("tr.edd_repeatable_row").each(function(){var current=$(this).data("key");if(parseInt(current)>highest){highest=current}});key=highest+=1;clone=row.clone();clone.find("select").each(function(){$(this).val(row.find('select[name="'+$(this).attr("name")+'"]').val())});clone.removeClass("edd_add_blank");clone.attr("data-key",key);clone.find("td input, td select, textarea").val("");clone.find("input, select, textarea").each(function(){var name=$(this).attr("name");var id=$(this).attr("id");if(name){name=name.replace(/\[(\d+)\]/,"["+parseInt(key)+"]");$(this).attr("name",name)}$(this).attr("data-key",key);if(typeof id!="undefined"){id=id.replace(/(\d+)/,parseInt(key));$(this).attr("id",id)}});clone.find("span.edd_price_id").each(function(){$(this).text(parseInt(key))});clone.find("span.edd_file_id").each(function(){$(this).text(parseInt(key))});clone.find(".edd_repeatable_default_input").each(function(){$(this).val(parseInt(key)).removeAttr("checked")});clone.find(".search-choice").remove();clone.find(".chosen-container").remove();return clone},add:function(){$(document.body).on("click",".submit .edd_add_repeatable",function(e){e.preventDefault();var button=$(this),row=button.parent().parent().prev("tr"),clone=EDD_Download_Configuration.clone_repeatable(row);clone.insertAfter(row).find("input, textarea, select").filter(":visible").eq(0).focus();clone.find(".edd-select-chosen").chosen({inherit_select_classes:true,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option});clone.find(".edd-select-chosen").css("width","100%");clone.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)})},move:function(){$(".edd_repeatable_table tbody").sortable({handle:".edd_draghandle",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var count=0;$(this).find("tr").each(function(){$(this).find("input.edd_repeatable_index").each(function(){$(this).val(count)});count++})}})},remove:function(){$(document.body).on("click",".edd_remove_repeatable",function(e){e.preventDefault();var row=$(this).parent().parent("tr"),count=row.parent().find("tr").length-1,type=$(this).data("type"),repeatable="tr.edd_repeatable_"+type+"s",focusElement,focusable,firstFocusable;if($(this).is(".ui-sortable tr:first-child .edd_remove_repeatable:first-child")){focusElement=row.next("tr")}else{focusElement=row.prev("tr")}focusable=focusElement.find("select, input, textarea, button").filter(":visible");firstFocusable=focusable.eq(0);if(type==="price"){var price_row_id=row.data("key");$('.edd_repeatable_condition_field option[value="'+price_row_id+'"]').remove()}if(count>1){$("input, select",row).val("");row.fadeOut("fast").remove();firstFocusable.focus()}else{switch(type){case"price":alert(edd_vars.one_price_min);break;case"file":$("input, select",row).val("");break;default:alert(edd_vars.one_field_min);break}}$(repeatable).each(function(rowIndex){$(this).find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+rowIndex+"]");$(this).attr("name",name).attr("id",name)})})})},type:function(){$(document.body).on("change","#_edd_product_type",function(e){var edd_products=$("#edd_products"),edd_download_files=$("#edd_download_files"),edd_download_limit_wrap=$("#edd_download_limit_wrap");if("bundle"===$(this).val()){edd_products.show();edd_download_files.hide();edd_download_limit_wrap.hide()}else{edd_products.hide();edd_download_files.show();edd_download_limit_wrap.show()}})},prices:function(){$(document.body).on("change","#edd_variable_pricing",function(e){var checked=$(this).is(":checked");var single=$("#edd_regular_price_field");var variable=$("#edd_variable_price_fields,.edd_repeatable_table .pricing");if(checked){single.hide();variable.show()}else{single.show();variable.hide()}})},files:function(){if(typeof wp==="undefined"||"1"!==edd_vars.new_media_ui){if($(".edd_upload_file_button").length>0){window.formfield="";$(document.body).on("click",".edd_upload_file_button",function(e){e.preventDefault();window.formfield=$(this).parent().prev();window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3);if(edd_vars.post_id!=null){var post_id="post_id="+edd_vars.post_id+"&"}tb_show(edd_vars.add_new_download,"media-upload.php?"+post_id+"TB_iframe=true")});window.edd_send_to_editor=window.send_to_editor;window.send_to_editor=function(html){if(window.formfield){imgurl=$("a","<div>"+html+"</div>").attr("href");window.formfield.val(imgurl);window.clearInterval(window.tbframe_interval);tb_remove()}else{window.edd_send_to_editor(html)}window.send_to_editor=window.edd_send_to_editor;window.formfield="";window.imagefield=false}}}else{var file_frame;window.formfield="";$(document.body).on("click",".edd_upload_file_button",function(e){e.preventDefault();var button=$(this);window.formfield=$(this).closest(".edd_repeatable_upload_wrapper");if(file_frame){file_frame.open();return}file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader-title"),button:{text:button.data("uploader-button-text")},multiple:$(this).data("multiple")=="0"?false:true});file_frame.on("menu:render:default",function(view){var views={};view.unset("library-separator");view.unset("gallery");view.unset("featured-image");view.unset("embed");view.set(views)});file_frame.on("insert",function(){var selection=file_frame.state().get("selection");selection.each(function(attachment,index){attachment=attachment.toJSON();if(0===index){window.formfield.find(".edd_repeatable_attachment_id_field").val(attachment.id);window.formfield.find(".edd_repeatable_upload_field").val(attachment.url);window.formfield.find(".edd_repeatable_name_field").val(attachment.title)}else{var row=window.formfield,clone=EDD_Download_Configuration.clone_repeatable(row);clone.find(".edd_repeatable_attachment_id_field").val(attachment.id);clone.find(".edd_repeatable_upload_field").val(attachment.url);if(attachment.title.length>0){clone.find(".edd_repeatable_name_field").val(attachment.title)}else{clone.find(".edd_repeatable_name_field").val(attachment.filename)}clone.insertAfter(row)}})});file_frame.open()});var file_frame;window.formfield=""}},updatePrices:function(){$("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var key=$(this).parents("tr").data("key"),name=$(this).val(),field_option=$(".edd_repeatable_condition_field option[value="+key+"]");if(field_option.length>0){field_option.text(name)}else{$(".edd_repeatable_condition_field").append($("<option></option>").attr("value",key).text(name))}})}};EDD_Download_Configuration.init();var edd_datepicker=$(".edd_datepicker");if(edd_datepicker.length>0){var dateFormat="mm/dd/yy";edd_datepicker.datepicker({dateFormat:dateFormat})}var EDD_Edit_Payment={init:function(){this.edit_address();this.remove_download();this.add_download();this.new_customer();this.recalculate_total();this.variable_prices_check();this.add_note();this.remove_note();this.resend_receipt();this.copy_download_link()},edit_address:function(){$('select[name="edd-payment-address[0][country]"]').change(function(){var $this=$(this);data={action:"edd_get_shop_states",country:$this.val(),field_name:"edd-payment-address[0][state]"};$.post(ajaxurl,data,function(response){var state_wrapper=$("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");$("#edd-order-address-state-wrap .chosen-container").remove();if("nostates"==response){state_wrapper.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>')}else{state_wrapper.replaceWith(response)}});return false})},remove_download:function(){$("#edd-purchased-files").on("click",".edd-order-remove-download",function(){var count=$(document.body).find("#edd-purchased-files > .row").length;if(count===1){alert(edd_vars.one_download_min);return false}if(confirm(edd_vars.delete_payment_download)){var key=$(this).data("key");var purchase_id=$(".edd-payment-id").val();var download_id=$('input[name="edd-payment-details-downloads['+key+'][id]"]').val();var price_id=$('input[name="edd-payment-details-downloads['+key+'][price_id]"]').val();var quantity=$('input[name="edd-payment-details-downloads['+key+'][quantity]"]').val();var amount=$('input[name="edd-payment-details-downloads['+key+'][amount]"]').val();if($('input[name="edd-payment-details-downloads['+key+'][fees]"]')){var fees=$.parseJSON($('input[name="edd-payment-details-downloads['+key+'][fees]"]').val())}var currently_removed=$('input[name="edd-payment-removed"]').val();currently_removed=$.parseJSON(currently_removed);if(currently_removed.length<1){currently_removed={}}var removed_item=[{id:download_id,price_id:price_id,quantity:quantity,amount:amount,cart_index:key}];currently_removed[key]=removed_item;$('input[name="edd-payment-removed"]').val(JSON.stringify(currently_removed));$(this).parent().parent().parent().remove();if(fees&&fees.length){$.each(fees,function(key,value){$('*li[data-fee-id="'+value+'"]').remove()})}$("#edd-payment-downloads-changed").val(1);$(".edd-order-payment-recalc-totals").show()}return false})},new_customer:function(){$("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(e){e.preventDefault();var new_customer=$(this).hasClass("edd-payment-new-customer");var cancel=$(this).hasClass("edd-payment-new-customer-cancel");if(new_customer){$(".customer-info").hide();$(".new-customer").show()}else if(cancel){$(".customer-info").show();$(".new-customer").hide()}var new_customer=$("#edd-new-customer");if($(".new-customer").is(":visible")){new_customer.val(1)}else{new_customer.val(0)}})},add_download:function(){$("#edd-purchased-files").on("click","#edd-order-add-download",function(e){e.preventDefault();var order_download_select=$("#edd_order_download_select"),order_download_quantity=$("#edd-order-download-quantity"),order_download_amount=$("#edd-order-download-amount"),selected_price_option=$(".edd_price_options_select option:selected");var download_id=order_download_select.val();var download_title=order_download_select.find(":selected").text();var quantity=order_download_quantity.val();var amount=order_download_amount.val();var price_id=selected_price_option.val();var price_name=selected_price_option.text();if(download_id<1){return false}if(!amount){amount=0}amount=parseFloat(amount);if(isNaN(amount)){alert(edd_vars.numeric_item_price);return false}var item_price=amount;if(edd_vars.quantities_enabled==="1"){if(!isNaN(parseInt(quantity))){amount=amount*quantity}else{alert(edd_vars.numeric_quantity);return false}}amount=amount.toFixed(edd_vars.currency_decimals);var formatted_amount=amount+edd_vars.currency_sign;if("before"===edd_vars.currency_pos){formatted_amount=edd_vars.currency_sign+amount}if(price_name){download_title=download_title+" - "+price_name}var count=$("#edd-purchased-files div.row").length;var clone=$("#edd-purchased-files div.row:last").clone();clone.find(".download span").html('<a href="post.php?post='+download_id+'&action=edit"></a>');clone.find(".download span a").text(download_title);clone.find(".price-text").text(formatted_amount);clone.find(".item-quantity").text(quantity);clone.find(".item-price").text(edd_vars.currency_sign+(amount/quantity).toFixed(edd_vars.currency_decimals));clone.find("input.edd-payment-details-download-id").val(download_id);clone.find("input.edd-payment-details-download-price-id").val(price_id);clone.find("input.edd-payment-details-download-item-price").val(item_price);clone.find("input.edd-payment-details-download-amount").val(amount);clone.find("input.edd-payment-details-download-quantity").val(quantity);clone.find("input.edd-payment-details-download-has-log").val(0);clone.find("input").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("name",name).attr("id",name)});$("#edd-payment-downloads-changed").val(1);$(clone).insertAfter("#edd-purchased-files div.row:last");$(".edd-order-payment-recalc-totals").show()})},recalculate_total:function(){$("#edd-order-recalc-total").on("click",function(e){e.preventDefault();var total=0,purchased_files=$("#edd-purchased-files .row .edd-payment-details-download-amount");if(purchased_files.length){purchased_files.each(function(){total+=parseFloat($(this).val())})}if($(".edd-payment-fees").length){$(".edd-payment-fees span.fee-amount").each(function(){total+=parseFloat($(this).data("fee"))})}$("input[name=edd-payment-total]").val(total.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){$("#edd-purchased-files").on("change","select#edd_order_download_select",function(){var $this=$(this),download_id=$this.val();if(parseInt(download_id)>0){var postData={action:"edd_check_for_download_price_variations",download_id:download_id};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$(".edd_price_options_select").remove();$(response).insertAfter($this.next())}}).fail(function(data){if(window.console&&window.console.log){console.log(data)}})}})},add_note:function(){$("#edd-add-payment-note").on("click",function(e){e.preventDefault();var postData={action:"edd_insert_payment_note",payment_id:$(this).data("payment-id"),note:$("#edd-payment-note").val()};if(postData.note){$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-payment-notes-inner").append(response);$(".edd-no-payment-notes").hide();$("#edd-payment-note").val("")}}).fail(function(data){if(window.console&&window.console.log){console.log(data)}})}else{var border_color=$("#edd-payment-note").css("border-color");$("#edd-payment-note").css("border-color","red");setTimeout(function(){$("#edd-payment-note").css("border-color",border_color)},500)}})},remove_note:function(){$(document.body).on("click",".edd-delete-payment-note",function(e){e.preventDefault();if(confirm(edd_vars.delete_payment_note)){var postData={action:"edd_delete_payment_note",payment_id:$(this).data("payment-id"),note_id:$(this).data("note-id")};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-payment-note-"+postData.note_id).remove();if(!$(".edd-payment-note").length){$(".edd-no-payment-notes").show()}return false}}).fail(function(data){if(window.console&&window.console.log){console.log(data)}});return true}})},resend_receipt:function(){var emails_wrap=$(".edd-order-resend-receipt-addresses");$(document.body).on("click","#edd-select-receipt-email",function(e){e.preventDefault();emails_wrap.slideDown()});$(document.body).on("change",".edd-order-resend-receipt-email",function(){var href=$("#edd-select-receipt-email").prop("href")+"&email="+$(this).val();if(confirm(edd_vars.resend_receipt)){window.location=href}});$(document.body).on("click","#edd-resend-receipt",function(e){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){$(document.body).on("click",".edd-copy-download-link",function(e){e.preventDefault();var $this=$(this);var postData={action:"edd_get_file_download_link",payment_id:$('input[name="edd_payment_id"]').val(),download_id:$this.data("download-id"),price_id:$this.data("price-id")};$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(link){$("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+link+"</textarea>");$("#edd-download-link-textarea").focus().select();return false}}).fail(function(data){if(window.console&&window.console.log){console.log(data)}})})}};EDD_Edit_Payment.init();var EDD_Discount={init:function(){this.type_select();this.product_requirements()},type_select:function(){$("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){var val=$(this).val();$(".edd-amount-description").hide();$(".edd-amount-description."+val+"-discount").show()})},product_requirements:function(){$("#products").change(function(){var product_conditions=$("#edd-discount-product-conditions");if($(this).val()){product_conditions.show()}else{product_conditions.hide()}})}};EDD_Discount.init();var EDD_Reports={init:function(){this.date_options();this.customers_export()},date_options:function(){$("#edd-graphs-date-options").change(function(){var $this=$(this),date_range_options=$("#edd-date-range-options");if("other"===$this.val()){date_range_options.show()}else{date_range_options.hide()}})},customers_export:function(){$("#edd_customer_export_download").change(function(){var $this=$(this),download_id=$("option:selected",$this).val(),customer_export_option=$("#edd_customer_export_option");if("0"===$this.val()){customer_export_option.show()}else{customer_export_option.hide()}if(parseInt(download_id)!=0){var data={action:"edd_check_for_download_price_variations",download_id:download_id,all_prices:true};var price_options_select=$(".edd_price_options_select");$.post(ajaxurl,data,function(response){price_options_select.remove();$("#edd_customer_export_download_chosen").after(response)})}else{price_options_select.remove()}})}};EDD_Reports.init();var EDD_Settings={init:function(){this.general();this.taxes();this.emails();this.misc()},general:function(){var edd_color_picker=$(".edd-color-picker");if(edd_color_picker.length){edd_color_picker.wpColorPicker()}if(typeof wp==="undefined"||"1"!==edd_vars.new_media_ui){var edd_settings_upload_button=$(".edd_settings_upload_button");if(edd_settings_upload_button.length>0){window.formfield="";$(document.body).on("click",edd_settings_upload_button,function(e){e.preventDefault();window.formfield=$(this).parent().prev();window.tbframe_interval=setInterval(function(){jQuery("#TB_iframeContent").contents().find(".savesend .button").val(edd_vars.use_this_file).end().find("#insert-gallery, .wp-post-thumbnail").hide()},2e3);tb_show(edd_vars.add_new_download,"media-upload.php?TB_iframe=true")});window.edd_send_to_editor=window.send_to_editor;window.send_to_editor=function(html){if(window.formfield){imgurl=$("a","<div>"+html+"</div>").attr("href");window.formfield.val(imgurl);window.clearInterval(window.tbframe_interval);tb_remove()}else{window.edd_send_to_editor(html)}window.send_to_editor=window.edd_send_to_editor;window.formfield="";window.imagefield=false}}}else{var file_frame;window.formfield="";$(document.body).on("click",".edd_settings_upload_button",function(e){e.preventDefault();var button=$(this);window.formfield=$(this).parent().prev();if(file_frame){file_frame.open();return}file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader_title"),button:{text:button.data("uploader_button_text")},multiple:false});file_frame.on("menu:render:default",function(view){var views={};view.unset("library-separator");view.unset("gallery");view.unset("featured-image");view.unset("embed");view.set(views)});file_frame.on("insert",function(){var selection=file_frame.state().get("selection");selection.each(function(attachment,index){attachment=attachment.toJSON();window.formfield.val(attachment.url)})});file_frame.open()});var file_frame;window.formfield=""}},taxes:function(){var no_states=$("select.edd-no-states");if(no_states.length){no_states.closest("tr").hide()}$('select[name="edd_settings[base_country]"]').change(function(){var $this=$(this),$tr=$this.closest("tr");data={action:"edd_get_shop_states",country:$(this).val(),field_name:"edd_settings[base_state]"};$.post(ajaxurl,data,function(response){if("nostates"==response){$tr.next().hide()}else{$tr.next().show();$tr.next().find("select").replaceWith(response)}});return false});$(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var $this=$(this);data={action:"edd_get_shop_states",country:$(this).val(),field_name:$this.attr("name").replace("country","state")};$.post(ajaxurl,data,function(response){if("nostates"==response){var text_field='<input type="text" name="'+data.field_name+'" value=""/>';$this.parent().next().find("select").replaceWith(text_field)}else{$this.parent().next().find("input,select").show();$this.parent().next().find("input,select").replaceWith(response)}});return false});$("#edd_add_tax_rate").on("click",function(){var row=$("#edd_tax_rates tr:last");var clone=row.clone();var count=row.parent().find("tr").length;clone.find("td input").not(":input[type=checkbox]").val("");clone.find('td [type="checkbox"]').attr("checked",false);clone.find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("name",name).attr("id",name)});clone.find("label").each(function(){var name=$(this).attr("for");name=name.replace(/\[(\d+)\]/,"["+parseInt(count)+"]");$(this).attr("for",name)});clone.insertAfter(row);return false});$(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){if(confirm(edd_vars.delete_tax_rate)){var tax_rates=$("#edd_tax_rates tr:visible");var count=tax_rates.length;if(count===2){$("#edd_tax_rates select").val("");$('#edd_tax_rates input[type="text"]').val("");$('#edd_tax_rates input[type="number"]').val("");$('#edd_tax_rates input[type="checkbox"]').attr("checked",false)}else{$(this).closest("tr").remove()}$("#edd_tax_rates tr").each(function(rowIndex){$(this).children().find("input, select").each(function(){var name=$(this).attr("name");name=name.replace(/\[(\d+)\]/,"["+(rowIndex-1)+"]");$(this).attr("name",name).attr("id",name)})})}return false})},emails:function(){var email_preview_wrap=$("#email-preview-wrap");if(email_preview_wrap.length){var emailPreview=$("#email-preview");email_preview_wrap.colorbox({inline:true,href:emailPreview,width:"80%",height:"auto"})}},misc:function(){var downloadMethod=$('select[name="edd_settings[download_method]"]');var symlink=downloadMethod.parent().parent().next();if(downloadMethod.val()=="direct"){symlink.hide();symlink.find("input").prop("checked",false)}downloadMethod.on("change",function(){if($(this).val()=="direct"){symlink.hide();symlink.find("input").prop("checked",false)}else{symlink.show()}})}};EDD_Settings.init();$(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){if(confirm(edd_vars.delete_payment)){return true}return false});$("#the-list").on("click",".editinline",function(){var post_id=$(this).closest("tr").attr("id");post_id=post_id.replace("post-","");var $edd_inline_data=$("#post-"+post_id);var regprice=$edd_inline_data.find(".column-price .downloadprice-"+post_id).val();if(regprice!=$("#post-"+post_id+".column-price .downloadprice-"+post_id).val()){$(".regprice","#edd-download-data").val(regprice).attr("disabled",false)}else{$(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}});$(document.body).on("click","#bulk_edit",function(){var $bulk_row=$("#bulk-edit");var $post_ids=new Array;$bulk_row.find("#bulk-titles").children().each(function(){$post_ids.push($(this).attr("id").replace(/^(ttle)/i,""))});var $price=$('#edd-download-data input[name="_edd_regprice"]').val();var data={action:"edd_save_bulk_edit",edd_bulk_nonce:$post_ids,post_ids:$post_ids,price:$price};$.post(ajaxurl,data)});$(".edd-select-chosen").chosen({inherit_select_classes:true,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option});$(".edd-select-chosen .chosen-search input").each(function(){var type=$(this).parent().parent().parent().prev("select.edd-select-chosen").data("search-type");var placeholder="";if(type==="download"){placeholder=edd_vars.search_placeholder}else{var type="search_placeholder_"+type;if(edd_vars[type]){placeholder=edd_vars[type]}}$(this).attr("placeholder",placeholder)});$(".chosen-choices").on("click",function(){$(this).children("li").children("input").attr("placeholder",edd_vars.type_to_search)});var typingTimer;var doneTypingInterval=342;$(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(e){var val=$(this).val();var container=$(this).closest(".edd-select-chosen");var menu_id=container.attr("id").replace("_chosen","");var no_bundles=container.hasClass("no-bundles");var variations=container.hasClass("variations");var lastKey=e.which;var search_type="edd_download_search";if(container.prev().data("search-type")){if("no_ajax"==container.prev().data("search-type")){return}search_type="edd_"+container.prev().data("search-type")+"_search"}if(val.length<=3&&"edd_download_search"==search_type||(lastKey==16||lastKey==13||lastKey==91||lastKey==17||lastKey==37||lastKey==38||lastKey==39||lastKey==40)){return}clearTimeout(typingTimer);typingTimer=setTimeout(function(){$.ajax({type:"GET",url:ajaxurl,data:{action:search_type,s:val,no_bundles:no_bundles,variations:variations},dataType:"json",beforeSend:function(){$("ul.chosen-results").empty()},success:function(data){$("#"+menu_id+" option:not(:selected)").remove();$.each(data,function(key,item){if(!$("#"+menu_id+' option[value="'+item.id+'"]').length){$("#"+menu_id).prepend('<option value="'+item.id+'">'+item.name+"</option>")}});$(".edd-select-chosen").trigger("chosen:updated");$("#"+menu_id).next().find("input").val(val)}}).fail(function(response){if(window.console&&window.console.log){console.log(response)}}).done(function(response){})},doneTypingInterval)});$("#post").on("click",".edd-thickbox",function(){$(".edd-select-chosen","#choose-download").css("width","100%")});var EDD_Tools={init:function(){this.revoke_api_key();this.regenerate_api_key();this.create_api_key();this.recount_stats()},revoke_api_key:function(){$(document.body).on("click",".edd-revoke-api-key",function(e){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){$(document.body).on("click",".edd-regenerate-api-key",function(e){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){$(document.body).on("submit","#api-key-generate-form",function(e){var input=$('input[type="text"][name="user_id"]');input.css("border-color","#ddd");var user_id=input.val();if(user_id.length<1||user_id==0){input.css("border-color","#ff0000");return false}})},recount_stats:function(){$("body").on("change","#recount-stats-type",function(){var export_form=$("#edd-tools-recount-form");var selected_type=$("option:selected",this).data("type");var submit_button=$("#recount-stats-submit");var products=$("#tools-product-dropdown");export_form.find(".notice-wrap").remove();submit_button.removeClass("button-disabled").attr("disabled",false);products.hide();$(".edd-recount-stats-descriptions span").hide();if("recount-download"===selected_type){products.show();products.find(".edd-select-chosen").css("width","auto")}else if("reset-stats"===selected_type){export_form.append('<div class="notice-wrap"></div>');var notice_wrap=export_form.find(".notice-wrap");notice_wrap.html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+edd_vars.reset_stats_warn+"</label></p></div>");$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}else{products.hide();products.val(0)}$("#"+selected_type).show()});$("body").on("change","#confirm-reset",function(){var checked=$(this).is(":checked");if(checked){$("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled")}else{$("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}});$("#edd-tools-recount-form").submit(function(e){var selection=$("#recount-stats-type").val();var export_form=$(this);var selected_type=$("option:selected",this).data("type");if("reset-stats"===selected_type){var is_confirmed=$("#confirm-reset").is(":checked");if(is_confirmed){return true}else{has_errors=true}}export_form.find(".notice-wrap").remove();export_form.append('<div class="notice-wrap"></div>');var notice_wrap=export_form.find(".notice-wrap");var has_errors=false;if(null===selection||0===selection){notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>");has_errors=true}if("recount-download"===selected_type){var selected_download=$('select[name="download_id"]').val();if(selected_download==0){notice_wrap.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>");has_errors=true}}if(has_errors){export_form.find(".button-disabled").removeClass("button-disabled");return false}})}};EDD_Tools.init();var EDD_Export={init:function(){this.submit();this.dismiss_message()},submit:function(){var self=this;$(document.body).on("submit",".edd-export-form",function(e){e.preventDefault();var submitButton=$(this).find('input[type="submit"]');if(!submitButton.hasClass("button-disabled")){var data=$(this).serialize();submitButton.addClass("button-disabled");$(this).find(".notice-wrap").remove();$(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>');self.process_step(1,data,self)}})},process_step:function(step,data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:data,action:"edd_do_ajax_export",step:step},dataType:"json",success:function(response){if("done"==response.step||response.error||response.success){var export_form=$(".edd-export-form").find(".edd-progress").parent().parent();var notice_wrap=export_form.find(".notice-wrap");export_form.find(".button-disabled").removeClass("button-disabled");if(response.error){var error_message=response.message;notice_wrap.html('<div class="updated error"><p>'+error_message+"</p></div>")}else if(response.success){var success_message=response.message;notice_wrap.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+success_message+'<span class="notice-dismiss"></span></p></div>')}else{notice_wrap.remove();window.location=response.url}}else{$(".edd-progress div").animate({width:response.percentage+"%"},50,function(){});self.process_step(parseInt(response.step),data,self)}}}).fail(function(response){if(window.console&&window.console.log){console.log(response)}})},dismiss_message:function(){$("body").on("click","#edd-batch-success .notice-dismiss",function(){$("#edd-batch-success").parent().slideUp("fast")})}};EDD_Export.init();var EDD_Import={init:function(){this.submit()},submit:function(){var self=this;$(".edd-import-form").ajaxForm({beforeSubmit:self.before_submit,success:self.success,complete:self.complete,dataType:"json",error:self.error})},before_submit:function(arr,$form,options){$form.find(".notice-wrap").remove();$form.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>');if(window.File&&window.FileReader&&window.FileList&&window.Blob){}else{var import_form=$(".edd-import-form").find(".edd-progress").parent().parent();var notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled");notice_wrap.html('<div class="update error"><p>'+edd_vars.unsupported_browser+"</p></div>");return false}},success:function(responseText,statusText,xhr,$form){},complete:function(xhr){var response=jQuery.parseJSON(xhr.responseText);if(response.success){var $form=$(".edd-import-form .notice-wrap").parent();$form.find(".edd-import-file-wrap,.notice-wrap").remove();$form.find(".edd-import-options").slideDown();var select=$form.find("select.edd-import-csv-column");var row=select.parent().parent();var options="";var columns=response.data.columns.sort(function(a,b){
2
+ if(a<b)return-1;if(a>b)return 1;return 0});$.each(columns,function(key,value){options+='<option value="'+value+'">'+value+"</option>"});select.append(options);select.on("change",function(){var $key=$(this).val();if(!$key){$(this).parent().next().html("")}else{if(false!=response.data.first_row[$key]){$(this).parent().next().html(response.data.first_row[$key])}else{$(this).parent().next().html("")}}});$("body").on("click",".edd-import-proceed",function(e){e.preventDefault();$form.append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>');response.data.mapping=$form.serialize();EDD_Import.process_step(1,response.data,self)})}else{EDD_Import.error(xhr)}},error:function(xhr){var response=jQuery.parseJSON(xhr.responseText);var import_form=$(".edd-import-form").find(".edd-progress").parent().parent();var notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled");if(response.data.error){notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>")}else{notice_wrap.remove()}},process_step:function(step,import_data,self){$.ajax({type:"POST",url:ajaxurl,data:{form:import_data.form,nonce:import_data.nonce,class:import_data.class,upload:import_data.upload,mapping:import_data.mapping,action:"edd_do_ajax_import",step:step},dataType:"json",success:function(response){if("done"==response.data.step||response.data.error){var import_form=$(".edd-import-form").find(".edd-progress").parent().parent();var notice_wrap=import_form.find(".notice-wrap");import_form.find(".button-disabled").removeClass("button-disabled");if(response.data.error){notice_wrap.html('<div class="update error"><p>'+response.data.error+"</p></div>")}else{import_form.find(".edd-import-options").hide();$("html, body").animate({scrollTop:import_form.parent().offset().top},500);notice_wrap.html('<div class="updated"><p>'+response.data.message+"</p></div>")}}else{$(".edd-progress div").animate({width:response.data.percentage+"%"},50,function(){});EDD_Import.process_step(parseInt(response.data.step),import_data,self)}}}).fail(function(response){if(window.console&&window.console.log){console.log(response)}})}};EDD_Import.init();var EDD_Customer={vars:{customer_card_wrap_editable:$(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:$(".edd-customer-card-wrapper .edit-item"),user_id:$('input[name="customerinfo[user_id]"]'),state_input:$(':input[name="customerinfo[state]"]'),note:$("#customer-note")},init:function(){this.edit_customer();this.add_email();this.user_search();this.remove_user();this.cancel_edit();this.change_country();this.add_note();this.delete_checked()},edit_customer:function(){$(document.body).on("click","#edit-customer",function(e){e.preventDefault();EDD_Customer.vars.customer_card_wrap_editable.hide();EDD_Customer.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},add_email:function(){$(document.body).on("click","#add-customer-email",function(e){e.preventDefault();var button=$(this);var wrapper=button.parent();wrapper.parent().find(".notice-wrap").remove();wrapper.find(".spinner").css("visibility","visible");button.attr("disabled",true);var customer_id=wrapper.find('input[name="customer-id"]').val();var email=wrapper.find('input[name="additional-email"]').val();var primary=wrapper.find('input[name="make-additional-primary"]').is(":checked");var nonce=wrapper.find('input[name="add_email_nonce"]').val();var postData={edd_action:"customer-add-email",customer_id:customer_id,email:email,primary:primary,_wpnonce:nonce};$.post(ajaxurl,postData,function(response){if(true===response.success){window.location.href=response.redirect}else{button.attr("disabled",false);wrapper.after('<div class="notice-wrap"><div class="notice notice-error inline"><p>'+response.message+"</p></div></div>");wrapper.find(".spinner").css("visibility","hidden")}},"json")})},user_search:function(){$(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(e){e.preventDefault();var user_id=$(this).data("userid");EDD_Customer.vars.user_id.val(user_id)})},remove_user:function(){$(document.body).on("click","#disconnect-customer",function(e){e.preventDefault();var customer_id=$('input[name="customerinfo[id]"]').val();var postData={edd_action:"disconnect-userid",customer_id:customer_id,_wpnonce:$("#edit-customer-info #_wpnonce").val()};$.post(ajaxurl,postData,function(response){window.location.href=window.location.href},"json")})},cancel_edit:function(){$(document.body).on("click","#edd-edit-customer-cancel",function(e){e.preventDefault();EDD_Customer.vars.customer_card_wrap_edit_item.hide();EDD_Customer.vars.customer_card_wrap_editable.show();$(".edd_user_search_results").html("")})},change_country:function(){$('select[name="customerinfo[country]"]').change(function(){var $this=$(this);data={action:"edd_get_shop_states",country:$this.val(),field_name:"customerinfo[state]"};$.post(ajaxurl,data,function(response){if("nostates"==response){EDD_Customer.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>')}else{EDD_Customer.vars.state_input.replaceWith(response)}});return false})},add_note:function(){$(document.body).on("click","#add-customer-note",function(e){e.preventDefault();var postData={edd_action:"add-customer-note",customer_id:$("#customer-id").val(),customer_note:EDD_Customer.vars.note.val(),add_customer_note_nonce:$("#add_customer_note_nonce").val()};if(postData.customer_note){$.ajax({type:"POST",data:postData,url:ajaxurl,success:function(response){$("#edd-customer-notes").prepend(response);$(".edd-no-customer-notes").hide();EDD_Customer.vars.note.val("")}}).fail(function(data){if(window.console&&window.console.log){console.log(data)}})}else{var border_color=EDD_Customer.vars.note.css("border-color");EDD_Customer.vars.note.css("border-color","red");setTimeout(function(){EDD_Customer.vars.note.css("border-color",border_color)},500)}})},delete_checked:function(){$("#edd-customer-delete-confirm").change(function(){var records_input=$("#edd-customer-delete-records");var submit_button=$("#edd-delete-customer");if($(this).prop("checked")){records_input.attr("disabled",false);submit_button.attr("disabled",false)}else{records_input.attr("disabled",true);records_input.prop("checked",false);submit_button.attr("disabled",true)}})}};EDD_Customer.init();$(".edd-ajax-user-search").keyup(function(){var user_search=$(this).val();var exclude="";if($(this).data("exclude")){exclude=$(this).data("exclude")}$(".edd-ajax").show();data={action:"edd_search_users",user_name:user_search,exclude:exclude};document.body.style.cursor="wait";$.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(search_response){$(".edd-ajax").hide();$(".edd_user_search_results").removeClass("hidden");$(".edd_user_search_results span").html("");$(search_response.results).appendTo(".edd_user_search_results span");document.body.style.cursor="default"}})});$(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(e){e.preventDefault();var login=$(this).data("login");$(".edd-ajax-user-search").val(login);$(".edd_user_search_results").addClass("hidden");$(".edd_user_search_results span").html("")});$(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(e){e.preventDefault();$(".edd-ajax-user-search").val("");$(".edd_user_search_results").addClass("hidden");$(".edd_user_search_results span").html("")});if($("#edd_dashboard_sales").length){$.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(response){$("#edd_dashboard_sales .inside").html(response)}})}$(document).on("keydown",".customer-note-input",function(e){if(e.keyCode==13&&(e.metaKey||e.ctrlKey)){$("#add-customer-note").click()}})});var eddFormatCurrency=function(value){var numeric=parseFloat(value);var storeCurrency=edd_vars.currency;var decimalPlaces=edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"currency",currency:storeCurrency,minimumFractionDigits:decimalPlaces,maximumFractionDigits:decimalPlaces})};var eddFormatNumber=function(value){var numeric=parseFloat(value);var storeCurrency=edd_vars.currency;var decimalPlaces=edd_vars.currency_decimals;return numeric.toLocaleString(storeCurrency,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})};var eddLabelFormatter=function(label,series){return'<div style="font-size:12px; text-align:center; padding:2px">'+label+"</div>"};var eddLegendFormatterSales=function(label,series){var slug=label.toLowerCase().replace(/\s/g,"-");var color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>';var value='<div class="edd-pie-legend-item">'+label+": "+Math.round(series.percent)+"% ("+eddFormatNumber(series.data[0][1])+")</div>";var item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+value+"</div>";jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item);return item};var eddLegendFormatterEarnings=function(label,series){var slug=label.toLowerCase().replace(/\s/g,"-");var color='<div class="edd-legend-color" style="background-color: '+series.color+'"></div>';var value='<div class="edd-pie-legend-item">'+label+": "+Math.round(series.percent)+"% ("+eddFormatCurrency(series.data[0][1])+")</div>";var item='<div id="'+series.edd_vars.id+slug+'" class="edd-legend-item-wrapper">'+color+value+"</div>";jQuery("#edd-pie-legend-"+series.edd_vars.id).append(item);return item};
easy-digital-downloads.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.6.11
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
@@ -25,7 +25,7 @@
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
- * @version 2.6.11
29
  */
30
 
31
  // Exit if accessed directly.
@@ -196,7 +196,7 @@ final class Easy_Digital_Downloads {
196
 
197
  // Plugin version.
198
  if ( ! defined( 'EDD_VERSION' ) ) {
199
- define( 'EDD_VERSION', '2.6.11' );
200
  }
201
 
202
  // Plugin Folder Path.
5
  * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Easy Digital Downloads
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.6.12
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.6.12
29
  */
30
 
31
  // Exit if accessed directly.
196
 
197
  // Plugin version.
198
  if ( ! defined( 'EDD_VERSION' ) ) {
199
+ define( 'EDD_VERSION', '2.6.12' );
200
  }
201
 
202
  // Plugin Folder Path.
includes/EDD_SL_Plugin_Updater.php CHANGED
@@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
10
  * Allows plugins to use their own update API.
11
  *
12
  * @author Pippin Williamson
13
- * @version 1.6.5
14
  */
15
  class EDD_SL_Plugin_Updater {
16
 
@@ -20,6 +20,7 @@ class EDD_SL_Plugin_Updater {
20
  private $slug = '';
21
  private $version = '';
22
  private $wp_override = false;
 
23
 
24
  /**
25
  * Class constructor.
@@ -42,6 +43,8 @@ class EDD_SL_Plugin_Updater {
42
  $this->version = $_api_data['version'];
43
  $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
44
 
 
 
45
  $edd_plugin_data[ $this->slug ] = $this->api_data;
46
 
47
  // Set up hooks.
@@ -58,7 +61,7 @@ class EDD_SL_Plugin_Updater {
58
  */
59
  public function init() {
60
 
61
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
62
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
63
  remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10, 2 );
64
  add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
@@ -95,7 +98,13 @@ class EDD_SL_Plugin_Updater {
95
  return $_transient_data;
96
  }
97
 
98
- $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
 
 
 
 
 
 
99
 
100
  if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
101
 
@@ -146,21 +155,19 @@ class EDD_SL_Plugin_Updater {
146
 
147
  if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
148
 
149
- $cache_key = md5( 'edd_plugin_' . sanitize_key( $this->name ) . '_version_info' );
150
- $version_info = get_transient( $cache_key );
151
-
152
- if( false === $version_info ) {
153
 
 
154
  $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
155
 
156
- set_transient( $cache_key, $version_info, 3600 );
157
  }
158
 
159
- if( ! is_object( $version_info ) ) {
160
  return;
161
  }
162
 
163
- if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
164
 
165
  $update_cache->response[ $this->name ] = $version_info;
166
 
@@ -251,7 +258,7 @@ class EDD_SL_Plugin_Updater {
251
  )
252
  );
253
 
254
- $cache_key = 'edd_api_request_' . substr( md5( serialize( $this->slug ) ), 0, 15 );
255
 
256
  //Get the transient where we store the api request for this plugin for 24 hours
257
  $edd_api_request_transient = get_site_transient( $cache_key );
@@ -321,7 +328,7 @@ class EDD_SL_Plugin_Updater {
321
  'slug' => $data['slug'],
322
  'author' => $data['author'],
323
  'url' => home_url(),
324
- 'beta' => $data['beta']
325
  );
326
 
327
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
10
  * Allows plugins to use their own update API.
11
  *
12
  * @author Pippin Williamson
13
+ * @version 1.6.6
14
  */
15
  class EDD_SL_Plugin_Updater {
16
 
20
  private $slug = '';
21
  private $version = '';
22
  private $wp_override = false;
23
+ private $cache_key = '';
24
 
25
  /**
26
  * Class constructor.
43
  $this->version = $_api_data['version'];
44
  $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
45
 
46
+ $this->cache_key = md5( serialize( $this->slug . $this->api_data['license'] ) );
47
+
48
  $edd_plugin_data[ $this->slug ] = $this->api_data;
49
 
50
  // Set up hooks.
61
  */
62
  public function init() {
63
 
64
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
65
  add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
66
  remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10, 2 );
67
  add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
98
  return $_transient_data;
99
  }
100
 
101
+ $version_info = get_transient( $this->cache_key );
102
+
103
+ if ( false === $version_info ) {
104
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
105
+
106
+ set_transient( $this->cache_key, $version_info, 3600 );
107
+ }
108
 
109
  if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
110
 
155
 
156
  if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
157
 
158
+ $version_info = get_transient( $this->cache_key );
 
 
 
159
 
160
+ if ( false === $version_info ) {
161
  $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
162
 
163
+ set_transient( $this->cache_key, $version_info, 3600 );
164
  }
165
 
166
+ if ( ! is_object( $version_info ) ) {
167
  return;
168
  }
169
 
170
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
171
 
172
  $update_cache->response[ $this->name ] = $version_info;
173
 
258
  )
259
  );
260
 
261
+ $cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data->license ) );
262
 
263
  //Get the transient where we store the api request for this plugin for 24 hours
264
  $edd_api_request_transient = get_site_transient( $cache_key );
328
  'slug' => $data['slug'],
329
  'author' => $data['author'],
330
  'url' => home_url(),
331
+ 'beta' => isset( $data['beta'] ) ? $data['beta'] : false,
332
  );
333
 
334
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
includes/admin/class-edd-notices.php CHANGED
@@ -46,14 +46,14 @@ class EDD_Notices {
46
  ?>
47
  <div class="error">
48
  <p><?php printf( __( 'No checkout page has been configured. Visit <a href="%s">Settings</a> to set one.', 'easy-digital-downloads' ), admin_url( 'edit.php?post_type=download&page=edd-settings' ) ); ?></p>
49
- <p><a href="<?php echo add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'set_checkout' ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
50
  </div>
51
  <?php
52
  echo ob_get_clean();
53
  }
54
 
55
  if ( isset( $_GET['page'] ) && 'edd-payment-history' == $_GET['page'] && current_user_can( 'view_shop_reports' ) && edd_is_test_mode() ) {
56
- $notices['updated']['edd-payment-history-test-mode'] = sprintf( __( 'Note: Test Mode is enabled, only test payments are shown below. <a href="%s">Settings</a>.', 'easy-digital-downloads' ), admin_url( 'edit.php?post_type=download&page=edd-settings' ) );
57
  }
58
 
59
  if( stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) && ! get_user_meta( get_current_user_id(), '_edd_nginx_redirect_dismissed', true ) && current_user_can( 'manage_shop_settings' ) ) {
@@ -64,7 +64,7 @@ class EDD_Notices {
64
  <p><?php printf( __( 'The download files in %s are not currently protected due to your site running on NGINX.', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
65
  <p><?php _e( 'To protect them, you must add a redirect rule as explained in <a href="http://docs.easydigitaldownloads.com/article/682-protected-download-files-on-nginx">this guide</a>.', 'easy-digital-downloads' ); ?></p>
66
  <p><?php _e( 'If you have already added the redirect rule, you may safely dismiss this notice', 'easy-digital-downloads' ); ?></p>
67
- <p><a href="<?php echo add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'nginx_redirect' ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
68
  </div>
69
  <?php
70
  echo ob_get_clean();
@@ -81,7 +81,7 @@ class EDD_Notices {
81
  <p><?php printf( __( 'The Easy Digital Downloads .htaccess file is missing from %s!', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
82
  <p><?php printf( __( 'First, please resave the Misc settings tab a few times. If this warning continues to appear, create a file called ".htaccess" in the %s directory, and copy the following into it:', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
83
  <p><pre><?php echo edd_get_htaccess_rules(); ?></pre></p>
84
- <p><a href="<?php echo add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'htaccess_missing' ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
85
  </div>
86
  <?php
87
  echo ob_get_clean();
46
  ?>
47
  <div class="error">
48
  <p><?php printf( __( 'No checkout page has been configured. Visit <a href="%s">Settings</a> to set one.', 'easy-digital-downloads' ), admin_url( 'edit.php?post_type=download&page=edd-settings' ) ); ?></p>
49
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'set_checkout' ) ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
50
  </div>
51
  <?php
52
  echo ob_get_clean();
53
  }
54
 
55
  if ( isset( $_GET['page'] ) && 'edd-payment-history' == $_GET['page'] && current_user_can( 'view_shop_reports' ) && edd_is_test_mode() ) {
56
+ $notices['updated']['edd-payment-history-test-mode'] = sprintf( __( 'Note: Test Mode is enabled, only test payments are shown below. <a href="%s">Settings</a>.', 'easy-digital-downloads' ), admin_url( 'edit.php?post_type=download&page=edd-settings&tab=gateways' ) );
57
  }
58
 
59
  if( stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) && ! get_user_meta( get_current_user_id(), '_edd_nginx_redirect_dismissed', true ) && current_user_can( 'manage_shop_settings' ) ) {
64
  <p><?php printf( __( 'The download files in %s are not currently protected due to your site running on NGINX.', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
65
  <p><?php _e( 'To protect them, you must add a redirect rule as explained in <a href="http://docs.easydigitaldownloads.com/article/682-protected-download-files-on-nginx">this guide</a>.', 'easy-digital-downloads' ); ?></p>
66
  <p><?php _e( 'If you have already added the redirect rule, you may safely dismiss this notice', 'easy-digital-downloads' ); ?></p>
67
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'nginx_redirect' ) ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
68
  </div>
69
  <?php
70
  echo ob_get_clean();
81
  <p><?php printf( __( 'The Easy Digital Downloads .htaccess file is missing from %s!', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
82
  <p><?php printf( __( 'First, please resave the Misc settings tab a few times. If this warning continues to appear, create a file called ".htaccess" in the %s directory, and copy the following into it:', 'easy-digital-downloads' ), '<strong>' . edd_get_upload_dir() . '</strong>' ); ?></p>
83
  <p><pre><?php echo edd_get_htaccess_rules(); ?></pre></p>
84
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'edd_action' => 'dismiss_notices', 'edd_notice' => 'htaccess_missing' ) ) ); ?>"><?php _e( 'Dismiss Notice', 'easy-digital-downloads' ); ?></a></p>
85
  </div>
86
  <?php
87
  echo ob_get_clean();
includes/admin/discounts/discount-actions.php CHANGED
@@ -41,7 +41,7 @@ function edd_add_discount( $data ) {
41
  $value[ $product_key ] = preg_replace("/[^0-9_]/", '', $product_value );
42
  }
43
 
44
- $discount[ $key ] = $value;
45
 
46
  } else if ( $key != 'edd-discount-nonce' && $key != 'edd-action' && $key != 'edd-redirect' ) {
47
 
41
  $value[ $product_key ] = preg_replace("/[^0-9_]/", '', $product_value );
42
  }
43
 
44
+ $posted[ $key ] = $value;
45
 
46
  } else if ( $key != 'edd-discount-nonce' && $key != 'edd-action' && $key != 'edd-redirect' ) {
47
 
includes/admin/downloads/metabox.php CHANGED
@@ -116,7 +116,7 @@ function edd_download_meta_box_save( $post_id, $post ) {
116
 
117
  // Accept blank or "0"
118
  if ( '_edd_download_limit' == $field ) {
119
- if ( ! empty( $_POST[ $field ] ) || strlen( $_POST[ $field ] ) === 0 || "0" === $_POST[ $field ] ) {
120
 
121
  $global_limit = edd_get_option( 'file_download_limit' );
122
  $new_limit = apply_filters( 'edd_metabox_save_' . $field, $_POST[ $field ] );
116
 
117
  // Accept blank or "0"
118
  if ( '_edd_download_limit' == $field ) {
119
+ if ( ! empty( $_POST[ $field ] ) || ( isset( $_POST[ $field ] ) && strlen( $_POST[ $field ] ) === 0 ) || ( isset( $_POST[ $field ] ) && "0" === $_POST[ $field ] ) ) {
120
 
121
  $global_limit = edd_get_option( 'file_download_limit' );
122
  $new_limit = apply_filters( 'edd_metabox_save_' . $field, $_POST[ $field ] );
includes/admin/payments/view-order-details.php CHANGED
@@ -177,7 +177,7 @@ $customer = new EDD_Customer( $payment->customer_id );
177
  <div class="inside">
178
  <div class="edd-order-resend-receipt-box edd-admin-box">
179
  <?php do_action( 'edd_view_order_details_resend_receipt_before', $payment_id ); ?>
180
- <a href="<?php echo add_query_arg( array( 'edd-action' => 'email_links', 'purchase_id' => $payment_id ) ); ?>" id="<?php if( count( $customer->emails ) > 1 ) { echo 'edd-select-receipt-email'; } else { echo 'edd-resend-receipt'; } ?>" class="button-secondary alignleft"><?php _e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
181
  <span alt="f223" class="edd-help-tip dashicons dashicons-editor-help" title="<?php _e( '<strong>Resend Receipt</strong>: This will send a new copy of the purchase receipt to the customer&#8217;s email address. If download URLs are included in the receipt, new file download URLs will also be included with the receipt.', 'easy-digital-downloads' ); ?>"></span>
182
  <?php if( count( $customer->emails ) > 1 ) : ?>
183
  <div class="clear"></div>
177
  <div class="inside">
178
  <div class="edd-order-resend-receipt-box edd-admin-box">
179
  <?php do_action( 'edd_view_order_details_resend_receipt_before', $payment_id ); ?>
180
+ <a href="<?php echo esc_url( add_query_arg( array( 'edd-action' => 'email_links', 'purchase_id' => $payment_id ) ) ); ?>" id="<?php if( count( $customer->emails ) > 1 ) { echo 'edd-select-receipt-email'; } else { echo 'edd-resend-receipt'; } ?>" class="button-secondary alignleft"><?php _e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
181
  <span alt="f223" class="edd-help-tip dashicons dashicons-editor-help" title="<?php _e( '<strong>Resend Receipt</strong>: This will send a new copy of the purchase receipt to the customer&#8217;s email address. If download URLs are included in the receipt, new file download URLs will also be included with the receipt.', 'easy-digital-downloads' ); ?>"></span>
182
  <?php if( count( $customer->emails ) > 1 ) : ?>
183
  <div class="clear"></div>
includes/admin/reporting/graphing.php CHANGED
@@ -37,7 +37,9 @@ function edd_reports_graph() {
37
  $day_by_day = true;
38
  break;
39
  case 'other' :
40
- if( $dates['m_end'] - $dates['m_start'] >= 3 || ( $dates['year_end'] > $dates['year'] && ( $dates['m_start'] - $dates['m_end'] ) != 10 ) ) {
 
 
41
  $day_by_day = false;
42
  } else {
43
  $day_by_day = true;
@@ -55,7 +57,7 @@ function edd_reports_graph() {
55
 
56
  if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
57
  // Hour by hour
58
- $hour = 1;
59
  $month = $dates['m_start'];
60
 
61
  $i = 0;
@@ -72,7 +74,7 @@ function edd_reports_graph() {
72
  $earnings_totals += $earnings;
73
  $earnings_data[] = array( $date, $earnings );
74
 
75
- if ( $sales[ $i ]['h'] == $hour ) {
76
  $sales_data[] = array( $date, $sales[ $i ]['count'] );
77
  $sales_totals += $sales[ $i ]['count'];
78
  $i++;
@@ -82,9 +84,7 @@ function edd_reports_graph() {
82
 
83
  $hour++;
84
  }
85
-
86
  } elseif ( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) {
87
-
88
  $num_of_days = cal_days_in_month( CAL_GREGORIAN, $dates['m_start'], $dates['year'] );
89
 
90
  $report_dates = array();
@@ -130,8 +130,21 @@ function edd_reports_graph() {
130
  }
131
 
132
  } else {
133
- $date_start = $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day'];
134
- $date_end = $dates['year_end'] . '-' . $dates['m_end'] . '-' . $dates['day_end'];
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  $sales = EDD()->payment_stats->get_sales_by_range( $dates['range'], $day_by_day, $date_start, $date_end );
137
 
@@ -150,7 +163,7 @@ function edd_reports_graph() {
150
  $sales_totals += $sale['count'];
151
  }
152
 
153
- while ( $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) {
154
  $d = date( 'd', strtotime( $date_start ) );
155
  $m = date( 'm', strtotime( $date_start ) );
156
  $y = date( 'Y', strtotime( $date_start ) );
@@ -162,7 +175,7 @@ function edd_reports_graph() {
162
  $date_start = date( 'Y-m-d', strtotime( '+1 day', strtotime( $date_start ) ) );
163
  }
164
 
165
- while ( ! $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) {
166
  $m = date( 'm', strtotime( $date_start ) );
167
  $y = date( 'Y', strtotime( $date_start ) );
168
 
@@ -173,51 +186,27 @@ function edd_reports_graph() {
173
  $date_start = date( 'Y-m', strtotime( '+1 month', strtotime( $date_start ) ) );
174
  }
175
 
176
- while ( $y <= $dates['year_end'] ) {
177
- $last_year = false;
178
-
179
- if ( $dates['year'] == $dates['year_end'] ) {
180
- $month_start = $dates['m_start'];
181
- $month_end = $dates['m_end'];
182
- $last_year = true;
183
- } elseif( $y == $dates['year'] ) {
184
- $month_start = $dates['m_start'];
185
- $month_end = 12;
186
- } elseif ( $y == $dates['year_end'] ) {
187
- $month_start = 1;
188
- $month_end = $dates['m_end'];
189
- } else {
190
- $month_start = 1;
191
- $month_end = 12;
192
- }
193
-
194
- $i = $month_start;
195
- while ( $i <= $month_end ) {
196
- $d = $dates['day'];
197
-
198
- if ( $i == $month_end ) {
199
- $num_of_days = $dates['day_end'];
200
-
201
- if ( $month_start < $month_end ) {
202
- $d = 1;
203
- }
204
- } else {
205
- $num_of_days = cal_days_in_month( CAL_GREGORIAN, $i, $y );
206
- }
207
-
208
- while ( $d <= $num_of_days ) {
209
- $earnings = edd_get_earnings_by_date( $d, $i, $y, null, $include_taxes );
210
- $earnings_totals += $earnings;
211
 
212
- $temp_data['earnings'][ $y ][ $i ][ $d ] = $earnings;
 
 
 
213
 
214
- $d++;
215
- }
216
 
217
- $i++;
218
- }
219
 
220
- $y++;
221
  }
222
 
223
  $sales_data = array();
@@ -238,7 +227,9 @@ function edd_reports_graph() {
238
  foreach ( $sales_data as $key => $value ) {
239
  $timestamps[ $key ] = $value[0];
240
  }
241
- array_multisort( $timestamps, SORT_ASC, $sales_data );
 
 
242
 
243
  foreach ( $temp_data['earnings'] as $year => $months ) {
244
  foreach ( $months as $month => $days ) {
@@ -246,7 +237,6 @@ function edd_reports_graph() {
246
  $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000;
247
  $earnings_data[] = array( $date, $earnings );
248
  }
249
-
250
  }
251
  }
252
 
@@ -285,7 +275,9 @@ function edd_reports_graph() {
285
  foreach ( $sales_data as $key => $value ) {
286
  $timestamps[ $key ] = $value[0];
287
  }
288
- array_multisort( $timestamps, SORT_ASC, $sales_data );
 
 
289
 
290
  foreach ( $temp_data[ 'earnings' ] as $year => $months ) {
291
  $month_keys = array_keys( $months );
@@ -430,7 +422,7 @@ function edd_reports_graph_of_download( $download_id = 0 ) {
430
  if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
431
  // Hour by hour
432
  $month = $dates['m_start'];
433
- $hour = 1;
434
  $minute = 0;
435
  $second = 0;
436
  while ( $hour <= 23 ) :
@@ -813,6 +805,7 @@ function edd_get_report_dates() {
813
  $dates['m_end'] = $month;
814
  $dates['year'] = $year;
815
  $dates['year_end'] = $year;
 
816
  break;
817
 
818
  case 'this_week' :
37
  $day_by_day = true;
38
  break;
39
  case 'other' :
40
+ if ( $dates['m_start'] == 12 && $dates['m_end'] == 1 ) {
41
+ $day_by_day = true;
42
+ } elseif ( $dates['m_end'] - $dates['m_start'] >= 3 || ( $dates['year_end'] > $dates['year'] && ( $dates['m_start'] - $dates['m_end'] ) != 10 ) ) {
43
  $day_by_day = false;
44
  } else {
45
  $day_by_day = true;
57
 
58
  if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
59
  // Hour by hour
60
+ $hour = 0;
61
  $month = $dates['m_start'];
62
 
63
  $i = 0;
74
  $earnings_totals += $earnings;
75
  $earnings_data[] = array( $date, $earnings );
76
 
77
+ if ( isset( $sales[ $i ] ) && $sales[ $i ]['h'] == $hour ) {
78
  $sales_data[] = array( $date, $sales[ $i ]['count'] );
79
  $sales_totals += $sales[ $i ]['count'];
80
  $i++;
84
 
85
  $hour++;
86
  }
 
87
  } elseif ( $dates['range'] == 'this_week' || $dates['range'] == 'last_week' ) {
 
88
  $num_of_days = cal_days_in_month( CAL_GREGORIAN, $dates['m_start'], $dates['year'] );
89
 
90
  $report_dates = array();
130
  }
131
 
132
  } else {
133
+ if ( cal_days_in_month( CAL_GREGORIAN, $dates['m_start'], $dates['year'] ) < $dates['day'] ) {
134
+ $next_day = mktime( 0, 0, 0, $dates['m_start'] + 1, 1, $dates['year'] );
135
+ $day = date( 'd', $next_day );
136
+ $month = date( 'm', $next_day );
137
+ $year = date( 'Y', $next_day );
138
+ $date_start = $year . '-' . $month . '-' . $day;
139
+ } else {
140
+ $date_start = $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day'];
141
+ }
142
+
143
+ if ( cal_days_in_month( CAL_GREGORIAN, $dates['m_end'], $dates['year'] ) < $dates['day_end'] ) {
144
+ $date_end = $dates['year_end'] . '-' . $dates['m_end'] . '-' . cal_days_in_month( CAL_GREGORIAN, $dates['m_end'], $dates['year'] );
145
+ } else {
146
+ $date_end = $dates['year_end'] . '-' . $dates['m_end'] . '-' . $dates['day_end'];
147
+ }
148
 
149
  $sales = EDD()->payment_stats->get_sales_by_range( $dates['range'], $day_by_day, $date_start, $date_end );
150
 
163
  $sales_totals += $sale['count'];
164
  }
165
 
166
+ while ( $dates['range'] !== 'other' && $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) {
167
  $d = date( 'd', strtotime( $date_start ) );
168
  $m = date( 'm', strtotime( $date_start ) );
169
  $y = date( 'Y', strtotime( $date_start ) );
175
  $date_start = date( 'Y-m-d', strtotime( '+1 day', strtotime( $date_start ) ) );
176
  }
177
 
178
+ while ( $dates['range'] !== 'other' && ! $day_by_day && ( strtotime( $date_start ) <= strtotime( $date_end ) ) ) {
179
  $m = date( 'm', strtotime( $date_start ) );
180
  $y = date( 'Y', strtotime( $date_start ) );
181
 
186
  $date_start = date( 'Y-m', strtotime( '+1 month', strtotime( $date_start ) ) );
187
  }
188
 
189
+ if ( cal_days_in_month( CAL_GREGORIAN, $dates['m_start'], $dates['year'] ) < $dates['day'] ) {
190
+ $next_day = mktime( 0, 0, 0, $dates['m_start'] + 1, 1, $dates['year'] );
191
+ $day = date( 'd', $next_day );
192
+ $month = date( 'm', $next_day );
193
+ $year = date( 'Y', $next_day );
194
+ $date_start = $year . '-' . $month . '-' . $day;
195
+ } else {
196
+ $date_start = $dates['year'] . '-' . $dates['m_start'] . '-' . $dates['day'];
197
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
+ while ( strtotime( $date_start ) <= strtotime( $date_end ) ) {
200
+ $m = date( 'm', strtotime( $date_start ) );
201
+ $y = date( 'Y', strtotime( $date_start ) );
202
+ $d = date( 'd', strtotime( $date_start ) );
203
 
204
+ $earnings = edd_get_earnings_by_date( $d, $m, $y, null, $include_taxes );
205
+ $earnings_totals += $earnings;
206
 
207
+ $temp_data['earnings'][ $y ][ $m ][ $d ] = $earnings;
 
208
 
209
+ $date_start = date( 'Y-m-d', strtotime( '+1 day', strtotime( $date_start ) ) );
210
  }
211
 
212
  $sales_data = array();
227
  foreach ( $sales_data as $key => $value ) {
228
  $timestamps[ $key ] = $value[0];
229
  }
230
+ if ( ! empty( $timestamps ) ) {
231
+ array_multisort( $timestamps, SORT_ASC, $sales_data );
232
+ }
233
 
234
  foreach ( $temp_data['earnings'] as $year => $months ) {
235
  foreach ( $months as $month => $days ) {
237
  $date = mktime( 0, 0, 0, $month, $day, $year ) * 1000;
238
  $earnings_data[] = array( $date, $earnings );
239
  }
 
240
  }
241
  }
242
 
275
  foreach ( $sales_data as $key => $value ) {
276
  $timestamps[ $key ] = $value[0];
277
  }
278
+ if ( ! empty( $timestamps ) ) {
279
+ array_multisort( $timestamps, SORT_ASC, $sales_data );
280
+ }
281
 
282
  foreach ( $temp_data[ 'earnings' ] as $year => $months ) {
283
  $month_keys = array_keys( $months );
422
  if ( $dates['range'] == 'today' || $dates['range'] == 'yesterday' ) {
423
  // Hour by hour
424
  $month = $dates['m_start'];
425
+ $hour = 0;
426
  $minute = 0;
427
  $second = 0;
428
  while ( $hour <= 23 ) :
805
  $dates['m_end'] = $month;
806
  $dates['year'] = $year;
807
  $dates['year_end'] = $year;
808
+ $dates['day_end'] = $day;
809
  break;
810
 
811
  case 'this_week' :
includes/admin/settings/display-settings.php CHANGED
@@ -40,10 +40,22 @@ function edd_options_page() {
40
  $all_settings = edd_get_registered_settings();
41
 
42
  // Let's verify we have a 'main' section to show
43
- ob_start();
44
- do_settings_sections( 'edd_settings_' . $active_tab . '_main' );
45
- $has_main_settings = strlen( ob_get_contents() ) > 0;
46
- ob_end_clean();
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  $override = false;
49
  if ( false === $has_main_settings ) {
40
  $all_settings = edd_get_registered_settings();
41
 
42
  // Let's verify we have a 'main' section to show
43
+ $has_main_settings = true;
44
+ if ( empty( $all_settings[ $active_tab ]['main'] ) ) {
45
+ $has_main_settings = false;
46
+ }
47
+
48
+ // Check for old non-sectioned settings (see #4211 and #5171)
49
+ if ( ! $has_main_settings ) {
50
+ foreach( $all_settings[ $active_tab ] as $sid => $stitle ) {
51
+ if ( is_string( $sid ) && is_array( $sections ) && array_key_exists( $sid, $sections ) ) {
52
+ continue;
53
+ } else {
54
+ $has_main_settings = true;
55
+ break;
56
+ }
57
+ }
58
+ }
59
 
60
  $override = false;
61
  if ( false === $has_main_settings ) {
includes/admin/tracking.php CHANGED
@@ -239,22 +239,21 @@ class EDD_Tracking {
239
  * @return void
240
  */
241
  public function admin_notice() {
242
-
243
  $hide_notice = get_option( 'edd_tracking_notice' );
244
 
245
- if( $hide_notice ) {
246
  return;
247
  }
248
 
249
- if( edd_get_option( 'allow_tracking', false ) ) {
250
  return;
251
  }
252
 
253
- if( ! current_user_can( 'manage_options' ) ) {
254
  return;
255
  }
256
 
257
- if(
258
  stristr( network_site_url( '/' ), 'dev' ) !== false ||
259
  stristr( network_site_url( '/' ), 'localhost' ) !== false ||
260
  stristr( network_site_url( '/' ), ':8888' ) !== false // This is common with MAMP on OS X
@@ -267,7 +266,7 @@ class EDD_Tracking {
267
  $source = substr( md5( get_bloginfo( 'name' ) ), 0, 10 );
268
  $extensions_url = 'https://easydigitaldownloads.com/downloads/?utm_source=' . $source . '&utm_medium=admin&utm_term=notice&utm_campaign=EDDUsageTracking';
269
  echo '<div class="updated"><p>';
270
- echo sprintf( __( 'Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and our newsletter and immediately be emailed a 20%% discount to the EDD shop, valid towards the <a href="%s" target="_blank">purchase of extensions</a>. No sensitive data is tracked.', 'easy-digital-downloads' ), $extensions_url );
271
  echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'easy-digital-downloads' ) . '</a>';
272
  echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'easy-digital-downloads' ) . '</a>';
273
  echo '</p></div>';
239
  * @return void
240
  */
241
  public function admin_notice() {
 
242
  $hide_notice = get_option( 'edd_tracking_notice' );
243
 
244
+ if ( $hide_notice ) {
245
  return;
246
  }
247
 
248
+ if ( edd_get_option( 'allow_tracking', false ) ) {
249
  return;
250
  }
251
 
252
+ if ( ! current_user_can( 'manage_options' ) ) {
253
  return;
254
  }
255
 
256
+ if (
257
  stristr( network_site_url( '/' ), 'dev' ) !== false ||
258
  stristr( network_site_url( '/' ), 'localhost' ) !== false ||
259
  stristr( network_site_url( '/' ), ':8888' ) !== false // This is common with MAMP on OS X
266
  $source = substr( md5( get_bloginfo( 'name' ) ), 0, 10 );
267
  $extensions_url = 'https://easydigitaldownloads.com/downloads/?utm_source=' . $source . '&utm_medium=admin&utm_term=notice&utm_campaign=EDDUsageTracking';
268
  echo '<div class="updated"><p>';
269
+ echo sprintf( __( 'Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and our newsletter and immediately be emailed a 20%s discount to the EDD shop, valid towards the <a href="%s" target="_blank">purchase of extensions</a>. No sensitive data is tracked.', 'easy-digital-downloads' ), '%', $extensions_url );
270
  echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-secondary">' . __( 'Allow', 'easy-digital-downloads' ) . '</a>';
271
  echo '&nbsp;<a href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow', 'easy-digital-downloads' ) . '</a>';
272
  echo '</p></div>';
includes/admin/upgrades/upgrades.php CHANGED
@@ -25,7 +25,10 @@ function edd_upgrades_screen() {
25
  $custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0;
26
  $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100;
27
  $steps = round( ( $total / $number ), 0 );
28
-
 
 
 
29
  $doing_upgrade_args = array(
30
  'page' => 'edd-upgrades',
31
  'edd-upgrade' => $action,
25
  $custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0;
26
  $number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100;
27
  $steps = round( ( $total / $number ), 0 );
28
+ if ( ( $steps * $number ) < $total ) {
29
+ $steps++;
30
+ }
31
+
32
  $doing_upgrade_args = array(
33
  'page' => 'edd-upgrades',
34
  'edd-upgrade' => $action,
includes/class-edd-cron.php CHANGED
@@ -70,7 +70,7 @@ class EDD_Cron {
70
  */
71
  private function weekly_events() {
72
  if ( ! wp_next_scheduled( 'edd_weekly_scheduled_events' ) ) {
73
- wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'edd_weekly_scheduled_events' );
74
  }
75
  }
76
 
@@ -83,7 +83,7 @@ class EDD_Cron {
83
  */
84
  private function daily_events() {
85
  if ( ! wp_next_scheduled( 'edd_daily_scheduled_events' ) ) {
86
- wp_schedule_event( current_time( 'timestamp' ), 'daily', 'edd_daily_scheduled_events' );
87
  }
88
  }
89
 
70
  */
71
  private function weekly_events() {
72
  if ( ! wp_next_scheduled( 'edd_weekly_scheduled_events' ) ) {
73
+ wp_schedule_event( current_time( 'timestamp', true ), 'weekly', 'edd_weekly_scheduled_events' );
74
  }
75
  }
76
 
83
  */
84
  private function daily_events() {
85
  if ( ! wp_next_scheduled( 'edd_daily_scheduled_events' ) ) {
86
+ wp_schedule_event( current_time( 'timestamp', true ), 'daily', 'edd_daily_scheduled_events' );
87
  }
88
  }
89
 
includes/class-edd-html-elements.php CHANGED
@@ -504,8 +504,12 @@ class EDD_HTML_Elements {
504
  $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) );
505
  $output = '<select' . $disabled . $readonly . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( edd_sanitize_key( str_replace( '-', '_', $args['id'] ) ) ) . '" class="edd-select ' . $class . '"' . $multiple . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>';
506
 
 
 
 
 
507
  if ( $args['show_option_all'] ) {
508
- if( $args['multiple'] ) {
509
  $selected = selected( true, in_array( 0, $args['selected'] ), false );
510
  } else {
511
  $selected = selected( $args['selected'], 0, false );
@@ -514,21 +518,19 @@ class EDD_HTML_Elements {
514
  }
515
 
516
  if ( ! empty( $args['options'] ) ) {
517
-
518
  if ( $args['show_option_none'] ) {
519
- if( $args['multiple'] ) {
520
  $selected = selected( true, in_array( -1, $args['selected'] ), false );
521
- } else {
522
  $selected = selected( $args['selected'], -1, false );
523
  }
524
  $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
525
  }
526
 
527
  foreach ( $args['options'] as $key => $option ) {
528
-
529
  if ( $args['multiple'] && is_array( $args['selected'] ) ) {
530
  $selected = selected( true, in_array( (string) $key, $args['selected'] ), false );
531
- } else {
532
  $selected = selected( $args['selected'], $key, false );
533
  }
534
 
504
  $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) );
505
  $output = '<select' . $disabled . $readonly . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( edd_sanitize_key( str_replace( '-', '_', $args['id'] ) ) ) . '" class="edd-select ' . $class . '"' . $multiple . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>';
506
 
507
+ if ( ! isset( $args['selected'] ) || empty( $args['selected'] ) || ! $args['selected'] ) {
508
+ $selected = "";
509
+ }
510
+
511
  if ( $args['show_option_all'] ) {
512
+ if ( $args['multiple'] && ! empty( $args['selected'] ) ) {
513
  $selected = selected( true, in_array( 0, $args['selected'] ), false );
514
  } else {
515
  $selected = selected( $args['selected'], 0, false );
518
  }
519
 
520
  if ( ! empty( $args['options'] ) ) {
 
521
  if ( $args['show_option_none'] ) {
522
+ if ( $args['multiple'] ) {
523
  $selected = selected( true, in_array( -1, $args['selected'] ), false );
524
+ } elseif ( isset( $args['selected'] ) && ! empty( $args['selected'] ) && ! is_array( $args['selected'] ) ) {
525
  $selected = selected( $args['selected'], -1, false );
526
  }
527
  $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
528
  }
529
 
530
  foreach ( $args['options'] as $key => $option ) {
 
531
  if ( $args['multiple'] && is_array( $args['selected'] ) ) {
532
  $selected = selected( true, in_array( (string) $key, $args['selected'] ), false );
533
+ } elseif ( isset( $args['selected'] ) && ! empty( $args['selected'] ) && ! is_array( $args['selected'] ) ) {
534
  $selected = selected( $args['selected'], $key, false );
535
  }
536
 
includes/discount-functions.php CHANGED
@@ -63,21 +63,28 @@ function edd_get_discounts( $args = array() ) {
63
  * @return bool
64
  */
65
  function edd_has_active_discounts() {
66
- $has_active = false;
 
 
 
 
 
 
67
 
68
- $discounts = edd_get_discounts();
 
 
 
69
 
70
- if ( $discounts) {
71
- foreach ( $discounts as $discount ) {
72
- if ( edd_is_discount_active( $discount->ID ) ) {
73
- $has_active = true;
74
- break;
75
- }
76
  }
77
  }
78
- return $has_active;
79
- }
80
 
 
 
81
 
82
  /**
83
  * Get Discount
@@ -374,16 +381,18 @@ function edd_discount_exists( $code_id ) {
374
  * Checks whether a discount code is active.
375
  *
376
  * @since 1.0
 
377
  * @param int $code_id
 
378
  * @return bool
379
  */
380
- function edd_is_discount_active( $code_id = null ) {
381
- $discount = edd_get_discount( $code_id );
382
  $return = false;
383
 
384
  if ( $discount ) {
385
- if ( edd_is_discount_expired( $code_id ) ) {
386
- if( defined( 'DOING_AJAX' ) ) {
387
  edd_set_error( 'edd-discount-error', __( 'This discount is expired.', 'easy-digital-downloads' ) );
388
  }
389
  } elseif ( $discount->post_status == 'active' ) {
@@ -566,16 +575,15 @@ function edd_is_discount_not_global( $code_id = 0 ) {
566
  }
567
 
568
  /**
569
- * Is Discount Expired
570
- *
571
  * Checks whether a discount code is expired.
572
  *
573
- * @param int $code_id
574
- *
575
- * @since 1.0
576
- * @return bool
 
577
  */
578
- function edd_is_discount_expired( $code_id = null ) {
579
  $discount = edd_get_discount( $code_id );
580
  $return = false;
581
 
@@ -585,8 +593,10 @@ function edd_is_discount_expired( $code_id = null ) {
585
  $expiration = strtotime( $expiration );
586
  if ( $expiration < current_time( 'timestamp' ) ) {
587
  // Discount is expired
588
- edd_update_discount_status( $code_id, 'inactive' );
589
- update_post_meta( $code_id, '_edd_discount_status', 'expired' );
 
 
590
  $return = true;
591
  }
592
  }
63
  * @return bool
64
  */
65
  function edd_has_active_discounts() {
66
+ $discounts = edd_get_discounts(
67
+ array(
68
+ 'post_status' => 'active',
69
+ 'posts_per_page' => 100,
70
+ 'fields' => 'ids'
71
+ )
72
+ );
73
 
74
+ // When there are no discounts found anymore there are no active ones.
75
+ if ( ! is_array( $discounts ) || array() === $discounts ) {
76
+ return false;
77
+ }
78
 
79
+ foreach ( $discounts as $discount ) {
80
+ // If we catch an active one, we can quit and return true.
81
+ if ( edd_is_discount_active( $discount, false ) ) {
82
+ return true;
 
 
83
  }
84
  }
 
 
85
 
86
+ return false;
87
+ }
88
 
89
  /**
90
  * Get Discount
381
  * Checks whether a discount code is active.
382
  *
383
  * @since 1.0
384
+ * @since 2.6.11 Added $update parameter
385
  * @param int $code_id
386
+ * @param bool $update Update the discount to expired if an one is found but has an active status
387
  * @return bool
388
  */
389
+ function edd_is_discount_active( $code_id = null, $update = true ) {
390
+ $discount = edd_get_discount( $code_id );
391
  $return = false;
392
 
393
  if ( $discount ) {
394
+ if ( edd_is_discount_expired( $code_id, $update ) ) {
395
+ if ( defined( 'DOING_AJAX' ) ) {
396
  edd_set_error( 'edd-discount-error', __( 'This discount is expired.', 'easy-digital-downloads' ) );
397
  }
398
  } elseif ( $discount->post_status == 'active' ) {
575
  }
576
 
577
  /**
 
 
578
  * Checks whether a discount code is expired.
579
  *
580
+ * @since 1.0
581
+ * @since 2.6.11 Added $update parameter
582
+ * @param int $code_id Discount code ID
583
+ * @param bool $update Update the discount to expired if an one is found but has an active status
584
+ * @return bool
585
  */
586
+ function edd_is_discount_expired( $code_id = null, $update = true ) {
587
  $discount = edd_get_discount( $code_id );
588
  $return = false;
589
 
593
  $expiration = strtotime( $expiration );
594
  if ( $expiration < current_time( 'timestamp' ) ) {
595
  // Discount is expired
596
+ if ( $update ) {
597
+ edd_update_discount_status( $code_id, 'inactive' );
598
+ update_post_meta( $code_id, '_edd_discount_status', 'expired' );
599
+ }
600
  $return = true;
601
  }
602
  }
includes/payments/class-edd-payment.php CHANGED
@@ -1605,7 +1605,7 @@ class EDD_Payment {
1605
  $meta_value = apply_filters( 'edd_edd_update_payment_meta_' . $meta_key, $meta_value, $this->ID );
1606
  update_post_meta( $this->ID, '_edd_payment_user_email', $meta_value );
1607
 
1608
- $current_meta = $this->get_meta();
1609
  $current_meta['user_info']['email'] = $meta_value;
1610
 
1611
  $meta_key = '_edd_payment_meta';
1605
  $meta_value = apply_filters( 'edd_edd_update_payment_meta_' . $meta_key, $meta_value, $this->ID );
1606
  update_post_meta( $this->ID, '_edd_payment_user_email', $meta_value );
1607
 
1608
+ $current_meta = $this->get_meta( '_edd_payment_meta', false );
1609
  $current_meta['user_info']['email'] = $meta_value;
1610
 
1611
  $meta_key = '_edd_payment_meta';
includes/payments/class-payment-stats.php CHANGED
@@ -290,7 +290,7 @@ class EDD_Payment_Stats extends EDD_Stats {
290
  $select = "DATE_FORMAT(posts.post_date, '%%m') AS m, YEAR(posts.post_date) AS y, COUNT(DISTINCT posts.ID) as count";
291
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date)";
292
  } else {
293
- if ( $range == 'today' ) {
294
  $select = "DATE_FORMAT(posts.post_date, '%%d') AS d, DATE_FORMAT(posts.post_date, '%%m') AS m, YEAR(posts.post_date) AS y, HOUR(posts.post_date) AS h, COUNT(DISTINCT posts.ID) as count";
295
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date), HOUR(posts.post_date)";
296
  } else {
@@ -299,7 +299,7 @@ class EDD_Payment_Stats extends EDD_Stats {
299
  }
300
  }
301
 
302
- if ( $range == 'today' ) {
303
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date), HOUR(posts.post_date)";
304
  }
305
 
290
  $select = "DATE_FORMAT(posts.post_date, '%%m') AS m, YEAR(posts.post_date) AS y, COUNT(DISTINCT posts.ID) as count";
291
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date)";
292
  } else {
293
+ if ( $range == 'today' || $range == 'yesterday' ) {
294
  $select = "DATE_FORMAT(posts.post_date, '%%d') AS d, DATE_FORMAT(posts.post_date, '%%m') AS m, YEAR(posts.post_date) AS y, HOUR(posts.post_date) AS h, COUNT(DISTINCT posts.ID) as count";
295
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date), HOUR(posts.post_date)";
296
  } else {
299
  }
300
  }
301
 
302
+ if ( $range == 'today' || $range == 'yesterday' ) {
303
  $grouping = "YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date), HOUR(posts.post_date)";
304
  }
305
 
includes/payments/functions.php CHANGED
@@ -518,10 +518,9 @@ function edd_count_payments( $args = array() ) {
518
 
519
  $is_date = checkdate( $month, $day, $year );
520
  if ( false !== $is_date ) {
 
521
 
522
- $date = new DateTime( $args['end-date'] );
523
- $where .= $wpdb->prepare( " AND p.post_date <= '%s'", $date->format( 'Y-m-d' ) );
524
-
525
  }
526
 
527
  }
518
 
519
  $is_date = checkdate( $month, $day, $year );
520
  if ( false !== $is_date ) {
521
+ $date = date( 'Y-m-d', strtotime( '+1 day', mktime( 0, 0, 0, $month, $day, $year ) ) );
522
 
523
+ $where .= $wpdb->prepare( " AND p.post_date < '%s'", $date );
 
 
524
  }
525
 
526
  }
includes/process-purchase.php CHANGED
@@ -390,6 +390,17 @@ function edd_purchase_form_required_fields() {
390
  'error_id' => 'invalid_state',
391
  'error_message' => __( 'Please enter billing state / province', 'easy-digital-downloads' )
392
  );
 
 
 
 
 
 
 
 
 
 
 
393
  }
394
 
395
  return apply_filters( 'edd_purchase_form_required_fields', $required_fields );
390
  'error_id' => 'invalid_state',
391
  'error_message' => __( 'Please enter billing state / province', 'easy-digital-downloads' )
392
  );
393
+
394
+ // Check if the Customer's Country has been passed in and if it has no states.
395
+ if ( isset( $_POST['billing_country'] ) && isset( $required_fields['card_state'] ) ){
396
+ $customer_billing_country = sanitize_text_field( $_POST['billing_country'] );
397
+ $states = edd_get_shop_states( $customer_billing_country );
398
+
399
+ // If this country has no states, remove the requirement of a card_state.
400
+ if ( empty( $states ) ){
401
+ unset( $required_fields['card_state'] );
402
+ }
403
+ }
404
  }
405
 
406
  return apply_filters( 'edd_purchase_form_required_fields', $required_fields );
includes/scripts.php CHANGED
@@ -184,9 +184,9 @@ function edd_load_admin_scripts( $hook ) {
184
  $admin_deps = array();
185
 
186
  if ( ! edd_is_admin_page( $hook, 'edit' ) && ! edd_is_admin_page( $hook, 'new' ) ) {
187
- $admin_deps = array( 'jquery', 'inline-edit-post' );
188
  } else {
189
- $admin_deps = array( 'jquery' );
190
  }
191
 
192
  wp_register_script( 'edd-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', $admin_deps, EDD_VERSION, false );
184
  $admin_deps = array();
185
 
186
  if ( ! edd_is_admin_page( $hook, 'edit' ) && ! edd_is_admin_page( $hook, 'new' ) ) {
187
+ $admin_deps = array( 'jquery', 'jquery-form', 'inline-edit-post' );
188
  } else {
189
+ $admin_deps = array( 'jquery', 'jquery-form' );
190
  }
191
 
192
  wp_register_script( 'edd-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', $admin_deps, EDD_VERSION, false );
includes/shortcodes.php CHANGED
@@ -300,7 +300,7 @@ function edd_purchase_collection_shortcode( $atts, $content = null ) {
300
 
301
  $button_display = implode( ' ', array( $style, $color, $class ) );
302
 
303
- return '<a href="' . add_query_arg( array( 'edd_action' => 'purchase_collection', 'taxonomy' => $taxonomy, 'terms' => $terms ) ) . '" class="' . $button_display . '">' . $text . '</a>';
304
  }
305
  add_shortcode( 'purchase_collection', 'edd_purchase_collection_shortcode' );
306
 
300
 
301
  $button_display = implode( ' ', array( $style, $color, $class ) );
302
 
303
+ return '<a href="' . esc_url( add_query_arg( array( 'edd_action' => 'purchase_collection', 'taxonomy' => $taxonomy, 'terms' => $terms ) ) ) . '" class="' . $button_display . '">' . $text . '</a>';
304
  }
305
  add_shortcode( 'purchase_collection', 'edd_purchase_collection_shortcode' );
306
 
includes/user-functions.php CHANGED
@@ -21,15 +21,14 @@ if ( ! defined( 'ABSPATH' ) ) exit;
21
  *
22
  * @since 1.0
23
  *
24
- * @param int $user User ID or email address
25
- * @param int $number Number of purchases to retrieve
26
- * @param bool $pagination
27
- * @param string $status
28
  *
29
  * @return bool|object List of all user purchases
30
  */
31
  function edd_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) {
32
-
33
  if ( empty( $user ) ) {
34
  $user = get_current_user_id();
35
  }
@@ -38,7 +37,19 @@ function edd_get_users_purchases( $user = 0, $number = 20, $pagination = false,
38
  return false;
39
  }
40
 
41
- $status = $status === 'complete' ? 'publish' : $status;
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  if ( $pagination ) {
44
  if ( get_query_var( 'paged' ) )
@@ -166,11 +177,9 @@ function edd_get_users_purchased_products( $user = 0, $status = 'complete' ) {
166
  return false;
167
  }
168
 
169
- $post_type = get_post_type( $product_ids[0] );
170
-
171
  $args = apply_filters( 'edd_get_users_purchased_products_args', array(
172
  'include' => $product_ids,
173
- 'post_type' => $post_type,
174
  'posts_per_page' => -1,
175
  ) );
176
 
@@ -652,9 +661,9 @@ function edd_get_user_verification_request_url( $user_id = 0 ) {
652
  $user_id = get_current_user_id();
653
  }
654
 
655
- $url = wp_nonce_url( add_query_arg( array(
656
  'edd_action' => 'send_verification_email'
657
- ) ), 'edd-request-verification' );
658
 
659
  return apply_filters( 'edd_get_user_verification_request_url', $url, $user_id );
660
 
21
  *
22
  * @since 1.0
23
  *
24
+ * @param int $user User ID or email address
25
+ * @param int $number Number of purchases to retrieve
26
+ * @param bool pagination
27
+ * @param string|array $status Either an array of statuses, a single status as a string literal or a comma separated list of statues
28
  *
29
  * @return bool|object List of all user purchases
30
  */
31
  function edd_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) {
 
32
  if ( empty( $user ) ) {
33
  $user = get_current_user_id();
34
  }
37
  return false;
38
  }
39
 
40
+ if ( is_string( $status ) ) {
41
+ if ( strpos( $status, ',' ) ) {
42
+ $status = explode( ',', $status );
43
+ } else {
44
+ $status = $status === 'complete' ? 'publish' : $status;
45
+ $status = array( $status );
46
+ }
47
+
48
+ }
49
+
50
+ if ( is_array( $status ) ) {
51
+ $status = array_unique( $status );
52
+ }
53
 
54
  if ( $pagination ) {
55
  if ( get_query_var( 'paged' ) )
177
  return false;
178
  }
179
 
 
 
180
  $args = apply_filters( 'edd_get_users_purchased_products_args', array(
181
  'include' => $product_ids,
182
+ 'post_type' => 'download',
183
  'posts_per_page' => -1,
184
  ) );
185
 
661
  $user_id = get_current_user_id();
662
  }
663
 
664
+ $url = esc_url( wp_nonce_url( add_query_arg( array(
665
  'edd_action' => 'send_verification_email'
666
+ ) ), 'edd-request-verification' ) );
667
 
668
  return apply_filters( 'edd_get_user_verification_request_url', $url, $user_id );
669
 
languages/easy-digital-downloads.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Easy Digital Downloads 2.6.11\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2016-11-08 13:27:35+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -99,8 +99,8 @@ msgstr ""
99
  #: includes/error-tracking.php:36 includes/gateways/functions.php:221
100
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:155
101
  #: includes/process-download.php:254 includes/process-download.php:787
102
- #: includes/query-filters.php:48 includes/user-functions.php:817
103
- #: includes/user-functions.php:842 includes/user-functions.php:895
104
  msgid "Error"
105
  msgstr ""
106
 
@@ -389,7 +389,7 @@ msgstr ""
389
  #: includes/admin/discounts/class-discount-codes-table.php:289
390
  #: includes/admin/payments/class-payments-table.php:323
391
  #: includes/admin/payments/class-payments-table.php:395
392
- #: includes/payments/functions.php:1613
393
  msgid "Delete"
394
  msgstr ""
395
 
@@ -469,7 +469,7 @@ msgid "An error has occured. Please try again."
469
  msgstr ""
470
 
471
  #: includes/admin/customers/customer-actions.php:207
472
- #: includes/user-functions.php:842
473
  msgid "Nonce verification failed."
474
  msgstr ""
475
 
@@ -592,14 +592,14 @@ msgstr ""
592
  #: includes/admin/reporting/class-export-payments.php:68
593
  #: includes/admin/reporting/export/class-batch-export-payments.php:48
594
  #: includes/admin/tools.php:686 includes/checkout/template.php:355
595
- #: templates/shortcode-profile-editor.php:132
596
  msgid "City"
597
  msgstr ""
598
 
599
  #: includes/admin/customers/customers.php:246
600
  #: includes/admin/settings/register-settings.php:1931
601
  #: includes/admin/tools.php:695 includes/checkout/template.php:417
602
- #: templates/shortcode-profile-editor.php:145
603
  msgid "State / Province"
604
  msgstr ""
605
 
@@ -640,7 +640,7 @@ msgstr ""
640
  #: includes/admin/customers/customers.php:305
641
  #: includes/admin/customers/customers.php:587
642
  #: includes/admin/payments/view-order-details.php:475
643
- #: includes/admin/thickbox.php:131 includes/class-edd-html-elements.php:731
644
  msgid "Cancel"
645
  msgstr ""
646
 
@@ -690,7 +690,7 @@ msgstr ""
690
  #: includes/admin/payments/view-order-details.php:375
691
  #: includes/admin/settings/register-settings.php:1934 includes/scripts.php:222
692
  #: templates/checkout_cart.php:57 templates/checkout_cart.php:75
693
- #: templates/shortcode-profile-editor.php:114
694
  msgid "Remove"
695
  msgstr ""
696
 
@@ -838,8 +838,8 @@ msgstr ""
838
  #: includes/admin/reporting/class-download-reports-table.php:112
839
  #: includes/admin/reporting/class-export-earnings.php:64
840
  #: includes/admin/reporting/export/class-batch-export-downloads.php:59
841
- #: includes/admin/reporting/graphing.php:309
842
- #: includes/admin/reporting/graphing.php:609
843
  #: includes/admin/reporting/pdf-reports.php:206
844
  #: includes/admin/reporting/reports.php:54
845
  msgid "Earnings"
@@ -853,12 +853,12 @@ msgstr[0] ""
853
  msgstr[1] ""
854
 
855
  #: includes/admin/dashboard-widgets.php:80
856
- #: includes/admin/reporting/graphing.php:650 includes/class-edd-stats.php:89
857
  msgid "Last Month"
858
  msgstr ""
859
 
860
  #: includes/admin/dashboard-widgets.php:105
861
- #: includes/admin/reporting/graphing.php:645 includes/class-edd-stats.php:84
862
  msgid "Today"
863
  msgstr ""
864
 
@@ -867,8 +867,8 @@ msgstr ""
867
  #: includes/admin/reporting/class-download-reports-table.php:111
868
  #: includes/admin/reporting/class-export-earnings.php:63
869
  #: includes/admin/reporting/export/class-batch-export-downloads.php:58
870
- #: includes/admin/reporting/graphing.php:310
871
- #: includes/admin/reporting/graphing.php:610
872
  #: includes/admin/reporting/logs.php:145
873
  #: includes/admin/reporting/pdf-reports.php:223
874
  msgid "Sales"
@@ -1776,27 +1776,27 @@ msgid "Completed"
1776
  msgstr ""
1777
 
1778
  #: includes/admin/payments/class-payments-table.php:202
1779
- #: includes/payments/functions.php:649
1780
  msgid "Pending"
1781
  msgstr ""
1782
 
1783
  #: includes/admin/payments/class-payments-table.php:203
1784
- #: includes/payments/functions.php:651
1785
  msgid "Refunded"
1786
  msgstr ""
1787
 
1788
  #: includes/admin/payments/class-payments-table.php:204
1789
- #: includes/payments/functions.php:654
1790
  msgid "Revoked"
1791
  msgstr ""
1792
 
1793
  #: includes/admin/payments/class-payments-table.php:205
1794
- #: includes/payments/functions.php:652
1795
  msgid "Failed"
1796
  msgstr ""
1797
 
1798
  #: includes/admin/payments/class-payments-table.php:206
1799
- #: includes/payments/functions.php:653
1800
  msgid "Abandoned"
1801
  msgstr ""
1802
 
@@ -2319,7 +2319,7 @@ msgstr ""
2319
  #: includes/admin/reporting/class-export-payments.php:64
2320
  #: includes/admin/reporting/export/class-batch-export-payments.php:44
2321
  #: includes/admin/tools.php:506 includes/checkout/template.php:191
2322
- #: templates/shortcode-profile-editor.php:33
2323
  msgid "First Name"
2324
  msgstr ""
2325
 
@@ -2327,7 +2327,7 @@ msgstr ""
2327
  #: includes/admin/reporting/class-export-payments.php:65
2328
  #: includes/admin/reporting/export/class-batch-export-payments.php:45
2329
  #: includes/admin/tools.php:515 includes/checkout/template.php:201
2330
- #: templates/shortcode-profile-editor.php:36
2331
  msgid "Last Name"
2332
  msgstr ""
2333
 
@@ -2391,14 +2391,14 @@ msgstr ""
2391
  #: includes/admin/reporting/class-export-payments.php:70
2392
  #: includes/admin/reporting/export/class-batch-export-payments.php:50
2393
  #: includes/admin/settings/register-settings.php:1930
2394
- #: includes/admin/tools.php:713 templates/shortcode-profile-editor.php:138
2395
  msgid "Country"
2396
  msgstr ""
2397
 
2398
  #: includes/admin/reporting/class-export-payments.php:71
2399
  #: includes/admin/reporting/export/class-batch-export-payments.php:51
2400
  #: includes/admin/tools.php:704 includes/checkout/template.php:365
2401
- #: templates/shortcode-profile-editor.php:135
2402
  msgid "Zip / Postal Code"
2403
  msgstr ""
2404
 
@@ -2644,93 +2644,93 @@ msgstr ""
2644
  msgid "Batch Processing Complete"
2645
  msgstr ""
2646
 
2647
- #: includes/admin/reporting/graphing.php:319
2648
  msgid "Earnings Over Time"
2649
  msgstr ""
2650
 
2651
- #: includes/admin/reporting/graphing.php:337
2652
- #: includes/admin/reporting/graphing.php:626
2653
  msgid "Total earnings for period shown: "
2654
  msgstr ""
2655
 
2656
- #: includes/admin/reporting/graphing.php:345
2657
- #: includes/admin/reporting/graphing.php:627
2658
  msgid "Total sales for period shown: "
2659
  msgstr ""
2660
 
2661
- #: includes/admin/reporting/graphing.php:351
2662
  msgid "Estimated monthly earnings: "
2663
  msgstr ""
2664
 
2665
- #: includes/admin/reporting/graphing.php:359
2666
  msgid "Estimated monthly sales: "
2667
  msgstr ""
2668
 
2669
- #: includes/admin/reporting/graphing.php:366
2670
  msgid "Excludes sales tax."
2671
  msgstr ""
2672
 
2673
- #: includes/admin/reporting/graphing.php:616
2674
  msgid "Earnings Over Time for %s"
2675
  msgstr ""
2676
 
2677
- #: includes/admin/reporting/graphing.php:628
2678
  msgid "Average monthly earnings: %s"
2679
  msgstr ""
2680
 
2681
- #: includes/admin/reporting/graphing.php:629
2682
  msgid "Average monthly sales: %s"
2683
  msgstr ""
2684
 
2685
- #: includes/admin/reporting/graphing.php:646 includes/class-edd-stats.php:85
2686
  msgid "Yesterday"
2687
  msgstr ""
2688
 
2689
- #: includes/admin/reporting/graphing.php:647 includes/class-edd-stats.php:86
2690
  msgid "This Week"
2691
  msgstr ""
2692
 
2693
- #: includes/admin/reporting/graphing.php:648 includes/class-edd-stats.php:87
2694
  msgid "Last Week"
2695
  msgstr ""
2696
 
2697
- #: includes/admin/reporting/graphing.php:649 includes/class-edd-stats.php:88
2698
  msgid "This Month"
2699
  msgstr ""
2700
 
2701
- #: includes/admin/reporting/graphing.php:651 includes/class-edd-stats.php:90
2702
  msgid "This Quarter"
2703
  msgstr ""
2704
 
2705
- #: includes/admin/reporting/graphing.php:652 includes/class-edd-stats.php:91
2706
  msgid "Last Quarter"
2707
  msgstr ""
2708
 
2709
- #: includes/admin/reporting/graphing.php:653 includes/class-edd-stats.php:92
2710
  msgid "This Year"
2711
  msgstr ""
2712
 
2713
- #: includes/admin/reporting/graphing.php:654 includes/class-edd-stats.php:93
2714
  msgid "Last Year"
2715
  msgstr ""
2716
 
2717
- #: includes/admin/reporting/graphing.php:655
2718
  msgid "Custom"
2719
  msgstr ""
2720
 
2721
- #: includes/admin/reporting/graphing.php:687
2722
  msgid "From"
2723
  msgstr ""
2724
 
2725
- #: includes/admin/reporting/graphing.php:703
2726
  msgid "To"
2727
  msgstr ""
2728
 
2729
- #: includes/admin/reporting/graphing.php:723
2730
  msgid "Exclude Taxes"
2731
  msgstr ""
2732
 
2733
- #: includes/admin/reporting/graphing.php:728
2734
  msgid "Filter"
2735
  msgstr ""
2736
 
@@ -4565,19 +4565,19 @@ msgstr ""
4565
  msgid "Please upload a file to import"
4566
  msgstr ""
4567
 
4568
- #: includes/admin/tracking.php:270
4569
  msgid ""
4570
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
4571
- "our newsletter and immediately be emailed a 20%% discount to the EDD shop, "
4572
  "valid towards the <a href=\"%s\" target=\"_blank\">purchase of "
4573
  "extensions</a>. No sensitive data is tracked."
4574
  msgstr ""
4575
 
4576
- #: includes/admin/tracking.php:271
4577
  msgid "Allow"
4578
  msgstr ""
4579
 
4580
- #: includes/admin/tracking.php:272
4581
  msgid "Do not allow"
4582
  msgstr ""
4583
 
@@ -4670,18 +4670,18 @@ msgstr ""
4670
  msgid "Your transaction failed, please try again or contact site support."
4671
  msgstr ""
4672
 
4673
- #: includes/admin/upgrades/upgrades.php:44
4674
  msgid "Easy Digital Downloads - Upgrades"
4675
  msgstr ""
4676
 
4677
- #: includes/admin/upgrades/upgrades.php:49
4678
- #: includes/admin/upgrades/upgrades.php:63
4679
  msgid ""
4680
  "The upgrade process has started, please be patient. This could take several "
4681
  "minutes. You will be automatically redirected when the upgrade is finished."
4682
  msgstr ""
4683
 
4684
- #: includes/admin/upgrades/upgrades.php:52
4685
  msgid "Step %d of approximately %d running"
4686
  msgstr ""
4687
 
@@ -5150,27 +5150,27 @@ msgstr ""
5150
  msgid "No download logs found!"
5151
  msgstr ""
5152
 
5153
- #: includes/api/class-edd-api.php:1887 includes/user-functions.php:977
5154
  msgid "Easy Digital Downloads API Keys"
5155
  msgstr ""
5156
 
5157
- #: includes/api/class-edd-api.php:1896 includes/user-functions.php:982
5158
  msgid "Generate API Key"
5159
  msgstr ""
5160
 
5161
- #: includes/api/class-edd-api.php:1898 includes/user-functions.php:984
5162
  msgid "Public key:"
5163
  msgstr ""
5164
 
5165
- #: includes/api/class-edd-api.php:1899 includes/user-functions.php:985
5166
  msgid "Secret key:"
5167
  msgstr ""
5168
 
5169
- #: includes/api/class-edd-api.php:1900 includes/user-functions.php:986
5170
  msgid "Token:"
5171
  msgstr ""
5172
 
5173
- #: includes/api/class-edd-api.php:1902 includes/user-functions.php:988
5174
  msgid "Revoke API Keys"
5175
  msgstr ""
5176
 
@@ -5646,8 +5646,8 @@ msgstr ""
5646
  msgid "Customer User ID: %s"
5647
  msgstr ""
5648
 
5649
- #: includes/class-edd-cli.php:335 includes/user-functions.php:509
5650
- #: includes/user-functions.php:518
5651
  msgid "Username: %s"
5652
  msgstr ""
5653
 
@@ -5836,7 +5836,7 @@ msgstr ""
5836
  msgid "Select a discount"
5837
  msgstr ""
5838
 
5839
- #: includes/class-edd-html-elements.php:716
5840
  msgid "Enter username"
5841
  msgstr ""
5842
 
@@ -6281,39 +6281,39 @@ msgstr ""
6281
  msgid "No payments matching your request were found."
6282
  msgstr ""
6283
 
6284
- #: includes/discount-functions.php:387
6285
  msgid "This discount is expired."
6286
  msgstr ""
6287
 
6288
- #: includes/discount-functions.php:393
6289
  msgid "This discount is not active."
6290
  msgstr ""
6291
 
6292
- #: includes/discount-functions.php:621
6293
  msgid "This discount is not active yet."
6294
  msgstr ""
6295
 
6296
- #: includes/discount-functions.php:652
6297
  msgid "This discount has reached its maximum usage."
6298
  msgstr ""
6299
 
6300
- #: includes/discount-functions.php:681
6301
  msgid "Minimum order of %s not met."
6302
  msgstr ""
6303
 
6304
- #: includes/discount-functions.php:743 includes/discount-functions.php:763
6305
  msgid "The product requirements for this discount are not met."
6306
  msgstr ""
6307
 
6308
- #: includes/discount-functions.php:779
6309
  msgid "This discount is not valid for the cart contents."
6310
  msgstr ""
6311
 
6312
- #: includes/discount-functions.php:883
6313
  msgid "This discount has already been redeemed."
6314
  msgstr ""
6315
 
6316
- #: includes/discount-functions.php:929
6317
  msgid "This discount is invalid."
6318
  msgstr ""
6319
 
@@ -6824,16 +6824,16 @@ msgstr ""
6824
  msgid "The password you entered is incorrect"
6825
  msgstr ""
6826
 
6827
- #: includes/login-register.php:95 includes/process-purchase.php:612
6828
  msgid "The username you entered does not exist"
6829
  msgstr ""
6830
 
6831
  #: includes/login-register.php:149 includes/login-register.php:157
6832
- #: includes/process-purchase.php:497
6833
  msgid "Invalid username"
6834
  msgstr ""
6835
 
6836
- #: includes/login-register.php:153 includes/process-purchase.php:490
6837
  msgid "Username already taken"
6838
  msgstr ""
6839
 
@@ -6841,8 +6841,8 @@ msgstr ""
6841
  msgid "Email address already taken"
6842
  msgstr ""
6843
 
6844
- #: includes/login-register.php:165 includes/process-purchase.php:437
6845
- #: includes/process-purchase.php:512 includes/process-purchase.php:645
6846
  msgid "Invalid email"
6847
  msgstr ""
6848
 
@@ -6994,11 +6994,11 @@ msgstr ""
6994
  msgid "Status changed from %s to %s"
6995
  msgstr ""
6996
 
6997
- #: includes/payments/functions.php:650
6998
  msgid "Complete"
6999
  msgstr ""
7000
 
7001
- #: includes/payments/functions.php:1598
7002
  msgid "EDD Bot"
7003
  msgstr ""
7004
 
@@ -7338,55 +7338,55 @@ msgstr ""
7338
  msgid "Please enter billing state / province"
7339
  msgstr ""
7340
 
7341
- #: includes/process-purchase.php:442
7342
  msgid "The user information is invalid"
7343
  msgstr ""
7344
 
7345
- #: includes/process-purchase.php:495
7346
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
7347
  msgstr ""
7348
 
7349
- #: includes/process-purchase.php:504
7350
  msgid "You must register or login to complete your purchase"
7351
  msgstr ""
7352
 
7353
- #: includes/process-purchase.php:517
7354
  msgid "Email already used"
7355
  msgstr ""
7356
 
7357
- #: includes/process-purchase.php:525 includes/process-purchase.php:652
7358
  msgid "Enter an email"
7359
  msgstr ""
7360
 
7361
- #: includes/process-purchase.php:533
7362
  msgid "Passwords don't match"
7363
  msgstr ""
7364
 
7365
- #: includes/process-purchase.php:542 includes/process-purchase.php:608
7366
  msgid "Enter a password"
7367
  msgstr ""
7368
 
7369
- #: includes/process-purchase.php:545
7370
  msgid "Enter the password confirmation"
7371
  msgstr ""
7372
 
7373
- #: includes/process-purchase.php:569
7374
  msgid "You must login or register to complete your purchase"
7375
  msgstr ""
7376
 
7377
- #: includes/process-purchase.php:589
7378
  msgid "The password you entered is incorrect. %sReset Password%s"
7379
  msgstr ""
7380
 
7381
- #: includes/process-purchase.php:634
7382
  msgid "You must be logged into an account to purchase"
7383
  msgstr ""
7384
 
7385
- #: includes/process-purchase.php:814
7386
  msgid "The zip / postal code you entered for your billing address is invalid"
7387
  msgstr ""
7388
 
7389
- #: includes/process-purchase.php:1076
7390
  msgid "An internal error has occurred, please try again or contact support."
7391
  msgstr ""
7392
 
@@ -7618,51 +7618,51 @@ msgstr ""
7618
  msgid "Plain Text"
7619
  msgstr ""
7620
 
7621
- #: includes/user-functions.php:507
7622
  msgid "[%s] New User Registration"
7623
  msgstr ""
7624
 
7625
- #: includes/user-functions.php:508
7626
  msgid "New user registration"
7627
  msgstr ""
7628
 
7629
- #: includes/user-functions.php:510
7630
  msgid "E-mail: %s"
7631
  msgstr ""
7632
 
7633
- #: includes/user-functions.php:516
7634
  msgid "[%s] Your username and password"
7635
  msgstr ""
7636
 
7637
- #: includes/user-functions.php:517
7638
  msgid "Your account info"
7639
  msgstr ""
7640
 
7641
- #: includes/user-functions.php:521
7642
  msgid "Password entered at checkout"
7643
  msgstr ""
7644
 
7645
- #: includes/user-functions.php:523
7646
  msgid "Password entered at registration"
7647
  msgstr ""
7648
 
7649
- #: includes/user-functions.php:526
7650
  msgid "Password: %s"
7651
  msgstr ""
7652
 
7653
- #: includes/user-functions.php:530
7654
  msgid "Click here to log in"
7655
  msgstr ""
7656
 
7657
- #: includes/user-functions.php:534
7658
  msgid "To log in, visit: %s"
7659
  msgstr ""
7660
 
7661
- #: includes/user-functions.php:690 includes/user-functions.php:691
7662
  msgid "Verify your account"
7663
  msgstr ""
7664
 
7665
- #: includes/user-functions.php:693
7666
  msgid ""
7667
  "Hello %s,\n"
7668
  "\n"
@@ -7672,33 +7672,33 @@ msgid ""
7672
  "Link missing? Visit the following URL: %s"
7673
  msgstr ""
7674
 
7675
- #: includes/user-functions.php:817
7676
  msgid ""
7677
  "Sorry but your account verification link has expired. <a href=\"#\">Click "
7678
  "here</a> to request a new verification URL."
7679
  msgstr ""
7680
 
7681
- #: includes/user-functions.php:846
7682
  msgid "You must be logged in to verify your account."
7683
  msgstr ""
7684
 
7685
- #: includes/user-functions.php:846 includes/user-functions.php:850
7686
  msgid "Notice"
7687
  msgstr ""
7688
 
7689
- #: includes/user-functions.php:850
7690
  msgid "Your account has already been verified."
7691
  msgstr ""
7692
 
7693
- #: includes/user-functions.php:895
7694
  msgid "Invalid verification token provided."
7695
  msgstr ""
7696
 
7697
- #: includes/user-functions.php:1000
7698
  msgid "Easy Digital Downloads <a href=\"%s\">iOS App</a>"
7699
  msgstr ""
7700
 
7701
- #: includes/user-functions.php:1007
7702
  msgid "Add to iOS App"
7703
  msgstr ""
7704
 
@@ -7860,51 +7860,51 @@ msgstr ""
7860
  msgid "Your profile has been edited successfully."
7861
  msgstr ""
7862
 
7863
- #: templates/shortcode-profile-editor.php:31
7864
  msgid "Change your Name"
7865
  msgstr ""
7866
 
7867
- #: templates/shortcode-profile-editor.php:40
7868
  msgid "Display Name"
7869
  msgstr ""
7870
 
7871
- #: templates/shortcode-profile-editor.php:58
7872
  msgid "Primary Email Address"
7873
  msgstr ""
7874
 
7875
- #: templates/shortcode-profile-editor.php:95
7876
  msgid "Additional Email Addresses"
7877
  msgstr ""
7878
 
7879
- #: templates/shortcode-profile-editor.php:124
7880
  msgid "Change your Billing Address"
7881
  msgstr ""
7882
 
7883
- #: templates/shortcode-profile-editor.php:126
7884
  msgid "Line 1"
7885
  msgstr ""
7886
 
7887
- #: templates/shortcode-profile-editor.php:129
7888
  msgid "Line 2"
7889
  msgstr ""
7890
 
7891
- #: templates/shortcode-profile-editor.php:162
7892
  msgid "Change your Password"
7893
  msgstr ""
7894
 
7895
- #: templates/shortcode-profile-editor.php:164
7896
  msgid "New Password"
7897
  msgstr ""
7898
 
7899
- #: templates/shortcode-profile-editor.php:167
7900
  msgid "Re-enter Password"
7901
  msgstr ""
7902
 
7903
- #: templates/shortcode-profile-editor.php:176
7904
  msgid "Save Changes"
7905
  msgstr ""
7906
 
7907
- #: templates/shortcode-profile-editor.php:185
7908
  msgid "You need to login to edit your profile."
7909
  msgstr ""
7910
 
2
  # This file is distributed under the same license as the Easy Digital Downloads package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Easy Digital Downloads 2.6.12\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2016-11-16 19:38:03+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
99
  #: includes/error-tracking.php:36 includes/gateways/functions.php:221
100
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:155
101
  #: includes/process-download.php:254 includes/process-download.php:787
102
+ #: includes/query-filters.php:48 includes/user-functions.php:826
103
+ #: includes/user-functions.php:851 includes/user-functions.php:904
104
  msgid "Error"
105
  msgstr ""
106
 
389
  #: includes/admin/discounts/class-discount-codes-table.php:289
390
  #: includes/admin/payments/class-payments-table.php:323
391
  #: includes/admin/payments/class-payments-table.php:395
392
+ #: includes/payments/functions.php:1612
393
  msgid "Delete"
394
  msgstr ""
395
 
469
  msgstr ""
470
 
471
  #: includes/admin/customers/customer-actions.php:207
472
+ #: includes/user-functions.php:851
473
  msgid "Nonce verification failed."
474
  msgstr ""
475
 
592
  #: includes/admin/reporting/class-export-payments.php:68
593
  #: includes/admin/reporting/export/class-batch-export-payments.php:48
594
  #: includes/admin/tools.php:686 includes/checkout/template.php:355
595
+ #: templates/shortcode-profile-editor.php:135
596
  msgid "City"
597
  msgstr ""
598
 
599
  #: includes/admin/customers/customers.php:246
600
  #: includes/admin/settings/register-settings.php:1931
601
  #: includes/admin/tools.php:695 includes/checkout/template.php:417
602
+ #: templates/shortcode-profile-editor.php:148
603
  msgid "State / Province"
604
  msgstr ""
605
 
640
  #: includes/admin/customers/customers.php:305
641
  #: includes/admin/customers/customers.php:587
642
  #: includes/admin/payments/view-order-details.php:475
643
+ #: includes/admin/thickbox.php:131 includes/class-edd-html-elements.php:733
644
  msgid "Cancel"
645
  msgstr ""
646
 
690
  #: includes/admin/payments/view-order-details.php:375
691
  #: includes/admin/settings/register-settings.php:1934 includes/scripts.php:222
692
  #: templates/checkout_cart.php:57 templates/checkout_cart.php:75
693
+ #: templates/shortcode-profile-editor.php:117
694
  msgid "Remove"
695
  msgstr ""
696
 
838
  #: includes/admin/reporting/class-download-reports-table.php:112
839
  #: includes/admin/reporting/class-export-earnings.php:64
840
  #: includes/admin/reporting/export/class-batch-export-downloads.php:59
841
+ #: includes/admin/reporting/graphing.php:291
842
+ #: includes/admin/reporting/graphing.php:591
843
  #: includes/admin/reporting/pdf-reports.php:206
844
  #: includes/admin/reporting/reports.php:54
845
  msgid "Earnings"
853
  msgstr[1] ""
854
 
855
  #: includes/admin/dashboard-widgets.php:80
856
+ #: includes/admin/reporting/graphing.php:632 includes/class-edd-stats.php:89
857
  msgid "Last Month"
858
  msgstr ""
859
 
860
  #: includes/admin/dashboard-widgets.php:105
861
+ #: includes/admin/reporting/graphing.php:627 includes/class-edd-stats.php:84
862
  msgid "Today"
863
  msgstr ""
864
 
867
  #: includes/admin/reporting/class-download-reports-table.php:111
868
  #: includes/admin/reporting/class-export-earnings.php:63
869
  #: includes/admin/reporting/export/class-batch-export-downloads.php:58
870
+ #: includes/admin/reporting/graphing.php:292
871
+ #: includes/admin/reporting/graphing.php:592
872
  #: includes/admin/reporting/logs.php:145
873
  #: includes/admin/reporting/pdf-reports.php:223
874
  msgid "Sales"
1776
  msgstr ""
1777
 
1778
  #: includes/admin/payments/class-payments-table.php:202
1779
+ #: includes/payments/functions.php:648
1780
  msgid "Pending"
1781
  msgstr ""
1782
 
1783
  #: includes/admin/payments/class-payments-table.php:203
1784
+ #: includes/payments/functions.php:650
1785
  msgid "Refunded"
1786
  msgstr ""
1787
 
1788
  #: includes/admin/payments/class-payments-table.php:204
1789
+ #: includes/payments/functions.php:653
1790
  msgid "Revoked"
1791
  msgstr ""
1792
 
1793
  #: includes/admin/payments/class-payments-table.php:205
1794
+ #: includes/payments/functions.php:651
1795
  msgid "Failed"
1796
  msgstr ""
1797
 
1798
  #: includes/admin/payments/class-payments-table.php:206
1799
+ #: includes/payments/functions.php:652
1800
  msgid "Abandoned"
1801
  msgstr ""
1802
 
2319
  #: includes/admin/reporting/class-export-payments.php:64
2320
  #: includes/admin/reporting/export/class-batch-export-payments.php:44
2321
  #: includes/admin/tools.php:506 includes/checkout/template.php:191
2322
+ #: templates/shortcode-profile-editor.php:36
2323
  msgid "First Name"
2324
  msgstr ""
2325
 
2327
  #: includes/admin/reporting/class-export-payments.php:65
2328
  #: includes/admin/reporting/export/class-batch-export-payments.php:45
2329
  #: includes/admin/tools.php:515 includes/checkout/template.php:201
2330
+ #: templates/shortcode-profile-editor.php:39
2331
  msgid "Last Name"
2332
  msgstr ""
2333
 
2391
  #: includes/admin/reporting/class-export-payments.php:70
2392
  #: includes/admin/reporting/export/class-batch-export-payments.php:50
2393
  #: includes/admin/settings/register-settings.php:1930
2394
+ #: includes/admin/tools.php:713 templates/shortcode-profile-editor.php:141
2395
  msgid "Country"
2396
  msgstr ""
2397
 
2398
  #: includes/admin/reporting/class-export-payments.php:71
2399
  #: includes/admin/reporting/export/class-batch-export-payments.php:51
2400
  #: includes/admin/tools.php:704 includes/checkout/template.php:365
2401
+ #: templates/shortcode-profile-editor.php:138
2402
  msgid "Zip / Postal Code"
2403
  msgstr ""
2404
 
2644
  msgid "Batch Processing Complete"
2645
  msgstr ""
2646
 
2647
+ #: includes/admin/reporting/graphing.php:301
2648
  msgid "Earnings Over Time"
2649
  msgstr ""
2650
 
2651
+ #: includes/admin/reporting/graphing.php:319
2652
+ #: includes/admin/reporting/graphing.php:608
2653
  msgid "Total earnings for period shown: "
2654
  msgstr ""
2655
 
2656
+ #: includes/admin/reporting/graphing.php:327
2657
+ #: includes/admin/reporting/graphing.php:609
2658
  msgid "Total sales for period shown: "
2659
  msgstr ""
2660
 
2661
+ #: includes/admin/reporting/graphing.php:333
2662
  msgid "Estimated monthly earnings: "
2663
  msgstr ""
2664
 
2665
+ #: includes/admin/reporting/graphing.php:341
2666
  msgid "Estimated monthly sales: "
2667
  msgstr ""
2668
 
2669
+ #: includes/admin/reporting/graphing.php:348
2670
  msgid "Excludes sales tax."
2671
  msgstr ""
2672
 
2673
+ #: includes/admin/reporting/graphing.php:598
2674
  msgid "Earnings Over Time for %s"
2675
  msgstr ""
2676
 
2677
+ #: includes/admin/reporting/graphing.php:610
2678
  msgid "Average monthly earnings: %s"
2679
  msgstr ""
2680
 
2681
+ #: includes/admin/reporting/graphing.php:611
2682
  msgid "Average monthly sales: %s"
2683
  msgstr ""
2684
 
2685
+ #: includes/admin/reporting/graphing.php:628 includes/class-edd-stats.php:85
2686
  msgid "Yesterday"
2687
  msgstr ""
2688
 
2689
+ #: includes/admin/reporting/graphing.php:629 includes/class-edd-stats.php:86
2690
  msgid "This Week"
2691
  msgstr ""
2692
 
2693
+ #: includes/admin/reporting/graphing.php:630 includes/class-edd-stats.php:87
2694
  msgid "Last Week"
2695
  msgstr ""
2696
 
2697
+ #: includes/admin/reporting/graphing.php:631 includes/class-edd-stats.php:88
2698
  msgid "This Month"
2699
  msgstr ""
2700
 
2701
+ #: includes/admin/reporting/graphing.php:633 includes/class-edd-stats.php:90
2702
  msgid "This Quarter"
2703
  msgstr ""
2704
 
2705
+ #: includes/admin/reporting/graphing.php:634 includes/class-edd-stats.php:91
2706
  msgid "Last Quarter"
2707
  msgstr ""
2708
 
2709
+ #: includes/admin/reporting/graphing.php:635 includes/class-edd-stats.php:92
2710
  msgid "This Year"
2711
  msgstr ""
2712
 
2713
+ #: includes/admin/reporting/graphing.php:636 includes/class-edd-stats.php:93
2714
  msgid "Last Year"
2715
  msgstr ""
2716
 
2717
+ #: includes/admin/reporting/graphing.php:637
2718
  msgid "Custom"
2719
  msgstr ""
2720
 
2721
+ #: includes/admin/reporting/graphing.php:669
2722
  msgid "From"
2723
  msgstr ""
2724
 
2725
+ #: includes/admin/reporting/graphing.php:685
2726
  msgid "To"
2727
  msgstr ""
2728
 
2729
+ #: includes/admin/reporting/graphing.php:705
2730
  msgid "Exclude Taxes"
2731
  msgstr ""
2732
 
2733
+ #: includes/admin/reporting/graphing.php:710
2734
  msgid "Filter"
2735
  msgstr ""
2736
 
4565
  msgid "Please upload a file to import"
4566
  msgstr ""
4567
 
4568
+ #: includes/admin/tracking.php:269
4569
  msgid ""
4570
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
4571
+ "our newsletter and immediately be emailed a 20%s discount to the EDD shop, "
4572
  "valid towards the <a href=\"%s\" target=\"_blank\">purchase of "
4573
  "extensions</a>. No sensitive data is tracked."
4574
  msgstr ""
4575
 
4576
+ #: includes/admin/tracking.php:270
4577
  msgid "Allow"
4578
  msgstr ""
4579
 
4580
+ #: includes/admin/tracking.php:271
4581
  msgid "Do not allow"
4582
  msgstr ""
4583
 
4670
  msgid "Your transaction failed, please try again or contact site support."
4671
  msgstr ""
4672
 
4673
+ #: includes/admin/upgrades/upgrades.php:47
4674
  msgid "Easy Digital Downloads - Upgrades"
4675
  msgstr ""
4676
 
4677
+ #: includes/admin/upgrades/upgrades.php:52
4678
+ #: includes/admin/upgrades/upgrades.php:66
4679
  msgid ""
4680
  "The upgrade process has started, please be patient. This could take several "
4681
  "minutes. You will be automatically redirected when the upgrade is finished."
4682
  msgstr ""
4683
 
4684
+ #: includes/admin/upgrades/upgrades.php:55
4685
  msgid "Step %d of approximately %d running"
4686
  msgstr ""
4687
 
5150
  msgid "No download logs found!"
5151
  msgstr ""
5152
 
5153
+ #: includes/api/class-edd-api.php:1887 includes/user-functions.php:986
5154
  msgid "Easy Digital Downloads API Keys"
5155
  msgstr ""
5156
 
5157
+ #: includes/api/class-edd-api.php:1896 includes/user-functions.php:991
5158
  msgid "Generate API Key"
5159
  msgstr ""
5160
 
5161
+ #: includes/api/class-edd-api.php:1898 includes/user-functions.php:993
5162
  msgid "Public key:"
5163
  msgstr ""
5164
 
5165
+ #: includes/api/class-edd-api.php:1899 includes/user-functions.php:994
5166
  msgid "Secret key:"
5167
  msgstr ""
5168
 
5169
+ #: includes/api/class-edd-api.php:1900 includes/user-functions.php:995
5170
  msgid "Token:"
5171
  msgstr ""
5172
 
5173
+ #: includes/api/class-edd-api.php:1902 includes/user-functions.php:997
5174
  msgid "Revoke API Keys"
5175
  msgstr ""
5176
 
5646
  msgid "Customer User ID: %s"
5647
  msgstr ""
5648
 
5649
+ #: includes/class-edd-cli.php:335 includes/user-functions.php:518
5650
+ #: includes/user-functions.php:527
5651
  msgid "Username: %s"
5652
  msgstr ""
5653
 
5836
  msgid "Select a discount"
5837
  msgstr ""
5838
 
5839
+ #: includes/class-edd-html-elements.php:718
5840
  msgid "Enter username"
5841
  msgstr ""
5842
 
6281
  msgid "No payments matching your request were found."
6282
  msgstr ""
6283
 
6284
+ #: includes/discount-functions.php:396
6285
  msgid "This discount is expired."
6286
  msgstr ""
6287
 
6288
+ #: includes/discount-functions.php:402
6289
  msgid "This discount is not active."
6290
  msgstr ""
6291
 
6292
+ #: includes/discount-functions.php:631
6293
  msgid "This discount is not active yet."
6294
  msgstr ""
6295
 
6296
+ #: includes/discount-functions.php:662
6297
  msgid "This discount has reached its maximum usage."
6298
  msgstr ""
6299
 
6300
+ #: includes/discount-functions.php:691
6301
  msgid "Minimum order of %s not met."
6302
  msgstr ""
6303
 
6304
+ #: includes/discount-functions.php:753 includes/discount-functions.php:773
6305
  msgid "The product requirements for this discount are not met."
6306
  msgstr ""
6307
 
6308
+ #: includes/discount-functions.php:789
6309
  msgid "This discount is not valid for the cart contents."
6310
  msgstr ""
6311
 
6312
+ #: includes/discount-functions.php:893
6313
  msgid "This discount has already been redeemed."
6314
  msgstr ""
6315
 
6316
+ #: includes/discount-functions.php:939
6317
  msgid "This discount is invalid."
6318
  msgstr ""
6319
 
6824
  msgid "The password you entered is incorrect"
6825
  msgstr ""
6826
 
6827
+ #: includes/login-register.php:95 includes/process-purchase.php:623
6828
  msgid "The username you entered does not exist"
6829
  msgstr ""
6830
 
6831
  #: includes/login-register.php:149 includes/login-register.php:157
6832
+ #: includes/process-purchase.php:508
6833
  msgid "Invalid username"
6834
  msgstr ""
6835
 
6836
+ #: includes/login-register.php:153 includes/process-purchase.php:501
6837
  msgid "Username already taken"
6838
  msgstr ""
6839
 
6841
  msgid "Email address already taken"
6842
  msgstr ""
6843
 
6844
+ #: includes/login-register.php:165 includes/process-purchase.php:448
6845
+ #: includes/process-purchase.php:523 includes/process-purchase.php:656
6846
  msgid "Invalid email"
6847
  msgstr ""
6848
 
6994
  msgid "Status changed from %s to %s"
6995
  msgstr ""
6996
 
6997
+ #: includes/payments/functions.php:649
6998
  msgid "Complete"
6999
  msgstr ""
7000
 
7001
+ #: includes/payments/functions.php:1597
7002
  msgid "EDD Bot"
7003
  msgstr ""
7004
 
7338
  msgid "Please enter billing state / province"
7339
  msgstr ""
7340
 
7341
+ #: includes/process-purchase.php:453
7342
  msgid "The user information is invalid"
7343
  msgstr ""
7344
 
7345
+ #: includes/process-purchase.php:506
7346
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
7347
  msgstr ""
7348
 
7349
+ #: includes/process-purchase.php:515
7350
  msgid "You must register or login to complete your purchase"
7351
  msgstr ""
7352
 
7353
+ #: includes/process-purchase.php:528
7354
  msgid "Email already used"
7355
  msgstr ""
7356
 
7357
+ #: includes/process-purchase.php:536 includes/process-purchase.php:663
7358
  msgid "Enter an email"
7359
  msgstr ""
7360
 
7361
+ #: includes/process-purchase.php:544
7362
  msgid "Passwords don't match"
7363
  msgstr ""
7364
 
7365
+ #: includes/process-purchase.php:553 includes/process-purchase.php:619
7366
  msgid "Enter a password"
7367
  msgstr ""
7368
 
7369
+ #: includes/process-purchase.php:556
7370
  msgid "Enter the password confirmation"
7371
  msgstr ""
7372
 
7373
+ #: includes/process-purchase.php:580
7374
  msgid "You must login or register to complete your purchase"
7375
  msgstr ""
7376
 
7377
+ #: includes/process-purchase.php:600
7378
  msgid "The password you entered is incorrect. %sReset Password%s"
7379
  msgstr ""
7380
 
7381
+ #: includes/process-purchase.php:645
7382
  msgid "You must be logged into an account to purchase"
7383
  msgstr ""
7384
 
7385
+ #: includes/process-purchase.php:825
7386
  msgid "The zip / postal code you entered for your billing address is invalid"
7387
  msgstr ""
7388
 
7389
+ #: includes/process-purchase.php:1087
7390
  msgid "An internal error has occurred, please try again or contact support."
7391
  msgstr ""
7392
 
7618
  msgid "Plain Text"
7619
  msgstr ""
7620
 
7621
+ #: includes/user-functions.php:516
7622
  msgid "[%s] New User Registration"
7623
  msgstr ""
7624
 
7625
+ #: includes/user-functions.php:517
7626
  msgid "New user registration"
7627
  msgstr ""
7628
 
7629
+ #: includes/user-functions.php:519
7630
  msgid "E-mail: %s"
7631
  msgstr ""
7632
 
7633
+ #: includes/user-functions.php:525
7634
  msgid "[%s] Your username and password"
7635
  msgstr ""
7636
 
7637
+ #: includes/user-functions.php:526
7638
  msgid "Your account info"
7639
  msgstr ""
7640
 
7641
+ #: includes/user-functions.php:530
7642
  msgid "Password entered at checkout"
7643
  msgstr ""
7644
 
7645
+ #: includes/user-functions.php:532
7646
  msgid "Password entered at registration"
7647
  msgstr ""
7648
 
7649
+ #: includes/user-functions.php:535
7650
  msgid "Password: %s"
7651
  msgstr ""
7652
 
7653
+ #: includes/user-functions.php:539
7654
  msgid "Click here to log in"
7655
  msgstr ""
7656
 
7657
+ #: includes/user-functions.php:543
7658
  msgid "To log in, visit: %s"
7659
  msgstr ""
7660
 
7661
+ #: includes/user-functions.php:699 includes/user-functions.php:700
7662
  msgid "Verify your account"
7663
  msgstr ""
7664
 
7665
+ #: includes/user-functions.php:702
7666
  msgid ""
7667
  "Hello %s,\n"
7668
  "\n"
7672
  "Link missing? Visit the following URL: %s"
7673
  msgstr ""
7674
 
7675
+ #: includes/user-functions.php:826
7676
  msgid ""
7677
  "Sorry but your account verification link has expired. <a href=\"#\">Click "
7678
  "here</a> to request a new verification URL."
7679
  msgstr ""
7680
 
7681
+ #: includes/user-functions.php:855
7682
  msgid "You must be logged in to verify your account."
7683
  msgstr ""
7684
 
7685
+ #: includes/user-functions.php:855 includes/user-functions.php:859
7686
  msgid "Notice"
7687
  msgstr ""
7688
 
7689
+ #: includes/user-functions.php:859
7690
  msgid "Your account has already been verified."
7691
  msgstr ""
7692
 
7693
+ #: includes/user-functions.php:904
7694
  msgid "Invalid verification token provided."
7695
  msgstr ""
7696
 
7697
+ #: includes/user-functions.php:1009
7698
  msgid "Easy Digital Downloads <a href=\"%s\">iOS App</a>"
7699
  msgstr ""
7700
 
7701
+ #: includes/user-functions.php:1016
7702
  msgid "Add to iOS App"
7703
  msgstr ""
7704
 
7860
  msgid "Your profile has been edited successfully."
7861
  msgstr ""
7862
 
7863
+ #: templates/shortcode-profile-editor.php:34
7864
  msgid "Change your Name"
7865
  msgstr ""
7866
 
7867
+ #: templates/shortcode-profile-editor.php:43
7868
  msgid "Display Name"
7869
  msgstr ""
7870
 
7871
+ #: templates/shortcode-profile-editor.php:61
7872
  msgid "Primary Email Address"
7873
  msgstr ""
7874
 
7875
+ #: templates/shortcode-profile-editor.php:98
7876
  msgid "Additional Email Addresses"
7877
  msgstr ""
7878
 
7879
+ #: templates/shortcode-profile-editor.php:127
7880
  msgid "Change your Billing Address"
7881
  msgstr ""
7882
 
7883
+ #: templates/shortcode-profile-editor.php:129
7884
  msgid "Line 1"
7885
  msgstr ""
7886
 
7887
+ #: templates/shortcode-profile-editor.php:132
7888
  msgid "Line 2"
7889
  msgstr ""
7890
 
7891
+ #: templates/shortcode-profile-editor.php:165
7892
  msgid "Change your Password"
7893
  msgstr ""
7894
 
7895
+ #: templates/shortcode-profile-editor.php:167
7896
  msgid "New Password"
7897
  msgstr ""
7898
 
7899
+ #: templates/shortcode-profile-editor.php:170
7900
  msgid "Re-enter Password"
7901
  msgstr ""
7902
 
7903
+ #: templates/shortcode-profile-editor.php:179
7904
  msgid "Save Changes"
7905
  msgstr ""
7906
 
7907
+ #: templates/shortcode-profile-editor.php:191
7908
  msgid "You need to login to edit your profile."
7909
  msgstr ""
7910
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link: https://easydigitaldownloads.com/donate/
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce
7
  Requires at least: 4.0
8
  Tested up to: 4.7
9
- Stable Tag: 2.6.11
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
@@ -187,6 +187,32 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  = 2.6.11, November 8, 2016 =
191
  * New: WP CLI: Customers command now allows searching by user_id.
192
  * New: Add framework for the new Software Licensing beta support.
6
  Tags: download, downloads, e-store, eshop, digital downloads, e-commerce, wp-ecommerce, wp ecommerce
7
  Requires at least: 4.0
8
  Tested up to: 4.7
9
+ Stable Tag: 2.6.12
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
187
 
188
  == Changelog ==
189
 
190
+ = 2.6.12, November 17, 2016 =
191
+ * New: Added new hooks to the profile editor form.
192
+ * Fix: edd_has_active_discounts could return false when there were active discounts.
193
+ * Fix: Supplying an invalid date range on reports could produce an incorrect graph.
194
+ * Fix: EDD_Payment::update_meta could produce a PHP warning when used.
195
+ * Fix: Variable Pricing options were inconsistently being shown and hidden when toggled.
196
+ * Fix: Today/Yesterday Reports miscalculated hours to include the first hour of the next day.
197
+ * Fix: When single day ranges were used on Payments list table, order status counts were not loading.
198
+ * Fix: EDD HTML Select input had many cases where mixed variable types could trigger errors and warnings.
199
+ * Fix: edd_get_users_purchases had outdated PHPDocs.
200
+ * Fix: Determining the 'main' subsection of settings could fire hooks twice and had poor performance.
201
+ * Fix: When changing report years, the report data could have been incorrect.
202
+ * Fix: Payment counts were incorrect on the Payments list table when custom dates were used.
203
+ * Fix: Certain hosting configurations caused the usage tracking notice to be improperly escaped.
204
+ * Fix: Admin scripts were not requiring `jquery-form`.
205
+ * Fix: Download limit setting isn't checked for existence before accessing it when saving a Download.
206
+ * Fix: Timezone wasn't respected when setting up daily cron.
207
+ * Fix: Upgrade routines could calculate incorrect number of total steps.
208
+ * Fix: The notice about being in test mode was not linked to the correct settings page.
209
+ * Fix: `edd_get_users_purchased_products` would fail if the first product ID supplied was not a download.
210
+ * Fix: Checkout could require a state even if the country had no states associated with it.
211
+ * Fix: Creating a discount would not save the product requirements and exclusions on first save.
212
+ * Fix: PHP Warning was being caused by the new beta setting in the extension updater.
213
+ * Fix: The EDD_SL_Plugin_Updater::check_update method could possibly be called twice.
214
+ * Fix: Sanitized unescaped URLs with esc_url
215
+
216
  = 2.6.11, November 8, 2016 =
217
  * New: WP CLI: Customers command now allows searching by user_id.
218
  * New: Add framework for the new Software Licensing beta support.
templates/shortcode-profile-editor.php CHANGED
@@ -27,6 +27,9 @@ if ( is_user_logged_in() ):
27
  <?php do_action( 'edd_profile_editor_before' ); ?>
28
 
29
  <form id="edd_profile_editor_form" class="edd_form" action="<?php echo edd_get_current_page_url(); ?>" method="post">
 
 
 
30
  <fieldset>
31
  <span id="edd_profile_name_label"><legend><?php _e( 'Change your Name', 'easy-digital-downloads' ); ?></legend></span>
32
  <p id="edd_profile_name_wrap">
@@ -176,6 +179,9 @@ if ( is_user_logged_in() ):
176
  <input name="edd_profile_editor_submit" id="edd_profile_editor_submit" type="submit" class="edd_submit" value="<?php _e( 'Save Changes', 'easy-digital-downloads' ); ?>"/>
177
  </p>
178
  </fieldset>
 
 
 
179
  </form><!-- #edd_profile_editor_form -->
180
 
181
  <?php do_action( 'edd_profile_editor_after' ); ?>
27
  <?php do_action( 'edd_profile_editor_before' ); ?>
28
 
29
  <form id="edd_profile_editor_form" class="edd_form" action="<?php echo edd_get_current_page_url(); ?>" method="post">
30
+
31
+ <?php do_action( 'edd_profile_editor_fields_top' ); ?>
32
+
33
  <fieldset>
34
  <span id="edd_profile_name_label"><legend><?php _e( 'Change your Name', 'easy-digital-downloads' ); ?></legend></span>
35
  <p id="edd_profile_name_wrap">
179
  <input name="edd_profile_editor_submit" id="edd_profile_editor_submit" type="submit" class="edd_submit" value="<?php _e( 'Save Changes', 'easy-digital-downloads' ); ?>"/>
180
  </p>
181
  </fieldset>
182
+
183
+ <?php do_action( 'edd_profile_editor_fields_bottom' ); ?>
184
+
185
  </form><!-- #edd_profile_editor_form -->
186
 
187
  <?php do_action( 'edd_profile_editor_after' ); ?>