Easy Digital Downloads - Version 2.5.15

Version Description

Download this release

Release Info

Developer mordauk
Plugin Icon 128x128 Easy Digital Downloads
Version 2.5.15
Comparing to
See all releases

Code changes from version 2.5.14 to 2.5.15

assets/js/admin-scripts.js CHANGED
@@ -91,6 +91,7 @@ jQuery(document).ready(function ($) {
91
  placeholder_text_multiple: edd_vars.one_or_more_option,
92
  });
93
  clone.find( '.edd-select-chosen' ).css( 'width', '100%' );
 
94
  });
95
  },
96
 
@@ -403,7 +404,7 @@ jQuery(document).ready(function ($) {
403
  currently_removed = {};
404
  }
405
 
406
- var removed_item = [ { 'id': download_id, 'price_id': price_id, 'quantity': quantity, 'amount': amount } ];
407
  currently_removed[key] = removed_item
408
 
409
  $('input[name="edd-payment-removed"]').val(JSON.stringify(currently_removed));
@@ -1122,6 +1123,8 @@ jQuery(document).ready(function ($) {
1122
  placeholder_text_multiple: edd_vars.one_or_more_option,
1123
  });
1124
 
 
 
1125
  // Add placeholders for Chosen input fields
1126
  $( '.chosen-choices' ).on( 'click', function () {
1127
  $(this).children('li').children('input').attr( 'placeholder', edd_vars.type_to_search );
91
  placeholder_text_multiple: edd_vars.one_or_more_option,
92
  });
93
  clone.find( '.edd-select-chosen' ).css( 'width', '100%' );
94
+ clone.find( '.edd-select-chosen .chosen-search input' ).attr( 'placeholder', edd_vars.search_placeholder );
95
  });
96
  },
97
 
404
  currently_removed = {};
405
  }
406
 
407
+ var removed_item = [ { 'id': download_id, 'price_id': price_id, 'quantity': quantity, 'amount': amount, 'cart_index': key } ];
408
  currently_removed[key] = removed_item
409
 
410
  $('input[name="edd-payment-removed"]').val(JSON.stringify(currently_removed));
1123
  placeholder_text_multiple: edd_vars.one_or_more_option,
1124
  });
1125
 
1126
+ $('.edd-select-chosen .chosen-search input' ).attr( 'placeholder', edd_vars.search_placeholder );
1127
+
1128
  // Add placeholders for Chosen input fields
1129
  $( '.chosen-choices' ).on( 'click', function () {
1130
  $(this).children('li').children('input').attr( 'placeholder', edd_vars.type_to_search );
assets/js/admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){var t={init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices()},clone_repeatable:function(t){var d=highest=1;return t.parent().find("tr.edd_repeatable_row").each(function(){var t=e(this).data("key");parseInt(t)>highest&&(highest=t)}),d=highest+=1,clone=t.clone(),clone.find("select").each(function(){e(this).val(t.find('select[name="'+e(this).attr("name")+'"]').val())}),clone.removeClass("edd_add_blank"),clone.attr("data-key",d),clone.find("td input, td select, textarea").val(""),clone.find("input, select, textarea").each(function(){var t=e(this).attr("name"),n=e(this).attr("id");t&&(t=t.replace(/\[(\d+)\]/,"["+parseInt(d)+"]"),e(this).attr("name",t)),"undefined"!=typeof n&&(n=n.replace(/(\d+)/,parseInt(d)),e(this).attr("id",n))}),clone.find("span.edd_price_id").each(function(){e(this).text(parseInt(d))}),clone.find("span.edd_file_id").each(function(){e(this).text(parseInt(d))}),clone.find(".edd_repeatable_default_input").each(function(){e(this).val(parseInt(d)).removeAttr("checked")}),clone.find(".search-choice").remove(),clone.find(".chosen-container").remove(),clone},add:function(){e(document.body).on("click",".submit .edd_add_repeatable",function(d){d.preventDefault();var n=e(this),a=n.parent().parent().prev("tr"),i=t.clone_repeatable(a);i.insertAfter(a).find("input, textarea, select").filter(":visible").eq(0).focus(),i.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}),i.find(".edd-select-chosen").css("width","100%")})},move:function(){e(".edd_repeatable_table tbody").sortable({handle:".edd_draghandle",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var t=0;e(this).find("tr").each(function(){e(this).find("input.edd_repeatable_index").each(function(){e(this).val(t)}),t++})}})},remove:function(){e(document.body).on("click",".edd_remove_repeatable",function(t){t.preventDefault();var d=e(this).parent().parent("tr"),n=d.parent().find("tr").length-1,a=e(this).data("type"),i="tr.edd_repeatable_"+a+"s";if("price"===a){var o=d.data("key");e('.edd_repeatable_condition_field option[value="'+o+'"]').remove()}if(n>1)e("input, select",d).val(""),d.fadeOut("fast").remove();else switch(a){case"price":alert(edd_vars.one_price_min);break;case"file":e("input, select",d).val("");break;default:alert(edd_vars.one_field_min)}e(i).each(function(t){e(this).find("input, select").each(function(){var d=e(this).attr("name");d=d.replace(/\[(\d+)\]/,"["+t+"]"),e(this).attr("name",d).attr("id",d)})})})},type:function(){e(document.body).on("change","#_edd_product_type",function(t){var d=e("#edd_products"),n=e("#edd_download_files"),a=e("#edd_download_limit_wrap");"bundle"===e(this).val()?(d.show(),n.hide(),a.hide()):(d.hide(),n.show(),a.show())})},prices:function(){e(document.body).on("change","#edd_variable_pricing",function(t){e(".edd_pricing_fields,.edd_repeatable_table .pricing").toggle()})},files:function(){if("undefined"==typeof wp||"1"!==edd_vars.new_media_ui)e(".edd_upload_file_button").length>0&&(window.formfield="",e(document.body).on("click",".edd_upload_file_button",function(t){if(t.preventDefault(),window.formfield=e(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 d="post_id="+edd_vars.post_id+"&";tb_show(edd_vars.add_new_download,"media-upload.php?"+d+"TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(t){window.formfield?(imgurl=e("a","<div>"+t+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(t),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1});else{var d;window.formfield="",e(document.body).on("click",".edd_upload_file_button",function(n){n.preventDefault();var a=e(this);return window.formfield=e(this).closest(".edd_repeatable_upload_wrapper"),d?void d.open():(d=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:a.data("uploader-title"),button:{text:a.data("uploader-button-text")},multiple:"0"==e(this).data("multiple")?!1:!0}),d.on("menu:render:default",function(e){var t={};e.unset("library-separator"),e.unset("gallery"),e.unset("featured-image"),e.unset("embed"),e.set(t)}),d.on("insert",function(){var e=d.state().get("selection");e.each(function(e,d){if(e=e.toJSON(),0===d)window.formfield.find(".edd_repeatable_attachment_id_field").val(e.id),window.formfield.find(".edd_repeatable_upload_field").val(e.url),window.formfield.find(".edd_repeatable_name_field").val(e.title);else{var n=window.formfield,a=t.clone_repeatable(n);a.find(".edd_repeatable_attachment_id_field").val(e.id),a.find(".edd_repeatable_upload_field").val(e.url),e.title.length>0?a.find(".edd_repeatable_name_field").val(e.title):a.find(".edd_repeatable_name_field").val(e.filename),a.insertAfter(n)}})}),void d.open())});var d;window.formfield=""}},updatePrices:function(){e("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var t=e(this).parents("tr").data("key"),d=e(this).val(),n=e(".edd_repeatable_condition_field option[value="+t+"]");n.length>0?n.text(d):e(".edd_repeatable_condition_field").append(e("<option></option>").attr("value",t).text(d))})}};t.init();var d=e(".edd_datepicker");if(d.length>0){var n="mm/dd/yy";d.datepicker({dateFormat:n})}var a={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(){e('select[name="edd-payment-address[0][country]"]').change(function(){var t=e(this);return data={action:"edd_get_shop_states",country:t.val(),field_name:"edd-payment-address[0][state]"},e.post(ajaxurl,data,function(t){var d=e("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");"nostates"==t?d.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>'):d.replaceWith(t)}),!1})},remove_download:function(){e("#edd-purchased-files").on("click",".edd-order-remove-download",function(){var t=e(document.body).find("#edd-purchased-files > .row").length;if(1===t)return alert(edd_vars.one_download_min),!1;if(confirm(edd_vars.delete_payment_download)){var d=e(this).data("key"),n=(e(".edd-payment-id").val(),e('input[name="edd-payment-details-downloads['+d+'][id]"]').val()),a=e('input[name="edd-payment-details-downloads['+d+'][price_id]"]').val(),i=e('input[name="edd-payment-details-downloads['+d+'][quantity]"]').val(),o=e('input[name="edd-payment-details-downloads['+d+'][amount]"]').val(),r=e('input[name="edd-payment-removed"]').val();r=e.parseJSON(r),r.length<1&&(r={});var s=[{id:n,price_id:a,quantity:i,amount:o}];r[d]=s,e('input[name="edd-payment-removed"]').val(JSON.stringify(r)),e(this).parent().parent().parent().remove(),e("#edd-payment-downloads-changed").val(1),e(".edd-order-payment-recalc-totals").show()}return!1})},new_customer:function(){e("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(t){t.preventDefault(),e(".customer-info").toggle(),e(".new-customer").toggle();var d=e("#edd-new-customer");e(".new-customer").is(":visible")?d.val(1):d.val(0)})},add_download:function(){e("#edd-purchased-files").on("click","#edd-order-add-download",function(t){t.preventDefault();var d=e("#edd_order_download_select"),n=e("#edd-order-download-quantity"),a=e("#edd-order-download-amount"),i=e(".edd_price_options_select option:selected"),o=d.val(),r=d.find(":selected").text(),s=n.val(),c=a.val(),l=i.val(),u=i.text();if(1>o)return!1;if(c||(c=0),c=parseFloat(c),isNaN(c))return alert(edd_vars.numeric_item_price),!1;var p=c;if("1"===edd_vars.quantities_enabled){if(isNaN(parseInt(s)))return alert(edd_vars.numeric_quantity),!1;c*=s}c=c.toFixed(edd_vars.currency_decimals);var _=c+edd_vars.currency_sign;"before"===edd_vars.currency_pos&&(_=edd_vars.currency_sign+c),u&&(r=r+" - "+u);var f=e("#edd-purchased-files div.row").length,m=e("#edd-purchased-files div.row:last").clone();m.find(".download span").html('<a href="post.php?post='+o+'&action=edit"></a>'),m.find(".download span a").text(r),m.find(".price-text").text(_),m.find(".item-quantity").text(s),m.find(".item-price").text(edd_vars.currency_sign+(c/s).toFixed(edd_vars.currency_decimals)),m.find("input.edd-payment-details-download-id").val(o),m.find("input.edd-payment-details-download-price-id").val(l),m.find("input.edd-payment-details-download-item-price").val(p),m.find("input.edd-payment-details-download-amount").val(c),m.find("input.edd-payment-details-download-quantity").val(s),m.find("input.edd-payment-details-download-has-log").val(0),m.find("input").each(function(){var t=e(this).attr("name");t=t.replace(/\[(\d+)\]/,"["+parseInt(f)+"]"),e(this).attr("name",t).attr("id",t)}),e("#edd-payment-downloads-changed").val(1),e(m).insertAfter("#edd-purchased-files div.row:last"),e(".edd-order-payment-recalc-totals").show()})},recalculate_total:function(){e("#edd-order-recalc-total").on("click",function(t){t.preventDefault();var d=0,n=e("#edd-purchased-files .row .edd-payment-details-download-amount");n.length&&n.each(function(){d+=parseFloat(e(this).val())}),e(".edd-payment-fees").length&&e(".edd-payment-fees span.fee-amount").each(function(){d+=parseFloat(e(this).data("fee"))}),e("input[name=edd-payment-total]").val(d.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){e("#edd-purchased-files").on("change","select#edd_order_download_select",function(){var t=e(this),d=t.val();if(parseInt(d)>0){var n={action:"edd_check_for_download_price_variations",download_id:d};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(d){e(".edd_price_options_select").remove(),e(d).insertAfter(t.next())}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}})},add_note:function(){e("#edd-add-payment-note").on("click",function(t){t.preventDefault();var d={action:"edd_insert_payment_note",payment_id:e(this).data("payment-id"),note:e("#edd-payment-note").val()};if(d.note)e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){e("#edd-payment-notes-inner").append(t),e(".edd-no-payment-notes").hide(),e("#edd-payment-note").val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=e("#edd-payment-note").css("border-color");e("#edd-payment-note").css("border-color","red"),setTimeout(function(){e("#edd-payment-note").css("border-color",n)},500)}})},remove_note:function(){e(document.body).on("click",".edd-delete-payment-note",function(t){if(t.preventDefault(),confirm(edd_vars.delete_payment_note)){var d={action:"edd_delete_payment_note",payment_id:e(this).data("payment-id"),note_id:e(this).data("note-id")};return e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){return e("#edd-payment-note-"+d.note_id).remove(),e(".edd-payment-note").length||e(".edd-no-payment-notes").show(),!1}}).fail(function(e){window.console&&window.console.log&&console.log(e)}),!0}})},resend_receipt:function(){e(document.body).on("click","#edd-resend-receipt",function(e){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){e(document.body).on("click",".edd-copy-download-link",function(t){t.preventDefault();var d=e(this),n={action:"edd_get_file_download_link",payment_id:e('input[name="edd_payment_id"]').val(),download_id:d.data("download-id"),price_id:d.data("price-id")};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(t){return e("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+t+"</textarea>"),e("#edd-download-link-textarea").focus().select(),!1}}).fail(function(e){window.console&&window.console.log&&console.log(e)})})}};a.init();var i={init:function(){this.type_select(),this.product_requirements()},type_select:function(){e("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){e(".edd-amount-description").toggle()})},product_requirements:function(){e("#products").change(function(){var t=e("#edd-discount-product-conditions");e(this).val()?t.show():t.hide()})}};i.init();var o={init:function(){this.date_options(),this.customers_export()},date_options:function(){e("#edd-graphs-date-options").change(function(){var t=e(this),d=e("#edd-date-range-options");"other"===t.val()?d.show():d.hide()})},customers_export:function(){e("#edd_customer_export_download").change(function(){var t=e(this),d=e("option:selected",t).val(),n=e("#edd_customer_export_option");if("0"===t.val()?n.show():n.hide(),0!=parseInt(d)){var a={action:"edd_check_for_download_price_variations",download_id:d,all_prices:!0},i=e(".edd_price_options_select");e.post(ajaxurl,a,function(t){i.remove(),e("#edd_customer_export_download_chosen").after(t)})}else i.remove()})}};o.init();var r={init:function(){this.general(),this.taxes(),this.emails(),this.misc()},general:function(){var t=e(".edd-color-picker");if(t.length&&t.wpColorPicker(),"undefined"==typeof wp||"1"!==edd_vars.new_media_ui){var d=e(".edd_settings_upload_button");d.length>0&&(window.formfield="",e(document.body).on("click",d,function(t){t.preventDefault(),window.formfield=e(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(t){window.formfield?(imgurl=e("a","<div>"+t+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(t),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1})}else{var n;window.formfield="",e(document.body).on("click",".edd_settings_upload_button",function(t){t.preventDefault();var d=e(this);return window.formfield=e(this).parent().prev(),n?void n.open():(n=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:d.data("uploader_title"),button:{text:d.data("uploader_button_text")},multiple:!1}),n.on("menu:render:default",function(e){var t={};e.unset("library-separator"),e.unset("gallery"),e.unset("featured-image"),e.unset("embed"),e.set(t)}),n.on("insert",function(){var e=n.state().get("selection");e.each(function(e,t){e=e.toJSON(),window.formfield.val(e.url)})}),void n.open())});var n;window.formfield=""}},taxes:function(){var t=e("select.edd-no-states");t.length&&t.closest("tr").hide(),e('select[name="edd_settings[base_country]"]').change(function(){var t=e(this),d=t.closest("tr");return data={action:"edd_get_shop_states",country:e(this).val(),field_name:"edd_settings[base_state]"},e.post(ajaxurl,data,function(e){"nostates"==e?d.next().hide():(d.next().show(),d.next().find("select").replaceWith(e))}),!1}),e(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var t=e(this);return data={action:"edd_get_shop_states",country:e(this).val(),field_name:t.attr("name").replace("country","state")},e.post(ajaxurl,data,function(e){if("nostates"==e){var d='<input type="text" name="'+data.field_name+'" value=""/>';t.parent().next().find("select").replaceWith(d)}else t.parent().next().find("input,select").show(),t.parent().next().find("input,select").replaceWith(e)}),!1}),e("#edd_add_tax_rate").on("click",function(){var t=e("#edd_tax_rates tr:last"),d=t.clone(),n=t.parent().find("tr").length;return d.find("td input").not(":input[type=checkbox]").val(""),d.find('td [type="checkbox"]').attr("checked",!1),d.find("input, select").each(function(){var t=e(this).attr("name");t=t.replace(/\[(\d+)\]/,"["+parseInt(n)+"]"),e(this).attr("name",t).attr("id",t)}),d.find("label").each(function(){var t=e(this).attr("for");t=t.replace(/\[(\d+)\]/,"["+parseInt(n)+"]"),e(this).attr("for",t)}),d.insertAfter(t),!1}),e(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){if(confirm(edd_vars.delete_tax_rate)){var t=e("#edd_tax_rates tr:visible"),d=t.length;2===d?(e("#edd_tax_rates select").val(""),e('#edd_tax_rates input[type="text"]').val(""),e('#edd_tax_rates input[type="number"]').val(""),e('#edd_tax_rates input[type="checkbox"]').attr("checked",!1)):e(this).closest("tr").remove(),e("#edd_tax_rates tr").each(function(t){e(this).children().find("input, select").each(function(){var d=e(this).attr("name");d=d.replace(/\[(\d+)\]/,"["+(t-1)+"]"),e(this).attr("name",d).attr("id",d)})})}return!1})},emails:function(){var t=e("#email-preview-wrap");if(t.length){var d=e("#email-preview");t.colorbox({inline:!0,href:d,width:"80%",height:"auto"})}},misc:function(){var t=e('select[name="edd_settings[download_method]"]'),d=t.parent().parent().next();"direct"==t.val()&&(d.hide(),d.find("input").prop("checked",!1)),t.on("change",function(){"direct"==e(this).val()?(d.hide(),d.find("input").prop("checked",!1)):d.show()})}};r.init(),e(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){return confirm(edd_vars.delete_payment)?!0:!1}),e("#the-list").on("click",".editinline",function(){var t=e(this).closest("tr").attr("id");t=t.replace("post-","");var d=e("#post-"+t),n=d.find(".column-price .downloadprice-"+t).val();n!=e("#post-"+t+".column-price .downloadprice-"+t).val()?e(".regprice","#edd-download-data").val(n).attr("disabled",!1):e(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}),e(document.body).on("click","#bulk_edit",function(){var t=e("#bulk-edit"),d=new Array;t.find("#bulk-titles").children().each(function(){d.push(e(this).attr("id").replace(/^(ttle)/i,""))});var n=e('#edd-download-data input[name="_edd_regprice"]').val(),a={action:"edd_save_bulk_edit",edd_bulk_nonce:d,post_ids:d,price:n};e.post(ajaxurl,a)}),e(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),e(".chosen-choices").on("click",function(){e(this).children("li").children("input").attr("placeholder",edd_vars.type_to_search)});var s,c=342;e(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(t){var d=e(this).val(),n=e(this).closest(".edd-select-chosen"),a=n.attr("id").replace("_chosen",""),i=n.hasClass("no-bundles"),o=t.which,r="edd_download_search";n.prev().data("search-type")&&(r="edd_"+n.prev().data("search-type")+"_search"),d.length<=3&&"edd_download_search"==r||16==o||13==o||91==o||17==o||37==o||38==o||39==o||40==o||(clearTimeout(s),s=setTimeout(function(){e.ajax({type:"GET",url:ajaxurl,data:{action:r,s:d,current_id:edd_vars.post_id,no_bundles:i},dataType:"json",beforeSend:function(){e("ul.chosen-results").empty()},success:function(t){e("#"+a+" option:not(:selected)").remove(),e.each(t,function(t,d){e("#"+a+' option[value="'+d.id+'"]').length||e("#"+a).prepend('<option value="'+d.id+'">'+d.name+"</option>")}),e(".edd-select-chosen").trigger("chosen:updated"),e("#"+a).next().find("input").val(d)}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){})},c))}),e("#post").on("click",".edd-thickbox",function(){e(".edd-select-chosen","#choose-download").css("width","100%")});var l={init:function(){this.revoke_api_key(),this.regenerate_api_key(),this.create_api_key(),this.recount_stats()},revoke_api_key:function(){e(document.body).on("click",".edd-revoke-api-key",function(e){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){e(document.body).on("click",".edd-regenerate-api-key",function(e){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){e(document.body).on("submit","#api-key-generate-form",function(t){var d=e('input[type="text"][name="user_id"]');d.css("border-color","#ddd");var n=d.val();return n.length<1||0==n?(d.css("border-color","#ff0000"),!1):void 0})},recount_stats:function(){e("body").on("change","#recount-stats-type",function(){var t=e("#edd-tools-recount-form"),d=e("option:selected",this).data("type"),n=e("#recount-stats-submit"),a=e("#tools-product-dropdown");if(t.find(".notice-wrap").remove(),n.removeClass("button-disabled").attr("disabled",!1),a.hide(),e(".edd-recount-stats-descriptions span").hide(),"recount-download"===d)a.show(),a.find(".edd-select-chosen").css("width","auto");else if("reset-stats"===d){t.append('<div class="notice-wrap"></div>');var i=t.find(".notice-wrap");i.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>"),e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}else a.hide(),a.val(0);e("#"+d).show()}),e("body").on("change","#confirm-reset",function(){var t=e(this).is(":checked");t?e("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),e("#edd-tools-recount-form").submit(function(t){var d=e("#recount-stats-type").val(),n=e(this),a=e("option:selected",this).data("type");if("reset-stats"===a){var i=e("#confirm-reset").is(":checked");if(i)return!0;r=!0}n.find(".notice-wrap").remove(),n.append('<div class="notice-wrap"></div>');var o=n.find(".notice-wrap"),r=!1;if((null===d||0===d)&&(o.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>"),r=!0),"recount-download"===a){var s=e('select[name="download_id"]').val();0==s&&(o.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>"),r=!0)}return r?(n.find(".button-disabled").removeClass("button-disabled"),!1):void 0})}};l.init();var u={init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;e(document.body).on("submit",".edd-export-form",function(d){d.preventDefault();var n=e(this).find('input[type="submit"]');if(!n.hasClass("button-disabled")){var a=e(this).serialize();n.addClass("button-disabled"),e(this).find(".notice-wrap").remove(),e(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),t.process_step(1,a,t)}})},process_step:function(t,d,n){e.ajax({type:"POST",url:ajaxurl,data:{form:d,action:"edd_do_ajax_export",step:t},dataType:"json",success:function(t){if("done"==t.step||t.error||t.success){var a=e(".edd-export-form").find(".edd-progress").parent().parent(),i=a.find(".notice-wrap");if(a.find(".button-disabled").removeClass("button-disabled"),t.error){var o=t.message;i.html('<div class="updated error"><p>'+o+"</p></div>")}else if(t.success){var r=t.message;i.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+r+'<span class="notice-dismiss"></span></p></div>')}else i.remove(),window.location=t.url}else e(".edd-progress div").animate({width:t.percentage+"%"},50,function(){}),n.process_step(parseInt(t.step),d,n)}}).fail(function(e){window.console&&window.console.log&&console.log(e)})},dismiss_message:function(){e("body").on("click","#edd-batch-success .notice-dismiss",function(){e("#edd-batch-success").parent().slideUp("fast")})}};u.init();var p={vars:{customer_card_wrap_editable:e(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:e(".edd-customer-card-wrapper .edit-item"),user_id:e('input[name="customerinfo[user_id]"]'),state_input:e(':input[name="customerinfo[state]"]'),note:e("#customer-note")},init:function(){this.edit_customer(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.add_note(),this.delete_checked()},edit_customer:function(){e(document.body).on("click","#edit-customer",function(e){e.preventDefault(),p.vars.customer_card_wrap_editable.hide(),p.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},user_search:function(){e(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(t){t.preventDefault();var d=e(this).data("userid");p.vars.user_id.val(d)})},remove_user:function(){e(document.body).on("click","#disconnect-customer",function(t){t.preventDefault();var d=e('input[name="customerinfo[id]"]').val(),n={edd_action:"disconnect-userid",customer_id:d,_wpnonce:e("#edit-customer-info #_wpnonce").val()};e.post(ajaxurl,n,function(e){window.location.href=window.location.href},"json")})},cancel_edit:function(){e(document.body).on("click","#edd-edit-customer-cancel",function(t){t.preventDefault(),p.vars.customer_card_wrap_edit_item.hide(),p.vars.customer_card_wrap_editable.show(),e(".edd_user_search_results").html("")})},change_country:function(){e('select[name="customerinfo[country]"]').change(function(){var t=e(this);return data={action:"edd_get_shop_states",country:t.val(),field_name:"customerinfo[state]"},e.post(ajaxurl,data,function(e){"nostates"==e?p.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):p.vars.state_input.replaceWith(e)}),!1})},add_note:function(){e(document.body).on("click","#add-customer-note",function(t){t.preventDefault();var d={edd_action:"add-customer-note",customer_id:e("#customer-id").val(),customer_note:p.vars.note.val(),add_customer_note_nonce:e("#add_customer_note_nonce").val()};if(d.customer_note)e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){e("#edd-customer-notes").prepend(t),e(".edd-no-customer-notes").hide(),p.vars.note.val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=p.vars.note.css("border-color");p.vars.note.css("border-color","red"),setTimeout(function(){p.vars.note.css("border-color",n)},500)}})},delete_checked:function(){e("#edd-customer-delete-confirm").change(function(){var t=e("#edd-customer-delete-records"),d=e("#edd-delete-customer");e(this).prop("checked")?(t.attr("disabled",!1),d.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),d.attr("disabled",!0))})}};p.init(),e(".edd-ajax-user-search").keyup(function(){var t=e(this).val(),d="";e(this).data("exclude")&&(d=e(this).data("exclude")),e(".edd-ajax").show(),data={action:"edd_search_users",user_name:t,exclude:d},document.body.style.cursor="wait",e.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(t){e(".edd-ajax").hide(),e(".edd_user_search_results").removeClass("hidden"),e(".edd_user_search_results span").html(""),e(t.results).appendTo(".edd_user_search_results span"),document.body.style.cursor="default"}})}),e(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(t){t.preventDefault();var d=e(this).data("login");e(".edd-ajax-user-search").val(d),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")}),e(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(t){t.preventDefault(),e(".edd-ajax-user-search").val(""),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")}),e("#edd_dashboard_sales").length&&e.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(t){e("#edd_dashboard_sales .inside").html(t)}}),e(document).on("keydown",".customer-note-input",function(t){13==t.keyCode&&(t.metaKey||t.ctrlKey)&&e("#add-customer-note").click()})});var eddFormatCurrency=function(e){var t=parseFloat(e),d=edd_vars.currency,n=edd_vars.currency_decimals;return t.toLocaleString(d,{style:"currency",currency:d,minimumFractionDigits:n,maximumFractionDigits:n})},eddFormatNumber=function(e){var t=parseFloat(e),d=edd_vars.currency;edd_vars.currency_decimals;return t.toLocaleString(d,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})},eddLabelFormatter=function(e,t){return'<div style="font-size:12px; text-align:center; padding:2px">'+e+"</div>"},eddLegendFormatterSales=function(e,t){var d=e.toLowerCase().replace(/\s/g,"-"),n='<div class="edd-legend-color" style="background-color: '+t.color+'"></div>',a='<div class="edd-pie-legend-item">'+e+": "+Math.round(t.percent)+"% ("+eddFormatNumber(t.data[0][1])+")</div>",i='<div id="'+t.edd_vars.id+d+'" class="edd-legend-item-wrapper">'+n+a+"</div>";return jQuery("#edd-pie-legend-"+t.edd_vars.id).append(i),i},eddLegendFormatterEarnings=function(e,t){var d=e.toLowerCase().replace(/\s/g,"-"),n='<div class="edd-legend-color" style="background-color: '+t.color+'"></div>',a='<div class="edd-pie-legend-item">'+e+": "+Math.round(t.percent)+"% ("+eddFormatCurrency(t.data[0][1])+")</div>",i='<div id="'+t.edd_vars.id+d+'" class="edd-legend-item-wrapper">'+n+a+"</div>";return jQuery("#edd-pie-legend-"+t.edd_vars.id).append(i),i};
1
+ jQuery(document).ready(function(e){var t={init:function(){this.add(),this.move(),this.remove(),this.type(),this.prices(),this.files(),this.updatePrices()},clone_repeatable:function(t){var d=highest=1;return t.parent().find("tr.edd_repeatable_row").each(function(){var t=e(this).data("key");parseInt(t)>highest&&(highest=t)}),d=highest+=1,clone=t.clone(),clone.find("select").each(function(){e(this).val(t.find('select[name="'+e(this).attr("name")+'"]').val())}),clone.removeClass("edd_add_blank"),clone.attr("data-key",d),clone.find("td input, td select, textarea").val(""),clone.find("input, select, textarea").each(function(){var t=e(this).attr("name"),n=e(this).attr("id");t&&(t=t.replace(/\[(\d+)\]/,"["+parseInt(d)+"]"),e(this).attr("name",t)),"undefined"!=typeof n&&(n=n.replace(/(\d+)/,parseInt(d)),e(this).attr("id",n))}),clone.find("span.edd_price_id").each(function(){e(this).text(parseInt(d))}),clone.find("span.edd_file_id").each(function(){e(this).text(parseInt(d))}),clone.find(".edd_repeatable_default_input").each(function(){e(this).val(parseInt(d)).removeAttr("checked")}),clone.find(".search-choice").remove(),clone.find(".chosen-container").remove(),clone},add:function(){e(document.body).on("click",".submit .edd_add_repeatable",function(d){d.preventDefault();var n=e(this),a=n.parent().parent().prev("tr"),i=t.clone_repeatable(a);i.insertAfter(a).find("input, textarea, select").filter(":visible").eq(0).focus(),i.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}),i.find(".edd-select-chosen").css("width","100%"),i.find(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder)})},move:function(){e(".edd_repeatable_table tbody").sortable({handle:".edd_draghandle",items:".edd_repeatable_row",opacity:.6,cursor:"move",axis:"y",update:function(){var t=0;e(this).find("tr").each(function(){e(this).find("input.edd_repeatable_index").each(function(){e(this).val(t)}),t++})}})},remove:function(){e(document.body).on("click",".edd_remove_repeatable",function(t){t.preventDefault();var d=e(this).parent().parent("tr"),n=d.parent().find("tr").length-1,a=e(this).data("type"),i="tr.edd_repeatable_"+a+"s";if("price"===a){var o=d.data("key");e('.edd_repeatable_condition_field option[value="'+o+'"]').remove()}if(n>1)e("input, select",d).val(""),d.fadeOut("fast").remove();else switch(a){case"price":alert(edd_vars.one_price_min);break;case"file":e("input, select",d).val("");break;default:alert(edd_vars.one_field_min)}e(i).each(function(t){e(this).find("input, select").each(function(){var d=e(this).attr("name");d=d.replace(/\[(\d+)\]/,"["+t+"]"),e(this).attr("name",d).attr("id",d)})})})},type:function(){e(document.body).on("change","#_edd_product_type",function(t){var d=e("#edd_products"),n=e("#edd_download_files"),a=e("#edd_download_limit_wrap");"bundle"===e(this).val()?(d.show(),n.hide(),a.hide()):(d.hide(),n.show(),a.show())})},prices:function(){e(document.body).on("change","#edd_variable_pricing",function(t){e(".edd_pricing_fields,.edd_repeatable_table .pricing").toggle()})},files:function(){if("undefined"==typeof wp||"1"!==edd_vars.new_media_ui)e(".edd_upload_file_button").length>0&&(window.formfield="",e(document.body).on("click",".edd_upload_file_button",function(t){if(t.preventDefault(),window.formfield=e(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 d="post_id="+edd_vars.post_id+"&";tb_show(edd_vars.add_new_download,"media-upload.php?"+d+"TB_iframe=true")}),window.edd_send_to_editor=window.send_to_editor,window.send_to_editor=function(t){window.formfield?(imgurl=e("a","<div>"+t+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(t),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1});else{var d;window.formfield="",e(document.body).on("click",".edd_upload_file_button",function(n){n.preventDefault();var a=e(this);return window.formfield=e(this).closest(".edd_repeatable_upload_wrapper"),d?void d.open():(d=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:a.data("uploader-title"),button:{text:a.data("uploader-button-text")},multiple:"0"==e(this).data("multiple")?!1:!0}),d.on("menu:render:default",function(e){var t={};e.unset("library-separator"),e.unset("gallery"),e.unset("featured-image"),e.unset("embed"),e.set(t)}),d.on("insert",function(){var e=d.state().get("selection");e.each(function(e,d){if(e=e.toJSON(),0===d)window.formfield.find(".edd_repeatable_attachment_id_field").val(e.id),window.formfield.find(".edd_repeatable_upload_field").val(e.url),window.formfield.find(".edd_repeatable_name_field").val(e.title);else{var n=window.formfield,a=t.clone_repeatable(n);a.find(".edd_repeatable_attachment_id_field").val(e.id),a.find(".edd_repeatable_upload_field").val(e.url),e.title.length>0?a.find(".edd_repeatable_name_field").val(e.title):a.find(".edd_repeatable_name_field").val(e.filename),a.insertAfter(n)}})}),void d.open())});var d;window.formfield=""}},updatePrices:function(){e("#edd_price_fields").on("keyup",".edd_variable_prices_name",function(){var t=e(this).parents("tr").data("key"),d=e(this).val(),n=e(".edd_repeatable_condition_field option[value="+t+"]");n.length>0?n.text(d):e(".edd_repeatable_condition_field").append(e("<option></option>").attr("value",t).text(d))})}};t.init();var d=e(".edd_datepicker");if(d.length>0){var n="mm/dd/yy";d.datepicker({dateFormat:n})}var a={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(){e('select[name="edd-payment-address[0][country]"]').change(function(){var t=e(this);return data={action:"edd_get_shop_states",country:t.val(),field_name:"edd-payment-address[0][state]"},e.post(ajaxurl,data,function(t){var d=e("#edd-order-address-state-wrap select, #edd-order-address-state-wrap input");"nostates"==t?d.replaceWith('<input type="text" name="edd-payment-address[0][state]" value="" class="edd-edit-toggles medium-text"/>'):d.replaceWith(t)}),!1})},remove_download:function(){e("#edd-purchased-files").on("click",".edd-order-remove-download",function(){var t=e(document.body).find("#edd-purchased-files > .row").length;if(1===t)return alert(edd_vars.one_download_min),!1;if(confirm(edd_vars.delete_payment_download)){var d=e(this).data("key"),n=(e(".edd-payment-id").val(),e('input[name="edd-payment-details-downloads['+d+'][id]"]').val()),a=e('input[name="edd-payment-details-downloads['+d+'][price_id]"]').val(),i=e('input[name="edd-payment-details-downloads['+d+'][quantity]"]').val(),o=e('input[name="edd-payment-details-downloads['+d+'][amount]"]').val(),r=e('input[name="edd-payment-removed"]').val();r=e.parseJSON(r),r.length<1&&(r={});var s=[{id:n,price_id:a,quantity:i,amount:o,cart_index:d}];r[d]=s,e('input[name="edd-payment-removed"]').val(JSON.stringify(r)),e(this).parent().parent().parent().remove(),e("#edd-payment-downloads-changed").val(1),e(".edd-order-payment-recalc-totals").show()}return!1})},new_customer:function(){e("#edd-customer-details").on("click",".edd-payment-new-customer, .edd-payment-new-customer-cancel",function(t){t.preventDefault(),e(".customer-info").toggle(),e(".new-customer").toggle();var d=e("#edd-new-customer");e(".new-customer").is(":visible")?d.val(1):d.val(0)})},add_download:function(){e("#edd-purchased-files").on("click","#edd-order-add-download",function(t){t.preventDefault();var d=e("#edd_order_download_select"),n=e("#edd-order-download-quantity"),a=e("#edd-order-download-amount"),i=e(".edd_price_options_select option:selected"),o=d.val(),r=d.find(":selected").text(),s=n.val(),c=a.val(),l=i.val(),u=i.text();if(1>o)return!1;if(c||(c=0),c=parseFloat(c),isNaN(c))return alert(edd_vars.numeric_item_price),!1;var p=c;if("1"===edd_vars.quantities_enabled){if(isNaN(parseInt(s)))return alert(edd_vars.numeric_quantity),!1;c*=s}c=c.toFixed(edd_vars.currency_decimals);var _=c+edd_vars.currency_sign;"before"===edd_vars.currency_pos&&(_=edd_vars.currency_sign+c),u&&(r=r+" - "+u);var f=e("#edd-purchased-files div.row").length,m=e("#edd-purchased-files div.row:last").clone();m.find(".download span").html('<a href="post.php?post='+o+'&action=edit"></a>'),m.find(".download span a").text(r),m.find(".price-text").text(_),m.find(".item-quantity").text(s),m.find(".item-price").text(edd_vars.currency_sign+(c/s).toFixed(edd_vars.currency_decimals)),m.find("input.edd-payment-details-download-id").val(o),m.find("input.edd-payment-details-download-price-id").val(l),m.find("input.edd-payment-details-download-item-price").val(p),m.find("input.edd-payment-details-download-amount").val(c),m.find("input.edd-payment-details-download-quantity").val(s),m.find("input.edd-payment-details-download-has-log").val(0),m.find("input").each(function(){var t=e(this).attr("name");t=t.replace(/\[(\d+)\]/,"["+parseInt(f)+"]"),e(this).attr("name",t).attr("id",t)}),e("#edd-payment-downloads-changed").val(1),e(m).insertAfter("#edd-purchased-files div.row:last"),e(".edd-order-payment-recalc-totals").show()})},recalculate_total:function(){e("#edd-order-recalc-total").on("click",function(t){t.preventDefault();var d=0,n=e("#edd-purchased-files .row .edd-payment-details-download-amount");n.length&&n.each(function(){d+=parseFloat(e(this).val())}),e(".edd-payment-fees").length&&e(".edd-payment-fees span.fee-amount").each(function(){d+=parseFloat(e(this).data("fee"))}),e("input[name=edd-payment-total]").val(d.toFixed(edd_vars.currency_decimals))})},variable_prices_check:function(){e("#edd-purchased-files").on("change","select#edd_order_download_select",function(){var t=e(this),d=t.val();if(parseInt(d)>0){var n={action:"edd_check_for_download_price_variations",download_id:d};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(d){e(".edd_price_options_select").remove(),e(d).insertAfter(t.next())}}).fail(function(e){window.console&&window.console.log&&console.log(e)})}})},add_note:function(){e("#edd-add-payment-note").on("click",function(t){t.preventDefault();var d={action:"edd_insert_payment_note",payment_id:e(this).data("payment-id"),note:e("#edd-payment-note").val()};if(d.note)e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){e("#edd-payment-notes-inner").append(t),e(".edd-no-payment-notes").hide(),e("#edd-payment-note").val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=e("#edd-payment-note").css("border-color");e("#edd-payment-note").css("border-color","red"),setTimeout(function(){e("#edd-payment-note").css("border-color",n)},500)}})},remove_note:function(){e(document.body).on("click",".edd-delete-payment-note",function(t){if(t.preventDefault(),confirm(edd_vars.delete_payment_note)){var d={action:"edd_delete_payment_note",payment_id:e(this).data("payment-id"),note_id:e(this).data("note-id")};return e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){return e("#edd-payment-note-"+d.note_id).remove(),e(".edd-payment-note").length||e(".edd-no-payment-notes").show(),!1}}).fail(function(e){window.console&&window.console.log&&console.log(e)}),!0}})},resend_receipt:function(){e(document.body).on("click","#edd-resend-receipt",function(e){return confirm(edd_vars.resend_receipt)})},copy_download_link:function(){e(document.body).on("click",".edd-copy-download-link",function(t){t.preventDefault();var d=e(this),n={action:"edd_get_file_download_link",payment_id:e('input[name="edd_payment_id"]').val(),download_id:d.data("download-id"),price_id:d.data("price-id")};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(t){return e("#edd-download-link").dialog({width:400}).html('<textarea rows="10" cols="40" id="edd-download-link-textarea">'+t+"</textarea>"),e("#edd-download-link-textarea").focus().select(),!1}}).fail(function(e){window.console&&window.console.log&&console.log(e)})})}};a.init();var i={init:function(){this.type_select(),this.product_requirements()},type_select:function(){e("#edd-edit-discount #edd-type, #edd-add-discount #edd-type").change(function(){e(".edd-amount-description").toggle()})},product_requirements:function(){e("#products").change(function(){var t=e("#edd-discount-product-conditions");e(this).val()?t.show():t.hide()})}};i.init();var o={init:function(){this.date_options(),this.customers_export()},date_options:function(){e("#edd-graphs-date-options").change(function(){var t=e(this),d=e("#edd-date-range-options");"other"===t.val()?d.show():d.hide()})},customers_export:function(){e("#edd_customer_export_download").change(function(){var t=e(this),d=e("option:selected",t).val(),n=e("#edd_customer_export_option");if("0"===t.val()?n.show():n.hide(),0!=parseInt(d)){var a={action:"edd_check_for_download_price_variations",download_id:d,all_prices:!0},i=e(".edd_price_options_select");e.post(ajaxurl,a,function(t){i.remove(),e("#edd_customer_export_download_chosen").after(t)})}else i.remove()})}};o.init();var r={init:function(){this.general(),this.taxes(),this.emails(),this.misc()},general:function(){var t=e(".edd-color-picker");if(t.length&&t.wpColorPicker(),"undefined"==typeof wp||"1"!==edd_vars.new_media_ui){var d=e(".edd_settings_upload_button");d.length>0&&(window.formfield="",e(document.body).on("click",d,function(t){t.preventDefault(),window.formfield=e(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(t){window.formfield?(imgurl=e("a","<div>"+t+"</div>").attr("href"),window.formfield.val(imgurl),window.clearInterval(window.tbframe_interval),tb_remove()):window.edd_send_to_editor(t),window.send_to_editor=window.edd_send_to_editor,window.formfield="",window.imagefield=!1})}else{var n;window.formfield="",e(document.body).on("click",".edd_settings_upload_button",function(t){t.preventDefault();var d=e(this);return window.formfield=e(this).parent().prev(),n?void n.open():(n=wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:d.data("uploader_title"),button:{text:d.data("uploader_button_text")},multiple:!1}),n.on("menu:render:default",function(e){var t={};e.unset("library-separator"),e.unset("gallery"),e.unset("featured-image"),e.unset("embed"),e.set(t)}),n.on("insert",function(){var e=n.state().get("selection");e.each(function(e,t){e=e.toJSON(),window.formfield.val(e.url)})}),void n.open())});var n;window.formfield=""}},taxes:function(){var t=e("select.edd-no-states");t.length&&t.closest("tr").hide(),e('select[name="edd_settings[base_country]"]').change(function(){var t=e(this),d=t.closest("tr");return data={action:"edd_get_shop_states",country:e(this).val(),field_name:"edd_settings[base_state]"},e.post(ajaxurl,data,function(e){"nostates"==e?d.next().hide():(d.next().show(),d.next().find("select").replaceWith(e))}),!1}),e(document.body).on("change","#edd_tax_rates select.edd-tax-country",function(){var t=e(this);return data={action:"edd_get_shop_states",country:e(this).val(),field_name:t.attr("name").replace("country","state")},e.post(ajaxurl,data,function(e){if("nostates"==e){var d='<input type="text" name="'+data.field_name+'" value=""/>';t.parent().next().find("select").replaceWith(d)}else t.parent().next().find("input,select").show(),t.parent().next().find("input,select").replaceWith(e)}),!1}),e("#edd_add_tax_rate").on("click",function(){var t=e("#edd_tax_rates tr:last"),d=t.clone(),n=t.parent().find("tr").length;return d.find("td input").not(":input[type=checkbox]").val(""),d.find('td [type="checkbox"]').attr("checked",!1),d.find("input, select").each(function(){var t=e(this).attr("name");t=t.replace(/\[(\d+)\]/,"["+parseInt(n)+"]"),e(this).attr("name",t).attr("id",t)}),d.find("label").each(function(){var t=e(this).attr("for");t=t.replace(/\[(\d+)\]/,"["+parseInt(n)+"]"),e(this).attr("for",t)}),d.insertAfter(t),!1}),e(document.body).on("click","#edd_tax_rates .edd_remove_tax_rate",function(){if(confirm(edd_vars.delete_tax_rate)){var t=e("#edd_tax_rates tr:visible"),d=t.length;2===d?(e("#edd_tax_rates select").val(""),e('#edd_tax_rates input[type="text"]').val(""),e('#edd_tax_rates input[type="number"]').val(""),e('#edd_tax_rates input[type="checkbox"]').attr("checked",!1)):e(this).closest("tr").remove(),e("#edd_tax_rates tr").each(function(t){e(this).children().find("input, select").each(function(){var d=e(this).attr("name");d=d.replace(/\[(\d+)\]/,"["+(t-1)+"]"),e(this).attr("name",d).attr("id",d)})})}return!1})},emails:function(){var t=e("#email-preview-wrap");if(t.length){var d=e("#email-preview");t.colorbox({inline:!0,href:d,width:"80%",height:"auto"})}},misc:function(){var t=e('select[name="edd_settings[download_method]"]'),d=t.parent().parent().next();"direct"==t.val()&&(d.hide(),d.find("input").prop("checked",!1)),t.on("change",function(){"direct"==e(this).val()?(d.hide(),d.find("input").prop("checked",!1)):d.show()})}};r.init(),e(".download_page_edd-payment-history .row-actions .delete a, a.edd-delete-payment").on("click",function(){return confirm(edd_vars.delete_payment)?!0:!1}),e("#the-list").on("click",".editinline",function(){var t=e(this).closest("tr").attr("id");t=t.replace("post-","");var d=e("#post-"+t),n=d.find(".column-price .downloadprice-"+t).val();n!=e("#post-"+t+".column-price .downloadprice-"+t).val()?e(".regprice","#edd-download-data").val(n).attr("disabled",!1):e(".regprice","#edd-download-data").val(edd_vars.quick_edit_warning).attr("disabled","disabled")}),e(document.body).on("click","#bulk_edit",function(){var t=e("#bulk-edit"),d=new Array;t.find("#bulk-titles").children().each(function(){d.push(e(this).attr("id").replace(/^(ttle)/i,""))});var n=e('#edd-download-data input[name="_edd_regprice"]').val(),a={action:"edd_save_bulk_edit",edd_bulk_nonce:d,post_ids:d,price:n};e.post(ajaxurl,a)}),e(".edd-select-chosen").chosen({inherit_select_classes:!0,placeholder_text_single:edd_vars.one_option,placeholder_text_multiple:edd_vars.one_or_more_option}),e(".edd-select-chosen .chosen-search input").attr("placeholder",edd_vars.search_placeholder),e(".chosen-choices").on("click",function(){e(this).children("li").children("input").attr("placeholder",edd_vars.type_to_search)});var s,c=342;e(document.body).on("keyup",".edd-select.chosen-container .chosen-search input, .edd-select.chosen-container .search-field input",function(t){var d=e(this).val(),n=e(this).closest(".edd-select-chosen"),a=n.attr("id").replace("_chosen",""),i=n.hasClass("no-bundles"),o=t.which,r="edd_download_search";n.prev().data("search-type")&&(r="edd_"+n.prev().data("search-type")+"_search"),d.length<=3&&"edd_download_search"==r||16==o||13==o||91==o||17==o||37==o||38==o||39==o||40==o||(clearTimeout(s),s=setTimeout(function(){e.ajax({type:"GET",url:ajaxurl,data:{action:r,s:d,current_id:edd_vars.post_id,no_bundles:i},dataType:"json",beforeSend:function(){e("ul.chosen-results").empty()},success:function(t){e("#"+a+" option:not(:selected)").remove(),e.each(t,function(t,d){e("#"+a+' option[value="'+d.id+'"]').length||e("#"+a).prepend('<option value="'+d.id+'">'+d.name+"</option>")}),e(".edd-select-chosen").trigger("chosen:updated"),e("#"+a).next().find("input").val(d)}}).fail(function(e){window.console&&window.console.log&&console.log(e)}).done(function(e){})},c))}),e("#post").on("click",".edd-thickbox",function(){e(".edd-select-chosen","#choose-download").css("width","100%")});var l={init:function(){this.revoke_api_key(),this.regenerate_api_key(),this.create_api_key(),this.recount_stats()},revoke_api_key:function(){e(document.body).on("click",".edd-revoke-api-key",function(e){return confirm(edd_vars.revoke_api_key)})},regenerate_api_key:function(){e(document.body).on("click",".edd-regenerate-api-key",function(e){return confirm(edd_vars.regenerate_api_key)})},create_api_key:function(){e(document.body).on("submit","#api-key-generate-form",function(t){var d=e('input[type="text"][name="user_id"]');d.css("border-color","#ddd");var n=d.val();return n.length<1||0==n?(d.css("border-color","#ff0000"),!1):void 0})},recount_stats:function(){e("body").on("change","#recount-stats-type",function(){var t=e("#edd-tools-recount-form"),d=e("option:selected",this).data("type"),n=e("#recount-stats-submit"),a=e("#tools-product-dropdown");if(t.find(".notice-wrap").remove(),n.removeClass("button-disabled").attr("disabled",!1),a.hide(),e(".edd-recount-stats-descriptions span").hide(),"recount-download"===d)a.show(),a.find(".edd-select-chosen").css("width","auto");else if("reset-stats"===d){t.append('<div class="notice-wrap"></div>');var i=t.find(".notice-wrap");i.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>"),e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}else a.hide(),a.val(0);e("#"+d).show()}),e("body").on("change","#confirm-reset",function(){var t=e(this).is(":checked");t?e("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")}),e("#edd-tools-recount-form").submit(function(t){var d=e("#recount-stats-type").val(),n=e(this),a=e("option:selected",this).data("type");if("reset-stats"===a){var i=e("#confirm-reset").is(":checked");if(i)return!0;r=!0}n.find(".notice-wrap").remove(),n.append('<div class="notice-wrap"></div>');var o=n.find(".notice-wrap"),r=!1;if((null===d||0===d)&&(o.html('<div class="updated error"><p>'+edd_vars.batch_export_no_class+"</p></div>"),r=!0),"recount-download"===a){var s=e('select[name="download_id"]').val();0==s&&(o.html('<div class="updated error"><p>'+edd_vars.batch_export_no_reqs+"</p></div>"),r=!0)}return r?(n.find(".button-disabled").removeClass("button-disabled"),!1):void 0})}};l.init();var u={init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;e(document.body).on("submit",".edd-export-form",function(d){d.preventDefault();var n=e(this).find('input[type="submit"]');if(!n.hasClass("button-disabled")){var a=e(this).serialize();n.addClass("button-disabled"),e(this).find(".notice-wrap").remove(),e(this).append('<div class="notice-wrap"><span class="spinner is-active"></span><div class="edd-progress"><div></div></div></div>'),t.process_step(1,a,t)}})},process_step:function(t,d,n){e.ajax({type:"POST",url:ajaxurl,data:{form:d,action:"edd_do_ajax_export",step:t},dataType:"json",success:function(t){if("done"==t.step||t.error||t.success){var a=e(".edd-export-form").find(".edd-progress").parent().parent(),i=a.find(".notice-wrap");if(a.find(".button-disabled").removeClass("button-disabled"),t.error){var o=t.message;i.html('<div class="updated error"><p>'+o+"</p></div>")}else if(t.success){var r=t.message;i.html('<div id="edd-batch-success" class="updated notice is-dismissible"><p>'+r+'<span class="notice-dismiss"></span></p></div>')}else i.remove(),window.location=t.url}else e(".edd-progress div").animate({width:t.percentage+"%"},50,function(){}),n.process_step(parseInt(t.step),d,n)}}).fail(function(e){window.console&&window.console.log&&console.log(e)})},dismiss_message:function(){e("body").on("click","#edd-batch-success .notice-dismiss",function(){e("#edd-batch-success").parent().slideUp("fast")})}};u.init();var p={vars:{customer_card_wrap_editable:e(".edd-customer-card-wrapper .editable"),customer_card_wrap_edit_item:e(".edd-customer-card-wrapper .edit-item"),user_id:e('input[name="customerinfo[user_id]"]'),state_input:e(':input[name="customerinfo[state]"]'),note:e("#customer-note")},init:function(){this.edit_customer(),this.user_search(),this.remove_user(),this.cancel_edit(),this.change_country(),this.add_note(),this.delete_checked()},edit_customer:function(){e(document.body).on("click","#edit-customer",function(e){e.preventDefault(),p.vars.customer_card_wrap_editable.hide(),p.vars.customer_card_wrap_edit_item.fadeIn().css("display","block")})},user_search:function(){e(document.body).on("click.eddSelectUser",".edd_user_search_results a",function(t){t.preventDefault();var d=e(this).data("userid");p.vars.user_id.val(d)})},remove_user:function(){e(document.body).on("click","#disconnect-customer",function(t){t.preventDefault();var d=e('input[name="customerinfo[id]"]').val(),n={edd_action:"disconnect-userid",customer_id:d,_wpnonce:e("#edit-customer-info #_wpnonce").val()};e.post(ajaxurl,n,function(e){window.location.href=window.location.href},"json")})},cancel_edit:function(){e(document.body).on("click","#edd-edit-customer-cancel",function(t){t.preventDefault(),p.vars.customer_card_wrap_edit_item.hide(),p.vars.customer_card_wrap_editable.show(),e(".edd_user_search_results").html("")})},change_country:function(){e('select[name="customerinfo[country]"]').change(function(){var t=e(this);return data={action:"edd_get_shop_states",country:t.val(),field_name:"customerinfo[state]"},e.post(ajaxurl,data,function(e){"nostates"==e?p.vars.state_input.replaceWith('<input type="text" name="'+data.field_name+'" value="" class="edd-edit-toggles medium-text"/>'):p.vars.state_input.replaceWith(e)}),!1})},add_note:function(){e(document.body).on("click","#add-customer-note",function(t){t.preventDefault();var d={edd_action:"add-customer-note",customer_id:e("#customer-id").val(),customer_note:p.vars.note.val(),add_customer_note_nonce:e("#add_customer_note_nonce").val()};if(d.customer_note)e.ajax({type:"POST",data:d,url:ajaxurl,success:function(t){e("#edd-customer-notes").prepend(t),e(".edd-no-customer-notes").hide(),p.vars.note.val("")}}).fail(function(e){window.console&&window.console.log&&console.log(e)});else{var n=p.vars.note.css("border-color");p.vars.note.css("border-color","red"),setTimeout(function(){p.vars.note.css("border-color",n)},500)}})},delete_checked:function(){e("#edd-customer-delete-confirm").change(function(){var t=e("#edd-customer-delete-records"),d=e("#edd-delete-customer");e(this).prop("checked")?(t.attr("disabled",!1),d.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),d.attr("disabled",!0))})}};p.init(),e(".edd-ajax-user-search").keyup(function(){var t=e(this).val(),d="";e(this).data("exclude")&&(d=e(this).data("exclude")),e(".edd-ajax").show(),data={action:"edd_search_users",user_name:t,exclude:d},document.body.style.cursor="wait",e.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(t){e(".edd-ajax").hide(),e(".edd_user_search_results").removeClass("hidden"),e(".edd_user_search_results span").html(""),e(t.results).appendTo(".edd_user_search_results span"),document.body.style.cursor="default"}})}),e(document.body).on("click.eddSelectUser",".edd_user_search_results span a",function(t){t.preventDefault();var d=e(this).data("login");e(".edd-ajax-user-search").val(d),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")}),e(document.body).on("click.eddCancelUserSearch",".edd_user_search_results a.edd-ajax-user-cancel",function(t){t.preventDefault(),e(".edd-ajax-user-search").val(""),e(".edd_user_search_results").addClass("hidden"),e(".edd_user_search_results span").html("")}),e("#edd_dashboard_sales").length&&e.ajax({type:"GET",data:{action:"edd_load_dashboard_widget"},url:ajaxurl,success:function(t){e("#edd_dashboard_sales .inside").html(t)}}),e(document).on("keydown",".customer-note-input",function(t){13==t.keyCode&&(t.metaKey||t.ctrlKey)&&e("#add-customer-note").click()})});var eddFormatCurrency=function(e){var t=parseFloat(e),d=edd_vars.currency,n=edd_vars.currency_decimals;return t.toLocaleString(d,{style:"currency",currency:d,minimumFractionDigits:n,maximumFractionDigits:n})},eddFormatNumber=function(e){var t=parseFloat(e),d=edd_vars.currency;edd_vars.currency_decimals;return t.toLocaleString(d,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})},eddLabelFormatter=function(e,t){return'<div style="font-size:12px; text-align:center; padding:2px">'+e+"</div>"},eddLegendFormatterSales=function(e,t){var d=e.toLowerCase().replace(/\s/g,"-"),n='<div class="edd-legend-color" style="background-color: '+t.color+'"></div>',a='<div class="edd-pie-legend-item">'+e+": "+Math.round(t.percent)+"% ("+eddFormatNumber(t.data[0][1])+")</div>",i='<div id="'+t.edd_vars.id+d+'" class="edd-legend-item-wrapper">'+n+a+"</div>";return jQuery("#edd-pie-legend-"+t.edd_vars.id).append(i),i},eddLegendFormatterEarnings=function(e,t){var d=e.toLowerCase().replace(/\s/g,"-"),n='<div class="edd-legend-color" style="background-color: '+t.color+'"></div>',a='<div class="edd-pie-legend-item">'+e+": "+Math.round(t.percent)+"% ("+eddFormatCurrency(t.data[0][1])+")</div>",i='<div id="'+t.edd_vars.id+d+'" class="edd-legend-item-wrapper">'+n+a+"</div>";return jQuery("#edd-pie-legend-"+t.edd_vars.id).append(i),i};
easy-digital-downloads.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Plugin Name: Easy Digital Downloads
4
  * Plugin URI: https://easydigitaldownloads.com
5
- * Description: Serve Digital Downloads Through WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
- * Version: 2.5.14
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.5.14
29
  */
30
 
31
  // Exit if accessed directly.
@@ -186,7 +186,7 @@ final class Easy_Digital_Downloads {
186
 
187
  // Plugin version.
188
  if ( ! defined( 'EDD_VERSION' ) ) {
189
- define( 'EDD_VERSION', '2.5.14' );
190
  }
191
 
192
  // Plugin Folder Path.
2
  /**
3
  * Plugin Name: Easy Digital Downloads
4
  * Plugin URI: https://easydigitaldownloads.com
5
+ * Description: The easiest way to sell digital products with WordPress.
6
  * Author: Pippin Williamson and Company
7
  * Author URI: https://easydigitaldownloads.com
8
+ * Version: 2.5.15
9
  * Text Domain: easy-digital-downloads
10
  * Domain Path: languages
11
  *
25
  * @package EDD
26
  * @category Core
27
  * @author Pippin Williamson
28
+ * @version 2.5.15
29
  */
30
 
31
  // Exit if accessed directly.
186
 
187
  // Plugin version.
188
  if ( ! defined( 'EDD_VERSION' ) ) {
189
+ define( 'EDD_VERSION', '2.5.15' );
190
  }
191
 
192
  // Plugin Folder Path.
includes/admin/payments/actions.php CHANGED
@@ -105,7 +105,6 @@ function edd_update_payment_details( $data ) {
105
  }
106
 
107
  $deleted_downloads = json_decode( stripcslashes( $data['edd-payment-removed'] ), true );
108
-
109
  foreach ( $deleted_downloads as $deleted_download ) {
110
  $deleted_download = $deleted_download[0];
111
 
@@ -113,12 +112,19 @@ function edd_update_payment_details( $data ) {
113
  continue;
114
  }
115
 
116
- $price_id = empty( $deleted_download['price_id'] ) ? 0 : (int) $deleted_download['price_id'];
 
 
 
 
 
 
117
 
118
  $args = array(
119
  'quantity' => (int) $deleted_download['quantity'],
120
- 'price_id' => (int) $price_id,
121
  'item_price' => (float) $deleted_download['amount'],
 
122
  );
123
 
124
  $payment->remove_download( $deleted_download['id'], $args );
105
  }
106
 
107
  $deleted_downloads = json_decode( stripcslashes( $data['edd-payment-removed'] ), true );
 
108
  foreach ( $deleted_downloads as $deleted_download ) {
109
  $deleted_download = $deleted_download[0];
110
 
112
  continue;
113
  }
114
 
115
+ $price_id = false;
116
+
117
+ if ( edd_has_variable_prices( $deleted_download['id'] ) && isset( $deleted_download['price_id'] ) ) {
118
+ $price_id = absint( $deleted_download['price_id'] );
119
+ }
120
+
121
+ $cart_index = isset( $deleted_download['cart_index'] ) ? absint( $deleted_download['cart_index'] ) : false;
122
 
123
  $args = array(
124
  'quantity' => (int) $deleted_download['quantity'],
125
+ 'price_id' => $price_id,
126
  'item_price' => (float) $deleted_download['amount'],
127
+ 'cart_index' => $cart_index
128
  );
129
 
130
  $payment->remove_download( $deleted_download['id'], $args );
includes/admin/tracking.php CHANGED
@@ -121,7 +121,7 @@ class EDD_Tracking {
121
 
122
  // Send a maximum of once per week
123
  $last_send = $this->get_last_send();
124
- if( $last_send && $last_send > strtotime( '-1 week' ) ) {
125
  return false;
126
  }
127
 
121
 
122
  // Send a maximum of once per week
123
  $last_send = $this->get_last_send();
124
+ if( ! $last_send || $last_send > strtotime( '-1 week' ) ) {
125
  return false;
126
  }
127
 
includes/class-edd-html-elements.php CHANGED
@@ -40,7 +40,7 @@ class EDD_HTML_Elements {
40
  'chosen' => false,
41
  'number' => 30,
42
  'bundles' => true,
43
- 'placeholder' => sprintf( __( 'Select a %s', 'easy-digital-downloads' ), edd_get_label_singular() ),
44
  'data' => array( 'search-type' => 'download' ),
45
  );
46
 
@@ -65,17 +65,13 @@ class EDD_HTML_Elements {
65
  );
66
  }
67
 
68
- $products = get_posts( $product_args );
69
-
70
- $options = array();
71
-
72
  if ( $products ) {
73
- $options[0] = sprintf( __( 'Select a %s', 'easy-digital-downloads' ), edd_get_label_singular() );
74
  foreach ( $products as $product ) {
75
  $options[ absint( $product->ID ) ] = esc_html( $product->post_title );
76
  }
77
- } else {
78
- $options[0] = __( 'No products found', 'easy-digital-downloads' );
79
  }
80
 
81
  // This ensures that any selected products are included in the drop down
40
  'chosen' => false,
41
  'number' => 30,
42
  'bundles' => true,
43
+ 'placeholder' => sprintf( __( 'Choose a %s', 'easy-digital-downloads' ), edd_get_label_singular() ),
44
  'data' => array( 'search-type' => 'download' ),
45
  );
46
 
65
  );
66
  }
67
 
68
+ $products = get_posts( $product_args );
69
+ $options = array();
70
+ $options[0] = '';
 
71
  if ( $products ) {
 
72
  foreach ( $products as $product ) {
73
  $options[ absint( $product->ID ) ] = esc_html( $product->post_title );
74
  }
 
 
75
  }
76
 
77
  // This ensures that any selected products are included in the drop down
includes/download-functions.php CHANGED
@@ -787,8 +787,10 @@ function edd_get_download_files( $download_id = 0, $variable_price_id = null ) {
787
  * @return string The file name
788
  */
789
  function edd_get_file_name( $file = array() ) {
790
- if( empty( $file ) || ! is_array( $file ) )
791
  return false;
 
 
792
  $name = ! empty( $file['name'] ) ? esc_html( $file['name'] ) : basename( $file['file'] );
793
 
794
  return $name;
787
  * @return string The file name
788
  */
789
  function edd_get_file_name( $file = array() ) {
790
+ if( empty( $file ) || ! is_array( $file ) ) {
791
  return false;
792
+ }
793
+
794
  $name = ! empty( $file['name'] ) ? esc_html( $file['name'] ) : basename( $file['file'] );
795
 
796
  return $name;
includes/emails/class-edd-email-tags.php CHANGED
@@ -451,11 +451,11 @@ function edd_email_tag_download_list( $payment_id ) {
451
  if ( $show_links ) {
452
  $download_list .= '<div>';
453
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
454
- $download_list .= '<a href="' . esc_url( $file_url ) . '">' . $file['name'] . '</a>';
455
  $download_list .= '</div>';
456
  } else {
457
  $download_list .= '<div>';
458
- $download_list .= $file['name'];
459
  $download_list .= '</div>';
460
  }
461
  }
@@ -559,9 +559,9 @@ function edd_email_tag_download_list_plain( $payment_id ) {
559
  foreach ( $files as $filekey => $file ) {
560
  if( $show_links ) {
561
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
562
- $download_list .= $file['name'] . ': ' . $file_url . "\n";
563
  } else {
564
- $download_list .= $file['name'] . "\n";
565
  }
566
  }
567
  }
451
  if ( $show_links ) {
452
  $download_list .= '<div>';
453
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
454
+ $download_list .= '<a href="' . esc_url( $file_url ) . '">' . edd_get_file_name( $file ) . '</a>';
455
  $download_list .= '</div>';
456
  } else {
457
  $download_list .= '<div>';
458
+ $download_list .= edd_get_file_name( $file );
459
  $download_list .= '</div>';
460
  }
461
  }
559
  foreach ( $files as $filekey => $file ) {
560
  if( $show_links ) {
561
  $file_url = edd_get_download_file_url( $payment_data['key'], $email, $filekey, $bundle_item, $price_id );
562
+ $download_list .= edd_get_file_name( $file ) . ': ' . $file_url . "\n";
563
  } else {
564
+ $download_list .= edd_get_file_name( $file ) . "\n";
565
  }
566
  }
567
  }
includes/payments/class-edd-payment.php CHANGED
@@ -1006,13 +1006,13 @@ final class EDD_Payment {
1006
 
1007
  foreach ( $this->downloads as $key => $item ) {
1008
 
1009
- if ( $download_id != $item['id'] ) {
1010
  continue;
1011
  }
1012
 
1013
  if ( false !== $args['price_id'] ) {
1014
 
1015
- if ( isset( $item['options']['price_id'] ) && $args['price_id'] != $item['options']['price_id'] ) {
1016
  continue;
1017
  }
1018
 
@@ -1029,7 +1029,7 @@ final class EDD_Payment {
1029
  }
1030
 
1031
  // If this item has a price ID, make sure it matches the cart indexed item's price ID before removing
1032
- if ( isset( $item['options']['price_id'] ) && $item['options']['price_id'] != $cart_item['item_number']['options']['price_id'] ) {
1033
  continue;
1034
  }
1035
 
@@ -1064,13 +1064,13 @@ final class EDD_Payment {
1064
  }
1065
 
1066
  if ( false !== $args['price_id'] ) {
1067
- if ( isset( $item['item_number']['options']['price_id'] ) && $args['price_id'] != $item['item_number']['options']['price_id'] ) {
1068
  continue;
1069
  }
1070
  }
1071
 
1072
  if ( false !== $args['item_price'] ) {
1073
- if ( isset( $item['item_price'] ) && $args['item_price'] != $item['item_price'] ) {
1074
  continue;
1075
  }
1076
  }
@@ -1087,7 +1087,7 @@ final class EDD_Payment {
1087
  return false; // Invalid cart index passed.
1088
  }
1089
 
1090
- if ( $this->cart_details[ $cart_index ]['id'] !== $download_id ) {
1091
  return false; // We still need the proper Download ID to be sure.
1092
  }
1093
 
1006
 
1007
  foreach ( $this->downloads as $key => $item ) {
1008
 
1009
+ if ( (int) $download_id !== (int) $item['id'] ) {
1010
  continue;
1011
  }
1012
 
1013
  if ( false !== $args['price_id'] ) {
1014
 
1015
+ if ( isset( $item['options']['price_id'] ) && (int) $args['price_id'] !== (int) $item['options']['price_id'] ) {
1016
  continue;
1017
  }
1018
 
1029
  }
1030
 
1031
  // If this item has a price ID, make sure it matches the cart indexed item's price ID before removing
1032
+ if ( isset( $item['options']['price_id'] ) && (int) $item['options']['price_id'] !== (int) $cart_item['item_number']['options']['price_id'] ) {
1033
  continue;
1034
  }
1035
 
1064
  }
1065
 
1066
  if ( false !== $args['price_id'] ) {
1067
+ if ( isset( $item['item_number']['options']['price_id'] ) && (int) $args['price_id'] !== (int) $item['item_number']['options']['price_id'] ) {
1068
  continue;
1069
  }
1070
  }
1071
 
1072
  if ( false !== $args['item_price'] ) {
1073
+ if ( isset( $item['item_price'] ) && (float) $args['item_price'] != (float) $item['item_price'] ) {
1074
  continue;
1075
  }
1076
  }
1087
  return false; // Invalid cart index passed.
1088
  }
1089
 
1090
+ if ( (int) $this->cart_details[ $cart_index ]['id'] !== (int) $download_id ) {
1091
  return false; // We still need the proper Download ID to be sure.
1092
  }
1093
 
includes/process-purchase.php CHANGED
@@ -46,6 +46,9 @@ function edd_process_purchase_form() {
46
 
47
  // Validate the user
48
  $user = edd_get_purchase_form_user( $valid_data );
 
 
 
49
 
50
  if ( false === $valid_data || edd_get_errors() || ! $user ) {
51
  if ( $is_ajax ) {
46
 
47
  // Validate the user
48
  $user = edd_get_purchase_form_user( $valid_data );
49
+
50
+ // Let extensions validate fields after user is logged in if user has used login/registration form
51
+ do_action( 'edd_checkout_user_error_checks', $user, $valid_data, $_POST );
52
 
53
  if ( false === $valid_data || edd_get_errors() || ! $user ) {
54
  if ( $is_ajax ) {
includes/scripts.php CHANGED
@@ -215,6 +215,7 @@ function edd_load_admin_scripts( $hook ) {
215
  'batch_export_no_class' => __( 'You must choose a method.', 'easy-digital-downloads' ),
216
  'batch_export_no_reqs' => __( 'Required fields not completed.', 'easy-digital-downloads' ),
217
  'reset_stats_warn' => __( 'Are you sure you want to reset your store? This process is <strong><em>not reversible</em></strong>. Please be sure you have a recent backup.', 'easy-digital-downloads' ),
 
218
  ));
219
 
220
  wp_enqueue_style( 'wp-color-picker' );
215
  'batch_export_no_class' => __( 'You must choose a method.', 'easy-digital-downloads' ),
216
  'batch_export_no_reqs' => __( 'Required fields not completed.', 'easy-digital-downloads' ),
217
  'reset_stats_warn' => __( 'Are you sure you want to reset your store? This process is <strong><em>not reversible</em></strong>. Please be sure you have a recent backup.', 'easy-digital-downloads' ),
218
+ 'search_placeholder' => sprintf( __( 'Type to search all %s', 'easy-digital-downloads' ), edd_get_label_plural() )
219
  ));
220
 
221
  wp_enqueue_style( 'wp-color-picker' );
includes/template-functions.php CHANGED
@@ -529,10 +529,7 @@ function edd_get_purchase_download_links( $payment_id = 0 ) {
529
  foreach ( $files as $filekey => $file ) {
530
  $links .= '<div class="edd_download_link_file">';
531
  $links .= '<a href="' . esc_url( edd_get_download_file_url( $payment_key, $email, $filekey, $download['id'], $price_id ) ) . '">';
532
- if ( isset( $file['name'] ) )
533
- $links .= esc_html( $file['name'] );
534
- else
535
- $links .= esc_html( $file['file'] );
536
  $links .= '</a>';
537
  $links .= '</div>';
538
  }
529
  foreach ( $files as $filekey => $file ) {
530
  $links .= '<div class="edd_download_link_file">';
531
  $links .= '<a href="' . esc_url( edd_get_download_file_url( $payment_key, $email, $filekey, $download['id'], $price_id ) ) . '">';
532
+ $links .= edd_get_file_name( $file );
 
 
 
533
  $links .= '</a>';
534
  $links .= '</div>';
535
  }
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.5.12\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
- "POT-Creation-Date: 2016-04-14 18:29:30+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -53,13 +53,12 @@ msgstr ""
53
  #: includes/admin/discounts/discount-actions.php:194
54
  #: includes/admin/discounts/edit-discount.php:16
55
  #: includes/admin/downloads/dashboard-columns.php:171
56
- #: includes/admin/import/class-batch-import-downloads.php:37
57
  #: includes/admin/payments/actions.php:25
58
- #: includes/admin/payments/actions.php:139
59
- #: includes/admin/payments/actions.php:285
60
- #: includes/admin/payments/actions.php:301
61
- #: includes/admin/payments/actions.php:328
62
- #: includes/admin/payments/actions.php:348
63
  #: includes/admin/payments/view-order-details.php:22
64
  #: includes/admin/payments/view-order-details.php:32
65
  #: includes/admin/reporting/class-api-requests-logs-list-table.php:146
@@ -90,13 +89,13 @@ msgstr ""
90
  #: includes/cart/functions.php:1150 includes/cart/functions.php:1167
91
  #: includes/class-edd-license-handler.php:304
92
  #: includes/deprecated-functions.php:517 includes/deprecated-functions.php:532
93
- #: includes/deprecated-functions.php:542 includes/download-functions.php:1226
94
  #: includes/emails/actions.php:49 includes/emails/template.php:245
95
  #: includes/error-tracking.php:36 includes/gateways/functions.php:221
96
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:34
97
  #: includes/process-download.php:254 includes/process-download.php:787
98
- #: includes/query-filters.php:48 includes/user-functions.php:792
99
- #: includes/user-functions.php:817 includes/user-functions.php:870
100
  msgid "Error"
101
  msgstr ""
102
 
@@ -200,8 +199,7 @@ msgstr ""
200
 
201
  #: includes/admin/class-api-keys-table.php:176
202
  #: includes/checkout/template.php:466 includes/checkout/template.php:472
203
- #: includes/checkout/template.php:538 templates/shortcode-login.php:15
204
- #: templates/shortcode-login.php:16 templates/shortcode-register.php:18
205
  #: templates/shortcode-register.php:19
206
  msgid "Username"
207
  msgstr ""
@@ -585,7 +583,7 @@ msgstr ""
585
  #: includes/admin/customers/customers.php:305
586
  #: includes/admin/customers/customers.php:520
587
  #: includes/admin/payments/view-order-details.php:440
588
- #: includes/admin/thickbox.php:135 includes/class-edd-html-elements.php:590
589
  msgid "Cancel"
590
  msgstr ""
591
 
@@ -1535,27 +1533,23 @@ msgstr ""
1535
  msgid "View File Download Log"
1536
  msgstr ""
1537
 
1538
- #: includes/admin/import/class-batch-import-downloads.php:37
1539
- msgid "You do not have permission to import data."
1540
- msgstr ""
1541
-
1542
  #: includes/admin/payments/actions.php:25
1543
- #: includes/admin/payments/actions.php:285
1544
- #: includes/admin/payments/actions.php:301
1545
- #: includes/admin/payments/actions.php:328
1546
- #: includes/admin/payments/actions.php:348 includes/emails/actions.php:49
1547
  msgid "You do not have permission to edit this payment record"
1548
  msgstr ""
1549
 
1550
- #: includes/admin/payments/actions.php:139
1551
  msgid "Error Updating Payment"
1552
  msgstr ""
1553
 
1554
- #: includes/admin/payments/actions.php:150
1555
  msgid "New Customers require a name and email address"
1556
  msgstr ""
1557
 
1558
- #: includes/admin/payments/actions.php:165
1559
  msgid "Error creating new customer"
1560
  msgstr ""
1561
 
@@ -3910,7 +3904,7 @@ msgstr ""
3910
  msgid "Please upload a file to import"
3911
  msgstr ""
3912
 
3913
- #: includes/admin/tracking.php:247
3914
  msgid ""
3915
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
3916
  "our newsletter and immediately be emailed a 20%% discount to the EDD shop, "
@@ -3918,11 +3912,11 @@ msgid ""
3918
  "extensions</a>. No sensitive data is tracked."
3919
  msgstr ""
3920
 
3921
- #: includes/admin/tracking.php:248
3922
  msgid "Allow"
3923
  msgstr ""
3924
 
3925
- #: includes/admin/tracking.php:249
3926
  msgid "Do not allow"
3927
  msgstr ""
3928
 
@@ -4798,7 +4792,7 @@ msgstr ""
4798
  msgid "Enter a coupon code if you have one."
4799
  msgstr ""
4800
 
4801
- #: includes/checkout/template.php:723 includes/process-purchase.php:273
4802
  #: includes/scripts.php:55
4803
  msgid "Enter discount"
4804
  msgstr ""
@@ -4983,7 +4977,7 @@ msgstr ""
4983
  msgid "%d customers created in %d seconds"
4984
  msgstr ""
4985
 
4986
- #: includes/class-edd-cli.php:311 includes/class-edd-html-elements.php:151
4987
  msgid "No customers found"
4988
  msgstr ""
4989
 
@@ -4991,8 +4985,8 @@ msgstr ""
4991
  msgid "Customer User ID: %s"
4992
  msgstr ""
4993
 
4994
- #: includes/class-edd-cli.php:318 includes/user-functions.php:500
4995
- #: includes/user-functions.php:509
4996
  msgid "Username: %s"
4997
  msgstr ""
4998
 
@@ -5068,7 +5062,7 @@ msgstr ""
5068
  msgid " Product: %s - %s"
5069
  msgstr ""
5070
 
5071
- #: includes/class-edd-cli.php:419 includes/class-edd-html-elements.php:212
5072
  #: includes/shortcodes.php:237
5073
  msgid "No discounts found"
5074
  msgstr ""
@@ -5161,28 +5155,23 @@ msgstr ""
5161
  msgid "New Download Product"
5162
  msgstr ""
5163
 
5164
- #: includes/class-edd-html-elements.php:43
5165
- #: includes/class-edd-html-elements.php:73
5166
- msgid "Select a %s"
5167
- msgstr ""
5168
-
5169
- #: includes/class-edd-html-elements.php:78
5170
- msgid "No products found"
5171
  msgstr ""
5172
 
5173
- #: includes/class-edd-html-elements.php:132
5174
  msgid "Select a Customer"
5175
  msgstr ""
5176
 
5177
- #: includes/class-edd-html-elements.php:146
5178
  msgid "No customer attached"
5179
  msgstr ""
5180
 
5181
- #: includes/class-edd-html-elements.php:220
5182
  msgid "Select a discount"
5183
  msgstr ""
5184
 
5185
- #: includes/class-edd-html-elements.php:575
5186
  msgid "Enter username"
5187
  msgstr ""
5188
 
@@ -5538,7 +5527,7 @@ msgstr ""
5538
  msgid "Sorry but you have hit your download limit for this file."
5539
  msgstr ""
5540
 
5541
- #: includes/deprecated-functions.php:532 includes/download-functions.php:1226
5542
  msgid "Sorry but your download link has expired."
5543
  msgstr ""
5544
 
@@ -5986,16 +5975,16 @@ msgstr ""
5986
  msgid "The password you entered is incorrect"
5987
  msgstr ""
5988
 
5989
- #: includes/login-register.php:87 includes/process-purchase.php:576
5990
  msgid "The username you entered does not exist"
5991
  msgstr ""
5992
 
5993
  #: includes/login-register.php:140 includes/login-register.php:148
5994
- #: includes/process-purchase.php:464
5995
  msgid "Invalid username"
5996
  msgstr ""
5997
 
5998
- #: includes/login-register.php:144 includes/process-purchase.php:457
5999
  msgid "Username already taken"
6000
  msgstr ""
6001
 
@@ -6003,8 +5992,8 @@ msgstr ""
6003
  msgid "Email address already taken"
6004
  msgstr ""
6005
 
6006
- #: includes/login-register.php:156 includes/process-purchase.php:404
6007
- #: includes/process-purchase.php:479 includes/process-purchase.php:609
6008
  msgid "Invalid email"
6009
  msgstr ""
6010
 
@@ -6468,95 +6457,95 @@ msgstr ""
6468
  msgid "Your cart is empty"
6469
  msgstr ""
6470
 
6471
- #: includes/process-purchase.php:240
6472
  msgid "The selected payment gateway is not enabled"
6473
  msgstr ""
6474
 
6475
- #: includes/process-purchase.php:300
6476
  msgid "One or more of the discounts you entered is invalid"
6477
  msgstr ""
6478
 
6479
- #: includes/process-purchase.php:317
6480
  msgid "You must agree to the terms of use"
6481
  msgstr ""
6482
 
6483
- #: includes/process-purchase.php:332
6484
  msgid "Please enter a valid email address"
6485
  msgstr ""
6486
 
6487
- #: includes/process-purchase.php:336
6488
  msgid "Please enter your first name"
6489
  msgstr ""
6490
 
6491
- #: includes/process-purchase.php:346
6492
  msgid "Please enter your zip / postal code"
6493
  msgstr ""
6494
 
6495
- #: includes/process-purchase.php:350
6496
  msgid "Please enter your billing city"
6497
  msgstr ""
6498
 
6499
- #: includes/process-purchase.php:354
6500
  msgid "Please select your billing country"
6501
  msgstr ""
6502
 
6503
- #: includes/process-purchase.php:358
6504
  msgid "Please enter billing state / province"
6505
  msgstr ""
6506
 
6507
- #: includes/process-purchase.php:409
6508
  msgid "The user information is invalid"
6509
  msgstr ""
6510
 
6511
- #: includes/process-purchase.php:462
6512
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
6513
  msgstr ""
6514
 
6515
- #: includes/process-purchase.php:471
6516
  msgid "You must register or login to complete your purchase"
6517
  msgstr ""
6518
 
6519
- #: includes/process-purchase.php:482
6520
  msgid "Email already used"
6521
  msgstr ""
6522
 
6523
- #: includes/process-purchase.php:489 includes/process-purchase.php:616
6524
  msgid "Enter an email"
6525
  msgstr ""
6526
 
6527
- #: includes/process-purchase.php:497
6528
  msgid "Passwords don't match"
6529
  msgstr ""
6530
 
6531
- #: includes/process-purchase.php:506 includes/process-purchase.php:572
6532
  msgid "Enter a password"
6533
  msgstr ""
6534
 
6535
- #: includes/process-purchase.php:509
6536
  msgid "Enter the password confirmation"
6537
  msgstr ""
6538
 
6539
- #: includes/process-purchase.php:533
6540
  msgid "You must login or register to complete your purchase"
6541
  msgstr ""
6542
 
6543
- #: includes/process-purchase.php:553
6544
  msgid "The password you entered is incorrect. %sReset Password%s"
6545
  msgstr ""
6546
 
6547
- #: includes/process-purchase.php:554 templates/shortcode-login.php:29
6548
  msgid "Lost Password"
6549
  msgstr ""
6550
 
6551
- #: includes/process-purchase.php:598
6552
  msgid "You must be logged into an account to purchase"
6553
  msgstr ""
6554
 
6555
- #: includes/process-purchase.php:778
6556
  msgid "The zip / postal code you entered for your billing address is invalid"
6557
  msgstr ""
6558
 
6559
- #: includes/process-purchase.php:1040
6560
  msgid "An internal error has occurred, please try again or contact support."
6561
  msgstr ""
6562
 
@@ -6652,10 +6641,6 @@ msgstr ""
6652
  msgid "Payments must contain at least one item"
6653
  msgstr ""
6654
 
6655
- #: includes/scripts.php:203
6656
- msgid "Choose a %s"
6657
- msgstr ""
6658
-
6659
  #: includes/scripts.php:204
6660
  msgid "Choose one or more %s"
6661
  msgstr ""
@@ -6686,6 +6671,10 @@ msgid ""
6686
  "reversible</em></strong>. Please be sure you have a recent backup."
6687
  msgstr ""
6688
 
 
 
 
 
6689
  #: includes/shortcodes.php:261
6690
  msgid "Purchase All Items"
6691
  msgstr ""
@@ -6770,43 +6759,43 @@ msgstr ""
6770
  msgid "Plain Text"
6771
  msgstr ""
6772
 
6773
- #: includes/user-functions.php:498
6774
  msgid "[%s] New User Registration"
6775
  msgstr ""
6776
 
6777
- #: includes/user-functions.php:499
6778
  msgid "New user registration"
6779
  msgstr ""
6780
 
6781
- #: includes/user-functions.php:501
6782
  msgid "E-mail: %s"
6783
  msgstr ""
6784
 
6785
- #: includes/user-functions.php:507
6786
  msgid "[%s] Your username and password"
6787
  msgstr ""
6788
 
6789
- #: includes/user-functions.php:508
6790
  msgid "Your account info"
6791
  msgstr ""
6792
 
6793
- #: includes/user-functions.php:510
6794
  msgid "Password: %s"
6795
  msgstr ""
6796
 
6797
- #: includes/user-functions.php:510
6798
  msgid "[Password entered at checkout]"
6799
  msgstr ""
6800
 
6801
- #: includes/user-functions.php:511
6802
  msgid "Click Here to Log In"
6803
  msgstr ""
6804
 
6805
- #: includes/user-functions.php:665 includes/user-functions.php:666
6806
  msgid "Verify your account"
6807
  msgstr ""
6808
 
6809
- #: includes/user-functions.php:668
6810
  msgid ""
6811
  "Hello %s,\n"
6812
  "\n"
@@ -6816,29 +6805,29 @@ msgid ""
6816
  "Link missing? Visit the following URL: %s"
6817
  msgstr ""
6818
 
6819
- #: includes/user-functions.php:792
6820
  msgid ""
6821
  "Sorry but your account verification link has expired. <a href=\"#\">Click "
6822
  "here</a> to request a new verification URL."
6823
  msgstr ""
6824
 
6825
- #: includes/user-functions.php:817
6826
  msgid "Nonce verification failed."
6827
  msgstr ""
6828
 
6829
- #: includes/user-functions.php:821
6830
  msgid "You must be logged in to verify your account."
6831
  msgstr ""
6832
 
6833
- #: includes/user-functions.php:821 includes/user-functions.php:825
6834
  msgid "Notice"
6835
  msgstr ""
6836
 
6837
- #: includes/user-functions.php:825
6838
  msgid "Your account has already been verified."
6839
  msgstr ""
6840
 
6841
- #: includes/user-functions.php:870
6842
  msgid "Invalid verification token provided."
6843
  msgstr ""
6844
 
@@ -6976,6 +6965,10 @@ msgstr ""
6976
  msgid "Log into Your Account"
6977
  msgstr ""
6978
 
 
 
 
 
6979
  #: templates/shortcode-login.php:26
6980
  msgid "Log In"
6981
  msgstr ""
@@ -7093,7 +7086,7 @@ msgid "Number of items in cart"
7093
  msgstr ""
7094
 
7095
  #. Description of the plugin/theme
7096
- msgid "Serve Digital Downloads Through WordPress."
7097
  msgstr ""
7098
 
7099
  #: includes/admin/payments/view-order-details.php:479
@@ -7131,17 +7124,17 @@ msgctxt "Apply discount at checkout"
7131
  msgid "Apply"
7132
  msgstr ""
7133
 
7134
- #: includes/class-edd-html-elements.php:248
7135
  msgctxt "plural: Example: \"All Categories\""
7136
  msgid "All %s"
7137
  msgstr ""
7138
 
7139
- #: includes/class-edd-html-elements.php:338
7140
  msgctxt "all dropdown items"
7141
  msgid "All"
7142
  msgstr ""
7143
 
7144
- #: includes/class-edd-html-elements.php:339
7145
  msgctxt "no dropdown items"
7146
  msgid "None"
7147
  msgstr ""
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.5.14\n"
6
  "Report-Msgid-Bugs-To: https://easydigitaldownloads.com/\n"
7
+ "POT-Creation-Date: 2016-05-11 20:14:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
53
  #: includes/admin/discounts/discount-actions.php:194
54
  #: includes/admin/discounts/edit-discount.php:16
55
  #: includes/admin/downloads/dashboard-columns.php:171
 
56
  #: includes/admin/payments/actions.php:25
57
+ #: includes/admin/payments/actions.php:145
58
+ #: includes/admin/payments/actions.php:291
59
+ #: includes/admin/payments/actions.php:307
60
+ #: includes/admin/payments/actions.php:334
61
+ #: includes/admin/payments/actions.php:354
62
  #: includes/admin/payments/view-order-details.php:22
63
  #: includes/admin/payments/view-order-details.php:32
64
  #: includes/admin/reporting/class-api-requests-logs-list-table.php:146
89
  #: includes/cart/functions.php:1150 includes/cart/functions.php:1167
90
  #: includes/class-edd-license-handler.php:304
91
  #: includes/deprecated-functions.php:517 includes/deprecated-functions.php:532
92
+ #: includes/deprecated-functions.php:542 includes/download-functions.php:1228
93
  #: includes/emails/actions.php:49 includes/emails/template.php:245
94
  #: includes/error-tracking.php:36 includes/gateways/functions.php:221
95
  #: includes/gateways/manual.php:33 includes/gateways/paypal-standard.php:34
96
  #: includes/process-download.php:254 includes/process-download.php:787
97
+ #: includes/query-filters.php:48 includes/user-functions.php:791
98
+ #: includes/user-functions.php:816 includes/user-functions.php:869
99
  msgid "Error"
100
  msgstr ""
101
 
199
 
200
  #: includes/admin/class-api-keys-table.php:176
201
  #: includes/checkout/template.php:466 includes/checkout/template.php:472
202
+ #: includes/checkout/template.php:538 templates/shortcode-register.php:18
 
203
  #: templates/shortcode-register.php:19
204
  msgid "Username"
205
  msgstr ""
583
  #: includes/admin/customers/customers.php:305
584
  #: includes/admin/customers/customers.php:520
585
  #: includes/admin/payments/view-order-details.php:440
586
+ #: includes/admin/thickbox.php:135 includes/class-edd-html-elements.php:586
587
  msgid "Cancel"
588
  msgstr ""
589
 
1533
  msgid "View File Download Log"
1534
  msgstr ""
1535
 
 
 
 
 
1536
  #: includes/admin/payments/actions.php:25
1537
+ #: includes/admin/payments/actions.php:291
1538
+ #: includes/admin/payments/actions.php:307
1539
+ #: includes/admin/payments/actions.php:334
1540
+ #: includes/admin/payments/actions.php:354 includes/emails/actions.php:49
1541
  msgid "You do not have permission to edit this payment record"
1542
  msgstr ""
1543
 
1544
+ #: includes/admin/payments/actions.php:145
1545
  msgid "Error Updating Payment"
1546
  msgstr ""
1547
 
1548
+ #: includes/admin/payments/actions.php:156
1549
  msgid "New Customers require a name and email address"
1550
  msgstr ""
1551
 
1552
+ #: includes/admin/payments/actions.php:171
1553
  msgid "Error creating new customer"
1554
  msgstr ""
1555
 
3904
  msgid "Please upload a file to import"
3905
  msgstr ""
3906
 
3907
+ #: includes/admin/tracking.php:265
3908
  msgid ""
3909
  "Allow Easy Digital Downloads to track plugin usage? Opt-in to tracking and "
3910
  "our newsletter and immediately be emailed a 20%% discount to the EDD shop, "
3912
  "extensions</a>. No sensitive data is tracked."
3913
  msgstr ""
3914
 
3915
+ #: includes/admin/tracking.php:266
3916
  msgid "Allow"
3917
  msgstr ""
3918
 
3919
+ #: includes/admin/tracking.php:267
3920
  msgid "Do not allow"
3921
  msgstr ""
3922
 
4792
  msgid "Enter a coupon code if you have one."
4793
  msgstr ""
4794
 
4795
+ #: includes/checkout/template.php:723 includes/process-purchase.php:276
4796
  #: includes/scripts.php:55
4797
  msgid "Enter discount"
4798
  msgstr ""
4977
  msgid "%d customers created in %d seconds"
4978
  msgstr ""
4979
 
4980
+ #: includes/class-edd-cli.php:311 includes/class-edd-html-elements.php:147
4981
  msgid "No customers found"
4982
  msgstr ""
4983
 
4985
  msgid "Customer User ID: %s"
4986
  msgstr ""
4987
 
4988
+ #: includes/class-edd-cli.php:318 includes/user-functions.php:499
4989
+ #: includes/user-functions.php:508
4990
  msgid "Username: %s"
4991
  msgstr ""
4992
 
5062
  msgid " Product: %s - %s"
5063
  msgstr ""
5064
 
5065
+ #: includes/class-edd-cli.php:419 includes/class-edd-html-elements.php:208
5066
  #: includes/shortcodes.php:237
5067
  msgid "No discounts found"
5068
  msgstr ""
5155
  msgid "New Download Product"
5156
  msgstr ""
5157
 
5158
+ #: includes/class-edd-html-elements.php:43 includes/scripts.php:203
5159
+ msgid "Choose a %s"
 
 
 
 
 
5160
  msgstr ""
5161
 
5162
+ #: includes/class-edd-html-elements.php:128
5163
  msgid "Select a Customer"
5164
  msgstr ""
5165
 
5166
+ #: includes/class-edd-html-elements.php:142
5167
  msgid "No customer attached"
5168
  msgstr ""
5169
 
5170
+ #: includes/class-edd-html-elements.php:216
5171
  msgid "Select a discount"
5172
  msgstr ""
5173
 
5174
+ #: includes/class-edd-html-elements.php:571
5175
  msgid "Enter username"
5176
  msgstr ""
5177
 
5527
  msgid "Sorry but you have hit your download limit for this file."
5528
  msgstr ""
5529
 
5530
+ #: includes/deprecated-functions.php:532 includes/download-functions.php:1228
5531
  msgid "Sorry but your download link has expired."
5532
  msgstr ""
5533
 
5975
  msgid "The password you entered is incorrect"
5976
  msgstr ""
5977
 
5978
+ #: includes/login-register.php:87 includes/process-purchase.php:579
5979
  msgid "The username you entered does not exist"
5980
  msgstr ""
5981
 
5982
  #: includes/login-register.php:140 includes/login-register.php:148
5983
+ #: includes/process-purchase.php:467
5984
  msgid "Invalid username"
5985
  msgstr ""
5986
 
5987
+ #: includes/login-register.php:144 includes/process-purchase.php:460
5988
  msgid "Username already taken"
5989
  msgstr ""
5990
 
5992
  msgid "Email address already taken"
5993
  msgstr ""
5994
 
5995
+ #: includes/login-register.php:156 includes/process-purchase.php:407
5996
+ #: includes/process-purchase.php:482 includes/process-purchase.php:612
5997
  msgid "Invalid email"
5998
  msgstr ""
5999
 
6457
  msgid "Your cart is empty"
6458
  msgstr ""
6459
 
6460
+ #: includes/process-purchase.php:243
6461
  msgid "The selected payment gateway is not enabled"
6462
  msgstr ""
6463
 
6464
+ #: includes/process-purchase.php:303
6465
  msgid "One or more of the discounts you entered is invalid"
6466
  msgstr ""
6467
 
6468
+ #: includes/process-purchase.php:320
6469
  msgid "You must agree to the terms of use"
6470
  msgstr ""
6471
 
6472
+ #: includes/process-purchase.php:335
6473
  msgid "Please enter a valid email address"
6474
  msgstr ""
6475
 
6476
+ #: includes/process-purchase.php:339
6477
  msgid "Please enter your first name"
6478
  msgstr ""
6479
 
6480
+ #: includes/process-purchase.php:349
6481
  msgid "Please enter your zip / postal code"
6482
  msgstr ""
6483
 
6484
+ #: includes/process-purchase.php:353
6485
  msgid "Please enter your billing city"
6486
  msgstr ""
6487
 
6488
+ #: includes/process-purchase.php:357
6489
  msgid "Please select your billing country"
6490
  msgstr ""
6491
 
6492
+ #: includes/process-purchase.php:361
6493
  msgid "Please enter billing state / province"
6494
  msgstr ""
6495
 
6496
+ #: includes/process-purchase.php:412
6497
  msgid "The user information is invalid"
6498
  msgstr ""
6499
 
6500
+ #: includes/process-purchase.php:465
6501
  msgid "Invalid username. Only lowercase letters (a-z) and numbers are allowed"
6502
  msgstr ""
6503
 
6504
+ #: includes/process-purchase.php:474
6505
  msgid "You must register or login to complete your purchase"
6506
  msgstr ""
6507
 
6508
+ #: includes/process-purchase.php:485
6509
  msgid "Email already used"
6510
  msgstr ""
6511
 
6512
+ #: includes/process-purchase.php:492 includes/process-purchase.php:619
6513
  msgid "Enter an email"
6514
  msgstr ""
6515
 
6516
+ #: includes/process-purchase.php:500
6517
  msgid "Passwords don't match"
6518
  msgstr ""
6519
 
6520
+ #: includes/process-purchase.php:509 includes/process-purchase.php:575
6521
  msgid "Enter a password"
6522
  msgstr ""
6523
 
6524
+ #: includes/process-purchase.php:512
6525
  msgid "Enter the password confirmation"
6526
  msgstr ""
6527
 
6528
+ #: includes/process-purchase.php:536
6529
  msgid "You must login or register to complete your purchase"
6530
  msgstr ""
6531
 
6532
+ #: includes/process-purchase.php:556
6533
  msgid "The password you entered is incorrect. %sReset Password%s"
6534
  msgstr ""
6535
 
6536
+ #: includes/process-purchase.php:557 templates/shortcode-login.php:29
6537
  msgid "Lost Password"
6538
  msgstr ""
6539
 
6540
+ #: includes/process-purchase.php:601
6541
  msgid "You must be logged into an account to purchase"
6542
  msgstr ""
6543
 
6544
+ #: includes/process-purchase.php:781
6545
  msgid "The zip / postal code you entered for your billing address is invalid"
6546
  msgstr ""
6547
 
6548
+ #: includes/process-purchase.php:1043
6549
  msgid "An internal error has occurred, please try again or contact support."
6550
  msgstr ""
6551
 
6641
  msgid "Payments must contain at least one item"
6642
  msgstr ""
6643
 
 
 
 
 
6644
  #: includes/scripts.php:204
6645
  msgid "Choose one or more %s"
6646
  msgstr ""
6671
  "reversible</em></strong>. Please be sure you have a recent backup."
6672
  msgstr ""
6673
 
6674
+ #: includes/scripts.php:218
6675
+ msgid "Type to search all %s"
6676
+ msgstr ""
6677
+
6678
  #: includes/shortcodes.php:261
6679
  msgid "Purchase All Items"
6680
  msgstr ""
6759
  msgid "Plain Text"
6760
  msgstr ""
6761
 
6762
+ #: includes/user-functions.php:497
6763
  msgid "[%s] New User Registration"
6764
  msgstr ""
6765
 
6766
+ #: includes/user-functions.php:498
6767
  msgid "New user registration"
6768
  msgstr ""
6769
 
6770
+ #: includes/user-functions.php:500
6771
  msgid "E-mail: %s"
6772
  msgstr ""
6773
 
6774
+ #: includes/user-functions.php:506
6775
  msgid "[%s] Your username and password"
6776
  msgstr ""
6777
 
6778
+ #: includes/user-functions.php:507
6779
  msgid "Your account info"
6780
  msgstr ""
6781
 
6782
+ #: includes/user-functions.php:509
6783
  msgid "Password: %s"
6784
  msgstr ""
6785
 
6786
+ #: includes/user-functions.php:509
6787
  msgid "[Password entered at checkout]"
6788
  msgstr ""
6789
 
6790
+ #: includes/user-functions.php:510
6791
  msgid "Click Here to Log In"
6792
  msgstr ""
6793
 
6794
+ #: includes/user-functions.php:664 includes/user-functions.php:665
6795
  msgid "Verify your account"
6796
  msgstr ""
6797
 
6798
+ #: includes/user-functions.php:667
6799
  msgid ""
6800
  "Hello %s,\n"
6801
  "\n"
6805
  "Link missing? Visit the following URL: %s"
6806
  msgstr ""
6807
 
6808
+ #: includes/user-functions.php:791
6809
  msgid ""
6810
  "Sorry but your account verification link has expired. <a href=\"#\">Click "
6811
  "here</a> to request a new verification URL."
6812
  msgstr ""
6813
 
6814
+ #: includes/user-functions.php:816
6815
  msgid "Nonce verification failed."
6816
  msgstr ""
6817
 
6818
+ #: includes/user-functions.php:820
6819
  msgid "You must be logged in to verify your account."
6820
  msgstr ""
6821
 
6822
+ #: includes/user-functions.php:820 includes/user-functions.php:824
6823
  msgid "Notice"
6824
  msgstr ""
6825
 
6826
+ #: includes/user-functions.php:824
6827
  msgid "Your account has already been verified."
6828
  msgstr ""
6829
 
6830
+ #: includes/user-functions.php:869
6831
  msgid "Invalid verification token provided."
6832
  msgstr ""
6833
 
6965
  msgid "Log into Your Account"
6966
  msgstr ""
6967
 
6968
+ #: templates/shortcode-login.php:15 templates/shortcode-login.php:16
6969
+ msgid "Username or Email"
6970
+ msgstr ""
6971
+
6972
  #: templates/shortcode-login.php:26
6973
  msgid "Log In"
6974
  msgstr ""
7086
  msgstr ""
7087
 
7088
  #. Description of the plugin/theme
7089
+ msgid "The easiest way to sell digital products with WordPress."
7090
  msgstr ""
7091
 
7092
  #: includes/admin/payments/view-order-details.php:479
7124
  msgid "Apply"
7125
  msgstr ""
7126
 
7127
+ #: includes/class-edd-html-elements.php:244
7128
  msgctxt "plural: Example: \"All Categories\""
7129
  msgid "All %s"
7130
  msgstr ""
7131
 
7132
+ #: includes/class-edd-html-elements.php:334
7133
  msgctxt "all dropdown items"
7134
  msgid "All"
7135
  msgstr ""
7136
 
7137
+ #: includes/class-edd-html-elements.php:335
7138
  msgctxt "no dropdown items"
7139
  msgid "None"
7140
  msgstr ""
readme.txt CHANGED
@@ -6,11 +6,11 @@ Donate link: https://pippinsplugins.com/support-the-site
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.6
9
- Stable Tag: 2.5.14
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
13
- Sell digital downloads through WordPress with this complete digital downloads management plugin
14
 
15
  == Description ==
16
 
@@ -214,6 +214,14 @@ Yes, through the addition of one or more of the add-on payment gateways, you can
214
 
215
  == Changelog ==
216
 
 
 
 
 
 
 
 
 
217
  = 2.5.14, May 5, 2016 =
218
 
219
  * Fix: New user emails do not have the proper heading
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.6
9
+ Stable Tag: 2.5.15
10
 
11
  License: GNU Version 2 or Any Later Version
12
 
13
+ The easiest way to sell digital products with WordPress.
14
 
15
  == Description ==
16
 
214
 
215
  == Changelog ==
216
 
217
+ = 2.5.15, May 11, 2016 =
218
+
219
+ * Fix: Removed unused variables and typos in unit tests
220
+ * Fix: Non-standardized display of file names for items in bundles on receipts
221
+ * Fix: Downloads not always removed from payment records when removed from the View Order Details screen
222
+ * Tweak: Introduced new edd_checkout_user_error_checks action during purchase processing
223
+ * Tweak: Placeholders on product dropdowns improved to help indicate searchability
224
+
225
  = 2.5.14, May 5, 2016 =
226
 
227
  * Fix: New user emails do not have the proper heading
templates/history-downloads.php CHANGED
@@ -63,7 +63,7 @@ if ( $purchases ) :
63
 
64
  <div class="edd_download_file">
65
  <a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link">
66
- <?php echo isset( $file['name'] ) ? esc_html( $file['name'] ) : esc_html( $name ); ?>
67
  </a>
68
  </div>
69
 
@@ -107,4 +107,4 @@ if ( $purchases ) :
107
  <?php do_action( 'edd_after_download_history' ); ?>
108
  <?php else : ?>
109
  <p class="edd-no-downloads"><?php _e( 'You have not purchased any downloads', 'easy-digital-downloads' ); ?></p>
110
- <?php endif; ?>
63
 
64
  <div class="edd_download_file">
65
  <a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link">
66
+ <?php echo edd_get_file_name( $file ); ?>
67
  </a>
68
  </div>
69
 
107
  <?php do_action( 'edd_after_download_history' ); ?>
108
  <?php else : ?>
109
  <p class="edd-no-downloads"><?php _e( 'You have not purchased any downloads', 'easy-digital-downloads' ); ?></p>
110
+ <?php endif; ?>
templates/shortcode-receipt.php CHANGED
@@ -192,7 +192,7 @@ $status = edd_get_payment_status( $payment, true );
192
 
193
  $download_url = edd_get_download_file_url( $meta['key'], $email, $filekey, $bundle_item, $price_id ); ?>
194
  <li class="edd_download_file">
195
- <a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link"><?php echo esc_html( $file['name'] ); ?></a>
196
  </li>
197
  <?php
198
  do_action( 'edd_receipt_bundle_files', $filekey, $file, $item['id'], $bundle_item, $payment->ID, $meta );
192
 
193
  $download_url = edd_get_download_file_url( $meta['key'], $email, $filekey, $bundle_item, $price_id ); ?>
194
  <li class="edd_download_file">
195
+ <a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link"><?php echo edd_get_file_name( $file ); ?></a>
196
  </li>
197
  <?php
198
  do_action( 'edd_receipt_bundle_files', $filekey, $file, $item['id'], $bundle_item, $payment->ID, $meta );