WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress - Version 3.1.8

Version Description

Download this release

Release Info

Developer rabbii
Plugin Icon 128x128 WP User Frontend – Membership, Profile, Registration & Post Submission Plugin for WordPress
Version 3.1.8
Comparing to
See all releases

Code changes from version 3.1.7 to 3.1.8

assets/js/billing-address.js CHANGED
@@ -2,6 +2,8 @@ jQuery(function($){
2
 
3
  $('#wpuf-payment-gateway').submit(function (e) {
4
  wpuf_validate_address(e);
 
 
5
  });
6
 
7
  $('#wpuf-ajax-address-form').submit(function (e) {
2
 
3
  $('#wpuf-payment-gateway').submit(function (e) {
4
  wpuf_validate_address(e);
5
+
6
+ $('#wpuf-ajax-address-form').trigger('submit');
7
  });
8
 
9
  $('#wpuf-ajax-address-form').submit(function (e) {
assets/js/frontend-form.js CHANGED
@@ -165,7 +165,6 @@
165
  this.change_fieldset(step_number, progressbar_type);
166
 
167
  $('fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn').click(function(e) {
168
-
169
  // js_obj.formSubmit();
170
  if ( $(this).hasClass('wpuf-multistep-next-btn') ) {
171
  var result = js_obj.formStepCheck( '', $(this).closest('fieldset') );
@@ -179,11 +178,11 @@
179
  }
180
 
181
  var formDiv = document.querySelector( "form.wpuf-form-add" );
182
- var position = formDiv.getBoundingClientRect();
183
 
184
  // this changes the scrolling behavior to "smooth"
185
  window.scrollTo({
186
- top: position.top,
187
  behavior: "smooth"
188
  });
189
 
165
  this.change_fieldset(step_number, progressbar_type);
166
 
167
  $('fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn').click(function(e) {
 
168
  // js_obj.formSubmit();
169
  if ( $(this).hasClass('wpuf-multistep-next-btn') ) {
170
  var result = js_obj.formStepCheck( '', $(this).closest('fieldset') );
178
  }
179
 
180
  var formDiv = document.querySelector( "form.wpuf-form-add" );
181
+ var position = formDiv.offsetTop;
182
 
183
  // this changes the scrolling behavior to "smooth"
184
  window.scrollTo({
185
+ top: position - 32,
186
  behavior: "smooth"
187
  });
188
 
assets/js/frontend-form.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,b){a.fn.listautowidth=function(){return this.each(function(){var b=a(this).width(),c=b/a(this).children("li").length;a(this).children("li").each(function(){var b=a(this).outerWidth(!0)-a(this).width();a(this).width(c-b)})})},b.WP_User_Frontend={init:function(){this.enableMultistep(this),a(".wpuf-form").on("click","img.wpuf-clone-field",this.cloneField),a(".wpuf-form").on("click","img.wpuf-remove-field",this.removeField),a(".wpuf-form").on("click","a.wpuf-delete-avatar",this.deleteAvatar),a(".wpuf-form").on("click","a#wpuf-post-draft",this.draftPost),a(".wpuf-form").on("click","button#wpuf-account-update-profile",this.account_update_profile),a(".wpuf-form-add").on("submit",this.formSubmit),a("form#post").on("submit",this.adminPostSubmit),a(".wpuf-form").on("step-change-fieldset",function(a,b,c){if(wpuf_plupload_items.length)for(var d=wpuf_plupload_items.length-1;d>=0;d--)wpuf_plupload_items[d].refresh();if(wpuf_map_items.length)for(var d=wpuf_map_items.length-1;d>=0;d--)google.maps.event.trigger(wpuf_map_items[d].map,"resize"),wpuf_map_items[d].map.setCenter(wpuf_map_items[d].center)}),this.ajaxCategory(),a(':submit[name="wpuf_user_subscription_cancel"]').click(function(b){b.preventDefault(),swal({text:wpuf_frontend.cancelSubMsg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:wpuf_frontend.delete_it,cancelButtonText:wpuf_frontend.cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(b){if(!b)return!1;a("#wpuf_cancel_subscription").submit()})})},check_pass_strength:function(){var b=a("#pass1").val();if(a("#pass-strength-result").show(),a("#pass-strength-result").removeClass("short bad good strong"),!b)return a("#pass-strength-result").html("&nbsp;"),void a("#pass-strength-result").hide();if(void 0!==wp.passwordStrength)switch(wp.passwordStrength.meter(b,wp.passwordStrength.userInputBlacklist(),b)){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n.short)}},enableMultistep:function(c){var d=this,e=0,f=a(':hidden[name="wpuf_multistep_type"]').val();if(null!=f){if(a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-prev-btn").first().remove(),a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-next-btn").last().remove(),a(".wpuf-form fieldset").removeClass("field-active").first().addClass("field-active"),"progressive"==f&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){a("fieldset.wpuf-multistep-fieldset legend").first();a(".wpuf-multistep-progressbar").html('<div class="wpuf-progress-percentage"></div>');var g=a(".wpuf-multistep-progressbar"),h=a(".wpuf-progress-percentage");a(".wpuf-multistep-progressbar").progressbar({change:function(){h.text(g.progressbar("value")+"%")}}),a(".wpuf-multistep-fieldset legend").hide()}else a(".wpuf-form").each(function(){var b=a(this),c=a(".wpuf-multistep-progressbar",b),d="";c.addClass("wizard-steps"),d+='<ul class="wpuf-step-wizard">',a(".wpuf-multistep-fieldset",this).each(function(){d+="<li>"+a.trim(a("legend",this).text())+"</li>",a("legend",this).hide()}),d+="</ul>",c.append(d),a(".wpuf-step-wizard li",c).first().addClass("active-step"),a(".wpuf-step-wizard",c).listautowidth()});this.change_fieldset(e,f),a("fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn").click(function(g){if(a(this).hasClass("wpuf-multistep-next-btn")){0!=d.formStepCheck("",a(this).closest("fieldset"))&&c.change_fieldset(++e,f)}else a(this).hasClass("wpuf-multistep-prev-btn")&&c.change_fieldset(--e,f);var h=document.querySelector("form.wpuf-form-add"),i=h.getBoundingClientRect();return b.scrollTo({top:i.top,behavior:"smooth"}),!1})}},change_fieldset:function(b,c){var d=a("fieldset.wpuf-multistep-fieldset").eq(b);a("fieldset.wpuf-multistep-fieldset").removeClass("field-active").eq(b).addClass("field-active"),a(".wpuf-step-wizard li").each(function(){a(this).index()<=b?"step_by_step"==c?a(this).addClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).addClass("passed-wpuf-ms-bar"):"step_by_step"==c?a(this).removeClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).removeClass("passed-wpuf-ms-bar")}),a(".wpuf-step-wizard li").removeClass("wpuf-ms-bar-active active-step completed-step"),a(".passed-wpuf-ms-bar").addClass("completed-step").last().addClass("wpuf-ms-bar-active"),a(".wpuf-ms-bar-active").addClass("active-step");var e=a("fieldset.wpuf-multistep-fieldset").eq(b).find("legend").text();if(e=a.trim(e),"progressive"==c&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){var f=100*(b+1)/a("fieldset.wpuf-multistep-fieldset").length,f=Number(f.toFixed(2));a(".wpuf-multistep-progressbar").progressbar({value:f}),a(".wpuf-progress-percentage").text(e+" ("+f+"%)")}a(".wpuf-form").trigger("step-change-fieldset",[b,d])},ajaxCategory:function(){var b=".category-wrap";a(b).on("change",".cat-ajax",function(){currentLevel=parseInt(a(this).parent().attr("level")),WP_User_Frontend.getChildCats(a(this),"lvl",currentLevel+1,b,"category")})},getChildCats:function(b,c,d,e,f){cat=a(b).val(),results_div=c+d,f=void 0!==f?f:"category",field_attr=a(b).siblings("span").data("taxonomy"),a.ajax({type:"post",url:wpuf_frontend.ajaxurl,data:{action:"wpuf_get_child_cat",catID:cat,nonce:wpuf_frontend.nonce,field_attr:field_attr},beforeSend:function(){a(b).parent().parent().next(".loading").addClass("wpuf-loading")},complete:function(){a(b).parent().parent().next(".loading").removeClass("wpuf-loading")},success:function(e){a(b).parent().nextAll().each(function(){a(this).remove()}),""!=e&&(a(b).parent().addClass("hasChild").parent().append('<div id="'+c+d+'" level="'+d+'"></div>'),b.parent().parent().find("#"+results_div).html(e).slideDown("fast"))}})},cloneField:function(b){b.preventDefault();var c=a(this).closest("tr"),d=c.clone();d.find("input").val(""),d.find(":checked").attr("checked",""),c.after(d)},removeField:function(){var b=a(this).closest("tr");b.siblings().andSelf().length>1&&b.remove()},adminPostSubmit:function(b){b.preventDefault();var c=a(this);if(WP_User_Frontend.validateForm(c))return!0},draftPost:function(b){b.preventDefault();var c=a(this),d=a(this).closest("form"),e=d.serialize()+"&action=wpuf_draft_post",f=d.find('input[type="hidden"][name="post_id"]').val(),g=[];a(".wpuf-rich-validation").each(function(b,c){var c=a(c),d=c.data("id"),e=c.data("name"),f=a.trim(tinyMCE.get(d).getContent());g.push(e+"="+encodeURIComponent(f))}),e=e+"&"+g.join("&"),c.after(' <span class="wpuf-loading"></span>'),a.post(wpuf_frontend.ajaxurl,e,function(b){if(void 0===f){var e='<input type="hidden" name="post_id" value="'+b.post_id+'">';e+='<input type="hidden" name="post_date" value="'+b.date+'">',e+='<input type="hidden" name="post_author" value="'+b.post_author+'">',e+='<input type="hidden" name="comment_status" value="'+b.comment_status+'">',d.append(e)}c.next("span.wpuf-loading").remove(),c.after('<span class="wpuf-draft-saved">&nbsp; Post Saved</span>'),a(".wpuf-draft-saved").delay(2500).fadeOut("fast",function(){a(this).remove()})})},account_update_profile:function(b){b.preventDefault();var c=a(this).closest("form");a.post(wpuf_frontend.ajaxurl,c.serialize(),function(a){a.success?(c.find(".wpuf-error").hide(),c.find(".wpuf-success").show()):(c.find(".wpuf-success").hide(),c.find(".wpuf-error").show(),c.find(".wpuf-error").text(a.data))})},formStepCheck:function(a,b){var c=b;c.find("input[type=submit]");return form_data=WP_User_Frontend.validateForm(c),0==form_data&&WP_User_Frontend.addErrorNotice(self,"bottom"),form_data},formSubmit:function(c){c.preventDefault();var d=a(this),e=d.find("input[type=submit]");form_data=WP_User_Frontend.validateForm(d),form_data&&(d.find("li.wpuf-submit").append('<span class="wpuf-loading"></span>'),e.attr("disabled","disabled").addClass("button-primary-disabled"),a.post(wpuf_frontend.ajaxurl,form_data,function(c){if(c.success)a("body").trigger("wpuf:postform:success",c),1==c.show_message?(d.before('<div class="wpuf-success">'+c.message+"</div>"),d.slideUp("fast",function(){d.remove()}),a("html, body").animate({scrollTop:a(".wpuf-success").offset().top-100},"fast")):b.location=c.redirect_to;else{if(void 0!==c.type&&"login"===c.type)return void(confirm(c.error)?b.location=c.redirect_to:(e.removeAttr("disabled"),e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()));d.find(".g-recaptcha").length>0&&grecaptcha.reset(),swal({html:c.error,type:"warning",showCancelButton:!1,confirmButtonColor:"#d54e21",confirmButtonText:"OK",cancelButtonClass:"btn btn-danger"}),e.removeAttr("disabled")}e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()}))},validateForm:function(b){var c=!1;error_type="",WP_User_Frontend.removeErrors(b),WP_User_Frontend.removeErrorNotice(b),b.find('[data-required="yes"]:visible').each(function(b,d){var e=a(d).data("type");switch(j="",e){case"rich":var f=a(d).data("id");""===(j=a.trim(tinyMCE.get(f).getContent()))&&(c=!0,WP_User_Frontend.markError(d));break;case"textarea":case"text":""===(j=a.trim(a(d).val()))&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"password":case"confirm_password":var g=a(d).data("repeat");if(j=a.trim(a(d).val()),""===j&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type)),g){var h=a('[data-type="confirm_password"]').eq(0);h.val()!=j&&(c=!0,error_type="mismatch",WP_User_Frontend.markError(h,error_type))}break;case"select":(j=a(d).val())&&"-1"!==j||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"multiselect":null!==(j=a(d).val())&&0!==j.length||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"tax-checkbox":var i=a(d).children().find("input:checked").length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"radio":var i=a(d).find("input:checked").length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"file":var i=a(d).find("ul").children().length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"email":var j=a(d).val();""!==j?WP_User_Frontend.isValidEmail(j)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)):""===j&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"url":var j=a(d).val();""!==j&&(WP_User_Frontend.isValidURL(j)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)))}});var d=b.find('[data-required="yes"][name="google_map"]');if(d){","==a(d).val()&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type))}if(c)return WP_User_Frontend.addErrorNotice(b,"end"),!1;var e=b.serialize(),f=[];return a(".wpuf-rich-validation",b).each(function(b,c){var c=a(c),d=c.data("id"),e=c.data("name"),g=a.trim(tinyMCE.get(d).getContent());f.push(e+"="+encodeURIComponent(g))}),e=e+"&"+f.join("&")},addErrorNotice:function(b,c){"bottom"==c?a(".wpuf-multistep-fieldset:visible").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>"):a(b).find("li.wpuf-submit").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>")},removeErrorNotice:function(b){a(b).find(".wpuf-errors").remove()},markError:function(b,c){var d="";if(a(b).closest("li").addClass("has-error"),c){switch(d=a(b).closest("li").data("label"),c){case"required":case"mismatch":case"validation":d=d+" "+error_str_obj[c]}a(b).siblings(".wpuf-error-msg").remove(),a(b).after('<div class="wpuf-error-msg">'+d+"</div>")}a(b).focus()},removeErrors:function(b){a(b).find(".has-error").removeClass("has-error"),a(".wpuf-error-msg").remove()},isValidEmail:function(a){return new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(a)},isValidURL:function(a){return new RegExp("^(http://www.|https://www.|ftp://www.|www.|http://|https://){1}([0-9A-Za-z]+.)").test(a)},insertImage:function(b,c){if(a("#"+b).length){var d=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:"wpuf-insert-image-container",multipart:!0,multipart_params:{action:"wpuf_insert_image",form_id:a("#"+b).data("form_id")},multiple_queues:!1,multi_selection:!1,urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:"2mb",url:wpuf_frontend_upload.plupload.url,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:"jpg,jpeg,gif,png,bmp"}]});d.bind("Init",function(a,b){}),d.bind("FilesAdded",function(b,c){var d=a("#wpuf-insert-image-container");a.each(c,function(a,b){d.append('<div class="upload-item" id="'+b.id+'"><div class="progress progress-striped active"><div class="bar"></div></div></div>')}),b.refresh(),b.start()}),d.bind("QueueChanged",function(a){d.start()}),d.bind("UploadProgress",function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")}),d.bind("Error",function(a,b){alert("Error #"+b.code+": "+b.message)}),d.bind("FileUploaded",function(b,d,e){if(a("#"+d.id).remove(),"error"!==e.response){if("undefined"!=typeof tinyMCE)if("function"!=typeof tinyMCE.execInstanceCommand){var f=tinyMCE.get("post_content_"+c);null!==f&&f.insertContent(e.response)}else tinyMCE.execInstanceCommand("post_content_"+c,"mceInsertContent",!1,e.response);var g=a("#post_content_"+c);g.val(g.val()+e.response)}else alert("Something went wrong")}),d.init()}},deleteAvatar:function(b){b.preventDefault(),confirm(a(this).data("confirm"))&&a.post(wpuf_frontend.ajaxurl,{action:"wpuf_delete_avatar",_wpnonce:wpuf_frontend.nonce},function(){a(b.target).parent().remove(),a("[id^=wpuf-avatar]").css("display","")})},editorLimit:{bind:function(b,c,d){"no"===d?(a("textarea#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b)}),a("input#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b)}),a("textarea#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b)},100)}),a("input#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b)},100)})):setTimeout(function(){tinyMCE.get(c).onKeyDown.add(function(a,c){WP_User_Frontend.editorLimit.tinymce.onKeyDown(a,c,b)}),tinyMCE.get(c).onPaste.add(function(a,c){setTimeout(function(){WP_User_Frontend.editorLimit.tinymce.onPaste(a,c,b)},100)})},1e3)},tinymce:{getStats:function(a){var b=a.getBody(),c=tinymce.trim(b.innerText||b.textContent);return{chars:c.length,words:c.split(/[\w\u2019\'-]+/).length}},onKeyDown:function(b,c,d){var e=WP_User_Frontend.editorLimit.tinymce.getStats(b).words-1;d&&a(".mce-path-item.mce-last",b.container).html("Word Limit : "+e+"/"+d),d&&e>d&&(WP_User_Frontend.editorLimit.blockTyping(c),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend.word_limit))},onPaste:function(a,b,c){var d=a.getContent().split(" ").slice(0,c).join(" ");a.setContent(d),WP_User_Frontend.editorLimit.make_media_embed_code(d,a)}},textLimit:function(b,c){var d=a(this),e=d.val().split(" ");c&&e.length>c?(d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(wpuf_frontend.word_limit),WP_User_Frontend.editorLimit.blockTyping(b)):d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(""),"paste"===b.type&&d.val(e.slice(0,c).join(" "))},blockTyping:function(b){-1!==a.inArray(b.keyCode,[46,8,9,27,13,110,190,189])||65==b.keyCode&&!0===b.ctrlKey||b.keyCode>=35&&b.keyCode<=40||(b.preventDefault(),b.stopPropagation())},make_media_embed_code:function(b,c){a.post(ajaxurl,{action:"make_media_embed_code",content:b},function(a){c.setContent(c.getContent()+c.setContent(a))})}}},a(function(){if(WP_User_Frontend.init(),a("ul.wpuf-payment-gateways").on("click","input[type=radio]",function(b){a(".wpuf-payment-instruction").slideUp(250),a(this).parents("li").find(".wpuf-payment-instruction").slideDown(250)}),a("ul.wpuf-payment-gateways li").find("input[type=radio]").is(":checked")){a("ul.wpuf-payment-gateways li").find("input[type=radio]:checked").parents("li").find(".wpuf-payment-instruction").slideDown(250)}else a("ul.wpuf-payment-gateways li").first().find("input[type=radio]").click()}),a(function(){a('input[name="first_name"], input[name="last_name"]').on("change keyup",function(){var b,c=a.makeArray(a('input[name="first_name"], input[name="last_name"]').map(function(){if(b=a(this).val())return b})).join(" ");a('input[name="display_name"]').val(c)})}),a(function(a){a('.wpuf-form-add input[name="dokan_store_name"]').on("focusout",function(){var b=a(this).val().toLowerCase().replace(/-+/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");a('input[name="shopurl"]').val(b),a("#url-alart").text(b),a('input[name="shopurl"]').focus()}),a('.wpuf-form-add input[name="shopurl"]').keydown(function(b){a(this).val();-1!==a.inArray(b.keyCode,[46,8,9,27,13,91,109,110,173,189,190])||65==b.keyCode&&!0===b.ctrlKey||b.keyCode>=35&&b.keyCode<=39||(b.shiftKey||(b.keyCode<65||b.keyCode>90)&&(b.keyCode<48||b.keyCode>57))&&(b.keyCode<96||b.keyCode>105)&&b.preventDefault()}),a('.wpuf-form-add input[name="shopurl"]').keyup(function(b){a("#url-alart").text(a(this).val())}),a('.wpuf-form-add input[name="shopurl"]').on("focusout",function(){var b=a(this),c={action:"shop_url",url_slug:b.val(),_nonce:dokan.nonce};""!==b.val()&&a.post(dokan.ajaxurl,c,function(b){0==b?(a("#url-alart").removeClass("text-success").addClass("text-danger"),a("#url-alart-mgs").removeClass("text-success").addClass("text-danger").text(dokan.seller.notAvailable)):(a("#url-alart").removeClass("text-danger").addClass("text-success"),a("#url-alart-mgs").removeClass("text-danger").addClass("text-success").text(dokan.seller.available))})}),a(".wpuf-form-add #wpuf-map-add-location").attr("name","find_address")})}(jQuery,window);
1
+ !function(a,b){a.fn.listautowidth=function(){return this.each(function(){var b=a(this).width(),c=b/a(this).children("li").length;a(this).children("li").each(function(){var b=a(this).outerWidth(!0)-a(this).width();a(this).width(c-b)})})},b.WP_User_Frontend={init:function(){this.enableMultistep(this),a(".wpuf-form").on("click","img.wpuf-clone-field",this.cloneField),a(".wpuf-form").on("click","img.wpuf-remove-field",this.removeField),a(".wpuf-form").on("click","a.wpuf-delete-avatar",this.deleteAvatar),a(".wpuf-form").on("click","a#wpuf-post-draft",this.draftPost),a(".wpuf-form").on("click","button#wpuf-account-update-profile",this.account_update_profile),a(".wpuf-form-add").on("submit",this.formSubmit),a("form#post").on("submit",this.adminPostSubmit),a(".wpuf-form").on("step-change-fieldset",function(a,b,c){if(wpuf_plupload_items.length)for(var d=wpuf_plupload_items.length-1;d>=0;d--)wpuf_plupload_items[d].refresh();if(wpuf_map_items.length)for(var d=wpuf_map_items.length-1;d>=0;d--)google.maps.event.trigger(wpuf_map_items[d].map,"resize"),wpuf_map_items[d].map.setCenter(wpuf_map_items[d].center)}),this.ajaxCategory(),a(':submit[name="wpuf_user_subscription_cancel"]').click(function(b){b.preventDefault(),swal({text:wpuf_frontend.cancelSubMsg,type:"warning",showCancelButton:!0,confirmButtonColor:"#d54e21",confirmButtonText:wpuf_frontend.delete_it,cancelButtonText:wpuf_frontend.cancel_it,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger"}).then(function(b){if(!b)return!1;a("#wpuf_cancel_subscription").submit()})})},check_pass_strength:function(){var b=a("#pass1").val();if(a("#pass-strength-result").show(),a("#pass-strength-result").removeClass("short bad good strong"),!b)return a("#pass-strength-result").html("&nbsp;"),void a("#pass-strength-result").hide();if(void 0!==wp.passwordStrength)switch(wp.passwordStrength.meter(b,wp.passwordStrength.userInputBlacklist(),b)){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n.short)}},enableMultistep:function(c){var d=this,e=0,f=a(':hidden[name="wpuf_multistep_type"]').val();if(null!=f){if(a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-prev-btn").first().remove(),a("fieldset.wpuf-multistep-fieldset").find(".wpuf-multistep-next-btn").last().remove(),a(".wpuf-form fieldset").removeClass("field-active").first().addClass("field-active"),"progressive"==f&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){a("fieldset.wpuf-multistep-fieldset legend").first();a(".wpuf-multistep-progressbar").html('<div class="wpuf-progress-percentage"></div>');var g=a(".wpuf-multistep-progressbar"),h=a(".wpuf-progress-percentage");a(".wpuf-multistep-progressbar").progressbar({change:function(){h.text(g.progressbar("value")+"%")}}),a(".wpuf-multistep-fieldset legend").hide()}else a(".wpuf-form").each(function(){var b=a(this),c=a(".wpuf-multistep-progressbar",b),d="";c.addClass("wizard-steps"),d+='<ul class="wpuf-step-wizard">',a(".wpuf-multistep-fieldset",this).each(function(){d+="<li>"+a.trim(a("legend",this).text())+"</li>",a("legend",this).hide()}),d+="</ul>",c.append(d),a(".wpuf-step-wizard li",c).first().addClass("active-step"),a(".wpuf-step-wizard",c).listautowidth()});this.change_fieldset(e,f),a("fieldset .wpuf-multistep-prev-btn, fieldset .wpuf-multistep-next-btn").click(function(g){if(a(this).hasClass("wpuf-multistep-next-btn")){0!=d.formStepCheck("",a(this).closest("fieldset"))&&c.change_fieldset(++e,f)}else a(this).hasClass("wpuf-multistep-prev-btn")&&c.change_fieldset(--e,f);var h=document.querySelector("form.wpuf-form-add"),i=h.offsetTop;return b.scrollTo({top:i-32,behavior:"smooth"}),!1})}},change_fieldset:function(b,c){var d=a("fieldset.wpuf-multistep-fieldset").eq(b);a("fieldset.wpuf-multistep-fieldset").removeClass("field-active").eq(b).addClass("field-active"),a(".wpuf-step-wizard li").each(function(){a(this).index()<=b?"step_by_step"==c?a(this).addClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).addClass("passed-wpuf-ms-bar"):"step_by_step"==c?a(this).removeClass("passed-wpuf-ms-bar"):a(".wpuf-ps-bar",this).removeClass("passed-wpuf-ms-bar")}),a(".wpuf-step-wizard li").removeClass("wpuf-ms-bar-active active-step completed-step"),a(".passed-wpuf-ms-bar").addClass("completed-step").last().addClass("wpuf-ms-bar-active"),a(".wpuf-ms-bar-active").addClass("active-step");var e=a("fieldset.wpuf-multistep-fieldset").eq(b).find("legend").text();if(e=a.trim(e),"progressive"==c&&0!=a(".wpuf-form .wpuf-multistep-fieldset").length){var f=100*(b+1)/a("fieldset.wpuf-multistep-fieldset").length,f=Number(f.toFixed(2));a(".wpuf-multistep-progressbar").progressbar({value:f}),a(".wpuf-progress-percentage").text(e+" ("+f+"%)")}a(".wpuf-form").trigger("step-change-fieldset",[b,d])},ajaxCategory:function(){var b=".category-wrap";a(b).on("change",".cat-ajax",function(){currentLevel=parseInt(a(this).parent().attr("level")),WP_User_Frontend.getChildCats(a(this),"lvl",currentLevel+1,b,"category")})},getChildCats:function(b,c,d,e,f){cat=a(b).val(),results_div=c+d,f=void 0!==f?f:"category",field_attr=a(b).siblings("span").data("taxonomy"),a.ajax({type:"post",url:wpuf_frontend.ajaxurl,data:{action:"wpuf_get_child_cat",catID:cat,nonce:wpuf_frontend.nonce,field_attr:field_attr},beforeSend:function(){a(b).parent().parent().next(".loading").addClass("wpuf-loading")},complete:function(){a(b).parent().parent().next(".loading").removeClass("wpuf-loading")},success:function(e){a(b).parent().nextAll().each(function(){a(this).remove()}),""!=e&&(a(b).parent().addClass("hasChild").parent().append('<div id="'+c+d+'" level="'+d+'"></div>'),b.parent().parent().find("#"+results_div).html(e).slideDown("fast"))}})},cloneField:function(b){b.preventDefault();var c=a(this).closest("tr"),d=c.clone();d.find("input").val(""),d.find(":checked").attr("checked",""),c.after(d)},removeField:function(){var b=a(this).closest("tr");b.siblings().andSelf().length>1&&b.remove()},adminPostSubmit:function(b){b.preventDefault();var c=a(this);if(WP_User_Frontend.validateForm(c))return!0},draftPost:function(b){b.preventDefault();var c=a(this),d=a(this).closest("form"),e=d.serialize()+"&action=wpuf_draft_post",f=d.find('input[type="hidden"][name="post_id"]').val(),g=[];a(".wpuf-rich-validation").each(function(b,c){var c=a(c),d=c.data("id"),e=c.data("name"),f=a.trim(tinyMCE.get(d).getContent());g.push(e+"="+encodeURIComponent(f))}),e=e+"&"+g.join("&"),c.after(' <span class="wpuf-loading"></span>'),a.post(wpuf_frontend.ajaxurl,e,function(b){if(void 0===f){var e='<input type="hidden" name="post_id" value="'+b.post_id+'">';e+='<input type="hidden" name="post_date" value="'+b.date+'">',e+='<input type="hidden" name="post_author" value="'+b.post_author+'">',e+='<input type="hidden" name="comment_status" value="'+b.comment_status+'">',d.append(e)}c.next("span.wpuf-loading").remove(),c.after('<span class="wpuf-draft-saved">&nbsp; Post Saved</span>'),a(".wpuf-draft-saved").delay(2500).fadeOut("fast",function(){a(this).remove()})})},account_update_profile:function(b){b.preventDefault();var c=a(this).closest("form");a.post(wpuf_frontend.ajaxurl,c.serialize(),function(a){a.success?(c.find(".wpuf-error").hide(),c.find(".wpuf-success").show()):(c.find(".wpuf-success").hide(),c.find(".wpuf-error").show(),c.find(".wpuf-error").text(a.data))})},formStepCheck:function(a,b){var c=b;c.find("input[type=submit]");return form_data=WP_User_Frontend.validateForm(c),0==form_data&&WP_User_Frontend.addErrorNotice(self,"bottom"),form_data},formSubmit:function(c){c.preventDefault();var d=a(this),e=d.find("input[type=submit]");form_data=WP_User_Frontend.validateForm(d),form_data&&(d.find("li.wpuf-submit").append('<span class="wpuf-loading"></span>'),e.attr("disabled","disabled").addClass("button-primary-disabled"),a.post(wpuf_frontend.ajaxurl,form_data,function(c){if(c.success)a("body").trigger("wpuf:postform:success",c),1==c.show_message?(d.before('<div class="wpuf-success">'+c.message+"</div>"),d.slideUp("fast",function(){d.remove()}),a("html, body").animate({scrollTop:a(".wpuf-success").offset().top-100},"fast")):b.location=c.redirect_to;else{if(void 0!==c.type&&"login"===c.type)return void(confirm(c.error)?b.location=c.redirect_to:(e.removeAttr("disabled"),e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()));d.find(".g-recaptcha").length>0&&grecaptcha.reset(),swal({html:c.error,type:"warning",showCancelButton:!1,confirmButtonColor:"#d54e21",confirmButtonText:"OK",cancelButtonClass:"btn btn-danger"}),e.removeAttr("disabled")}e.removeClass("button-primary-disabled"),d.find("span.wpuf-loading").remove()}))},validateForm:function(b){var c=!1;error_type="",WP_User_Frontend.removeErrors(b),WP_User_Frontend.removeErrorNotice(b),b.find('[data-required="yes"]:visible').each(function(b,d){var e=a(d).data("type");switch(j="",e){case"rich":var f=a(d).data("id");""===(j=a.trim(tinyMCE.get(f).getContent()))&&(c=!0,WP_User_Frontend.markError(d));break;case"textarea":case"text":""===(j=a.trim(a(d).val()))&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"password":case"confirm_password":var g=a(d).data("repeat");if(j=a.trim(a(d).val()),""===j&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type)),g){var h=a('[data-type="confirm_password"]').eq(0);h.val()!=j&&(c=!0,error_type="mismatch",WP_User_Frontend.markError(h,error_type))}break;case"select":(j=a(d).val())&&"-1"!==j||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"multiselect":null!==(j=a(d).val())&&0!==j.length||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"tax-checkbox":var i=a(d).children().find("input:checked").length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"radio":var i=a(d).find("input:checked").length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"file":var i=a(d).find("ul").children().length;i||(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"email":var j=a(d).val();""!==j?WP_User_Frontend.isValidEmail(j)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)):""===j&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type));break;case"url":var j=a(d).val();""!==j&&(WP_User_Frontend.isValidURL(j)||(c=!0,error_type="validation",WP_User_Frontend.markError(d,error_type)))}});var d=b.find('[data-required="yes"][name="google_map"]');if(d){","==a(d).val()&&(c=!0,error_type="required",WP_User_Frontend.markError(d,error_type))}if(c)return WP_User_Frontend.addErrorNotice(b,"end"),!1;var e=b.serialize(),f=[];return a(".wpuf-rich-validation",b).each(function(b,c){var c=a(c),d=c.data("id"),e=c.data("name"),g=a.trim(tinyMCE.get(d).getContent());f.push(e+"="+encodeURIComponent(g))}),e=e+"&"+f.join("&")},addErrorNotice:function(b,c){"bottom"==c?a(".wpuf-multistep-fieldset:visible").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>"):a(b).find("li.wpuf-submit").append('<div class="wpuf-errors">'+wpuf_frontend.error_message+"</div>")},removeErrorNotice:function(b){a(b).find(".wpuf-errors").remove()},markError:function(b,c){var d="";if(a(b).closest("li").addClass("has-error"),c){switch(d=a(b).closest("li").data("label"),c){case"required":case"mismatch":case"validation":d=d+" "+error_str_obj[c]}a(b).siblings(".wpuf-error-msg").remove(),a(b).after('<div class="wpuf-error-msg">'+d+"</div>")}a(b).focus()},removeErrors:function(b){a(b).find(".has-error").removeClass("has-error"),a(".wpuf-error-msg").remove()},isValidEmail:function(a){return new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(a)},isValidURL:function(a){return new RegExp("^(http://www.|https://www.|ftp://www.|www.|http://|https://){1}([0-9A-Za-z]+.)").test(a)},insertImage:function(b,c){if(a("#"+b).length){var d=new plupload.Uploader({runtimes:"html5,html4",browse_button:b,container:"wpuf-insert-image-container",multipart:!0,multipart_params:{action:"wpuf_insert_image",form_id:a("#"+b).data("form_id")},multiple_queues:!1,multi_selection:!1,urlstream_upload:!0,file_data_name:"wpuf_file",max_file_size:"2mb",url:wpuf_frontend_upload.plupload.url,flash_swf_url:wpuf_frontend_upload.flash_swf_url,filters:[{title:"Allowed Files",extensions:"jpg,jpeg,gif,png,bmp"}]});d.bind("Init",function(a,b){}),d.bind("FilesAdded",function(b,c){var d=a("#wpuf-insert-image-container");a.each(c,function(a,b){d.append('<div class="upload-item" id="'+b.id+'"><div class="progress progress-striped active"><div class="bar"></div></div></div>')}),b.refresh(),b.start()}),d.bind("QueueChanged",function(a){d.start()}),d.bind("UploadProgress",function(b,c){var d=a("#"+c.id);a(".bar",d).css({width:c.percent+"%"}),a(".percent",d).html(c.percent+"%")}),d.bind("Error",function(a,b){alert("Error #"+b.code+": "+b.message)}),d.bind("FileUploaded",function(b,d,e){if(a("#"+d.id).remove(),"error"!==e.response){if("undefined"!=typeof tinyMCE)if("function"!=typeof tinyMCE.execInstanceCommand){var f=tinyMCE.get("post_content_"+c);null!==f&&f.insertContent(e.response)}else tinyMCE.execInstanceCommand("post_content_"+c,"mceInsertContent",!1,e.response);var g=a("#post_content_"+c);g.val(g.val()+e.response)}else alert("Something went wrong")}),d.init()}},deleteAvatar:function(b){b.preventDefault(),confirm(a(this).data("confirm"))&&a.post(wpuf_frontend.ajaxurl,{action:"wpuf_delete_avatar",_wpnonce:wpuf_frontend.nonce},function(){a(b.target).parent().remove(),a("[id^=wpuf-avatar]").css("display","")})},editorLimit:{bind:function(b,c,d){"no"===d?(a("textarea#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b)}),a("input#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b)}),a("textarea#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b)},100)}),a("input#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b)},100)})):setTimeout(function(){tinyMCE.get(c).onKeyDown.add(function(a,c){WP_User_Frontend.editorLimit.tinymce.onKeyDown(a,c,b)}),tinyMCE.get(c).onPaste.add(function(a,c){setTimeout(function(){WP_User_Frontend.editorLimit.tinymce.onPaste(a,c,b)},100)})},1e3)},tinymce:{getStats:function(a){var b=a.getBody(),c=tinymce.trim(b.innerText||b.textContent);return{chars:c.length,words:c.split(/[\w\u2019\'-]+/).length}},onKeyDown:function(b,c,d){var e=WP_User_Frontend.editorLimit.tinymce.getStats(b).words-1;d&&a(".mce-path-item.mce-last",b.container).html("Word Limit : "+e+"/"+d),d&&e>d&&(WP_User_Frontend.editorLimit.blockTyping(c),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend.word_limit))},onPaste:function(a,b,c){var d=a.getContent().split(" ").slice(0,c).join(" ");a.setContent(d),WP_User_Frontend.editorLimit.make_media_embed_code(d,a)}},textLimit:function(b,c){var d=a(this),e=d.val().split(" ");c&&e.length>c?(d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(wpuf_frontend.word_limit),WP_User_Frontend.editorLimit.blockTyping(b)):d.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(""),"paste"===b.type&&d.val(e.slice(0,c).join(" "))},blockTyping:function(b){-1!==a.inArray(b.keyCode,[46,8,9,27,13,110,190,189])||65==b.keyCode&&!0===b.ctrlKey||b.keyCode>=35&&b.keyCode<=40||(b.preventDefault(),b.stopPropagation())},make_media_embed_code:function(b,c){a.post(ajaxurl,{action:"make_media_embed_code",content:b},function(a){c.setContent(c.getContent()+c.setContent(a))})}}},a(function(){if(WP_User_Frontend.init(),a("ul.wpuf-payment-gateways").on("click","input[type=radio]",function(b){a(".wpuf-payment-instruction").slideUp(250),a(this).parents("li").find(".wpuf-payment-instruction").slideDown(250)}),a("ul.wpuf-payment-gateways li").find("input[type=radio]").is(":checked")){a("ul.wpuf-payment-gateways li").find("input[type=radio]:checked").parents("li").find(".wpuf-payment-instruction").slideDown(250)}else a("ul.wpuf-payment-gateways li").first().find("input[type=radio]").click()}),a(function(){a('input[name="first_name"], input[name="last_name"]').on("change keyup",function(){var b,c=a.makeArray(a('input[name="first_name"], input[name="last_name"]').map(function(){if(b=a(this).val())return b})).join(" ");a('input[name="display_name"]').val(c)})}),a(function(a){a('.wpuf-form-add input[name="dokan_store_name"]').on("focusout",function(){var b=a(this).val().toLowerCase().replace(/-+/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");a('input[name="shopurl"]').val(b),a("#url-alart").text(b),a('input[name="shopurl"]').focus()}),a('.wpuf-form-add input[name="shopurl"]').keydown(function(b){a(this).val();-1!==a.inArray(b.keyCode,[46,8,9,27,13,91,109,110,173,189,190])||65==b.keyCode&&!0===b.ctrlKey||b.keyCode>=35&&b.keyCode<=39||(b.shiftKey||(b.keyCode<65||b.keyCode>90)&&(b.keyCode<48||b.keyCode>57))&&(b.keyCode<96||b.keyCode>105)&&b.preventDefault()}),a('.wpuf-form-add input[name="shopurl"]').keyup(function(b){a("#url-alart").text(a(this).val())}),a('.wpuf-form-add input[name="shopurl"]').on("focusout",function(){var b=a(this),c={action:"shop_url",url_slug:b.val(),_nonce:dokan.nonce};""!==b.val()&&a.post(dokan.ajaxurl,c,function(b){0==b?(a("#url-alart").removeClass("text-success").addClass("text-danger"),a("#url-alart-mgs").removeClass("text-success").addClass("text-danger").text(dokan.seller.notAvailable)):(a("#url-alart").removeClass("text-danger").addClass("text-success"),a("#url-alart-mgs").removeClass("text-danger").addClass("text-success").text(dokan.seller.available))})}),a(".wpuf-form-add #wpuf-map-add-location").attr("name","find_address")})}(jQuery,window);
class/payment.php CHANGED
@@ -415,13 +415,17 @@ class WPUF_Payment {
415
  }
416
 
417
  if ( empty( $data['tax'] ) ) {
418
- $data['tax'] = $data['cost'] - $data['subtotal'];
419
  }
420
 
421
  if ( wpuf_get_option( 'show_address', 'wpuf_address_options', false ) ) {
422
  $data['payer_address'] = wpuf_get_user_address();
423
  }
424
 
 
 
 
 
425
  if ( !$result ) {
426
  $wpdb->insert( $wpdb->prefix . 'wpuf_transaction', $data );
427
  } else {
415
  }
416
 
417
  if ( empty( $data['tax'] ) ) {
418
+ $data['tax'] = floatval( $data['cost'] ) - floatval( $data['subtotal'] );
419
  }
420
 
421
  if ( wpuf_get_option( 'show_address', 'wpuf_address_options', false ) ) {
422
  $data['payer_address'] = wpuf_get_user_address();
423
  }
424
 
425
+ if ( !empty( $data['payer_address'] ) ) {
426
+ $data['payer_address'] = maybe_serialize( $data['payer_address'] );
427
+ }
428
+
429
  if ( !$result ) {
430
  $wpdb->insert( $wpdb->prefix . 'wpuf_transaction', $data );
431
  } else {
includes/class-billing-address.php CHANGED
@@ -122,7 +122,7 @@ class WPUF_Ajax_Address_Form {
122
  <table id="wpuf-address-country-state" class="wp-list-table widefat">
123
  <tr>
124
  <td class="<?php echo $required; ?>" style="display:inline-block;float:left;width:100%;margin:0px;padding:5px;<?php echo $country_hide; ?>">
125
- <label>Country<?php echo $country_req ?></label>
126
  <br>
127
  <?php
128
  if (function_exists('wpuf_get_tax_rates')) {
@@ -149,7 +149,7 @@ class WPUF_Ajax_Address_Form {
149
  ?>
150
  </td>
151
  <td class="<?php echo $required; ?>" style="display:inline-block;float:left;width:100%;margin:0px;padding:5px;<?php echo $state_hide;?>">
152
- <label>State/Province/Region<?php echo $state_req; ?></label>
153
  <br>
154
  <?php
155
  $states = $cs->getStates($selected['country']);
@@ -228,6 +228,7 @@ class WPUF_Ajax_Address_Form {
228
  && isset( $_POST['wpuf_biiling_state'] )
229
  && isset( $_POST['wpuf_biiling_zip_code'] )
230
  && isset( $_POST['wpuf_biiling_country'] ) ) {
 
231
  $address_fields = array(
232
  'add_line_1' => $_POST['wpuf_biiling_add_line_1'],
233
  'add_line_2' => $_POST['wpuf_biiling_add_line_2'],
@@ -236,7 +237,9 @@ class WPUF_Ajax_Address_Form {
236
  'zip_code' => $_POST['wpuf_biiling_zip_code'],
237
  'country' => $_POST['wpuf_biiling_country']
238
  );
 
239
  update_user_meta( $user_id, 'wpuf_address_fields', $address_fields );
 
240
  $msg = '<div class="wpuf-success">' . __( 'Billing address is updated.', 'wp-user-frontend' ) . '</div>';
241
 
242
  echo $msg;
122
  <table id="wpuf-address-country-state" class="wp-list-table widefat">
123
  <tr>
124
  <td class="<?php echo $required; ?>" style="display:inline-block;float:left;width:100%;margin:0px;padding:5px;<?php echo $country_hide; ?>">
125
+ <label><?php _e( "Country", "wp-user-frontend" ); ?><?php echo $country_req ?></label>
126
  <br>
127
  <?php
128
  if (function_exists('wpuf_get_tax_rates')) {
149
  ?>
150
  </td>
151
  <td class="<?php echo $required; ?>" style="display:inline-block;float:left;width:100%;margin:0px;padding:5px;<?php echo $state_hide;?>">
152
+ <label><?php _e( "State/Province/Region", "wp-user-frontend" ); ?><?php echo $state_req; ?></label>
153
  <br>
154
  <?php
155
  $states = $cs->getStates($selected['country']);
228
  && isset( $_POST['wpuf_biiling_state'] )
229
  && isset( $_POST['wpuf_biiling_zip_code'] )
230
  && isset( $_POST['wpuf_biiling_country'] ) ) {
231
+
232
  $address_fields = array(
233
  'add_line_1' => $_POST['wpuf_biiling_add_line_1'],
234
  'add_line_2' => $_POST['wpuf_biiling_add_line_2'],
237
  'zip_code' => $_POST['wpuf_biiling_zip_code'],
238
  'country' => $_POST['wpuf_biiling_country']
239
  );
240
+
241
  update_user_meta( $user_id, 'wpuf_address_fields', $address_fields );
242
+
243
  $msg = '<div class="wpuf-success">' . __( 'Billing address is updated.', 'wp-user-frontend' ) . '</div>';
244
 
245
  echo $msg;
includes/class-frontend-form-post.php CHANGED
@@ -639,7 +639,7 @@ class WPUF_Frontend_Form extends WPUF_Frontend_Render_Form{
639
  $image_ids = '';
640
 
641
  if ( count( $file_input['value'] ) > 1 ) {
642
- $image_ids = maybe_serialize( $file_input['value'] );
643
  }
644
 
645
  if ( count( $file_input['value'] ) == 1 ) {
639
  $image_ids = '';
640
 
641
  if ( count( $file_input['value'] ) > 1 ) {
642
+ $image_ids = $file_input['value'];
643
  }
644
 
645
  if ( count( $file_input['value'] ) == 1 ) {
includes/class-gutenblock.php CHANGED
@@ -11,7 +11,7 @@ class WPUF_Form_Block {
11
  //when wpuf_form shortcode exists in admin pages.
12
  add_action( 'admin_enqueue_scripts', array( $this, 'load_dashicons' ) );
13
  // wait for Gutenberg to enqueue it's block assets
14
- add_action( 'enqueue_block_editor_assets', array( $this, 'wpuf_form_block' ) );
15
  // load the preview information and form
16
  add_action( 'wp_head', array( $this, 'load_preview_data' ) );
17
  }
11
  //when wpuf_form shortcode exists in admin pages.
12
  add_action( 'admin_enqueue_scripts', array( $this, 'load_dashicons' ) );
13
  // wait for Gutenberg to enqueue it's block assets
14
+ add_action( 'enqueue_block_editor_assets', array( $this, 'wpuf_form_block', 10 ) );
15
  // load the preview information and form
16
  add_action( 'wp_head', array( $this, 'load_preview_data' ) );
17
  }
languages/wp-user-frontend.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP User Frontend 3.1.7\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
- "POT-Creation-Date: 2019-05-31 09:35:06+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -340,7 +340,7 @@ msgstr ""
340
 
341
  #: admin/class-tools.php:39 admin/class-tools.php:95
342
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:86
343
- #: includes/class-list-table-subscribers.php:126 wpuf-functions.php:2696
344
  msgid "All"
345
  msgstr ""
346
 
@@ -2071,7 +2071,7 @@ msgid ""
2071
  msgstr ""
2072
 
2073
  #: admin/installer.php:77 admin/settings-options.php:23
2074
- #: includes/free/admin/shortcode-button.php:82 wpuf-functions.php:1698
2075
  msgid "Dashboard"
2076
  msgstr ""
2077
 
@@ -2087,7 +2087,7 @@ msgstr ""
2087
  #: admin/installer.php:88 class/subscription.php:356 class/subscription.php:376
2088
  #: class/subscription.php:377 class/subscription.php:378
2089
  #: includes/free/admin/shortcode-button.php:102
2090
- #: templates/dashboard/dashboard.php:19 wpuf-functions.php:1701
2091
  msgid "Subscription"
2092
  msgstr ""
2093
 
@@ -3328,7 +3328,7 @@ msgstr ""
3328
  #: class/upload.php:168 includes/fields/class-field-recaptcha.php:156
3329
  #: includes/fields/class-field-sectionbreak.php:56
3330
  #: templates/dashboard/posts.php:77 templates/dashboard.php:87
3331
- #: wpuf-functions.php:807
3332
  msgid "Title"
3333
  msgstr ""
3334
 
@@ -3345,7 +3345,7 @@ msgid "Enter the meta value"
3345
  msgstr ""
3346
 
3347
  #: admin/template.php:609 class/upload.php:170
3348
- #: includes/fields/class-field-sectionbreak.php:64 wpuf-functions.php:813
3349
  msgid "Description"
3350
  msgstr ""
3351
 
@@ -3613,7 +3613,7 @@ msgid "You already have activated a free package previously."
3613
  msgstr ""
3614
 
3615
  #: class/payment.php:139 includes/class-customizer.php:59
3616
- #: wpuf-functions.php:1702
3617
  msgid "Billing Address"
3618
  msgstr ""
3619
 
@@ -3661,11 +3661,11 @@ msgstr ""
3661
  msgid "No Payment gateway found"
3662
  msgstr ""
3663
 
3664
- #: class/payment.php:445 lib/gateway/bank.php:109
3665
  msgid "[%s] Payment Received"
3666
  msgstr ""
3667
 
3668
- #: class/payment.php:446
3669
  msgid "New payment received at %s"
3670
  msgstr ""
3671
 
@@ -3793,7 +3793,7 @@ msgid "Strength indicator"
3793
  msgstr ""
3794
 
3795
  #: class/render-form.php:1420 includes/fields/class-field-post-taxonomy.php:122
3796
- #: wpuf-functions.php:1486
3797
  msgid "-- Select --"
3798
  msgstr ""
3799
 
@@ -4007,7 +4007,7 @@ msgstr ""
4007
  msgid "No transactions found."
4008
  msgstr ""
4009
 
4010
- #: class/upload.php:169 wpuf-functions.php:810
4011
  msgid "Caption"
4012
  msgstr ""
4013
 
@@ -4049,10 +4049,21 @@ msgstr ""
4049
  msgid "Some Required Fields are not filled!"
4050
  msgstr ""
4051
 
 
 
 
 
 
 
4052
  #: includes/class-billing-address.php:147
4053
  msgid "Choose a country"
4054
  msgstr ""
4055
 
 
 
 
 
 
4056
  #: includes/class-billing-address.php:166
4057
  msgid "Choose a state"
4058
  msgstr ""
@@ -4083,21 +4094,11 @@ msgstr ""
4083
  msgid "Update Billing Address"
4084
  msgstr ""
4085
 
4086
- #: includes/class-billing-address.php:240
4087
  #: templates/dashboard/billing-address.php:24
4088
  msgid "Billing address is updated."
4089
  msgstr ""
4090
 
4091
- #: includes/class-customizer.php:24 includes/class-customizer.php:69
4092
- #: includes/class-privacy.php:275 templates/dashboard/billing-address.php:78
4093
- msgid "Country"
4094
- msgstr ""
4095
-
4096
- #: includes/class-customizer.php:25 includes/class-customizer.php:70
4097
- #: templates/dashboard/billing-address.php:63
4098
- msgid "State/Province/Region"
4099
- msgstr ""
4100
-
4101
  #: includes/class-customizer.php:26 includes/class-customizer.php:71
4102
  msgid "Address line 1"
4103
  msgstr ""
@@ -4125,7 +4126,7 @@ msgstr ""
4125
 
4126
  #: includes/class-dokan-integration.php:37
4127
  #: includes/class-wc-vendors-integration.php:109
4128
- #: templates/dashboard/dashboard.php:15 wpuf-functions.php:1699
4129
  msgid "Posts"
4130
  msgstr ""
4131
 
@@ -6010,219 +6011,219 @@ msgstr ""
6010
  msgid "CSV"
6011
  msgstr ""
6012
 
6013
- #: wpuf-functions.php:833
6014
  msgid "Directions »"
6015
  msgstr ""
6016
 
6017
- #: wpuf-functions.php:1700
6018
  msgid "Edit Profile"
6019
  msgstr ""
6020
 
6021
- #: wpuf-functions.php:1807
6022
  msgid "United Arab Emirates Dirham"
6023
  msgstr ""
6024
 
6025
- #: wpuf-functions.php:1808
6026
  msgid "Australian Dollars"
6027
  msgstr ""
6028
 
6029
- #: wpuf-functions.php:1809
6030
  msgid "Argentine Peso"
6031
  msgstr ""
6032
 
6033
- #: wpuf-functions.php:1810
6034
  msgid "Bangladeshi Taka"
6035
  msgstr ""
6036
 
6037
- #: wpuf-functions.php:1811
6038
  msgid "Brazilian Real"
6039
  msgstr ""
6040
 
6041
- #: wpuf-functions.php:1812
6042
  msgid "Bulgarian Lev"
6043
  msgstr ""
6044
 
6045
- #: wpuf-functions.php:1813
6046
  msgid "Canadian Dollars"
6047
  msgstr ""
6048
 
6049
- #: wpuf-functions.php:1814
6050
  msgid "Chilean Peso"
6051
  msgstr ""
6052
 
6053
- #: wpuf-functions.php:1815
6054
  msgid "Chinese Yuan"
6055
  msgstr ""
6056
 
6057
- #: wpuf-functions.php:1816
6058
  msgid "Colombian Peso"
6059
  msgstr ""
6060
 
6061
- #: wpuf-functions.php:1817
6062
  msgid "Czech Koruna"
6063
  msgstr ""
6064
 
6065
- #: wpuf-functions.php:1818
6066
  msgid "Danish Krone"
6067
  msgstr ""
6068
 
6069
- #: wpuf-functions.php:1819
6070
  msgid "Dominican Peso"
6071
  msgstr ""
6072
 
6073
- #: wpuf-functions.php:1820
6074
  msgid "Algerian Dinar"
6075
  msgstr ""
6076
 
6077
- #: wpuf-functions.php:1821
6078
  msgid "Euros"
6079
  msgstr ""
6080
 
6081
- #: wpuf-functions.php:1822
6082
  msgid "Hong Kong Dollar"
6083
  msgstr ""
6084
 
6085
- #: wpuf-functions.php:1823
6086
  msgid "Croatia kuna"
6087
  msgstr ""
6088
 
6089
- #: wpuf-functions.php:1824
6090
  msgid "Hungarian Forint"
6091
  msgstr ""
6092
 
6093
- #: wpuf-functions.php:1825
6094
  msgid "Icelandic krona"
6095
  msgstr ""
6096
 
6097
- #: wpuf-functions.php:1826
6098
  msgid "Indonesia Rupiah"
6099
  msgstr ""
6100
 
6101
- #: wpuf-functions.php:1827
6102
  msgid "Indian Rupee"
6103
  msgstr ""
6104
 
6105
- #: wpuf-functions.php:1828
6106
  msgid "Nepali Rupee"
6107
  msgstr ""
6108
 
6109
- #: wpuf-functions.php:1829
6110
  msgid "Israeli Shekel"
6111
  msgstr ""
6112
 
6113
- #: wpuf-functions.php:1830
6114
  msgid "Japanese Yen"
6115
  msgstr ""
6116
 
6117
- #: wpuf-functions.php:1831
6118
  msgid "Lao Kip"
6119
  msgstr ""
6120
 
6121
- #: wpuf-functions.php:1832
6122
  msgid "South Korean Won"
6123
  msgstr ""
6124
 
6125
- #: wpuf-functions.php:1833
6126
  msgid "Malaysian Ringgits"
6127
  msgstr ""
6128
 
6129
- #: wpuf-functions.php:1834
6130
  msgid "Mexican Peso"
6131
  msgstr ""
6132
 
6133
- #: wpuf-functions.php:1835
6134
  msgid "Nigerian Naira"
6135
  msgstr ""
6136
 
6137
- #: wpuf-functions.php:1836
6138
  msgid "Norwegian Krone"
6139
  msgstr ""
6140
 
6141
- #: wpuf-functions.php:1837
6142
  msgid "New Zealand Dollar"
6143
  msgstr ""
6144
 
6145
- #: wpuf-functions.php:1838
6146
  msgid "Omani Rial"
6147
  msgstr ""
6148
 
6149
- #: wpuf-functions.php:1839
6150
  msgid "Iranian Rial"
6151
  msgstr ""
6152
 
6153
- #: wpuf-functions.php:1840
6154
  msgid "Pakistani Rupee"
6155
  msgstr ""
6156
 
6157
- #: wpuf-functions.php:1841
6158
  msgid "Paraguayan Guaraní"
6159
  msgstr ""
6160
 
6161
- #: wpuf-functions.php:1842
6162
  msgid "Philippine Pesos"
6163
  msgstr ""
6164
 
6165
- #: wpuf-functions.php:1843
6166
  msgid "Polish Zloty"
6167
  msgstr ""
6168
 
6169
- #: wpuf-functions.php:1844
6170
  msgid "Pounds Sterling"
6171
  msgstr ""
6172
 
6173
- #: wpuf-functions.php:1845
6174
  msgid "Romanian Leu"
6175
  msgstr ""
6176
 
6177
- #: wpuf-functions.php:1846
6178
  msgid "Russian Ruble"
6179
  msgstr ""
6180
 
6181
- #: wpuf-functions.php:1847
6182
  msgid "Saudi Riyal"
6183
  msgstr ""
6184
 
6185
- #: wpuf-functions.php:1848
6186
  msgid "Singapore Dollar"
6187
  msgstr ""
6188
 
6189
- #: wpuf-functions.php:1849
6190
  msgid "South African rand"
6191
  msgstr ""
6192
 
6193
- #: wpuf-functions.php:1850
6194
  msgid "Swedish Krona"
6195
  msgstr ""
6196
 
6197
- #: wpuf-functions.php:1851
6198
  msgid "Swiss Franc"
6199
  msgstr ""
6200
 
6201
- #: wpuf-functions.php:1852
6202
  msgid "Taiwan New Dollars"
6203
  msgstr ""
6204
 
6205
- #: wpuf-functions.php:1853
6206
  msgid "Thai Baht"
6207
  msgstr ""
6208
 
6209
- #: wpuf-functions.php:1854
6210
  msgid "Turkish Lira"
6211
  msgstr ""
6212
 
6213
- #: wpuf-functions.php:1855
6214
  msgid "US Dollar"
6215
  msgstr ""
6216
 
6217
- #: wpuf-functions.php:1856
6218
  msgid "Vietnamese Dong"
6219
  msgstr ""
6220
 
6221
- #: wpuf-functions.php:1857
6222
  msgid "Egyptian Pound"
6223
  msgstr ""
6224
 
6225
- #: wpuf-functions.php:2697
6226
  msgid "None"
6227
  msgstr ""
6228
 
@@ -6267,7 +6268,7 @@ msgstr ""
6267
  msgid "Please Cancel Your Currently Active Pack first!"
6268
  msgstr ""
6269
 
6270
- #: wpuf.php:873
6271
  msgid "Error: Nonce verification failed"
6272
  msgstr ""
6273
 
@@ -6349,7 +6350,7 @@ msgctxt "enhanced select"
6349
  msgid "Searching&hellip;"
6350
  msgstr ""
6351
 
6352
- #: wpuf-functions.php:1257
6353
  msgctxt "tag delimiter"
6354
  msgid ","
6355
  msgstr ""
2
  # This file is distributed under the GPL2 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP User Frontend 3.1.8\n"
6
  "Report-Msgid-Bugs-To: https://wedevs.com/contact/\n"
7
+ "POT-Creation-Date: 2019-06-26 06:39:07+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
340
 
341
  #: admin/class-tools.php:39 admin/class-tools.php:95
342
  #: admin/post-forms-list-table.php:43 class/transactions-list-table.php:86
343
+ #: includes/class-list-table-subscribers.php:126 wpuf-functions.php:2697
344
  msgid "All"
345
  msgstr ""
346
 
2071
  msgstr ""
2072
 
2073
  #: admin/installer.php:77 admin/settings-options.php:23
2074
+ #: includes/free/admin/shortcode-button.php:82 wpuf-functions.php:1699
2075
  msgid "Dashboard"
2076
  msgstr ""
2077
 
2087
  #: admin/installer.php:88 class/subscription.php:356 class/subscription.php:376
2088
  #: class/subscription.php:377 class/subscription.php:378
2089
  #: includes/free/admin/shortcode-button.php:102
2090
+ #: templates/dashboard/dashboard.php:19 wpuf-functions.php:1702
2091
  msgid "Subscription"
2092
  msgstr ""
2093
 
3328
  #: class/upload.php:168 includes/fields/class-field-recaptcha.php:156
3329
  #: includes/fields/class-field-sectionbreak.php:56
3330
  #: templates/dashboard/posts.php:77 templates/dashboard.php:87
3331
+ #: wpuf-functions.php:808
3332
  msgid "Title"
3333
  msgstr ""
3334
 
3345
  msgstr ""
3346
 
3347
  #: admin/template.php:609 class/upload.php:170
3348
+ #: includes/fields/class-field-sectionbreak.php:64 wpuf-functions.php:814
3349
  msgid "Description"
3350
  msgstr ""
3351
 
3613
  msgstr ""
3614
 
3615
  #: class/payment.php:139 includes/class-customizer.php:59
3616
+ #: wpuf-functions.php:1703
3617
  msgid "Billing Address"
3618
  msgstr ""
3619
 
3661
  msgid "No Payment gateway found"
3662
  msgstr ""
3663
 
3664
+ #: class/payment.php:449 lib/gateway/bank.php:109
3665
  msgid "[%s] Payment Received"
3666
  msgstr ""
3667
 
3668
+ #: class/payment.php:450
3669
  msgid "New payment received at %s"
3670
  msgstr ""
3671
 
3793
  msgstr ""
3794
 
3795
  #: class/render-form.php:1420 includes/fields/class-field-post-taxonomy.php:122
3796
+ #: wpuf-functions.php:1487
3797
  msgid "-- Select --"
3798
  msgstr ""
3799
 
4007
  msgid "No transactions found."
4008
  msgstr ""
4009
 
4010
+ #: class/upload.php:169 wpuf-functions.php:811
4011
  msgid "Caption"
4012
  msgstr ""
4013
 
4049
  msgid "Some Required Fields are not filled!"
4050
  msgstr ""
4051
 
4052
+ #: includes/class-billing-address.php:125 includes/class-customizer.php:24
4053
+ #: includes/class-customizer.php:69 includes/class-privacy.php:275
4054
+ #: templates/dashboard/billing-address.php:78
4055
+ msgid "Country"
4056
+ msgstr ""
4057
+
4058
  #: includes/class-billing-address.php:147
4059
  msgid "Choose a country"
4060
  msgstr ""
4061
 
4062
+ #: includes/class-billing-address.php:152 includes/class-customizer.php:25
4063
+ #: includes/class-customizer.php:70 templates/dashboard/billing-address.php:63
4064
+ msgid "State/Province/Region"
4065
+ msgstr ""
4066
+
4067
  #: includes/class-billing-address.php:166
4068
  msgid "Choose a state"
4069
  msgstr ""
4094
  msgid "Update Billing Address"
4095
  msgstr ""
4096
 
4097
+ #: includes/class-billing-address.php:243
4098
  #: templates/dashboard/billing-address.php:24
4099
  msgid "Billing address is updated."
4100
  msgstr ""
4101
 
 
 
 
 
 
 
 
 
 
 
4102
  #: includes/class-customizer.php:26 includes/class-customizer.php:71
4103
  msgid "Address line 1"
4104
  msgstr ""
4126
 
4127
  #: includes/class-dokan-integration.php:37
4128
  #: includes/class-wc-vendors-integration.php:109
4129
+ #: templates/dashboard/dashboard.php:15 wpuf-functions.php:1700
4130
  msgid "Posts"
4131
  msgstr ""
4132
 
6011
  msgid "CSV"
6012
  msgstr ""
6013
 
6014
+ #: wpuf-functions.php:834
6015
  msgid "Directions »"
6016
  msgstr ""
6017
 
6018
+ #: wpuf-functions.php:1701
6019
  msgid "Edit Profile"
6020
  msgstr ""
6021
 
6022
+ #: wpuf-functions.php:1808
6023
  msgid "United Arab Emirates Dirham"
6024
  msgstr ""
6025
 
6026
+ #: wpuf-functions.php:1809
6027
  msgid "Australian Dollars"
6028
  msgstr ""
6029
 
6030
+ #: wpuf-functions.php:1810
6031
  msgid "Argentine Peso"
6032
  msgstr ""
6033
 
6034
+ #: wpuf-functions.php:1811
6035
  msgid "Bangladeshi Taka"
6036
  msgstr ""
6037
 
6038
+ #: wpuf-functions.php:1812
6039
  msgid "Brazilian Real"
6040
  msgstr ""
6041
 
6042
+ #: wpuf-functions.php:1813
6043
  msgid "Bulgarian Lev"
6044
  msgstr ""
6045
 
6046
+ #: wpuf-functions.php:1814
6047
  msgid "Canadian Dollars"
6048
  msgstr ""
6049
 
6050
+ #: wpuf-functions.php:1815
6051
  msgid "Chilean Peso"
6052
  msgstr ""
6053
 
6054
+ #: wpuf-functions.php:1816
6055
  msgid "Chinese Yuan"
6056
  msgstr ""
6057
 
6058
+ #: wpuf-functions.php:1817
6059
  msgid "Colombian Peso"
6060
  msgstr ""
6061
 
6062
+ #: wpuf-functions.php:1818
6063
  msgid "Czech Koruna"
6064
  msgstr ""
6065
 
6066
+ #: wpuf-functions.php:1819
6067
  msgid "Danish Krone"
6068
  msgstr ""
6069
 
6070
+ #: wpuf-functions.php:1820
6071
  msgid "Dominican Peso"
6072
  msgstr ""
6073
 
6074
+ #: wpuf-functions.php:1821
6075
  msgid "Algerian Dinar"
6076
  msgstr ""
6077
 
6078
+ #: wpuf-functions.php:1822
6079
  msgid "Euros"
6080
  msgstr ""
6081
 
6082
+ #: wpuf-functions.php:1823
6083
  msgid "Hong Kong Dollar"
6084
  msgstr ""
6085
 
6086
+ #: wpuf-functions.php:1824
6087
  msgid "Croatia kuna"
6088
  msgstr ""
6089
 
6090
+ #: wpuf-functions.php:1825
6091
  msgid "Hungarian Forint"
6092
  msgstr ""
6093
 
6094
+ #: wpuf-functions.php:1826
6095
  msgid "Icelandic krona"
6096
  msgstr ""
6097
 
6098
+ #: wpuf-functions.php:1827
6099
  msgid "Indonesia Rupiah"
6100
  msgstr ""
6101
 
6102
+ #: wpuf-functions.php:1828
6103
  msgid "Indian Rupee"
6104
  msgstr ""
6105
 
6106
+ #: wpuf-functions.php:1829
6107
  msgid "Nepali Rupee"
6108
  msgstr ""
6109
 
6110
+ #: wpuf-functions.php:1830
6111
  msgid "Israeli Shekel"
6112
  msgstr ""
6113
 
6114
+ #: wpuf-functions.php:1831
6115
  msgid "Japanese Yen"
6116
  msgstr ""
6117
 
6118
+ #: wpuf-functions.php:1832
6119
  msgid "Lao Kip"
6120
  msgstr ""
6121
 
6122
+ #: wpuf-functions.php:1833
6123
  msgid "South Korean Won"
6124
  msgstr ""
6125
 
6126
+ #: wpuf-functions.php:1834
6127
  msgid "Malaysian Ringgits"
6128
  msgstr ""
6129
 
6130
+ #: wpuf-functions.php:1835
6131
  msgid "Mexican Peso"
6132
  msgstr ""
6133
 
6134
+ #: wpuf-functions.php:1836
6135
  msgid "Nigerian Naira"
6136
  msgstr ""
6137
 
6138
+ #: wpuf-functions.php:1837
6139
  msgid "Norwegian Krone"
6140
  msgstr ""
6141
 
6142
+ #: wpuf-functions.php:1838
6143
  msgid "New Zealand Dollar"
6144
  msgstr ""
6145
 
6146
+ #: wpuf-functions.php:1839
6147
  msgid "Omani Rial"
6148
  msgstr ""
6149
 
6150
+ #: wpuf-functions.php:1840
6151
  msgid "Iranian Rial"
6152
  msgstr ""
6153
 
6154
+ #: wpuf-functions.php:1841
6155
  msgid "Pakistani Rupee"
6156
  msgstr ""
6157
 
6158
+ #: wpuf-functions.php:1842
6159
  msgid "Paraguayan Guaraní"
6160
  msgstr ""
6161
 
6162
+ #: wpuf-functions.php:1843
6163
  msgid "Philippine Pesos"
6164
  msgstr ""
6165
 
6166
+ #: wpuf-functions.php:1844
6167
  msgid "Polish Zloty"
6168
  msgstr ""
6169
 
6170
+ #: wpuf-functions.php:1845
6171
  msgid "Pounds Sterling"
6172
  msgstr ""
6173
 
6174
+ #: wpuf-functions.php:1846
6175
  msgid "Romanian Leu"
6176
  msgstr ""
6177
 
6178
+ #: wpuf-functions.php:1847
6179
  msgid "Russian Ruble"
6180
  msgstr ""
6181
 
6182
+ #: wpuf-functions.php:1848
6183
  msgid "Saudi Riyal"
6184
  msgstr ""
6185
 
6186
+ #: wpuf-functions.php:1849
6187
  msgid "Singapore Dollar"
6188
  msgstr ""
6189
 
6190
+ #: wpuf-functions.php:1850
6191
  msgid "South African rand"
6192
  msgstr ""
6193
 
6194
+ #: wpuf-functions.php:1851
6195
  msgid "Swedish Krona"
6196
  msgstr ""
6197
 
6198
+ #: wpuf-functions.php:1852
6199
  msgid "Swiss Franc"
6200
  msgstr ""
6201
 
6202
+ #: wpuf-functions.php:1853
6203
  msgid "Taiwan New Dollars"
6204
  msgstr ""
6205
 
6206
+ #: wpuf-functions.php:1854
6207
  msgid "Thai Baht"
6208
  msgstr ""
6209
 
6210
+ #: wpuf-functions.php:1855
6211
  msgid "Turkish Lira"
6212
  msgstr ""
6213
 
6214
+ #: wpuf-functions.php:1856
6215
  msgid "US Dollar"
6216
  msgstr ""
6217
 
6218
+ #: wpuf-functions.php:1857
6219
  msgid "Vietnamese Dong"
6220
  msgstr ""
6221
 
6222
+ #: wpuf-functions.php:1858
6223
  msgid "Egyptian Pound"
6224
  msgstr ""
6225
 
6226
+ #: wpuf-functions.php:2698
6227
  msgid "None"
6228
  msgstr ""
6229
 
6268
  msgid "Please Cancel Your Currently Active Pack first!"
6269
  msgstr ""
6270
 
6271
+ #: wpuf.php:875
6272
  msgid "Error: Nonce verification failed"
6273
  msgstr ""
6274
 
6350
  msgid "Searching&hellip;"
6351
  msgstr ""
6352
 
6353
+ #: wpuf-functions.php:1258
6354
  msgctxt "tag delimiter"
6355
  msgid ","
6356
  msgstr ""
lib/gateway/bank.php CHANGED
@@ -64,7 +64,7 @@ class WPUF_Gateway_Bank {
64
 
65
  $data['subtotal'] = $data['price'];
66
  $data['price'] = apply_filters( 'wpuf_payment_amount', $data['price'] );
67
- $data['tax'] = $data['price'] - $data['subtotal'];
68
 
69
  if ( $order_id ) {
70
  update_post_meta( $order_id, '_data', $data );
64
 
65
  $data['subtotal'] = $data['price'];
66
  $data['price'] = apply_filters( 'wpuf_payment_amount', $data['price'] );
67
+ $data['tax'] = floatval( $data['price'] ) - floatval( $data['subtotal'] );
68
 
69
  if ( $order_id ) {
70
  update_post_meta( $order_id, '_data', $data );
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: tareq1988, nizamuddinbabu, sk.shaikat, rabbii, itowhid06, wedevs
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership
5
  Requires at least: 4.0
6
- Tested up to: 5.2.1
7
  Requires PHP: 5.6
8
- Stable tag: 3.1.7
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -257,6 +257,14 @@ redirected to the edit page with that post id. Then you'll see the edit post for
257
 
258
  == Changelog ==
259
 
 
 
 
 
 
 
 
 
260
  = v3.1.7 (31 May, 2019) =
261
 
262
  * **Fix:** check for 'button_label' existence before using it.
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership
5
  Requires at least: 4.0
6
+ Tested up to: 5.2.2
7
  Requires PHP: 5.6
8
+ Stable tag: 3.1.8
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
257
 
258
  == Changelog ==
259
 
260
+ = v3.1.8 (26 June, 2019) =
261
+
262
+ * **Fix:** Multistep form was scrolling to the top of the browser instead of moving to the top of the form when clicking on `Next` or `Previous` button.
263
+ * **Fix:** Uploaded images were not showing in the ACF gallery field.
264
+ * **Fix:** Billing address was not saved from the frontend payment page.
265
+ * **Fix:** Added translation functions to the missing strings.
266
+ * **Fix:** Dependency styles error of Gutenblock-editor.css.
267
+
268
  = v3.1.7 (31 May, 2019) =
269
 
270
  * **Fix:** check for 'button_label' existence before using it.
wpuf-functions.php CHANGED
@@ -774,7 +774,8 @@ function wpuf_show_custom_fields( $content ) {
774
  $extension = pathinfo($path, PATHINFO_EXTENSION);
775
 
776
  if( $thumb ) {
777
- $playable = isset( $attr['playable_audio_video'] ) ? $attr['playable_audio_video'] : 'no';$wpuf_allowed_extensions = wpuf_allowed_extensions();
 
778
  $allowed_audio_extensions = explode( ',', $wpuf_allowed_extensions['audio']['ext'] );
779
  $allowed_video_extensions = explode( ',', $wpuf_allowed_extensions['video']['ext'] );
780
  $allowed_extenstions = array_merge( $allowed_audio_extensions, $allowed_video_extensions );
@@ -2964,7 +2965,7 @@ add_action( 'wp_ajax_nopriv_wpuf_update_billing_address', 'wpuf_update_billing_a
2964
  */
2965
 
2966
  function wpuf_get_user_address() {
2967
- $user_id = get_current_user_id();
2968
  $address_fields = array();
2969
 
2970
  if ( metadata_exists( 'user', $user_id, 'wpuf_address_fields') ) {
774
  $extension = pathinfo($path, PATHINFO_EXTENSION);
775
 
776
  if( $thumb ) {
777
+ $playable = isset( $attr['playable_audio_video'] ) ? $attr['playable_audio_video'] : 'no';
778
+ $wpuf_allowed_extensions = wpuf_allowed_extensions();
779
  $allowed_audio_extensions = explode( ',', $wpuf_allowed_extensions['audio']['ext'] );
780
  $allowed_video_extensions = explode( ',', $wpuf_allowed_extensions['video']['ext'] );
781
  $allowed_extenstions = array_merge( $allowed_audio_extensions, $allowed_video_extensions );
2965
  */
2966
 
2967
  function wpuf_get_user_address() {
2968
+ $user_id = get_current_user_id();
2969
  $address_fields = array();
2970
 
2971
  if ( metadata_exists( 'user', $user_id, 'wpuf_address_fields') ) {
wpuf.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP User Frontend
4
  Plugin URI: https://wordpress.org/plugins/wp-user-frontend/
5
  Description: Create, edit, delete, manages your post, pages or custom post types from frontend. Create registration forms, frontend profile and more...
6
  Author: Tareq Hasan
7
- Version: 3.1.7
8
  Author URI: https://tareq.co
9
  License: GPL2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Text Domain: wp-user-frontend
12
  Domain Path: /languages
13
  */
14
 
15
- define( 'WPUF_VERSION', '3.1.7' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', dirname( __FILE__ ) );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
@@ -776,8 +776,10 @@ final class WP_User_Frontend {
776
  $roles = $roles ? $roles : array();
777
  $current_user = wp_get_current_user();
778
 
779
- if ( !in_array( $current_user->roles[0], $roles ) ) {
780
- return false;
 
 
781
  }
782
 
783
  return $val;
4
  Plugin URI: https://wordpress.org/plugins/wp-user-frontend/
5
  Description: Create, edit, delete, manages your post, pages or custom post types from frontend. Create registration forms, frontend profile and more...
6
  Author: Tareq Hasan
7
+ Version: 3.1.8
8
  Author URI: https://tareq.co
9
  License: GPL2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
  Domain Path: /languages
13
  */
14
 
15
+ define( 'WPUF_VERSION', '3.1.8' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', dirname( __FILE__ ) );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
776
  $roles = $roles ? $roles : array();
777
  $current_user = wp_get_current_user();
778
 
779
+ if ( isset( $current_user->roles[0] ) ) {
780
+ if ( !in_array( $current_user->roles[0], $roles ) ) {
781
+ return false;
782
+ }
783
  }
784
 
785
  return $val;