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

Version Description

Download this release

Release Info

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

Code changes from version 3.5.25 to 3.5.26

admin/class-admin-subscription.php CHANGED
@@ -149,7 +149,7 @@ class WPUF_Admin_Subscription {
149
  foreach ( $user_pack['posts'] as $type => $value ) {
150
  $user_pack['posts'][ $type ] = isset( $_POST[ $type ] ) ? sanitize_text_field( wp_unslash( $_POST[ $type ] ) ) : 0;
151
  }
152
- $user_pack['expire'] = isset( $_POST['expire'] ) ? wpuf_date2mysql( sanitize_text_field( wp_unslash( $_POST['expire'] ) ) ) : $user_pack['expire'];
153
  }
154
  wpuf_get_user( $user_id )->subscription()->update_meta( $user_pack );
155
  } else {
149
  foreach ( $user_pack['posts'] as $type => $value ) {
150
  $user_pack['posts'][ $type ] = isset( $_POST[ $type ] ) ? sanitize_text_field( wp_unslash( $_POST[ $type ] ) ) : 0;
151
  }
152
+ $user_pack['expire'] = isset( $_POST['expire'] ) && 'Unlimited' !== $_POST['expire'] ? wpuf_date2mysql( sanitize_text_field( wp_unslash( $_POST['expire'] ) ) ) : $user_pack['expire'];
153
  }
154
  wpuf_get_user( $user_id )->subscription()->update_meta( $user_pack );
155
  } else {
admin/form-builder/assets/js/form-builder.js CHANGED
@@ -143,10 +143,12 @@
143
 
144
  // add new form field element
145
  add_form_field_element: function (state, payload) {
 
146
  state.form_fields.splice(payload.toIndex, 0, payload.field);
147
  var sprintf = wp.i18n.sprintf;
148
  var __ = wp.i18n.__;
149
- // bring newly added element into viewport
 
150
  Vue.nextTick(function () {
151
  var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
152
  if ('yes' == payload.field.is_meta && state.show_custom_field_tooltip) {
@@ -537,7 +539,7 @@
537
 
538
  var form_id = $('#wpuf-form-builder [name="wpuf_form_id"]').val();
539
 
540
- if ( typeof tinyMCE !== 'undefined' ) {
541
  $('textarea[name="wpuf_settings[notification][verification_body]"]').val(tinyMCE.get('wpuf_verification_body_' + form_id).getContent());
542
  $('textarea[name="wpuf_settings[notification][welcome_email_body]"]').val(tinyMCE.get('wpuf_welcome_email_body_' + form_id).getContent());
543
  }
143
 
144
  // add new form field element
145
  add_form_field_element: function (state, payload) {
146
+
147
  state.form_fields.splice(payload.toIndex, 0, payload.field);
148
  var sprintf = wp.i18n.sprintf;
149
  var __ = wp.i18n.__;
150
+ // bring newly added element into viewport, do not show for reg form
151
+ if ( window.location.search.substring(1).split('&').includes('page=wpuf-profile-forms') ) return;
152
  Vue.nextTick(function () {
153
  var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
154
  if ('yes' == payload.field.is_meta && state.show_custom_field_tooltip) {
539
 
540
  var form_id = $('#wpuf-form-builder [name="wpuf_form_id"]').val();
541
 
542
+ if ( typeof tinyMCE !== 'undefined' && window.location.search.substring(1).split('&').includes('page=wpuf-profile-forms') ) {
543
  $('textarea[name="wpuf_settings[notification][verification_body]"]').val(tinyMCE.get('wpuf_verification_body_' + form_id).getContent());
544
  $('textarea[name="wpuf_settings[notification][welcome_email_body]"]').val(tinyMCE.get('wpuf_welcome_email_body_' + form_id).getContent());
545
  }
admin/html/whats-new.php CHANGED
@@ -1,5 +1,16 @@
1
  <?php
2
  $changelog = [
 
 
 
 
 
 
 
 
 
 
 
3
  [
4
  'version' => 'Version 3.5.25',
5
  'released' => '2021-11-18',
1
  <?php
2
  $changelog = [
3
+ [
4
+ 'version' => 'Version 3.5.26',
5
+ 'released' => '2021-12-24',
6
+ 'changes' => [
7
+
8
+ [
9
+ 'title' => __( 'Promotion notice enhanced through api', 'wp-user-frontend' ),
10
+ 'type' => 'Enhancement',
11
+ ],
12
+ ],
13
+ ],
14
  [
15
  'version' => 'Version 3.5.25',
16
  'released' => '2021-11-18',
admin/promotion.php CHANGED
@@ -4,6 +4,7 @@
4
  * Promotional offer class
5
  */
6
  class WPUF_Admin_Promotion {
 
7
 
8
  public function __construct() {
9
  add_action( 'admin_notices', [ $this, 'promotional_offer' ] );
@@ -24,18 +25,44 @@ class WPUF_Admin_Promotion {
24
  return;
25
  }
26
  // Showing only for Uf menu
27
- if ( 'wp-user-frontend' !== get_admin_page_parent() ){
28
  return;
29
  }
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  $current_time = $this->convert_utc_to_est();
32
 
33
  if (
34
- strtotime( '2021-11-19 09:00:00 EST' ) < strtotime( $current_time )
35
- && strtotime( $current_time ) < strtotime( '2021-11-30 11:00:00 EST' )
36
  ) {
37
- $option_name = 'wpuf-bfcm2021';
38
- $notice = sprintf( '<p>%s <a href="%s" target="_blank">%s</a></p>', __( 'Irresistible Black Friday & Cyber Monday Deals. Enjoy Up To 50% OFF on WP User Frontend Pro.', 'wp-user-frontend' ), 'https://wedevs.com/wp-user-frontend-pro/pricing?utm_medium=text&utm_source=wordpress-wpuf-bfcm2021', __( 'Get Now', 'wp-user-frontend' ) );
39
  $this->generate_notice( $notice, $option_name );
40
  }
41
  }
4
  * Promotional offer class
5
  */
6
  class WPUF_Admin_Promotion {
7
+ const PROMO_KEY = 'wpuf_promo_notices';
8
 
9
  public function __construct() {
10
  add_action( 'admin_notices', [ $this, 'promotional_offer' ] );
25
  return;
26
  }
27
  // Showing only for Uf menu
28
+ if ( 'wp-user-frontend' !== get_admin_page_parent() ) {
29
  return;
30
  }
31
 
32
+ $promos = get_transient( self::PROMO_KEY );
33
+
34
+ if ( false === $promos ) {
35
+ $promo_notice_url = 'https://raw.githubusercontent.com/weDevsOfficial/wp-user-frontend/develop/assets/js/promotion.json';
36
+ $response = wp_remote_get( $promo_notice_url, array( 'timeout' => 15 ) );
37
+ $promos = wp_remote_retrieve_body( $response );
38
+
39
+ if ( is_wp_error( $response ) || $response['response']['code'] !== 200 ) {
40
+ $promos = '[]';
41
+ }
42
+
43
+ set_transient( self::PROMO_KEY, $promos, DAY_IN_SECONDS );
44
+ }
45
+
46
+ $promos = json_decode( $promos, true );
47
+
48
+ if ( empty( $promos ) || ! is_array( $promos ) ) {
49
+ return;
50
+ }
51
+
52
+ $option_name = $promos['key'];
53
+ $start_date = $promos['start_date'];
54
+ $end_date = $promos['end_date'];
55
+ $content = $promos['content'] . '.' . $promos['title'];
56
+ $action_url = $promos['action_url'];
57
+ $action_title = $promos['action_title'];
58
+
59
  $current_time = $this->convert_utc_to_est();
60
 
61
  if (
62
+ strtotime( $start_date ) < strtotime( $current_time )
63
+ && strtotime( $current_time ) < strtotime( $end_date )
64
  ) {
65
+ $notice = sprintf( '<p>%s <a href="%s" target="_blank">%s</a></p>', __( $content, 'wp-user-frontend' ), $action_url, __( $action_title, 'wp-user-frontend' ) );
 
66
  $this->generate_notice( $notice, $option_name );
67
  }
68
  }
assets/js/frontend-form.js CHANGED
@@ -90,7 +90,7 @@
90
  },
91
 
92
  warningOnExit: function () {
93
- $('input[name="submit"]').on('click', function () {
94
  window.onbeforeunload = null;
95
  return;
96
  });
90
  },
91
 
92
  warningOnExit: function () {
93
+ $('input[name="submit"], #wpuf-post-draft').on('click', function () {
94
  window.onbeforeunload = null;
95
  return;
96
  });
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),b.matchMedia("(max-width: 600px)").matches&&(a("table.items-table tr td .post-edit-icon").click(function(b){b.preventDefault(),a(this).parents("tr").find(".data-column").toggleClass("flex-column"),a(this).toggleClass("toggle-icon")}),a(".wpuf-dashboard-navigation ul li:first-child").after().click(function(b){b.preventDefault(),a(".wpuf-dashboard-navigation ul li").not(":first").toggle()})),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()})}),this.warningOnExit()},warningOnExit:function(){a('input[name="submit"]').on("click",function(){b.onbeforeunload=null}),a(".wpuf-form-add").on("change",function(){a(".wpuf-form-add input, .wpuf-form-add select, .wpuf-form-add textarea").each(function(c){"hidden"===a(this).attr("type")&&"submit"===a(this).attr("type")&&-1===a(this).val()||(b.onbeforeunload=function(){return"you have changes"})})})},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=a("form.wpuf-form-add"),i=h.offset().top;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(){a(".category-wrap").on("change",".cat-ajax",function(){var b=a(this).data("form-id");currentLevel=parseInt(a(this).parent().attr("level")),WP_User_Frontend.getChildCats(a(this),currentLevel+1,"category",b)})},getChildCats:function(b,c,d,e){var f=a(b).val(),g="wpuf-category-dropdown-lvl-"+c,d=void 0!==d?d:"category",h=a(b).siblings("span").data("taxonomy");a.ajax({type:"post",url:wpuf_frontend.ajaxurl,data:{action:"wpuf_get_child_cat",catID:f,nonce:wpuf_frontend.nonce,field_attr:h,form_id:e},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="'+g+'" level="'+c+'"></div>'),b.parent().parent().find("#"+g).html(e).slideDown("fast")),a(document).trigger("wpuf-ajax-fetched-child-categories",g,c,d)}})},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,d=(c.find("input[type=submit]"),WP_User_Frontend.validateForm(c));return 0==d&&WP_User_Frontend.addErrorNotice(self,"bottom"),d},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,d="";WP_User_Frontend.removeErrors(b),WP_User_Frontend.removeErrorNotice(b),b.find('[data-required="yes"]:visible').each(function(b,e){var f=a(e).data("type"),g="";switch(f){case"rich":var h=a(e).data("id");""===(g=a.trim(tinyMCE.get(h).getContent()))&&(c=!0,WP_User_Frontend.markError(e));break;case"textarea":case"text":""===(g=a.trim(a(e).val()))&&(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"password":case"confirm_password":var i=a(e).data("repeat");if(g=a.trim(a(e).val()),""===g&&(c=!0,d="required",WP_User_Frontend.markError(e,d)),i){var j=a('[data-type="confirm_password"]').eq(0);j.val()!=g&&(c=!0,d="mismatch",WP_User_Frontend.markError(j,d))}break;case"select":(g=a(e).val())&&"-1"!==g||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"multiselect":null!==(g=a(e).val())&&0!==g.length||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"tax-checkbox":var k=a(e).children().find("input:checked").length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"radio":var k=a(e).find("input:checked").length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"file":var k=a(e).find("ul").children().length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"email":var g=a(e).val();""!==g?WP_User_Frontend.isValidEmail(g)||(c=!0,d="validation",WP_User_Frontend.markError(e,d)):""===g&&(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"url":var g=a(e).val();""!==g&&(WP_User_Frontend.isValidURL(g)||(c=!0,d="validation",WP_User_Frontend.markError(e,d)))}});var e=b.find('[data-required="yes"]').parents(".wpuf-form-google-map-container");if(a.each(e,function(b,e){""==a(e).val()&&(c=!0,d="required",WP_User_Frontend.markError(e,d))}),c)return WP_User_Frontend.addErrorNotice(b,"end"),!1;var f=b.serialize(),g=[];return a(".wpuf-rich-validation",b).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))}),f=f+"&"+g.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){if(a(b).closest("div").addClass("has-error"),c){var d="",e=a(b).data("label");switch(d=e||a(b).closest("li").data("label"),c){case"required":case"mismatch":case"validation":d=d+" "+error_str_obj[c];break;case"limit":d=""}a(b).siblings(".wpuf-error-msg").remove(),"DIV"===a(b).prev().prop("nodeName")?a(b).append('<div class="wpuf-error-msg">'+d+"</div>"):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:wpuf_frontend_upload.max_filesize,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,e,f){"no"===d?(a("textarea#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b,e,f)}),a("input#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b,e,f)}),a("textarea#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b,e,f)},100)}),a("input#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b,e,f)},100)})):setTimeout(function(){tinyMCE.get(c).onKeyDown.add(function(a,c){WP_User_Frontend.editorLimit.tinymce.onKeyDown(a,c,b,e,f)}),tinyMCE.get(c).onPaste.add(function(a,c){setTimeout(function(){WP_User_Frontend.editorLimit.tinymce.onPaste(a,c,b,e,f)},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,e,f){field=a(".post_content");var g=WP_User_Frontend.editorLimit.tinymce.getStats(b).chars+1;"word"===e&&(g=WP_User_Frontend.editorLimit.tinymce.getStats(b).words),d&&g>d&&"max"===f?(WP_User_Frontend.editorLimit.blockTyping(c),WP_User_Frontend.markError(field,"limit"),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend["word_"+f]+g+"/"+d)):d&&g<d&&"min"===f?(WP_User_Frontend.markError(field,"limit"),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend["word_"+f]+g+"/"+d)):(field.removeClass("has-error"),jQuery(".mce-path-item.mce-last",b.container).html(""))},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,d,e){var f=a(this),g=f.val().length+1;"word"===d&&(g=f.val().split(" ").length),c&&g>c&&"max"===e?(WP_User_Frontend.content_limit_message(f,d,e,c),WP_User_Frontend.editorLimit.blockTyping(b)):c&&g<c&&"min"===e?WP_User_Frontend.content_limit_message(f,d,e,c):(f.closest("li").removeClass("has-error"),f.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html("")),"paste"===b.type&&(f.val(content.substring(0,c)),"word"===d&&f.val(content.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))})}},doUncheckRadioBtn:function(a){a.checked=!1},content_limit_message:function(a,b,c,d){WP_User_Frontend.markError(a,"limit"),"word"===b&&(limit_message=wpuf_frontend["word_"+c]+d),"character"===b&&(limit_message=wpuf_frontend["char_"+c]+d),a.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(limit_message)}},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),b.matchMedia("(max-width: 600px)").matches&&(a("table.items-table tr td .post-edit-icon").click(function(b){b.preventDefault(),a(this).parents("tr").find(".data-column").toggleClass("flex-column"),a(this).toggleClass("toggle-icon")}),a(".wpuf-dashboard-navigation ul li:first-child").after().click(function(b){b.preventDefault(),a(".wpuf-dashboard-navigation ul li").not(":first").toggle()})),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()})}),this.warningOnExit()},warningOnExit:function(){a('input[name="submit"], #wpuf-post-draft').on("click",function(){b.onbeforeunload=null}),a(".wpuf-form-add").on("change",function(){a(".wpuf-form-add input, .wpuf-form-add select, .wpuf-form-add textarea").each(function(c){"hidden"===a(this).attr("type")&&"submit"===a(this).attr("type")&&-1===a(this).val()||(b.onbeforeunload=function(){return"you have changes"})})})},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=a("form.wpuf-form-add"),i=h.offset().top;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(){a(".category-wrap").on("change",".cat-ajax",function(){var b=a(this).data("form-id");currentLevel=parseInt(a(this).parent().attr("level")),WP_User_Frontend.getChildCats(a(this),currentLevel+1,"category",b)})},getChildCats:function(b,c,d,e){var f=a(b).val(),g="wpuf-category-dropdown-lvl-"+c,d=void 0!==d?d:"category",h=a(b).siblings("span").data("taxonomy");a.ajax({type:"post",url:wpuf_frontend.ajaxurl,data:{action:"wpuf_get_child_cat",catID:f,nonce:wpuf_frontend.nonce,field_attr:h,form_id:e},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="'+g+'" level="'+c+'"></div>'),b.parent().parent().find("#"+g).html(e).slideDown("fast")),a(document).trigger("wpuf-ajax-fetched-child-categories",g,c,d)}})},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,d=(c.find("input[type=submit]"),WP_User_Frontend.validateForm(c));return 0==d&&WP_User_Frontend.addErrorNotice(self,"bottom"),d},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,d="";WP_User_Frontend.removeErrors(b),WP_User_Frontend.removeErrorNotice(b),b.find('[data-required="yes"]:visible').each(function(b,e){var f=a(e).data("type"),g="";switch(f){case"rich":var h=a(e).data("id");""===(g=a.trim(tinyMCE.get(h).getContent()))&&(c=!0,WP_User_Frontend.markError(e));break;case"textarea":case"text":""===(g=a.trim(a(e).val()))&&(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"password":case"confirm_password":var i=a(e).data("repeat");if(g=a.trim(a(e).val()),""===g&&(c=!0,d="required",WP_User_Frontend.markError(e,d)),i){var j=a('[data-type="confirm_password"]').eq(0);j.val()!=g&&(c=!0,d="mismatch",WP_User_Frontend.markError(j,d))}break;case"select":(g=a(e).val())&&"-1"!==g||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"multiselect":null!==(g=a(e).val())&&0!==g.length||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"tax-checkbox":var k=a(e).children().find("input:checked").length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"radio":var k=a(e).find("input:checked").length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"file":var k=a(e).find("ul").children().length;k||(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"email":var g=a(e).val();""!==g?WP_User_Frontend.isValidEmail(g)||(c=!0,d="validation",WP_User_Frontend.markError(e,d)):""===g&&(c=!0,d="required",WP_User_Frontend.markError(e,d));break;case"url":var g=a(e).val();""!==g&&(WP_User_Frontend.isValidURL(g)||(c=!0,d="validation",WP_User_Frontend.markError(e,d)))}});var e=b.find('[data-required="yes"]').parents(".wpuf-form-google-map-container");if(a.each(e,function(b,e){""==a(e).val()&&(c=!0,d="required",WP_User_Frontend.markError(e,d))}),c)return WP_User_Frontend.addErrorNotice(b,"end"),!1;var f=b.serialize(),g=[];return a(".wpuf-rich-validation",b).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))}),f=f+"&"+g.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){if(a(b).closest("div").addClass("has-error"),c){var d="",e=a(b).data("label");switch(d=e||a(b).closest("li").data("label"),c){case"required":case"mismatch":case"validation":d=d+" "+error_str_obj[c];break;case"limit":d=""}a(b).siblings(".wpuf-error-msg").remove(),"DIV"===a(b).prev().prop("nodeName")?a(b).append('<div class="wpuf-error-msg">'+d+"</div>"):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:wpuf_frontend_upload.max_filesize,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,e,f){"no"===d?(a("textarea#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b,e,f)}),a("input#"+c).keydown(function(a){WP_User_Frontend.editorLimit.textLimit.call(this,a,b,e,f)}),a("textarea#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b,e,f)},100)}),a("input#"+c).on("paste",function(c){var d=a(this);setTimeout(function(){WP_User_Frontend.editorLimit.textLimit.call(d,c,b,e,f)},100)})):setTimeout(function(){tinyMCE.get(c).onKeyDown.add(function(a,c){WP_User_Frontend.editorLimit.tinymce.onKeyDown(a,c,b,e,f)}),tinyMCE.get(c).onPaste.add(function(a,c){setTimeout(function(){WP_User_Frontend.editorLimit.tinymce.onPaste(a,c,b,e,f)},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,e,f){field=a(".post_content");var g=WP_User_Frontend.editorLimit.tinymce.getStats(b).chars+1;"word"===e&&(g=WP_User_Frontend.editorLimit.tinymce.getStats(b).words),d&&g>d&&"max"===f?(WP_User_Frontend.editorLimit.blockTyping(c),WP_User_Frontend.markError(field,"limit"),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend["word_"+f]+g+"/"+d)):d&&g<d&&"min"===f?(WP_User_Frontend.markError(field,"limit"),jQuery(".mce-path-item.mce-last",b.container).html(wpuf_frontend["word_"+f]+g+"/"+d)):(field.removeClass("has-error"),jQuery(".mce-path-item.mce-last",b.container).html(""))},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,d,e){var f=a(this),g=f.val().length+1;"word"===d&&(g=f.val().split(" ").length),c&&g>c&&"max"===e?(WP_User_Frontend.content_limit_message(f,d,e,c),WP_User_Frontend.editorLimit.blockTyping(b)):c&&g<c&&"min"===e?WP_User_Frontend.content_limit_message(f,d,e,c):(f.closest("li").removeClass("has-error"),f.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html("")),"paste"===b.type&&(f.val(content.substring(0,c)),"word"===d&&f.val(content.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))})}},doUncheckRadioBtn:function(a){a.checked=!1},content_limit_message:function(a,b,c,d){WP_User_Frontend.markError(a,"limit"),"word"===b&&(limit_message=wpuf_frontend["word_"+c]+d),"character"===b&&(limit_message=wpuf_frontend["char_"+c]+d),a.closest(".wpuf-fields").find("span.wpuf-wordlimit-message").html(limit_message)}},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);
assets/js/promotion.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "key": "wpuf-holidaysale2021",
3
+ "start_date": "2021-12-24 09:00:00 EST",
4
+ "end_date": "2022-01-12 23:00:00 EST",
5
+ "title": "Happy Holidays",
6
+ "content": "Let The Festivities Begin. Enjoy Up To 35% OFF on Dokan Pro.",
7
+ "action_url": "https://wedevs.com/wp-user-frontend-pro/pricing?utm_medium=text&utm_source=wordpress-wpuf-holidaysale2021",
8
+ "action_title": "Get Now →"
9
+ }
assets/js/wpuf-form-builder.js CHANGED
@@ -143,10 +143,12 @@
143
 
144
  // add new form field element
145
  add_form_field_element: function (state, payload) {
 
146
  state.form_fields.splice(payload.toIndex, 0, payload.field);
147
  var sprintf = wp.i18n.sprintf;
148
  var __ = wp.i18n.__;
149
- // bring newly added element into viewport
 
150
  Vue.nextTick(function () {
151
  var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
152
  if ('yes' == payload.field.is_meta && state.show_custom_field_tooltip) {
@@ -537,7 +539,7 @@
537
 
538
  var form_id = $('#wpuf-form-builder [name="wpuf_form_id"]').val();
539
 
540
- if ( typeof tinyMCE !== 'undefined' ) {
541
  $('textarea[name="wpuf_settings[notification][verification_body]"]').val(tinyMCE.get('wpuf_verification_body_' + form_id).getContent());
542
  $('textarea[name="wpuf_settings[notification][welcome_email_body]"]').val(tinyMCE.get('wpuf_welcome_email_body_' + form_id).getContent());
543
  }
143
 
144
  // add new form field element
145
  add_form_field_element: function (state, payload) {
146
+
147
  state.form_fields.splice(payload.toIndex, 0, payload.field);
148
  var sprintf = wp.i18n.sprintf;
149
  var __ = wp.i18n.__;
150
+ // bring newly added element into viewport, do not show for reg form
151
+ if ( window.location.search.substring(1).split('&').includes('page=wpuf-profile-forms') ) return;
152
  Vue.nextTick(function () {
153
  var el = $('#form-preview-stage .wpuf-form .field-items').eq(payload.toIndex);
154
  if ('yes' == payload.field.is_meta && state.show_custom_field_tooltip) {
539
 
540
  var form_id = $('#wpuf-form-builder [name="wpuf_form_id"]').val();
541
 
542
+ if ( typeof tinyMCE !== 'undefined' && window.location.search.substring(1).split('&').includes('page=wpuf-profile-forms') ) {
543
  $('textarea[name="wpuf_settings[notification][verification_body]"]').val(tinyMCE.get('wpuf_verification_body_' + form_id).getContent());
544
  $('textarea[name="wpuf_settings[notification][welcome_email_body]"]').val(tinyMCE.get('wpuf_welcome_email_body_' + form_id).getContent());
545
  }
changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  = v3.5.25 (18 Nov, 2021) =
2
 
 
 
 
 
3
  * Fix - Security Vulnerability fixed
4
 
5
  = v3.5.22 (28 Oct, 2021) =
1
  = v3.5.25 (18 Nov, 2021) =
2
 
3
+ * Enhancement - Promotion notice enhanced through api
4
+
5
+ = v3.5.25 (18 Nov, 2021) =
6
+
7
  * Fix - Security Vulnerability fixed
8
 
9
  = v3.5.22 (28 Oct, 2021) =
includes/class-gutenblock.php CHANGED
@@ -10,8 +10,6 @@ class WPUF_Form_Block {
10
  */
11
  public function __construct() {
12
  //Enqueue the Dashicons script as they are not loading
13
- //when wpuf_form shortcode exists in admin pages.
14
- add_action( 'admin_enqueue_scripts', [ $this, 'load_dashicons' ] );
15
  // wait for Gutenberg to enqueue it's block assets
16
  add_action( 'enqueue_block_editor_assets', [ $this, 'wpuf_form_block' ], 10 );
17
  // load the preview information and form
@@ -25,22 +23,24 @@ class WPUF_Form_Block {
25
  }
26
 
27
  public function wpuf_form_block() {
 
 
28
  $js_dir = WPUF_ASSET_URI . '/js/admin/';
29
  $css_dir = WPUF_ASSET_URI . '/css/admin/';
30
 
31
  // Once we have Gutenberg block javascript, we can enqueue our assets
32
- wp_register_script(
33
  'wpuf-forms-block',
34
  $js_dir . 'gutenblock.js',
35
  [ 'wp-blocks', 'wp-editor', 'wp-components', 'wp-i18n', 'wp-element', 'underscore' ]
36
  );
37
 
38
- wp_register_style(
39
  'wpuf-forms-block-style',
40
  $css_dir . 'gutenblock.css',
41
  [ 'wp-edit-blocks' ]
42
  );
43
- wp_register_style(
44
  'wpuf-forms-block-editor',
45
  $css_dir . 'gutenblock-editor.css',
46
  [ 'wp-edit-blocks', 'wpuf-forms-block-style' ]
@@ -106,7 +106,7 @@ class WPUF_Form_Block {
106
  <?php
107
 
108
  // register our script to target the form iFrame in page builder
109
- wp_register_script(
110
  'wpuf-block-setup',
111
  $js_dir . 'blockFrameSetup.js',
112
  [ 'underscore', 'jquery' ]
10
  */
11
  public function __construct() {
12
  //Enqueue the Dashicons script as they are not loading
 
 
13
  // wait for Gutenberg to enqueue it's block assets
14
  add_action( 'enqueue_block_editor_assets', [ $this, 'wpuf_form_block' ], 10 );
15
  // load the preview information and form
23
  }
24
 
25
  public function wpuf_form_block() {
26
+ $this->load_dashicons();
27
+
28
  $js_dir = WPUF_ASSET_URI . '/js/admin/';
29
  $css_dir = WPUF_ASSET_URI . '/css/admin/';
30
 
31
  // Once we have Gutenberg block javascript, we can enqueue our assets
32
+ wp_register_script(
33
  'wpuf-forms-block',
34
  $js_dir . 'gutenblock.js',
35
  [ 'wp-blocks', 'wp-editor', 'wp-components', 'wp-i18n', 'wp-element', 'underscore' ]
36
  );
37
 
38
+ wp_register_style(
39
  'wpuf-forms-block-style',
40
  $css_dir . 'gutenblock.css',
41
  [ 'wp-edit-blocks' ]
42
  );
43
+ wp_register_style(
44
  'wpuf-forms-block-editor',
45
  $css_dir . 'gutenblock-editor.css',
46
  [ 'wp-edit-blocks', 'wpuf-forms-block-style' ]
106
  <?php
107
 
108
  // register our script to target the form iFrame in page builder
109
+ wp_register_script(
110
  'wpuf-block-setup',
111
  $js_dir . 'blockFrameSetup.js',
112
  [ 'underscore', 'jquery' ]
includes/class-list-table-subscribers.php CHANGED
@@ -176,7 +176,7 @@ class WPUF_List_Table_Subscribers extends WP_List_Table {
176
  $sql = 'SELECT * FROM ' . $wpdb->prefix . 'wpuf_subscribers';
177
  $sql .= isset( $_REQUEST['post_ID'] ) ? ' WHERE subscribtion_id = ' . intval( sanitize_text_field( wp_unslash( $_REQUEST['post_ID'] ) ) ): '';
178
 
179
- $sql .= isset( $_REQUEST['status'] ) ? ' AND subscribtion_status = "' . sanitize_text_field( wp_unslash( $_REQUEST['status'] ) ) . '"' : '';
180
 
181
  $this->items = $wpdb->get_results( $sql, OBJECT );
182
 
176
  $sql = 'SELECT * FROM ' . $wpdb->prefix . 'wpuf_subscribers';
177
  $sql .= isset( $_REQUEST['post_ID'] ) ? ' WHERE subscribtion_id = ' . intval( sanitize_text_field( wp_unslash( $_REQUEST['post_ID'] ) ) ): '';
178
 
179
+ $sql .= isset( $_REQUEST['status'] ) ? ' AND subscribtion_status = "' . sanitize_key( wp_unslash( $_REQUEST['status'] ) ) . '"' : '';
180
 
181
  $this->items = $wpdb->get_results( $sql, OBJECT );
182
 
includes/fields/class-field-textarea.php CHANGED
@@ -89,7 +89,7 @@ class WPUF_Form_Field_Textarea extends WPUF_Field_Contract {
89
  if ( isset( $field_settings['content_restriction'] ) && $field_settings['content_restriction'] ) {
90
  $this->check_content_restriction_func(
91
  $field_settings['content_restriction'],
92
- 'no',
93
  $field_settings['name'] . '_' . $form_id,
94
  $field_settings['restriction_type'],
95
  $field_settings['restriction_to']
89
  if ( isset( $field_settings['content_restriction'] ) && $field_settings['content_restriction'] ) {
90
  $this->check_content_restriction_func(
91
  $field_settings['content_restriction'],
92
+ $field_settings['rich'] ? 'yes' : 'no',
93
  $field_settings['name'] . '_' . $form_id,
94
  $field_settings['restriction_type'],
95
  $field_settings['restriction_to']
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: tareq1988, nizamuddinbabu, wedevs
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership, frontend-post
5
  Requires at least: 4.0
6
- Tested up to: 5.8.1
7
  Requires PHP: 5.6
8
- Stable tag: 3.5.25
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
3
  Donate link: https://tareq.co/donate/
4
  Tags: Forms, registration, profile-builder, login, membership, frontend-post
5
  Requires at least: 4.0
6
+ Tested up to: 5.8.2
7
  Requires PHP: 5.6
8
+ Stable tag: 3.5.26
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
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: weDevs
7
- Version: 3.5.25
8
  Author URI: https://wedevs.com/?utm_source=WPUF_Author_URI
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.5.25' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', __DIR__ );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );
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: weDevs
7
+ Version: 3.5.26
8
  Author URI: https://wedevs.com/?utm_source=WPUF_Author_URI
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.5.26' );
16
  define( 'WPUF_FILE', __FILE__ );
17
  define( 'WPUF_ROOT', __DIR__ );
18
  define( 'WPUF_ROOT_URI', plugins_url( '', __FILE__ ) );