diff --git a/README.md b/README.md index 2084e86e..cb06e481 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl | Latest Version |Requires at least|Stable Tag| | :------------: |:------------:|:------------:| -| 2.0.17 | WordPress 4.9 or higher| 2.0.17 | +| 2.0.18 | WordPress 4.9 or higher| 2.0.18 | Features of the plugin include: @@ -48,7 +48,7 @@ GNU Version 2 or Any Later Version Releases ==================== -[Official Release Version: 2.0.17](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.17). +[Official Release Version: 2.0.18](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.18). [Official Release Version: 1.3.88](https://github.com/ultimatemember/ultimatemember/releases). diff --git a/assets/css/um-styles.css b/assets/css/um-styles.css index 9296a16e..1c1053a0 100644 --- a/assets/css/um-styles.css +++ b/assets/css/um-styles.css @@ -621,11 +621,40 @@ input[type=submit].um-button:hover { -moz-border-radius: 4px !important; -webkit-border-radius: 4px !important; border-radius: 4px !important; - border-top: 1px solid rgba(0,0,0,0.0) !important; - border-bottom: 2px solid rgba(0, 0, 0, 0.1) !important; + -webkit-box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); + box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); opacity: 1; } +a.um-button { + font-size: 15px; + border: none !important; + display: block; + width: 100%; + line-height: 1em !important; + padding: 16px 20px !important; + text-decoration: none !important; + text-align: center; + text-transform: none !important; + font-weight: normal !important; + overflow: hidden; + position: relative; + + transition: 0.25s; + box-sizing: border-box; + -moz-border-radius: 4px !important; + -webkit-border-radius: 4px !important; + border-radius: 4px !important; + -webkit-box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); + box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); + opacity: 1; +} + +a.um-button:hover { + -webkit-box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); + box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08); +} + .um-button.um-btn-auto-width { width: auto; diff --git a/assets/js/um-conditional.js b/assets/js/um-conditional.js index c66433d3..11a58835 100644 --- a/assets/js/um-conditional.js +++ b/assets/js/um-conditional.js @@ -12,7 +12,6 @@ jQuery(document).ready( function (){ function um_get_field_default_value( $dom ) { var default_value = ''; var type = um_get_field_type($dom); - switch ( type ) { case 'text': @@ -25,7 +24,6 @@ jQuery(document).ready( function (){ case 'multiselect': default_value = $dom.find('select').val(); - break; case 'radio': @@ -249,7 +247,6 @@ jQuery(document).ready( function (){ } if (condition.operator == 'equals to') { - if (condition.value == live_field_value && um_in_array(live_field_value, $owners_values[condition.owner])) { $owners[condition.owner][index] = true; } else { @@ -505,17 +502,22 @@ jQuery(document).ready( function (){ } } - jQuery(document).on('change', '.um-field select, .um-field input[type=radio], .um-field input[type=checkbox]', function () { + jQuery(document).on('change', '.um-field select, .um-field input[type="radio"], .um-field input[type="checkbox"]', function () { var me = jQuery(this); um_apply_conditions(me, false); }); - jQuery(document).on('input change', '.um-field input[type=text]', function () { + jQuery(document).on('input change', '.um-field input[type="text"]', function () { var me = jQuery(this); um_apply_conditions(me, false); }); - jQuery(document).on('input change', '.um-field input[type=password]', function () { + jQuery(document).on('input change', '.um-field input[type="number"]', function () { + var me = jQuery(this); + um_apply_conditions(me, false); + }); + + jQuery(document).on('input change', '.um-field input[type="password"]', function () { var me = jQuery(this); um_apply_conditions(me, false); }); diff --git a/assets/js/um-conditional.min.js b/assets/js/um-conditional.min.js index 53af0c12..e524467a 100644 --- a/assets/js/um-conditional.min.js +++ b/assets/js/um-conditional.min.js @@ -1 +1 @@ -jQuery(document).ready(function(){function e(e){var n="",a=i(e);switch(a){case"text":case"number":case"date":case"textarea":case"select":n=e.find("input:text,input[type=number],textarea,select").val();break;case"multiselect":n=e.find("select").val();break;case"radio":e.find("input[type=radio]:checked").length>=1&&(n=e.find("input[type=radio]:checked").val());break;case"checkbox":e.find("input[type=checkbox]:checked").length>=1&&(e.find("input[type=checkbox]:checked").length>1?e.find("input[type=checkbox]:checked").each(function(){n=n+jQuery(this).val()+" "}):n=e.find("input[type=checkbox]:checked").val())}return{type:a,value:n}}function n(e){var n=i(e);switch(n){case"text":case"number":case"date":case"textarea":case"select":case"multiselect":case"radio":case"checkbox":return e.find("input,textarea,select")}return""}function i(e){var n="",i=e.attr("class");return jQuery.each(i.split(" "),function(e,i){i.indexOf("um-field-type")!=-1&&(n=i.split("_")[1])}),n}function a(e){var n=[];return jQuery.each(h,function(i,a){a.field.parent==e&&n.push(a.field.condition)}),n}function t(e){return um_live_field=e.parents(".um-field").data("key"),um_live_value=e.val(),e.is(":checkbox")&&(um_live_value="",e.parents(".um-field").find("input:checked").length>1?e.parents(".um-field").find("input:checked").each(function(){um_live_value=um_live_value+jQuery(this).val()+" "}):e.parents(".um-field").find("input:checked").length>=1&&(um_live_value=e.parents(".um-field").find("input:checked").val())),e.is(":radio")&&(um_live_value=e.parents(".um-field").find("input[type=radio]:checked").val()),um_live_value}function c(e,n,i){var a,t=!1,i=!!i;for(a in n)if(i&&n[a]===e||!i&&n[a]==e){t=!0;break}return t}function r(e,n){var a=e.parents(".um-field[data-key]").data("key"),r=p[a],u=t(e),d={},s={},l={};jQuery.each(r,function(e,n){"undefined"==typeof s[n.owner]&&(s[n.owner]=[],l[n.owner]={}),s[n.owner].push(n.value),l[n.owner]=n}),jQuery.each(r,function(n,a){"undefined"==typeof d[a.owner]&&(d[a.owner]={}),"empty"==a.operator&&(!u||""==u&&c(u,s[a.owner])?d[a.owner][n]=!0:d[a.owner][n]=!1),"not empty"==a.operator&&(u&&""!=u&&!c(u,s[a.owner])?d[a.owner][n]=!0:d[a.owner][n]=!1),"equals to"==a.operator&&(a.value==u&&c(u,s[a.owner])?d[a.owner][n]=!0:d[a.owner][n]=!1),"not equals"==a.operator&&(jQuery.isNumeric(a.value)&&parseInt(u)!=parseInt(a.value)&&u&&!c(u,s[a.owner])?d[a.owner][n]=!0:a.value==u||c(u,s[a.owner])?d[a.owner][n]=!1:d[a.owner][n]=!0),"greater than"==a.operator&&(jQuery.isNumeric(a.value)&&parseInt(u)>parseInt(a.value)?d[a.owner][n]=!0:d[a.owner][n]=!1),"less than"==a.operator&&(jQuery.isNumeric(a.value)&&parseInt(u)=0&&c(a.value,u)?d[a.owner][n]=!0:d[a.owner][n]=!1:"checkbox"==i(e.parents(".um-field[data-key]"))?u&&u.indexOf(a.value)>=0?d[a.owner][n]=!0:d[a.owner][n]=!1:u&&u.indexOf(a.value)>=0&&c(u,s[a.owner])?d[a.owner][n]=!0:d[a.owner][n]=!1)}),jQuery.each(d,function(n,i){c(!0,i)?o(e,l[n],!0):o(e,l[n],!1)}),e.trigger("um_fields_change")}function o(e,n,i){var a=jQuery('div.um-field[data-key="'+n.owner+'"]');"show"==n.action&&i&&(a.show(),l(a),u(a)),"show"!=n.action||i||(a.hide(),s(a)),"hide"==n.action&&i&&(a.hide(),s(a)),"hide"!=n.action||i||(a.show(),l(a),u(a)),e.removeClass("um-field-has-changed")}function u(e){var a=i(e),t=e.data("key"),c=v[t];switch(a){case"text":case"number":case"date":case"textarea":e.find("input:text,input[type=number],textareas").val(c.value);break;case"select":e.find("select").find("option").prop("selected",!1),e.find("select").val(c.value),e.find("select").trigger("change");break;case"multiselect":e.find("select").find("option").prop("selected",!1),jQuery.each(c.value,function(n,i){e.find("select").find('option[value="'+i+'"]').attr("selected",!0)}),e.find("select").trigger("change");break;case"checkbox":if(e.find("input[type=checkbox]:checked").length>=1)if(e.find("input[type=checkbox]:checked").removeAttr("checked"),e.find("span.um-field-checkbox-state i").removeClass("um-icon-android-checkbox-outline"),e.find("span.um-field-checkbox-state i").addClass("um-icon-android-checkbox-outline-blank"),e.find(".um-field-checkbox.active").removeClass("active"),jQuery.isArray(c.value))jQuery.each(c.value,function(n,i){var a=e.find('input[type=checkbox][value="'+i+'"]');a.attr("checked",!0),a.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),a.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),a.closest(".um-field-checkbox").addClass("active")});else{var r=e.find('input[type=checkbox][value="'+c.value+'"]');r.attr("checked",!0),r.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),r.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),r.closest(".um-field-checkbox").addClass("active")}break;case"radio":e.find("input[type=radio]:checked").length>=1&&setTimeout(function(){e.find("input[type=radio]:checked").removeAttr("checked"),e.find("span.um-field-radio-state i").removeClass("um-icon-android-radio-button-on"),e.find("span.um-field-radio-state i").addClass("um-icon-android-radio-button-off"),e.find(".um-field-radio.active").removeClass("active");var n=e.find("input[type=radio][value='"+c.value+"']");n.attr("checked",!0),n.closest(".um-field-radio").find("i").removeClass("um-icon-android-radio-button-off"),n.closest(".um-field-radio").find("i").addClass("um-icon-android-radio-button-on"),n.closest(".um-field-radio").addClass("active")},100)}if(!e.hasClass("um-field-has-changed")){var o=n(e);"radio"!=a&&"checkbox"!=a||(o=o.find(":checked")),o&&(o.trigger("change"),e.addClass("um-field-has-changed"))}}function d(){jQuery.each(p,function(e,n){(jQuery('.um-field[data-key="'+e+'"]:hidden').length>=1||"none"==jQuery('.um-field[data-key="'+e+'"]').css("display"))&&jQuery.each(n,function(e,n){jQuery('.um-field[data-key="'+n.owner+'"]').hide()})})}function s(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"hidden"})}function l(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"visible"})}function f(){var i=[];jQuery(".um-field[data-key]").each(function(){var n=jQuery(this).data("key");i.push(n);var a={};jQuery.each(jQuery(this)[0].attributes,function(e,n){if(n.name.indexOf("data-cond")!=-1){var i=n.name.slice(10),t=i.substring(1,0),c=i.slice(2);"undefined"==typeof a[t]&&(a[t]={}),a[t][c]=n.value}}),jQuery.each(a,function(e,i){var a={field:{owner:n,action:i.action,parent:i.field,operator:i.operator,value:i.value,condition:{owner:n,action:i.action,operator:i.operator,value:i.value}}};h.push(a)}),v[jQuery(this).data("key")]=e(jQuery(this))}),jQuery.each(i,function(e,n){p[n]=a(n)}),jQuery(".um-field[data-key]:visible").each(function(){var e=jQuery(this),i=n(e);"undefined"!=typeof i.trigger&&i.trigger("change")})}var h=[],p={},v={};jQuery(document).on("change",".um-field select, .um-field input[type=radio], .um-field input[type=checkbox]",function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",".um-field input[type=text]",function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",".um-field input[type=password]",function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("um_fields_change",function(){d(),d()}),f()}); \ No newline at end of file +jQuery(document).ready(function(){function e(e){var n="",t=i(e);switch(t){case"text":case"number":case"date":case"textarea":case"select":n=e.find("input:text,input[type=number],textarea,select").val();break;case"multiselect":n=e.find("select").val();break;case"radio":e.find("input[type=radio]:checked").length>=1&&(n=e.find("input[type=radio]:checked").val());break;case"checkbox":e.find("input[type=checkbox]:checked").length>=1&&(e.find("input[type=checkbox]:checked").length>1?e.find("input[type=checkbox]:checked").each(function(){n=n+jQuery(this).val()+" "}):n=e.find("input[type=checkbox]:checked").val())}return{type:t,value:n}}function n(e){var n=i(e);switch(n){case"text":case"number":case"date":case"textarea":case"select":case"multiselect":case"radio":case"checkbox":return e.find("input,textarea,select")}return""}function i(e){var n="",i=e.attr("class");return jQuery.each(i.split(" "),function(e,i){i.indexOf("um-field-type")!=-1&&(n=i.split("_")[1])}),n}function t(e){var n=[];return jQuery.each(h,function(i,t){t.field.parent==e&&n.push(t.field.condition)}),n}function a(e){return um_live_field=e.parents(".um-field").data("key"),um_live_value=e.val(),e.is(":checkbox")&&(um_live_value="",e.parents(".um-field").find("input:checked").length>1?e.parents(".um-field").find("input:checked").each(function(){um_live_value=um_live_value+jQuery(this).val()+" "}):e.parents(".um-field").find("input:checked").length>=1&&(um_live_value=e.parents(".um-field").find("input:checked").val())),e.is(":radio")&&(um_live_value=e.parents(".um-field").find("input[type=radio]:checked").val()),um_live_value}function c(e,n,i){var t,a=!1,i=!!i;for(t in n)if(i&&n[t]===e||!i&&n[t]==e){a=!0;break}return a}function r(e,n){var t=e.parents(".um-field[data-key]").data("key"),r=p[t],o=a(e),d={},s={},l={};jQuery.each(r,function(e,n){"undefined"==typeof s[n.owner]&&(s[n.owner]=[],l[n.owner]={}),s[n.owner].push(n.value),l[n.owner]=n}),jQuery.each(r,function(n,t){"undefined"==typeof d[t.owner]&&(d[t.owner]={}),"empty"==t.operator&&(!o||""==o&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"not empty"==t.operator&&(o&&""!=o&&!c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"equals to"==t.operator&&(t.value==o&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1),"not equals"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)!=parseInt(t.value)&&o&&!c(o,s[t.owner])?d[t.owner][n]=!0:t.value==o||c(o,s[t.owner])?d[t.owner][n]=!1:d[t.owner][n]=!0),"greater than"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)>parseInt(t.value)?d[t.owner][n]=!0:d[t.owner][n]=!1),"less than"==t.operator&&(jQuery.isNumeric(t.value)&&parseInt(o)=0&&c(t.value,o)?d[t.owner][n]=!0:d[t.owner][n]=!1:"checkbox"==i(e.parents(".um-field[data-key]"))?o&&o.indexOf(t.value)>=0?d[t.owner][n]=!0:d[t.owner][n]=!1:o&&o.indexOf(t.value)>=0&&c(o,s[t.owner])?d[t.owner][n]=!0:d[t.owner][n]=!1)}),jQuery.each(d,function(n,i){c(!0,i)?u(e,l[n],!0):u(e,l[n],!1)}),e.trigger("um_fields_change")}function u(e,n,i){var t=jQuery('div.um-field[data-key="'+n.owner+'"]');"show"==n.action&&i&&(t.show(),l(t),o(t)),"show"!=n.action||i||(t.hide(),s(t)),"hide"==n.action&&i&&(t.hide(),s(t)),"hide"!=n.action||i||(t.show(),l(t),o(t)),e.removeClass("um-field-has-changed")}function o(e){var t=i(e),a=e.data("key"),c=v[a];switch(t){case"text":case"number":case"date":case"textarea":e.find("input:text,input[type=number],textareas").val(c.value);break;case"select":e.find("select").find("option").prop("selected",!1),e.find("select").val(c.value),e.find("select").trigger("change");break;case"multiselect":e.find("select").find("option").prop("selected",!1),jQuery.each(c.value,function(n,i){e.find("select").find('option[value="'+i+'"]').attr("selected",!0)}),e.find("select").trigger("change");break;case"checkbox":if(e.find("input[type=checkbox]:checked").length>=1)if(e.find("input[type=checkbox]:checked").removeAttr("checked"),e.find("span.um-field-checkbox-state i").removeClass("um-icon-android-checkbox-outline"),e.find("span.um-field-checkbox-state i").addClass("um-icon-android-checkbox-outline-blank"),e.find(".um-field-checkbox.active").removeClass("active"),jQuery.isArray(c.value))jQuery.each(c.value,function(n,i){var t=e.find('input[type=checkbox][value="'+i+'"]');t.attr("checked",!0),t.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),t.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),t.closest(".um-field-checkbox").addClass("active")});else{var r=e.find('input[type=checkbox][value="'+c.value+'"]');r.attr("checked",!0),r.closest(".um-field-checkbox").find("i").removeClass("um-icon-android-checkbox-outline-blank"),r.closest(".um-field-checkbox").find("i").addClass("um-icon-android-checkbox-outline"),r.closest(".um-field-checkbox").addClass("active")}break;case"radio":e.find("input[type=radio]:checked").length>=1&&setTimeout(function(){e.find("input[type=radio]:checked").removeAttr("checked"),e.find("span.um-field-radio-state i").removeClass("um-icon-android-radio-button-on"),e.find("span.um-field-radio-state i").addClass("um-icon-android-radio-button-off"),e.find(".um-field-radio.active").removeClass("active");var n=e.find("input[type=radio][value='"+c.value+"']");n.attr("checked",!0),n.closest(".um-field-radio").find("i").removeClass("um-icon-android-radio-button-off"),n.closest(".um-field-radio").find("i").addClass("um-icon-android-radio-button-on"),n.closest(".um-field-radio").addClass("active")},100)}if(!e.hasClass("um-field-has-changed")){var u=n(e);"radio"!=t&&"checkbox"!=t||(u=u.find(":checked")),u&&(u.trigger("change"),e.addClass("um-field-has-changed"))}}function d(){jQuery.each(p,function(e,n){(jQuery('.um-field[data-key="'+e+'"]:hidden').length>=1||"none"==jQuery('.um-field[data-key="'+e+'"]').css("display"))&&jQuery.each(n,function(e,n){jQuery('.um-field[data-key="'+n.owner+'"]').hide()})})}function s(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"hidden"})}function l(e){"undefined"!=typeof jQuery.browser&&jQuery.browser.msie&&e.css({visibility:"visible"})}function f(){var i=[];jQuery(".um-field[data-key]").each(function(){var n=jQuery(this).data("key");i.push(n);var t={};jQuery.each(jQuery(this)[0].attributes,function(e,n){if(n.name.indexOf("data-cond")!=-1){var i=n.name.slice(10),a=i.substring(1,0),c=i.slice(2);"undefined"==typeof t[a]&&(t[a]={}),t[a][c]=n.value}}),jQuery.each(t,function(e,i){var t={field:{owner:n,action:i.action,parent:i.field,operator:i.operator,value:i.value,condition:{owner:n,action:i.action,operator:i.operator,value:i.value}}};h.push(t)}),v[jQuery(this).data("key")]=e(jQuery(this))}),jQuery.each(i,function(e,n){p[n]=t(n)}),jQuery(".um-field[data-key]:visible").each(function(){var e=jQuery(this),i=n(e);"undefined"!=typeof i.trigger&&i.trigger("change")})}var h=[],p={},v={};jQuery(document).on("change",'.um-field select, .um-field input[type="radio"], .um-field input[type="checkbox"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="text"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="number"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("input change",'.um-field input[type="password"]',function(){var e=jQuery(this);r(e,!1)}),jQuery(document).on("um_fields_change",function(){d(),d()}),f()}); \ No newline at end of file diff --git a/assets/js/um-functions.js b/assets/js/um-functions.js index ff8a1ab2..d0e2a1e7 100644 --- a/assets/js/um-functions.js +++ b/assets/js/um-functions.js @@ -635,7 +635,6 @@ function um_modal_responsive() { } function um_remove_modal(){ - jQuery('img.cropper-hidden').cropper('destroy'); jQuery('body,html,textarea').css("overflow", "auto"); @@ -670,6 +669,14 @@ function prepare_Modal() { function remove_Modal() { if ( jQuery('.um-popup-overlay').length ) { + jQuery( document ).trigger( 'um_before_modal_removed' ); + + if ( jQuery('.um-popup-autogrow:visible').length ) { + jQuery('.um-popup-autogrow:visible').mCustomScrollbar("destroy"); + } else if ( jQuery('.um-popup-autogrow2:visible').length ) { + jQuery('.um-popup-autogrow2:visible').mCustomScrollbar("destroy"); + } + jQuery('.tipsy').remove(); jQuery('.um-popup').empty().remove(); jQuery('.um-popup-overlay').empty().remove(); diff --git a/assets/js/um-functions.min.js b/assets/js/um-functions.min.js index 742ac5a6..481141f6 100644 --- a/assets/js/um-functions.min.js +++ b/assets/js/um-functions.min.js @@ -1 +1 @@ -function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),o=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||a?t!==a?o.removeClass("um-validate-matched").addClass("um-validate-not-matched"):o.removeClass("um-validate-not-matched").addClass("um-validate-matched"):o.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),a=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(a="lc"),"lc"==a&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==a&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):element_width>960&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),jQuery(".um-account-nav").length>0&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover, .um-cover-e").each(function(){var e=jQuery(this),t=e.data("ratio"),a=e.width(),o=t.split(":");calcHeight=Math.round(a/o[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="",e.uploadFile({url:um_scripts.imageupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,a,o){e.selectedFiles=0;try{a=jQuery.parseJSON(a)}catch(e){return void console.log(e,a)}a.error&&""!=a.error?(e.parents(".um-modal-body").append('
'+a.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(a,function(t,a){var o=e.parents(".um-modal-body").find(".um-single-image-preview img"),i=e.parents(".um-modal-body").find(".um-single-image-preview");o.attr("src",a),o.load(function(){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),i.show(0),um_modal_responsive()})})}})}function initFileUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="",e.uploadFile({url:um_scripts.fileupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,a,o){e.selectedFiles=0,a=jQuery.parseJSON(a),a.error&&""!=a.error?(e.parents(".um-modal-body").append('
'+a.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),setTimeout(function(){um_modal_responsive()},1e3)):(jQuery.each(a,function(t,a){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),e.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==t?e.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(a):"icon_bg"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":a}):"filename"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(a):e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",a)}),setTimeout(function(){um_modal_responsive()},1e3))}})}function initCrop_UM(){var e=jQuery(".um-modal .um-single-image-preview img").first(),t=jQuery(".um-modal .um-single-image-preview"),a=e.parent().attr("data-crop"),o=e.parent().attr("data-min_width"),i=e.parent().attr("data-min_height"),r=e.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))var r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"),u=r.split(":"),r=u[0];if(e.length&&""!=e.attr("src")){var d=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(e.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),e.css({height:"auto"})):(e.css({height:"auto","max-height":d+"px"}),t.css({height:e.height(),"max-height":d+"px"})),"square"==a)var s={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};else if("cover"==a){Math.round(o/r)>0&&(i=Math.round(o/r));var s={minWidth:o,minHeight:i,dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}}}else if("user"==a)var s={minWidth:o,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};0!=a&&(e.cropper(s),jQuery(".um-single-image-preview img.cropper-hidden").cropper("destroy"),jQuery(".um-single-image-preview img.lazyloaded").addClass("cropper-hidden"),jQuery(".um-single-image-preview img.lazyloaded").removeClass("lazyloaded"),jQuery(".um-single-image-preview .cropper-container").append('
'))}}function um_new_modal(e,t,a,o){var i=jQuery("body").find(".um-modal-overlay");if(0==i.length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),a?jQuery("body").append('
'):jQuery("body").append('
'),jQuery("#"+e).prependTo(".um-modal"),a){jQuery(".um-modal").find(".um-modal-photo").html("");var r=jQuery(".um-modal-photo img"),u=jQuery(window).width()-60,d=jQuery(window).height()-.25*jQuery(window).height();r.attr("src",o),r.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),r.css({opacity:0}),r.css({"max-width":u}),r.css({"max-height":d}),jQuery(".um-modal").css({width:r.width(),"margin-left":"-"+r.width()/2+"px"}),r.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=jQuery(".um-modal:visible"),t=jQuery(".um-modal-body.photo:visible");if(t.length){e.removeClass("uimob340"),e.removeClass("uimob500");var a=jQuery(".um-modal-photo img"),o=jQuery(window).width()-60,i=jQuery(window).height()-.25*jQuery(window).height();a.css({opacity:0}),a.css({"max-width":o}),a.css({"max-height":i}),jQuery(".um-modal").css({width:a.width(),"margin-left":"-"+a.width()/2+"px"}),a.animate({opacity:1},1e3);var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(e.length){var u=jQuery(window).width();if(e.removeClass("uimob340"),e.removeClass("uimob500"),u<=340)e.addClass("uimob340"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=500)e.addClass("uimob500"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=800){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u<=960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u>960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('
'),jQuery("body").append('
'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,ag_height>350&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}function um_selected(e,t){if(e==t)return"selected='selected'"}jQuery(function(){jQuery(".um-search form *").keypress(function(e){if(13==e.which)return jQuery(".um-search form").submit(),!1}),2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()}); \ No newline at end of file +function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),o=jQuery("input[data-key=confirm_user_password]").val(),a=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||o?t!==o?a.removeClass("um-validate-matched").addClass("um-validate-not-matched"):a.removeClass("um-validate-not-matched").addClass("um-validate-matched"):a.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),o=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(o="lc"),"lc"==o&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==o&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):element_width>960&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),jQuery(".um-account-nav").length>0&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover, .um-cover-e").each(function(){var e=jQuery(this),t=e.data("ratio"),o=e.width(),a=t.split(":");calcHeight=Math.round(o/a[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="",e.uploadFile({url:um_scripts.imageupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,o,a){e.selectedFiles=0;try{o=jQuery.parseJSON(o)}catch(e){return void console.log(e,o)}o.error&&""!=o.error?(e.parents(".um-modal-body").append('
'+o.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(o,function(t,o){var a=e.parents(".um-modal-body").find(".um-single-image-preview img"),i=e.parents(".um-modal-body").find(".um-single-image-preview");a.attr("src",o),a.load(function(){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),i.show(0),um_modal_responsive()})})}})}function initFileUpload_UM(e){e.data("upload_help_text")?upload_help_text=''+e.data("upload_help_text")+"":upload_help_text="",e.data("icon")?icon='':icon="",e.data("upload_text")?upload_text=''+e.data("upload_text")+"":upload_text="",e.uploadFile({url:um_scripts.fileupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode"),_wpnonce:e.data("nonce"),timestamp:e.data("timestamp")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,o,a){e.selectedFiles=0,o=jQuery.parseJSON(o),o.error&&""!=o.error?(e.parents(".um-modal-body").append('
'+o.error+"
"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),setTimeout(function(){um_modal_responsive()},1e3)):(jQuery.each(o,function(t,o){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),e.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==t?e.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(o):"icon_bg"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":o}):"filename"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(o):e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",o)}),setTimeout(function(){um_modal_responsive()},1e3))}})}function initCrop_UM(){var e=jQuery(".um-modal .um-single-image-preview img").first(),t=jQuery(".um-modal .um-single-image-preview"),o=e.parent().attr("data-crop"),a=e.parent().attr("data-min_width"),i=e.parent().attr("data-min_height"),r=e.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))var r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"),u=r.split(":"),r=u[0];if(e.length&&""!=e.attr("src")){var d=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(e.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),e.css({height:"auto"})):(e.css({height:"auto","max-height":d+"px"}),t.css({height:e.height(),"max-height":d+"px"})),"square"==o)var s={minWidth:a,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};else if("cover"==o){Math.round(a/r)>0&&(i=Math.round(a/r));var s={minWidth:a,minHeight:i,dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}}}else if("user"==o)var s={minWidth:a,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};0!=o&&(e.cropper(s),jQuery(".um-single-image-preview img.cropper-hidden").cropper("destroy"),jQuery(".um-single-image-preview img.lazyloaded").addClass("cropper-hidden"),jQuery(".um-single-image-preview img.lazyloaded").removeClass("lazyloaded"),jQuery(".um-single-image-preview .cropper-container").append('
'))}}function um_new_modal(e,t,o,a){var i=jQuery("body").find(".um-modal-overlay");if(0==i.length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),o?jQuery("body").append('
'):jQuery("body").append('
'),jQuery("#"+e).prependTo(".um-modal"),o){jQuery(".um-modal").find(".um-modal-photo").html("");var r=jQuery(".um-modal-photo img"),u=jQuery(window).width()-60,d=jQuery(window).height()-.25*jQuery(window).height();r.attr("src",a),r.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),r.css({opacity:0}),r.css({"max-width":u}),r.css({"max-height":d}),jQuery(".um-modal").css({width:r.width(),"margin-left":"-"+r.width()/2+"px"}),r.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=jQuery(".um-modal:visible"),t=jQuery(".um-modal-body.photo:visible");if(t.length){e.removeClass("uimob340"),e.removeClass("uimob500");var o=jQuery(".um-modal-photo img"),a=jQuery(window).width()-60,i=jQuery(window).height()-.25*jQuery(window).height();o.css({opacity:0}),o.css({"max-width":a}),o.css({"max-height":i}),jQuery(".um-modal").css({width:o.width(),"margin-left":"-"+o.width()/2+"px"}),o.animate({opacity:1},1e3);var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(e.length){var u=jQuery(window).width();if(e.removeClass("uimob340"),e.removeClass("uimob500"),u<=340)e.addClass("uimob340"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=500)e.addClass("uimob500"),initCrop_UM(),e.animate({bottom:0},300);else if(u<=800){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u<=960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(u>960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('
'),jQuery("body").append('
'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(document).trigger("um_before_modal_removed"),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").mCustomScrollbar("destroy"):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").mCustomScrollbar("destroy"),jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,ag_height>350&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}function um_selected(e,t){if(e==t)return"selected='selected'"}jQuery(function(){jQuery(".um-search form *").keypress(function(e){if(13==e.which)return jQuery(".um-search form").submit(),!1}),2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()}); \ No newline at end of file diff --git a/includes/admin/assets/css/um-admin-misc.css b/includes/admin/assets/css/um-admin-misc.css index 6aeb7869..eeb376ee 100644 --- a/includes/admin/assets/css/um-admin-misc.css +++ b/includes/admin/assets/css/um-admin-misc.css @@ -258,3 +258,7 @@ p.disabled-on-off .um-admin-yesno *{ visibility: hidden; height: 0; } + +.um-admin-cur-condition-template { + display: none; +} diff --git a/includes/admin/assets/css/um-admin-settings.css b/includes/admin/assets/css/um-admin-settings.css index f26d9a8a..113d921d 100644 --- a/includes/admin/assets/css/um-admin-settings.css +++ b/includes/admin/assets/css/um-admin-settings.css @@ -240,14 +240,6 @@ th.column-email.column-primary { } */ -.email_template_wrapper .reset_email_template { - display: none; -} - -.email_template_wrapper.in_theme .reset_email_template { - display: block; -} - .um_setting_ajax_button_response.complete { color:darkgreen; font-style: italic; diff --git a/includes/admin/assets/js/um-admin-ajax.js b/includes/admin/assets/js/um-admin-ajax.js index a1df562d..f3347ef7 100644 --- a/includes/admin/assets/js/um-admin-ajax.js +++ b/includes/admin/assets/js/um-admin-ajax.js @@ -28,7 +28,6 @@ jQuery(document).ready(function() { jQuery('.tipsy').hide(); um_admin_remove_modal(); - jQuery.ajax({ url: um_admin_ajax_data.ajax_url, type: 'POST', diff --git a/includes/admin/assets/js/um-admin-field.js b/includes/admin/assets/js/um-admin-field.js index a677ec53..2bb0c7f9 100644 --- a/includes/admin/assets/js/um-admin-field.js +++ b/includes/admin/assets/js/um-admin-field.js @@ -3,13 +3,13 @@ jQuery(document).ready(function() { /* Remove field permanently */ jQuery(document).on('click', '.um-admin-btns a span.remove', function(e){ e.preventDefault(); - - if (confirm('This will permanently delete this custom field from database')) { - + + if ( confirm( 'This will permanently delete this custom field from database' ) ) { + jQuery(this).parents('a').remove(); - + arg1 = jQuery(this).parents('a').data('arg1'); - + jQuery.ajax({ url: um_admin_field_data.do_ajax_url, type: 'POST', @@ -21,13 +21,12 @@ jQuery(document).ready(function() { } }); - - } - + return false; }); - + + /* Add a Field */ jQuery(document).on('submit', 'form.um_add_field', function(e){ @@ -50,9 +49,8 @@ jQuery(document).ready(function() { form.css({'opacity': 1}); }, success: function(data){ - if (data.error){ - + c = 0; jQuery.each(data.error, function(i, v){ c++; @@ -61,11 +59,11 @@ jQuery(document).ready(function() { form.find('.um-admin-error-block').show().html(v); } }); - + um_admin_modal_responsive(); - + } else { - + jQuery('.um-col-demon-settings').data('in_row', ''); jQuery('.um-col-demon-settings').data('in_sub_row', ''); jQuery('.um-col-demon-settings').data('in_column', ''); diff --git a/includes/admin/assets/js/um-admin-modal.js b/includes/admin/assets/js/um-admin-modal.js index 3b690ee3..e66995ac 100644 --- a/includes/admin/assets/js/um-admin-modal.js +++ b/includes/admin/assets/js/um-admin-modal.js @@ -198,21 +198,26 @@ jQuery(document).ready(function() { if ( jQuery(this).hasClass('disabled') ) return false; - var content = jQuery(this).parents('.um-admin-btn-content'); - var length = content.find('.um-admin-cur-condition').length; + var content = jQuery(this).parents('.um-admin-btn-content'), + length = content.find('.um-admin-cur-condition').length; + if ( length < 5 ) { //content.find('select').select2('destroy'); - var cloned = jQuery(this).parents('.um-admin-cur-condition').clone(); - cloned.find('input[type=text],select').each(function(){ + var template = jQuery('.um-admin-btn-content').find('.um-admin-cur-condition-template').clone(); + + template.find('input[type=text],select').each(function(){ jQuery(this).attr('id', jQuery(this).attr('id') + length ); jQuery(this).attr('name', jQuery(this).attr('name') + length ); }); - cloned.find('input[type=text]').val(''); - cloned.find('.um-admin-new-condition').replaceWith('

'); - cloned.appendTo( content ); - cloned.find('select').val(''); + template.find('input[type=text]').val(''); + template.find('select').val(''); + + template.appendTo( content ); + jQuery(template).removeClass("um-admin-cur-condition-template"); + jQuery(template).addClass("um-admin-cur-condition"); + um_admin_live_update_scripts(); um_admin_modal_responsive(); } else { diff --git a/includes/admin/assets/js/um-admin-scripts.js b/includes/admin/assets/js/um-admin-scripts.js index 000abca8..fc20bbe2 100644 --- a/includes/admin/assets/js/um-admin-scripts.js +++ b/includes/admin/assets/js/um-admin-scripts.js @@ -216,4 +216,22 @@ jQuery(document).ready(function() { } }); + + jQuery(document).on( 'click', '.um-admin-notice.is-dismissible .notice-dismiss', function(e) { + var notice_key = jQuery(this).parents('.um-admin-notice').data('key'); + + wp.ajax.send( 'um_dimiss_notice', { + data: { + key: notice_key, + nonce: um_admin_scripts.nonce + }, + success: function( data ) { + return true; + }, + error: function( data ) { + return false; + } + }); + }); + }); \ No newline at end of file diff --git a/includes/admin/assets/js/um-admin-settings.js b/includes/admin/assets/js/um-admin-settings.js index 654c92a9..27533528 100644 --- a/includes/admin/assets/js/um-admin-settings.js +++ b/includes/admin/assets/js/um-admin-settings.js @@ -1,42 +1,4 @@ jQuery( document ).ready( function() { - /** - * Email templates - */ - /*jQuery( 'body' ).on( 'click', '.copy_email_template', function() { - var obj = jQuery(this); - - jQuery.ajax({ - url: php_data.copy_email_template, - type: 'POST', - data: { email_key : obj.parents('.email_template_wrapper').data('key') }, - success: function(data){ - obj.parents('.email_template_wrapper').addClass('in_theme'); - }, - error: function(data){ - alert('Something went wrong'); - } - }); - });*/ - - jQuery( 'body' ).on( 'click', '.reset_email_template', function() { - var obj = jQuery(this); - - jQuery.ajax({ - url: php_data.delete_email_template, - type: 'POST', - data: { email_key : obj.parents('.email_template_wrapper').data('key') }, - success: function(data){ - obj.parents('.email_template_wrapper').removeClass('in_theme'); - }, - error: function(data){ - alert('Something went wrong'); - } - }); - }); - - - - /** * Licenses */ diff --git a/includes/admin/core/class-admin-builder.php b/includes/admin/core/class-admin-builder.php index 7efae58b..3f61932c 100644 --- a/includes/admin/core/class-admin-builder.php +++ b/includes/admin/core/class-admin-builder.php @@ -167,27 +167,27 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) { function um_admin_pre_save_field_to_form( $array ){ unset( $array['conditions'] ); if ( isset($array['conditional_field']) && !empty( $array['conditional_action'] ) && !empty( $array['conditional_operator'] ) ) { - $array['conditional_value'] = ! empty( $array['conditional_value'] ) ? $array['conditional_value'] : ''; + $array['conditional_value'] = isset( $array['conditional_value'] ) ? $array['conditional_value'] : ''; $array['conditions'][] = array( $array['conditional_action'], $array['conditional_field'], $array['conditional_operator'], $array['conditional_value'] ); } if ( isset($array['conditional_field1']) && !empty( $array['conditional_action1'] ) && !empty( $array['conditional_operator1'] ) ) { - $array['conditional_value1'] = ! empty( $array['conditional_value1'] ) ? $array['conditional_value1'] : ''; + $array['conditional_value1'] = isset( $array['conditional_value1'] ) ? $array['conditional_value1'] : ''; $array['conditions'][] = array( $array['conditional_action1'], $array['conditional_field1'], $array['conditional_operator1'], $array['conditional_value1'] ); } if ( isset($array['conditional_field2']) && !empty( $array['conditional_action2'] ) && !empty( $array['conditional_operator2'] ) ) { - $array['conditional_value2'] = ! empty( $array['conditional_value2'] ) ? $array['conditional_value2'] : ''; + $array['conditional_value2'] = isset( $array['conditional_value2'] ) ? $array['conditional_value2'] : ''; $array['conditions'][] = array( $array['conditional_action2'], $array['conditional_field2'], $array['conditional_operator2'], $array['conditional_value2'] ); } if ( isset($array['conditional_field3']) && !empty( $array['conditional_action3'] ) && !empty( $array['conditional_operator3'] ) ) { - $array['conditional_value3'] = ! empty( $array['conditional_value3'] ) ? $array['conditional_value3'] : ''; + $array['conditional_value3'] = isset( $array['conditional_value3'] ) ? $array['conditional_value3'] : ''; $array['conditions'][] = array( $array['conditional_action3'], $array['conditional_field3'], $array['conditional_operator3'], $array['conditional_value3'] ); } if ( isset($array['conditional_field4']) && !empty( $array['conditional_action4'] ) && !empty( $array['conditional_operator4'] ) ) { - $array['conditional_value4'] = ! empty( $array['conditional_value4'] ) ? $array['conditional_value4'] : ''; + $array['conditional_value4'] = isset( $array['conditional_value4'] ) ? $array['conditional_value4'] : ''; $array['conditions'][] = array( $array['conditional_action4'], $array['conditional_field4'], $array['conditional_operator4'], $array['conditional_value4'] ); } @@ -231,10 +231,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
-

+

+

- $arr ) { @@ -247,11 +248,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) { field_input( '_conditional_operator' . $k, $form_id ); ?> field_input( '_conditional_value' . $k, $form_id ); ?> - -

- -

- +

@@ -274,7 +271,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) { +
+ field_input( '_conditional_action', $form_id ); ?> + field_input( '_conditional_field', $form_id ); ?> + field_input( '_conditional_operator', $form_id ); ?> + field_input( '_conditional_value', $form_id ); ?> + +

+ +
+
@@ -659,6 +666,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) { $output['error'] = apply_filters( 'um_admin_field_update_error_handling', $output['error'], $array ); extract( $array['post'] ); + if ( empty( $output['error'] ) ){ $save = array(); diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index f88469e7..279b0dfd 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -156,7 +156,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { wp_enqueue_script( 'um_admin_settings' ); $localize_data = array( - 'delete_email_template' => UM()->get_ajax_route( 'um\core\Mail', 'delete_email_template' ), 'onbeforeunload_text' => __( 'Are sure, maybe some settings not saved', 'ultimate-member' ), 'texts' => array( 'remove' => __( 'Remove', 'ultimate-member' ), @@ -303,7 +302,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { * Load jQuery custom code */ function load_custom_scripts() { - wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', '', '', true ); + wp_register_script( 'um_admin_scripts', $this->js_url . 'um-admin-scripts.js', array('jquery','wp-util'), '', true ); wp_enqueue_script( 'um_admin_scripts' ); } diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index fe3caa11..c1ab3669 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -732,15 +732,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { $value = $this->get_field_value( $field_data ); $options = ''; - foreach ( $field_data['options'] as $key=>$option ) { + foreach ( $field_data['options'] as $key => $option ) { if ( ! empty( $field_data['multi'] ) ) { if ( ! is_array( $value ) || empty( $value ) ) $value = array(); - $options .= ''; + $options .= ''; } else { - $options .= ''; + $options .= ''; } } @@ -1041,11 +1041,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { ob_start(); ?>

- +

localize_note(); $this->show_update_messages(); $this->check_wrong_install_folder(); - //$this->admin_notice_tracking(); + $this->admin_notice_tracking(); $this->need_upgrade(); $this->check_wrong_licenses(); + + //$this->future_changed(); + /** * UM hook * @@ -135,7 +140,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { $admin_notices = $this->get_admin_notices(); - $hidden = get_user_meta( get_current_user_id(), 'um_hidden_admin_notices' ); + $hidden = get_user_meta( get_current_user_id(), 'um_hidden_admin_notices', true ); $hidden = empty( $hidden ) ? array() : $hidden; uasort( $admin_notices, array( &$this, 'notice_priority_sort' ) ); @@ -186,9 +191,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { $class = ! empty( $notice_data['class'] ) ? $notice_data['class'] : 'updated'; + $dimissible = ! empty( $admin_notices[ $key ]['dimissible'] ); + ob_start(); ?> -
+
@@ -494,13 +501,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { */ public function admin_notice_tracking() { - if ( ! current_user_can( 'manage_options' ) ) + if ( ! current_user_can( 'manage_options' ) ) { return; + } $hide_notice = get_option( 'um_tracking_notice' ); - if ( $hide_notice ) + if ( $hide_notice ) { return; + } $optin_url = esc_url( add_query_arg( 'um_adm_action', 'opt_into_tracking' ) ); $optout_url = esc_url( add_query_arg( 'um_adm_action', 'opt_out_of_tracking' ) ); @@ -508,7 +517,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { ob_start(); ?>

- %s! The core plugin is free but we also sell extensions which allow us to continue developing and supporting the plugin full time. If you subscribe to our mailing list (no spam) we will email you a 20%% discount code which you can use to purchase the extensions bundle.', 'ultimate-member' ), ultimatemember_plugin_name, 'https://ultimatemember.com/core-extensions-bundle/' ); ?> + %s! We hope you like the plugin. To fund full-time development and support of the plugin we also sell extensions for %s via our website. If you subscribe to our mailing list we will immediately email you a 20%% discount code for our extensions bundle (you\'ll need to confirm your subscription via email).', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_plugin_name, 'https://ultimatemember.com/core-extensions-bundle/' ); ?>

@@ -517,9 +526,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {

+

+ privacy policy', 'ultimate-member' ), 'https://ultimatemember.com/support/policy/' ); ?> +

+ add_notice( 'invalid_dir', array( + $this->add_notice( 'tracking_notice', array( 'class' => 'updated', 'message' => $message, ), 2 ); @@ -595,5 +608,41 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) { } } + + /** + * Check Future Changes notice + */ + function future_changed() { + + ob_start(); ?> + +

+ %s future plans! Detailed future list is here', 'ultimate-member' ), ultimatemember_plugin_name, '#' ); ?> +

+ + add_notice( 'future_changes', array( + 'class' => 'updated', + 'message' => $message, + //'dimissible' => true, + ), 2 ); + } + + + function dimiss_notice() { + if ( empty( $_POST['key'] ) ) { + wp_send_json_error( __( 'Wrong Data', 'ultimate-member' ) ); + } + + $hidden_notices = get_user_meta( get_current_user_id(), 'um_hidden_admin_notices', true ); + $hidden_notices = empty( $hidden_notices ) ? array() : $hidden_notices; + $hidden_notices[] = $_POST['key']; + + update_user_meta( get_current_user_id(), 'um_hidden_admin_notices', $hidden_notices ); + + wp_send_json_success(); + } + } } \ No newline at end of file diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 29ff98fc..0a0828f3 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -617,7 +617,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'id' => 'email_html', 'type' => 'checkbox', 'label' => __( 'Use HTML for E-mails?','ultimate-member' ), - 'tooltip' => __('If you enable HTML for e-mails, you can customize the HTML e-mail templates found in templates/email folder.','ultimate-member'), + 'tooltip' => __( 'If you plan use e-mails with HTML, please make sure that this option is enabled. Otherwise, HTML will be displayed as plain text.','ultimate-member'), ) ) ), @@ -1692,8 +1692,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { $email_key = empty( $_GET['email'] ) ? '' : urldecode( $_GET['email'] ); $emails = UM()->config()->email_notifications; - if ( empty( $email_key ) || empty( $emails[$email_key] ) ) + if ( empty( $email_key ) || empty( $emails[ $email_key ] ) ) { return $section; + } $in_theme = UM()->mail()->template_in_theme( $email_key ); @@ -1722,7 +1723,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { array( 'id' => 'um_email_template', 'type' => 'hidden', - 'value' => $email_key, + 'value' => $email_key, ), array( 'id' => $email_key . '_on', @@ -2526,18 +2527,16 @@ Use Only Cookies: mail()->get_template_file( 'theme', $template ); - $in_theme = UM()->mail()->template_in_theme( $template ); - if ( ! $in_theme ) { - UM()->mail()->copy_email_template( $template ); - } + UM()->mail()->copy_email_template( $template ); $fp = fopen( $theme_template_path, "w" ); $result = fputs( $fp, $content ); @@ -2545,7 +2544,7 @@ Use Only Cookies: ' ) ) { - $upgrade_notice = get_option( '%UNIQUE_ID%_major_update' . $lastversion ); + if ( $old_version_array[0] < $new_version_array[0] ) { + $show_additional_notice = true; + } else { + if ( $old_version_array[1] < $new_version_array[1] ) { + $show_additional_notice = true; + } + } - echo '' . wp_kses_post( $upgrade_notice ); } - }*/ + + if ( $show_additional_notice ) { + ob_start(); ?> + + + + + + + + mail()->get_template_filename( $template_name ); + $ext = ! $html ? '.php' : '.html'; + + $blog_id = ''; + if ( ! $html ) { + $blog_id = UM()->mail()->get_blog_id(); + } + + // check if there is template at theme folder + $template = locate_template( array( + trailingslashit( 'ultimate-member/email' . $blog_id ) . $template_name_file . $ext + ) ); + // Return what we found. + return ! $template ? false : true; +} + + +/** + * Method returns expected path for template + * + * @access public + * @param string $location + * @param string $template_name + * @param bool $html + * @return string + */ +function um_upgrade20beta1_get_template_file( $location, $template_name, $html = false ) { + $template_path = ''; + $template_name_file = UM()->mail()->get_template_filename( $template_name ); + $ext = ! $html ? '.php' : '.html'; + switch( $location ) { + case 'theme': + + $blog_id = ''; + if ( ! $html ) { + $blog_id = UM()->mail()->get_blog_id(); + } + + $template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' . $blog_id ). $template_name_file . $ext; + break; + case 'plugin': + $path = ! empty( UM()->mail()->path_by_slug[ $template_name ] ) ? UM()->mail()->path_by_slug[ $template_name ] : um_path . 'templates/email'; + $template_path = trailingslashit( $path ) . $template_name . $ext; + break; + } + return $template_path; +} + + +/** + * Ajax copy template to the theme + * + * @param string $template + * @return bool + */ +function um_upgrade20beta1_copy_email_template( $template ) { + $in_theme = um_upgrade20beta1_template_in_theme( $template ); + if ( $in_theme ) { + return false; + } + $plugin_template_path = um_upgrade20beta1_get_template_file( 'plugin', $template ); + $theme_template_path = um_upgrade20beta1_get_template_file( 'theme', $template ); + $temp_path = str_replace( trailingslashit( get_stylesheet_directory() ), '', $theme_template_path ); + $temp_path = str_replace( '/', DIRECTORY_SEPARATOR, $temp_path ); + $folders = explode( DIRECTORY_SEPARATOR, $temp_path ); + $folders = array_splice( $folders, 0, count( $folders ) - 1 ); + $cur_folder = ''; + $theme_dir = trailingslashit( get_stylesheet_directory() ); + foreach ( $folders as $folder ) { + $prev_dir = $cur_folder; + $cur_folder .= $folder . DIRECTORY_SEPARATOR; + if ( ! is_dir( $theme_dir . $cur_folder ) && wp_is_writable( $theme_dir . $prev_dir ) ) { + mkdir( $theme_dir . $cur_folder, 0777 ); + } + } + if ( file_exists( $plugin_template_path ) && copy( $plugin_template_path, $theme_template_path ) ) { + return true; + } else { + return false; + } +} + + +/** + * Insert email template content to file + * + * @param string $path Filepath + * @param string $content Email template content + */ +function um_upgrade20beta1_insert_content( $path, $content ) { + $fp = @fopen( $path, "w" ); + @fputs( $fp, $content ); + @fclose( $fp ); +} + + /** * Transferring email templates to new logic */ -$templates_in_theme = 0; +function um_upgrade20beta1_email_templates_process() { + $templates_in_theme = 0; + $emails = UM()->config()->email_notifications; + foreach ( $emails as $email_key => $value ) { + + $in_theme = um_upgrade20beta1_template_in_theme( $email_key, true ); + $theme_template_path = um_upgrade20beta1_get_template_file( 'theme', $email_key ); + + if ( ! $in_theme ) { + //there isn't HTML email template's file in theme, get from option + //this value is correct for each multisite's subsites + $setting_value = UM()->options()->get( $email_key ); + + $html_email = UM()->options()->get( 'email_html' ); + if ( $html_email ) { + + if ( ! um_upgrade20beta1_copy_email_template( $email_key ) ) { + + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); + + } else { + + $templates_in_theme++; + + } + } else { + + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); + + } + + } else { + //there is HTML email template in a theme's folder + $theme_template_path_html = um_upgrade20beta1_get_template_file( 'theme', $email_key, true ); + + $setting_value = preg_replace( '/<\/body>|<\/head>||<\/html>||/' , '', file_get_contents( $theme_template_path_html ) ); + + if ( file_exists( $theme_template_path_html ) ) { + + $temp_path = str_replace( trailingslashit( get_stylesheet_directory() ), '', $theme_template_path ); + $temp_path = str_replace( '/', DIRECTORY_SEPARATOR, $temp_path ); + $folders = explode( DIRECTORY_SEPARATOR, $temp_path ); + $folders = array_splice( $folders, 0, count( $folders ) - 1 ); + $cur_folder = ''; + $theme_dir = trailingslashit( get_stylesheet_directory() ); + foreach ( $folders as $folder ) { + $prev_dir = $cur_folder; + $cur_folder .= $folder . DIRECTORY_SEPARATOR; + if ( ! is_dir( $theme_dir . $cur_folder ) && wp_is_writable( $theme_dir . $prev_dir ) ) { + mkdir( $theme_dir . $cur_folder, 0777 ); + } + } + + if ( copy( $theme_template_path_html, $theme_template_path ) ) { + + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); + + $templates_in_theme++; + + } + + } + + } + } + + $email_html = ( $templates_in_theme > 0 ) ? true : false; + UM()->options()->update( 'email_html', $email_html ); +} + + +if ( is_multisite() ) { + $start_blog_id = get_current_blog_id(); + + $blog_ids = get_sites( array( + 'fields' => 'ids', + ) ); + + foreach ( $blog_ids as $blog_id ) { + switch_to_blog( $blog_id ); + um_upgrade20beta1_email_templates_process(); + } + + restore_current_blog(); +} else { + um_upgrade20beta1_email_templates_process(); +} + + +/** + * Transferring email templates to new logic + */ +/*$templates_in_theme = 0; $emails = UM()->config()->email_notifications; foreach ( $emails as $email_key => $value ) { - $in_theme = UM()->mail()->template_in_theme( $email_key, true ); - $theme_template_path = UM()->mail()->get_template_file( 'theme', $email_key ); + $in_theme = um_upgrade20beta1_template_in_theme( $email_key, true ); + $theme_template_path = um_upgrade20beta1_get_template_file( 'theme', $email_key ); if ( ! $in_theme ) { + //there isn't HTML email template's file in theme, get from option + //this value is correct for each multisite's subsites + $setting_value = UM()->options()->get( $email_key ); + $html_email = UM()->options()->get( 'email_html' ); - if ( $html_email ) { - if ( ! UM()->mail()->copy_email_template( $email_key ) ) { - $setting_value = UM()->options()->get( $email_key ); - $fp = fopen( $theme_template_path, "w" ); - $result = fputs( $fp, $setting_value ); - fclose( $fp ); + if ( ! um_upgrade20beta1_copy_email_template( $email_key ) ) { + + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); + } else { + $templates_in_theme++; + } } else { - $setting_value = UM()->options()->get( $email_key ); - $fp = @fopen( $theme_template_path, "w" ); - $result = @fputs( $fp, $setting_value ); - fclose( $fp ); + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); + } + } else { - $theme_template_path_html = UM()->mail()->get_template_file( 'theme', $email_key, true ); + //there is HTML email template in a theme's folder + $theme_template_path_html = um_upgrade20beta1_get_template_file( 'theme', $email_key, true ); $setting_value = preg_replace( '/<\/body>|<\/head>||<\/html>||/' , '', file_get_contents( $theme_template_path_html ) ); if ( file_exists( $theme_template_path_html ) ) { + if ( copy( $theme_template_path_html, $theme_template_path ) ) { - $fp = fopen( $theme_template_path, "w" ); - $result = fputs( $fp, $setting_value ); - fclose( $fp ); + + um_upgrade20beta1_insert_content( $theme_template_path, $setting_value ); $templates_in_theme++; + } + } + } } -if ( $templates_in_theme > 0 ) { - UM()->options()->update( 'email_html', true ); -} else { - UM()->options()->update( 'email_html', false ); -} \ No newline at end of file +$email_html = ( $templates_in_theme > 0 ) ? true : false; +UM()->options()->update( 'email_html', $email_html );*/ \ No newline at end of file diff --git a/includes/admin/core/packages/2.0-beta1/functions.php b/includes/admin/core/packages/2.0-beta1/functions.php index 824fdfef..52adba1f 100644 --- a/includes/admin/core/packages/2.0-beta1/functions.php +++ b/includes/admin/core/packages/2.0-beta1/functions.php @@ -136,6 +136,8 @@ function um_upgrade_cpt20beta1() { function um_upgrade_get_forums20beta1() { um_maybe_unset_time_limit(); + remove_all_actions( 'pre_get_posts' ); + $bb_forums = get_posts( array( 'post_type' => 'forum', 'numberposts' => -1, diff --git a/includes/admin/templates/form/profile_customize.php b/includes/admin/templates/form/profile_customize.php index 6104eae0..b809ffcf 100644 --- a/includes/admin/templates/form/profile_customize.php +++ b/includes/admin/templates/form/profile_customize.php @@ -1,10 +1,11 @@
- roles()->get_roles( __( 'All roles', 'ultimate-member' ) ) as $key => $value ) { - $_um_profile_role = UM()->query()->get_meta_value( '_um_profile_role', $key ); - if ( ! empty( $_um_profile_role ) ) - $profile_role = $_um_profile_role; + roles()->get_roles() as $key => $value ) { + $_um_profile_role = UM()->query()->get_meta_value( '_um_profile_role', $key ); + if ( ! empty( $_um_profile_role ) ) { + $profile_role_array[] = $_um_profile_role; + } } UM()->admin_forms( array( @@ -14,8 +15,8 @@ array( 'id' => '_um_profile_use_custom_settings', 'type' => 'select', - 'label' => __( 'Apply custom settings to this form', 'ultimate-member' ), - 'tooltip' => __( 'Switch to yes if you want to customize this form settings, styling & appearance', 'ultimate-member' ), + 'label' => __( 'Apply custom settings to this form', 'ultimate-member' ), + 'tooltip' => __( 'Switch to yes if you want to customize this form settings, styling & appearance', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_use_custom_settings', null, 0 ), 'options' => array( 0 => __( 'No', 'ultimate-member' ), @@ -23,13 +24,14 @@ ), ), array( - 'id' => '_um_profile_role', - 'type' => 'select', - 'label' => __( 'Make this profile form role-specific', 'ultimate-member' ), - 'tooltip' => __( 'Please note if you make a profile form specific to a role then you must make sure that every other role is assigned a profile form', 'ultimate-member' ), - 'value' => ! empty( $profile_role ) ? $profile_role : 0, - 'options' => UM()->roles()->get_roles( __( 'All roles', 'ultimate-member' ) ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'id' => '_um_profile_role', + 'type' => 'select', + 'multi' => true, + 'label' => __( 'Make this profile form role-specific', 'ultimate-member' ), + 'tooltip' => __( 'Please note if you make a profile form specific to a role then you must make sure that every other role is assigned a profile form', 'ultimate-member' ), + 'value' => $profile_role_array, + 'options' => UM()->roles()->get_roles(), + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) ), array( 'id' => '_um_profile_template', diff --git a/includes/class-config.php b/includes/class-config.php index 2e61e1ab..7d92c771 100644 --- a/includes/class-config.php +++ b/includes/class-config.php @@ -210,7 +210,7 @@ if ( ! class_exists( 'um\Config' ) ) { '_um_profile_header_menu' => 'bc', '_um_profile_empty_text' => 1, '_um_profile_empty_text_emo' => 1, - '_um_profile_role' => '0', + '_um_profile_role' => array(), '_um_profile_template' => 'profile', '_um_profile_max_width' => '1000px', '_um_profile_area_max_width' => '600px', diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php index b0fe53b9..bd087afc 100644 --- a/includes/class-dependencies.php +++ b/includes/class-dependencies.php @@ -39,14 +39,14 @@ if ( ! class_exists( 'um\Dependencies' ) ) { 'instagram' => '2.0', 'invitations' => '2.0', 'mailchimp' => '2.0.1', - 'messaging' => '2.0.1', + 'messaging' => '2.0.5', 'mycred' => '2.0', 'notices' => '2.0.1', 'notifications' => '2.0.1', 'online' => '2.0', 'private-content' => '2.0', 'profile-completeness' => '2.0.1', - 'recaptcha' => '2.0', + 'recaptcha' => '2.0.2', 'reviews' => '2.0.3', 'social-activity' => '2.0.1', 'social-login' => '2.0.1', @@ -57,7 +57,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) { 'woocommerce' => '2.0.1', 'restrict-content' => '2.0', 'beaver-builder' => '2.0', - 'gdpr' => '1.0.0', + 'photos' => '1.1', ); diff --git a/includes/class-init.php b/includes/class-init.php index 0cc6f25d..5aaa9227 100644 --- a/includes/class-init.php +++ b/includes/class-init.php @@ -73,6 +73,7 @@ if ( ! class_exists( 'UM' ) ) { static public function instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); + self::$instance->_um_construct(); } return self::$instance; @@ -163,7 +164,15 @@ if ( ! class_exists( 'UM' ) ) { */ function __construct() { parent::__construct(); + } + + /** + * UM pseudo-constructor. + * + * @since 2.0.18 + */ + function _um_construct() { //register autoloader for include UM classes spl_autoload_register( array( $this, 'um__autoloader' ) ); @@ -486,6 +495,7 @@ if ( ! class_exists( 'UM' ) ) { $this->metabox(); $this->admin_upgrade()->init_packages_ajax_handlers(); $this->admin_gdpr(); + $this->columns(); } elseif ( $this->is_request( 'admin' ) ) { $this->admin(); $this->admin_menu(); @@ -524,7 +534,7 @@ if ( ! class_exists( 'UM' ) ) { $this->permalinks(); $this->modal(); $this->cron(); - //$this->tracking(); + $this->tracking(); $this->mobile(); $this->external_integrations(); $this->gdpr(); diff --git a/includes/core/class-access.php b/includes/core/class-access.php index 0bd198a6..0f3d7f95 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -1022,19 +1022,22 @@ if ( ! class_exists( 'um\core\Access' ) ) { } //post is private - if ( '1' == $restriction['_um_accessible'] ) { + if ( '0' == $restriction['_um_accessible'] ) { + $filtered_items[] = $menu_item; + continue; + } elseif ( '1' == $restriction['_um_accessible'] ) { //if post for not logged in users and user is not logged in if ( ! is_user_logged_in() ) { $filtered_items[] = $menu_item; continue; } else { - if ( current_user_can( 'administrator' ) ) { - $filtered_items[] = $menu_item; - continue; - } + if ( current_user_can( 'administrator' ) ) { + $filtered_items[] = $menu_item; + continue; + } - //if not single query when exclude if set _um_access_hide_from_queries + //if not single query when exclude if set _um_access_hide_from_queries if ( empty( $restriction['_um_access_hide_from_queries'] ) ) { $filtered_items[] = $menu_item; continue; @@ -1044,10 +1047,10 @@ if ( ! class_exists( 'um\core\Access' ) ) { //if post for logged in users and user is not logged in if ( is_user_logged_in() ) { - if ( current_user_can( 'administrator' ) ) { - $filtered_items[] = $menu_item; - continue; - } + if ( current_user_can( 'administrator' ) ) { + $filtered_items[] = $menu_item; + continue; + } $custom_restrict = $this->um_custom_restriction( $restriction ); @@ -1078,8 +1081,6 @@ if ( ! class_exists( 'um\core\Access' ) ) { } } } - - continue; } //add all other posts diff --git a/includes/core/class-account.php b/includes/core/class-account.php index a6fc0c67..5daa94b3 100644 --- a/includes/core/class-account.php +++ b/includes/core/class-account.php @@ -756,7 +756,7 @@ if ( ! class_exists( 'um\core\Account' ) ) {
- +
'instagram_url', 'url_text' => 'Instagram', 'advanced' => 'social', - 'color' => '#3f729b', + 'color' => 'radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%)', 'match' => 'https://instagram.com/', ), diff --git a/includes/core/class-enqueue.php b/includes/core/class-enqueue.php index b723b213..7c53f542 100644 --- a/includes/core/class-enqueue.php +++ b/includes/core/class-enqueue.php @@ -263,7 +263,9 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) { */ function load_selectjs() { - if ( class_exists( 'WooCommerce' ) ) { + $dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', false ); + + if ( class_exists( 'WooCommerce' ) || $dequeue_select2 ) { wp_dequeue_style( 'select2' ); wp_deregister_style( 'select2' ); diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 40c2cb9e..42bcd689 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -182,8 +182,38 @@ if ( ! class_exists( 'um\core\Fields' ) ) { */ function delete_field_from_form( $id, $form_id ) { $fields = UM()->query()->get_attr( 'custom_fields', $form_id ); - if (isset( $fields[$id] )) { - unset( $fields[$id] ); + + if ( isset( $fields[ $id ] ) ) { + $condition_fields = get_option( 'um_fields' ); + + foreach ( $condition_fields as $key => $value ) { + $deleted_field = array_search( $id, $value ); + + if ( $key != $id && $deleted_field != false ) { + $deleted_field_id = str_replace( 'conditional_field', '', $deleted_field ); + + if ( $deleted_field_id == '' ) { + $arr_id = 0; + } else { + $arr_id = $deleted_field_id; + } + + unset( $condition_fields[ $key ][ 'conditional_action' . $deleted_field_id ] ); + unset( $condition_fields[ $key ][ $deleted_field ] ); + unset( $condition_fields[ $key ][ 'conditional_operator' . $deleted_field_id ] ); + unset( $condition_fields[ $key ][ 'conditional_value' . $deleted_field_id ] ); + unset( $condition_fields[ $key ]['conditions'][ $arr_id ] ); + + unset( $fields[ $key ][ 'conditional_action' . $deleted_field_id ] ); + unset( $fields[ $key ][ $deleted_field ] ); + unset( $fields[ $key ][ 'conditional_operator' . $deleted_field_id ] ); + unset( $fields[ $key ][ 'conditional_value' . $deleted_field_id ] ); + unset( $fields[ $key ]['conditions'][ $arr_id ] ); + } + } + + update_option( 'um_fields' , $condition_fields ); + unset( $fields[ $id ] ); UM()->query()->update_attr( 'custom_fields', $form_id, $fields ); } } @@ -628,9 +658,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } elseif ( ( um_user( $key ) || isset( $data['show_anyway'] ) ) && $this->viewing == true ) { - $value = um_filtered_value( $key, $data ); - - return $value; + return um_filtered_value( $key, $data ); } elseif ( isset( UM()->user()->profile[ $key ] ) ) { @@ -1106,10 +1134,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) { */ function get_label( $key ) { $fields = UM()->builtin()->all_user_fields; - if (isset( $fields[$key]['label'] )) - return $fields[$key]['label']; - if (isset( $fields[$key]['title'] )) - return $fields[$key]['title']; + if ( isset( $fields[$key]['label'] ) ) + return stripslashes( $fields[$key]['label'] ); + if ( isset( $fields[$key]['title'] ) ) + return stripslashes( $fields[$key]['title'] ); return ''; } @@ -1690,7 +1718,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { case 'select': case 'radio': - $form_key = str_replace( 'role_select', 'role', $key ); + $form_key = str_replace( array( 'role_select', 'role_radio' ), 'role', $key ); $field_id = $form_key; break; default: @@ -2571,9 +2599,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { } } - $options = $this->get_available_roles( $form_key, $options ); - - // add an empty option! $output .= ''; $field_value = ''; @@ -2583,6 +2608,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $options_pair = true; } + $options = $this->get_available_roles( $form_key, $options ); + // add options if ( ! empty( $options ) ) { foreach ( $options as $k => $v ) { @@ -2890,7 +2917,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $um_field_checkbox_item_title = $v; $option_value = $v; - if ( ! is_numeric( $k ) && in_array( $form_key, array( 'role', 'role_radio' ) ) ) { + if ( ! is_numeric( $k ) && in_array( $form_key, array( 'role' ) ) ) { $um_field_checkbox_item_title = $v; $option_value = $k; } @@ -2910,6 +2937,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $class = "um-icon-android-radio-button-off"; } + if (isset( $data['editable'] ) && $data['editable'] == 0) { $col_class .= " um-field-radio-state-disabled"; } @@ -4010,23 +4038,23 @@ if ( ! class_exists( 'um\core\Fields' ) ) { switch ($act_id) { case 'um_admin_duplicate_field': - UM()->fields()->duplicate_field( $arg1, $arg2 ); + $this->duplicate_field( $arg1, $arg2 ); break; case 'um_admin_remove_field_global': - UM()->fields()->delete_field_from_db( $arg1 ); + $this->delete_field_from_db( $arg1 ); break; case 'um_admin_remove_field': - UM()->fields()->delete_field_from_form( $arg1, $arg2 ); + $this->delete_field_from_form( $arg1, $arg2 ); break; case 'um_admin_add_field_from_predefined': - UM()->fields()->add_field_from_predefined( $arg1, $arg2, $position ); + $this->add_field_from_predefined( $arg1, $arg2, $position ); break; case 'um_admin_add_field_from_list': - UM()->fields()->add_field_from_list( $arg1, $arg2, $position ); + $this->add_field_from_list( $arg1, $arg2, $position ); break; } diff --git a/includes/core/class-files.php b/includes/core/class-files.php index 39932ad5..7317fc6d 100644 --- a/includes/core/class-files.php +++ b/includes/core/class-files.php @@ -1133,14 +1133,16 @@ if ( ! class_exists( 'um\core\Files' ) ) { * @return string */ function format_bytes( $size , $precision = 1 ) { + if ( is_numeric( $size ) ) { + $base = log( $size, 1024 ); + $suffixes = array( '', 'kb', 'MB', 'GB', 'TB' ); + $computed_size = round( pow( 1024, $base - floor( $base ) ), $precision ); + $unit = $suffixes[ floor( $base ) ]; - $base = log($size, 1024); - $suffixes = array('', 'kb', 'MB', 'GB', 'TB'); - $computed_size = round(pow(1024, $base - floor($base)), $precision); - $unit = $suffixes[ floor($base) ]; - - return $computed_size.' '.$unit; + return $computed_size.' '.$unit; + } + return ''; } diff --git a/includes/core/class-form.php b/includes/core/class-form.php index 7c0c1db6..39f6887a 100644 --- a/includes/core/class-form.php +++ b/includes/core/class-form.php @@ -308,7 +308,7 @@ if ( ! class_exists( 'um\core\Form' ) ) { global $wp_roles; $role_keys = array_map( function( $item ) { return 'um_' . $item; - }, get_option( 'um_roles' ) ); + }, get_option( 'um_roles', array() ) ); $exclude_roles = array_diff( array_keys( $wp_roles->roles ), array_merge( $role_keys, array( 'subscriber' ) ) ); if ( ! empty( $role ) && diff --git a/includes/core/class-mail.php b/includes/core/class-mail.php index e92a208f..a4e71542 100644 --- a/includes/core/class-mail.php +++ b/includes/core/class-mail.php @@ -36,6 +36,23 @@ if ( ! class_exists( 'um\core\Mail' ) ) { } + /** + * Mandrill compatibility + * + * @param $nl2br + * @param string $message + * @return bool + */ + function mandrill_nl2br( $nl2br, $message = '' ) { + // text emails + if ( ! UM()->options()->get( 'email_html' ) ) { + $nl2br = true; + } + + return $nl2br; + } + + /** * Init paths for email notifications */ @@ -66,72 +83,73 @@ if ( ! class_exists( 'um\core\Mail' ) ) { /** - * Mandrill compatibility + * Check blog ID on multisite, return '' if single site * - * @param $nl2br - * @param string $message - * @return bool + * @return string */ - function mandrill_nl2br( $nl2br, $message = '' ) { - // text emails - if ( ! UM()->options()->get( 'email_html' ) ) { - $nl2br = true; + function get_blog_id() { + $blog_id = ''; + if ( is_multisite() ) { + $blog_id = '/' . get_current_blog_id(); } - return $nl2br; + return $blog_id; } /** - * Send Email function + * Locate a template and return the path for inclusion. * - * @param string $email - * @param null $template - * @param array $args + * @access public + * @param string $template_name + * @return string */ - function send( $email, $template, $args = array() ) { + function locate_template( $template_name ) { + // check if there is template at theme folder + $blog_id = $this->get_blog_id(); - if ( ! is_email( $email ) ) return; - if ( UM()->options()->get( $template . '_on' ) != 1 ) return; + //get template file from current blog ID folder + $template = locate_template( array( + trailingslashit( 'ultimate-member/email' . $blog_id ) . $template_name . '.php' + ) ); - $this->attachments = null; - $this->headers = 'From: '. UM()->options()->get('mail_from') .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n"; + //if there isn't template at theme folder for current blog ID get template file from theme folder + if ( is_multisite() && ! $template ) { + $template = locate_template( array( + trailingslashit( 'ultimate-member/email' ) . $template_name . '.php' + ) ); + } + //if there isn't template at theme folder get template file from plugin dir + if ( ! $template ) { + $path = ! empty( $this->path_by_slug[ $template_name ] ) ? $this->path_by_slug[ $template_name ] : um_path . 'templates/email'; + $template = trailingslashit( $path ) . $template_name . '.php'; + } + + // Return what we found. /** * UM hook * * @type filter - * @title um_email_send_subject - * @description Change email notification subject + * @title um_locate_email_template + * @description Change email notification template path * @input_vars - * [{"var":"$subject","type":"string","desc":"Subject"}, - * {"var":"$key","type":"string","desc":"Template Key"}] + * [{"var":"$template","type":"string","desc":"Template Path"}, + * {"var":"$template_name","type":"string","desc":"Template Name"}] * @change_log * ["Since: 2.0"] * @usage - * + * * @example * */ - $subject = apply_filters( 'um_email_send_subject', UM()->options()->get( $template . '_sub' ), $template ); - $this->subject = um_convert_tags( $subject , $args ); - - $this->message = $this->prepare_template( $template, $args ); - - if ( UM()->options()->get( 'email_html' ) ) { - $this->headers .= "Content-Type: text/html\r\n"; - } else { - $this->headers .= "Content-Type: text/plain\r\n"; - } - - // Send mail - wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments ); + return apply_filters( 'um_locate_email_template', $template, $template_name ); } @@ -313,7 +331,7 @@ if ( ! class_exists( 'um\core\Mail' ) ) { > - get_email_template( $slug, $args ); ?> + get_email_template( $slug, $args ); ?> @@ -358,48 +376,55 @@ if ( ! class_exists( 'um\core\Mail' ) ) { /** - * Locate a template and return the path for inclusion. + * Send Email function * - * @access public - * @param string $template_name - * @return string + * @param string $email + * @param null $template + * @param array $args */ - function locate_template( $template_name ) { - // check if there is template at theme folder - $template = locate_template( array( - trailingslashit( 'ultimate-member/email' ) . $template_name . '.php' - ) ); + function send( $email, $template, $args = array() ) { - //if there isn't template at theme folder get template file from plugin dir - if ( ! $template ) { - $path = ! empty( $this->path_by_slug[ $template_name ] ) ? $this->path_by_slug[ $template_name ] : um_path . 'templates/email'; - $template = trailingslashit( $path ) . $template_name . '.php'; - } + if ( ! is_email( $email ) ) return; + if ( UM()->options()->get( $template . '_on' ) != 1 ) return; + + $this->attachments = null; + $this->headers = 'From: '. UM()->options()->get('mail_from') .' <'. UM()->options()->get('mail_from_addr') .'>' . "\r\n"; - // Return what we found. /** * UM hook * * @type filter - * @title um_locate_email_template - * @description Change email notification template path + * @title um_email_send_subject + * @description Change email notification subject * @input_vars - * [{"var":"$template","type":"string","desc":"Template Path"}, - * {"var":"$template_name","type":"string","desc":"Template Name"}] + * [{"var":"$subject","type":"string","desc":"Subject"}, + * {"var":"$key","type":"string","desc":"Template Key"}] * @change_log * ["Since: 2.0"] * @usage - * + * * @example * */ - return apply_filters( 'um_locate_email_template', $template, $template_name ); + $subject = apply_filters( 'um_email_send_subject', UM()->options()->get( $template . '_sub' ), $template ); + $this->subject = um_convert_tags( $subject , $args ); + + $this->message = $this->prepare_template( $template, $args ); + + if ( UM()->options()->get( 'email_html' ) ) { + $this->headers .= "Content-Type: text/html\r\n"; + } else { + $this->headers .= "Content-Type: text/plain\r\n"; + } + + // Send mail + wp_mail( $email, $this->subject, $this->message, $this->headers, $this->attachments ); } @@ -439,16 +464,16 @@ if ( ! class_exists( 'um\core\Mail' ) ) { * * @access public * @param string $template_name - * @param bool $html * @return string */ - function template_in_theme( $template_name, $html = false ) { + function template_in_theme( $template_name ) { $template_name_file = $this->get_template_filename( $template_name ); - $ext = ! $html ? '.php' : '.html'; - // check if there is template at theme folder + $blog_id = $this->get_blog_id(); + + // check if there is template at theme blog ID folder $template = locate_template( array( - trailingslashit( 'ultimate-member/email' ) . $template_name_file . $ext + trailingslashit( 'ultimate-member/email' . $blog_id ) . $template_name_file . '.php' ) ); // Return what we found. @@ -460,24 +485,26 @@ if ( ! class_exists( 'um\core\Mail' ) ) { * Method returns expected path for template * * @access public + * * @param string $location * @param string $template_name - * @param bool $html + * * @return string */ - function get_template_file( $location, $template_name, $html = false ) { + function get_template_file( $location, $template_name ) { $template_path = ''; $template_name_file = $this->get_template_filename( $template_name ); - $ext = ! $html ? '.php' : '.html'; - switch( $location ) { case 'theme': - $template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' ). $template_name_file . $ext; + //save email template in blog ID folder if we use multisite + $blog_id = $this->get_blog_id(); + + $template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' . $blog_id ). $template_name_file . '.php'; break; case 'plugin': $path = ! empty( $this->path_by_slug[ $template_name ] ) ? $this->path_by_slug[ $template_name ] : um_path . 'templates/email'; - $template_path = trailingslashit( $path ) . $template_name . $ext; + $template_path = trailingslashit( $path ) . $template_name . '.php'; break; } @@ -488,10 +515,10 @@ if ( ! class_exists( 'um\core\Mail' ) ) { /** * Ajax copy template to the theme * - * @param bool $template + * @param string $template * @return bool */ - function copy_email_template( $template = false ) { + function copy_email_template( $template ) { $in_theme = $this->template_in_theme( $template ); if ( $in_theme ) { @@ -522,26 +549,5 @@ if ( ! class_exists( 'um\core\Mail' ) ) { return false; } } - - - /** - * Delete Email Notification Template - */ - function delete_email_template() { - $template = $_POST['email_key']; - - $in_theme = $this->template_in_theme( $template ); - if ( ! $in_theme ) { - wp_send_json_error( new \WP_Error( 'template_in_theme', __( 'Template does not exists in theme', 'ultimate-member' ) ) ); - } - - $theme_template_path = $this->get_template_file( 'theme', $template ); - - if ( unlink( $theme_template_path ) ) { - wp_send_json_success(); - } else { - wp_send_json_error( new \WP_Error( 'template_not_exists', __( 'Can not remove template from theme', 'ultimate-member' ) ) ); - } - } } } \ No newline at end of file diff --git a/includes/core/class-password.php b/includes/core/class-password.php index 774e66fa..25bb55a8 100644 --- a/includes/core/class-password.php +++ b/includes/core/class-password.php @@ -107,6 +107,10 @@ if ( ! class_exists( 'um\core\Password' ) ) { UM()->form()->post_form = $_POST; + if ( empty( UM()->form()->post_form['mode'] ) ) { + UM()->form()->post_form['mode'] = 'password'; + } + /** * UM hook * diff --git a/includes/core/class-permalinks.php b/includes/core/class-permalinks.php index 56e27224..d88200e9 100644 --- a/includes/core/class-permalinks.php +++ b/includes/core/class-permalinks.php @@ -130,46 +130,10 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) { * @return mixed|void */ function get_current_url( $no_query_params = false ) { - $server_name_method = UM()->options()->get( 'current_url_method' ); - $server_name_method = ! empty( $server_name_method ) ? $server_name_method : 'SERVER_NAME'; + //use WP native function for fill $_SERVER variables by correct values + wp_fix_server_vars(); - $um_port_forwarding_url = UM()->options()->get( 'um_port_forwarding_url' ); - $um_port_forwarding_url = ! empty( $um_port_forwarding_url ) ? $um_port_forwarding_url : ''; - - $page_url = ''; - if ( is_multisite() ) { - $blog_id = get_current_blog_id(); - $siteurl = get_site_url( $blog_id ); - - $network_permalink_structure = UM()->options()->get( 'network_permalink_structure' ); - - if( $network_permalink_structure == "sub-directory" ){ - $page_url .= "//"; - $page_url .= $_SERVER[ $server_name_method ]; - }else{ - $page_url .= $siteurl; - } - - if ( $um_port_forwarding_url == 1 && isset( $_SERVER["SERVER_PORT"] ) ) { - $page_url .= ":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; - } else { - $page_url .= $_SERVER["REQUEST_URI"]; - } - - } else { - if ( !isset( $_SERVER['SERVER_NAME'] ) ) - return ''; - - $page_url .= "//"; - - if ( $um_port_forwarding_url == 1 && isset( $_SERVER["SERVER_PORT"] ) ) { - $page_url .= $_SERVER[ $server_name_method ].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; - - } else { - $page_url .= $_SERVER[ $server_name_method ].$_SERVER["REQUEST_URI"]; - } - - } + $page_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if ( $no_query_params == true ) { $page_url = strtok( $page_url, '?' ); @@ -196,7 +160,7 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) { * } * ?> */ - return apply_filters( 'um_get_current_page_url', set_url_scheme( $page_url ) ); + return apply_filters( 'um_get_current_page_url', $page_url ); } diff --git a/includes/core/class-profile.php b/includes/core/class-profile.php index a857654a..5ea09603 100644 --- a/includes/core/class-profile.php +++ b/includes/core/class-profile.php @@ -118,18 +118,20 @@ if ( ! class_exists( 'um\core\Profile' ) ) { // disable private tabs if ( ! is_admin() ) { - if( is_user_logged_in() ) { - $user_id = um_user('ID'); - um_fetch_user( get_current_user_id() ); - } + if ( is_user_logged_in() ) { + $user_id = um_user('ID'); + um_fetch_user( get_current_user_id() ); + } + foreach ( $tabs as $id => $tab ) { if ( ! $this->can_view_tab( $id ) ) { - unset( $tabs[$id] ); + unset( $tabs[ $id ] ); } } - if( is_user_logged_in() ) { - um_fetch_user( $user_id ); - } + + if ( is_user_logged_in() ) { + um_fetch_user( $user_id ); + } } return $tabs; @@ -143,10 +145,13 @@ if ( ! class_exists( 'um\core\Profile' ) ) { */ function tabs_active() { $tabs = $this->tabs(); - foreach( $tabs as $id => $info ) { - if ( ! UM()->options()->get('profile_tab_'.$id) && !isset( $info['_builtin'] ) && !isset( $info['custom'] ) ) + + foreach ( $tabs as $id => $info ) { + if ( ! UM()->options()->get( 'profile_tab_' . $id ) && ! isset( $info['_builtin'] ) && ! isset( $info['custom'] ) ) { unset( $tabs[ $id ] ); + } } + return $tabs; } @@ -212,28 +217,38 @@ if ( ! class_exists( 'um\core\Profile' ) ) { * @return bool */ function can_view_tab( $tab ) { - $privacy = intval( UM()->options()->get( 'profile_tab_' . $tab . '_privacy' ) ); + + $target_id = UM()->user()->target_id; + if ( empty( $target_id ) ) { + return true; + } + $can_view = false; - switch( $privacy ) { + $privacy = intval( UM()->options()->get( 'profile_tab_' . $tab . '_privacy' ) ); + switch ( $privacy ) { + case 0: + $can_view = true; + break; + case 1: - $can_view = is_user_logged_in() ? false : true; + $can_view = ! is_user_logged_in(); break; case 2: - $can_view = is_user_logged_in() ? true : false; + $can_view = is_user_logged_in(); break; case 3: - $can_view = get_current_user_id() == um_user( 'ID' ) ? true : false; + $can_view = is_user_logged_in() && get_current_user_id() === $target_id; break; case 4: - $can_view = false; - if( is_user_logged_in() ) { - $roles = UM()->options()->get( 'profile_tab_' . $tab . '_roles' ); - if( is_array( $roles ) - && in_array( UM()->user()->get_role(), $roles ) ) { + if ( is_user_logged_in() ) { + $roles = (array) UM()->options()->get( 'profile_tab_' . $tab . '_roles' ); + + $current_user_roles = um_user( 'roles' ); + if ( ! empty( $current_user_roles ) && count( array_intersect( $current_user_roles, $roles ) ) > 0 ) { $can_view = true; } } diff --git a/includes/core/class-rest-api.php b/includes/core/class-rest-api.php index 8a75f37e..288d8737 100644 --- a/includes/core/class-rest-api.php +++ b/includes/core/class-rest-api.php @@ -70,10 +70,10 @@ if ( ! class_exists( 'um\core\REST_API' ) ) { add_action( 'template_redirect', array( $this, 'process_query' ), -1 ); add_filter( 'query_vars', array( $this, 'query_vars' ) ); - add_filter( 'um_user_profile_additional_fields', array( $this, 'user_key_field' ), 3, 2 ); + //add_filter( 'um_user_profile_additional_fields', array( $this, 'user_key_field' ), 3, 2 ); - add_action( 'personal_options_update', array( $this, 'update_key' ) ); - add_action( 'edit_user_profile_update', array( $this, 'update_key' ) ); + //add_action( 'personal_options_update', array( $this, 'update_key' ) ); + //add_action( 'edit_user_profile_update', array( $this, 'update_key' ) ); // Determine if JSON_PRETTY_PRINT is available $this->pretty_print = defined( 'JSON_PRETTY_PRINT' ) ? JSON_PRETTY_PRINT : null; diff --git a/includes/core/class-rewrite.php b/includes/core/class-rewrite.php index 68b93f41..140af7e0 100644 --- a/includes/core/class-rewrite.php +++ b/includes/core/class-rewrite.php @@ -205,6 +205,30 @@ if ( ! class_exists( 'um\core\Rewrite' ) ) { $user_id = username_exists( um_queried_user() ); + //Try + if ( ! $user_id ) { + $permalink_base = UM()->options()->get( 'permalink_base' ); + + // Search by Profile Slug + $args = array( + "fields" => 'ids', + 'meta_query' => array( + array( + 'key' => 'um_user_profile_url_slug_'.$permalink_base, + 'value' => strtolower( um_queried_user() ), + 'compare' => '=' + ) + ), + 'number' => 1 + ); + + + $ids = new \WP_User_Query( $args ); + if ( $ids->total_users > 0 ) { + $user_id = current( $ids->get_results() ); + } + } + // Try nice name if ( !$user_id ) { $slug = um_queried_user(); diff --git a/includes/core/class-roles-capabilities.php b/includes/core/class-roles-capabilities.php index 3f2a1489..0878254d 100644 --- a/includes/core/class-roles-capabilities.php +++ b/includes/core/class-roles-capabilities.php @@ -418,6 +418,7 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) { $um_roles_keys = array_map( function( $item ) { return 'um_' . $item; }, $um_roles_keys ); + } $orders = array(); @@ -571,21 +572,25 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) { * @return bool|int */ function um_current_user_can( $cap, $user_id ) { - if ( ! is_user_logged_in() ) + if ( ! is_user_logged_in() ) { return false; + } $return = 1; um_fetch_user( get_current_user_id() ); $current_user_roles = UM()->roles()->get_all_user_roles( $user_id ); + switch( $cap ) { case 'edit': if ( get_current_user_id() == $user_id && um_user( 'can_edit_profile' ) ) $return = 1; - elseif ( ! um_user( 'can_edit_everyone' ) ) + elseif ( get_current_user_id() == $user_id && ! um_user( 'can_edit_profile' ) ) $return = 0; - elseif ( get_current_user_id() == $user_id && ! um_user( 'can_edit_profile') ) + elseif ( um_user( 'can_edit_everyone' ) ) + $return = 1; + elseif ( ! um_user( 'can_edit_everyone' ) ) $return = 0; elseif ( um_user( 'can_edit_roles' ) && ( empty( $current_user_roles ) || count( array_intersect( $current_user_roles, um_user( 'can_edit_roles' ) ) ) <= 0 ) ) $return = 0; @@ -618,6 +623,7 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) { $user_id = get_current_user_id(); $role = UM()->roles()->get_priority_user_role( $user_id ); + $permissions = $this->role_data( $role ); /** @@ -647,6 +653,9 @@ if ( ! class_exists( 'um\core\Roles_Capabilities' ) ) { if ( isset( $permissions[ $permission ] ) && is_serialized( $permissions[ $permission ] ) ) return unserialize( $permissions[ $permission ] ); + if ( isset( $permissions[ $permission ] ) && is_array( $permissions[ $permission ] ) ) + return $permissions[ $permission ]; + if ( isset( $permissions[ $permission ] ) && $permissions[ $permission ] == 1 ) return true; diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index 98c78253..315e3463 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -522,8 +522,18 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { $use_custom = get_post_meta( $this->form_id, "_um_{$mode}_use_custom_settings", true ); if ( $use_custom ) { // Custom Form settings $current_user_roles = UM()->roles()->get_all_user_roles( um_profile_id() ); - if ( ! empty( $args['role'] ) && ! in_array( $args['role'], $current_user_roles ) ) { - return ''; + + //backward compatibility between single/multi role form's setting + if ( ! empty( $args['role'] ) ) { + if ( is_array( $args['role'] ) ) { + if ( ! count( array_intersect( $args['role'], $current_user_roles ) ) ) { + return ''; + } + } else { + if ( ! in_array( $args['role'], $current_user_roles ) ) { + return ''; + } + } } } } diff --git a/includes/core/class-tracking.php b/includes/core/class-tracking.php index 7b22bce0..17ecc503 100644 --- a/includes/core/class-tracking.php +++ b/includes/core/class-tracking.php @@ -161,7 +161,7 @@ if ( ! class_exists( 'um\core\Tracking' ) ) { $request = wp_remote_post( 'https://ultimatemember.com/?um_action=checkin', array( 'method' => 'POST', - 'timeout' => 20, + 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, diff --git a/includes/core/class-user.php b/includes/core/class-user.php index 28cff8f4..229cc7dc 100644 --- a/includes/core/class-user.php +++ b/includes/core/class-user.php @@ -1360,6 +1360,10 @@ if ( ! class_exists( 'um\core\User' ) ) { function delete( $send_mail = true ) { $this->send_mail_on_delete = $send_mail; + //don't send email notification to not approved user + if ( 'approved' != um_user( 'account_status' ) ) { + $this->send_mail_on_delete = false; + } $this->delete_user_handler( um_user( 'ID' ) ); @@ -1463,6 +1467,7 @@ if ( ! class_exists( 'um\core\User' ) ) { function get_admin_actions() { $items = array(); $actions = array(); + /** * UM hook * @@ -1484,12 +1489,16 @@ if ( ! class_exists( 'um\core\User' ) ) { * } * ?> */ - $actions = apply_filters('um_admin_user_actions_hook', $actions ); - if ( !isset( $actions ) || empty( $actions ) ) return false; - foreach($actions as $id => $arr ) { - $url = add_query_arg('um_action', $id ); - $url = add_query_arg('uid', um_profile_id(), $url ); - $items[] = '' . $arr['label'] . ''; + $actions = apply_filters( 'um_admin_user_actions_hook', $actions ); + if ( ! isset( $actions ) || empty( $actions ) ) { + return false; + } + + foreach ( $actions as $id => $arr ) { + $url = add_query_arg( array( 'um_action' => $id, 'uid' => um_profile_id() ) ); + /*$url = add_query_arg( 'um_action', $id ); + $url = add_query_arg( 'uid', um_profile_id(), $url );*/ + $items[] = '' . $arr['label'] . ''; } return $items; } @@ -1648,18 +1657,12 @@ if ( ! class_exists( 'um\core\User' ) ) { */ $changes = apply_filters('um_before_update_profile', $changes, $this->id ); - // save or update profile meta foreach ( $changes as $key => $value ) { if ( ! in_array( $key, $this->update_user_keys ) ) { - update_user_meta( $this->id, $key, $value ); - } else { - - $args[$key] = esc_attr( $changes[$key] ); - + $args[ $key ] = esc_attr( $changes[ $key ] ); } - } diff --git a/includes/core/um-actions-core.php b/includes/core/um-actions-core.php index fdfabc43..ba9ea420 100644 --- a/includes/core/um-actions-core.php +++ b/includes/core/um-actions-core.php @@ -9,32 +9,34 @@ function um_action_request_process() { if ( is_admin() ) { return; } + if ( ! is_user_logged_in() ) { return; } + if ( ! isset( $_REQUEST['um_action'] ) ) { return; } + if ( isset( $_REQUEST['uid'] ) && ! UM()->user()->user_exists_by_id( $_REQUEST['uid'] ) ) { return; } - + if ( isset( $_REQUEST['uid'] ) ) { if ( is_super_admin( $_REQUEST['uid'] ) ) { - wp_die( __( 'Super administrators can not be modified.','ultimate-member' ) ); + wp_die( __( 'Super administrators can not be modified.', 'ultimate-member' ) ); } } - if ( isset( $_REQUEST['um_action'] ) && $_REQUEST['um_action'] != "edit" && ! current_user_can( 'edit_users' ) ) { - wp_die( __( 'You do not have enough permissions to do that.','ultimate-member') ); - } +// if ( isset( $_REQUEST['um_action'] ) && $_REQUEST['um_action'] != "edit" && ! current_user_can( 'edit_users' ) ) { +// wp_die( __( 'You do not have enough permissions to do that.','ultimate-member') ); +// } if ( isset( $_REQUEST['uid'] ) ) { $uid = $_REQUEST['uid']; } - + switch ( $_REQUEST['um_action'] ) { - default: $uid = isset( $_REQUEST['uid'] ) ? $_REQUEST['uid'] : 0; /** @@ -59,63 +61,90 @@ function um_action_request_process() { */ do_action( 'um_action_user_request_hook', $_REQUEST['um_action'], $uid ); break; - + case 'edit': UM()->fields()->editing = true; - if ( !um_can_edit_my_profile() ) { - $url = um_edit_my_profile_cancel_uri(); - exit( wp_redirect( $url ) ); + if ( ! um_is_myprofile() ) { + if ( ! UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) { + exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); + } + } else { + if ( ! um_can_edit_my_profile() ) { + $url = um_edit_my_profile_cancel_uri(); + exit( wp_redirect( $url ) ); + } } break; - + case 'um_switch_user': - if ( !current_user_can('delete_users') ) { + if ( ! current_user_can( 'delete_users' ) ) { return; } UM()->user()->auto_login( $_REQUEST['uid'] ); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + case 'um_reject_membership': + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) ); + } + um_fetch_user( $uid ); UM()->user()->reject(); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + case 'um_approve_membership': case 'um_reenable': - um_fetch_user( $uid ); - UM()->user()->approve(); - exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); - break; - + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) ); + } + + um_fetch_user( $uid ); + UM()->user()->approve(); + exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); + break; + case 'um_put_as_pending': + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) ); + } + um_fetch_user( $uid ); UM()->user()->pending(); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + case 'um_resend_activation': + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) ); + } + um_fetch_user( $uid ); UM()->user()->email_pending(); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + case 'um_deactivate': + if ( ! current_user_can( 'manage_options' ) ) { + wp_die( __( 'You do not have permission to make this action.', 'ultimate-member' ) ); + } + um_fetch_user( $uid ); UM()->user()->deactivate(); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + case 'um_delete': if ( ! UM()->roles()->um_current_user_can( 'delete', $uid ) ) { - wp_die( __('You do not have permission to delete this user.','ultimate-member') ); + wp_die( __( 'You do not have permission to delete this user.', 'ultimate-member' ) ); } + um_fetch_user( $uid ); UM()->user()->delete(); exit( wp_redirect( UM()->permalinks()->get_current_url( true ) ) ); break; - + } } -add_action( 'init', 'um_action_request_process', 10 ); \ No newline at end of file +add_action( 'template_redirect', 'um_action_request_process', 10000 ); \ No newline at end of file diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index 4e035551..2af4ac9e 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -1064,113 +1064,104 @@ add_action( 'um_pre_profile_shortcode', 'um_pre_profile_shortcode' ); * @param $args */ function um_add_edit_icon( $args ) { - $output = ''; - - if (!is_user_logged_in()) return; // not allowed for guests - - if (isset( UM()->user()->cannot_edit ) && UM()->user()->cannot_edit == 1) return; // do not proceed if user cannot edit - - if (UM()->fields()->editing == true) { - - ?> - -
- - - -
- - - -
- - - - '' . __( 'Edit Profile', 'ultimate-member' ) . '', - 'myaccount' => '' . __( 'My Account', 'ultimate-member' ) . '', - 'logout' => '' . __( 'Logout', 'ultimate-member' ) . '', - 'cancel' => '' . __( 'Cancel', 'ultimate-member' ) . '', - ); - - $cancel = $items['cancel']; - - if (!um_is_myprofile()) { - - $actions = UM()->user()->get_admin_actions(); - - unset( $items['myaccount'] ); - unset( $items['logout'] ); - unset( $items['cancel'] ); - - if (is_array( $actions )) { - $items = array_merge( $items, $actions ); - } - - /** - * UM hook - * - * @type filter - * @title um_profile_edit_menu_items - * @description Edit menu items on profile page - * @input_vars - * [{"var":"$items","type":"array","desc":"User Menu"}, - * {"var":"$user_id","type":"int","desc":"Profile ID"}] - * @change_log - * ["Since: 2.0"] - * @usage - * - * @example - * - */ - $items = apply_filters( 'um_profile_edit_menu_items', $items, um_profile_id() ); - - $items['cancel'] = $cancel; - - } else { - - /** - * UM hook - * - * @type filter - * @title um_myprofile_edit_menu_items - * @description Edit menu items on my profile page - * @input_vars - * [{"var":"$items","type":"array","desc":"User Menu"}] - * @change_log - * ["Since: 2.0"] - * @usage - * - * @example - * - */ - $items = apply_filters( 'um_myprofile_edit_menu_items', $items ); - - } - - UM()->profile()->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items ); - - ?> - -
- - fields()->editing == true ) { ?> + +
+ +
+ + roles()->um_current_user_can( 'edit', um_profile_id() ) && ! UM()->roles()->um_current_user_can( 'delete', um_profile_id() ) ) { + return; + } + + $items = UM()->user()->get_admin_actions(); + if ( UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) { + $items['editprofile'] = '' . __( 'Edit Profile', 'ultimate-member' ) . ''; + } + + /** + * UM hook + * + * @type filter + * @title um_profile_edit_menu_items + * @description Edit menu items on profile page + * @input_vars + * [{"var":"$items","type":"array","desc":"User Menu"}, + * {"var":"$user_id","type":"int","desc":"Profile ID"}] + * @change_log + * ["Since: 2.0"] + * @usage + * + * @example + * + */ + $items = apply_filters( 'um_profile_edit_menu_items', $items, um_profile_id() ); + + $items['cancel'] = '' . __( 'Cancel', 'ultimate-member' ) . ''; + + } else { + $items = array( + 'editprofile' => '' . __( 'Edit Profile', 'ultimate-member' ) . '', + 'myaccount' => '' . __( 'My Account', 'ultimate-member' ) . '', + 'logout' => '' . __( 'Logout', 'ultimate-member' ) . '', + 'cancel' => '' . __( 'Cancel', 'ultimate-member' ) . '', + ); + + if ( ! empty( UM()->user()->cannot_edit ) ) { + unset( $items['editprofile'] ); + } + + /** + * UM hook + * + * @type filter + * @title um_myprofile_edit_menu_items + * @description Edit menu items on my profile page + * @input_vars + * [{"var":"$items","type":"array","desc":"User Menu"}] + * @change_log + * ["Since: 2.0"] + * @usage + * + * @example + * + */ + $items = apply_filters( 'um_myprofile_edit_menu_items', $items ); + } ?> + +
+ + + + profile()->new_ui( $args['header_menu'], 'div.um-profile-edit', 'click', $items ); ?> + +
+ + options()->get( 'profile_menu' ) ) + if ( ! UM()->options()->get( 'profile_menu' ) ) { return; + } // get active tabs $tabs = UM()->profile()->tabs_active(); diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index 4a2f59bf..089fdf4c 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -146,8 +146,9 @@ add_filter( 'um_profile_field_filter_hook___um_last_login', 'um_profile_field_fi * @return mixed|string|void */ function um_profile_field_filter_hook__textarea( $value, $data ) { - if ( isset( $data ) && isset( $data['html'] ) && $data['html'] == 1 ) + if ( isset( $data['html'] ) && $data['html'] == 1 ) { return $value; + } $value = esc_textarea( $value ); $value = preg_replace('$(https?://[a-z0-9_./?=&#-]+)(?![^<>]*>)$i', ' $1 ', $value." "); @@ -612,10 +613,12 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) { if( 'text' == $type && ! in_array( $data['validate'], array( 'unique_email' ) ) || 'password' == $type ) { $value = esc_attr( $value ); - }elseif( $type == 'url' ) { + } elseif( $type == 'url' ) { $value = esc_url( $value ); - } elseif ( 'textarea' == $type ){ - $value = wp_kses_post( $value ); + } elseif ( 'textarea' == $type ) { + if ( empty( $data['html'] ) ) { + $value = wp_kses_post( $value ); + } } } diff --git a/includes/core/um-filters-user.php b/includes/core/um-filters-user.php index 6fef1987..1cc1e154 100644 --- a/includes/core/um-filters-user.php +++ b/includes/core/um-filters-user.php @@ -9,49 +9,47 @@ * @return null */ function um_admin_user_actions_hook( $actions ) { - $actions = null; um_fetch_user( um_profile_id() ); - if ( current_user_can('manage_options') ) { + //if ( UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) { + if ( current_user_can( 'manage_options' ) ) { - if ( um_user('account_status') == 'awaiting_admin_review' ){ - $actions['um_approve_membership'] = array( 'label' => __('Approve Membership','ultimate-member') ); - $actions['um_reject_membership'] = array( 'label' => __('Reject Membership','ultimate-member') ); + if ( um_user( 'account_status' ) == 'awaiting_admin_review' ) { + $actions['um_approve_membership'] = array( 'label' => __( 'Approve Membership', 'ultimate-member' ) ); + $actions['um_reject_membership'] = array( 'label' => __( 'Reject Membership', 'ultimate-member' ) ); } - if ( um_user('account_status') == 'rejected' ) { - $actions['um_approve_membership'] = array( 'label' => __('Approve Membership','ultimate-member') ); + if ( um_user( 'account_status' ) == 'rejected' ) { + $actions['um_approve_membership'] = array( 'label' => __( 'Approve Membership', 'ultimate-member' ) ); } - if ( um_user('account_status') == 'approved' ) { - $actions['um_put_as_pending'] = array( 'label' => __('Put as Pending Review','ultimate-member') ); + if ( um_user( 'account_status' ) == 'approved' ) { + $actions['um_put_as_pending'] = array( 'label' => __( 'Put as Pending Review', 'ultimate-member' ) ); } - if ( um_user('account_status') == 'awaiting_email_confirmation' ) { - $actions['um_resend_activation'] = array( 'label' => __('Resend Activation E-mail','ultimate-member') ); + if ( um_user( 'account_status' ) == 'awaiting_email_confirmation' ) { + $actions['um_resend_activation'] = array( 'label' => __( 'Resend Activation E-mail', 'ultimate-member' ) ); } - if ( um_user('account_status') != 'inactive' ) { - $actions['um_deactivate'] = array( 'label' => __('Deactivate this account','ultimate-member') ); + if ( um_user( 'account_status' ) != 'inactive' ) { + $actions['um_deactivate'] = array( 'label' => __( 'Deactivate this account', 'ultimate-member' ) ); } - if ( um_user('account_status') == 'inactive' ) { - $actions['um_reenable'] = array( 'label' => __('Reactivate this account','ultimate-member') ); - } - - if ( UM()->roles()->um_current_user_can( 'delete', um_profile_id() ) ) { - $actions['um_delete'] = array( 'label' => __('Delete this user','ultimate-member') ); + if ( um_user( 'account_status' ) == 'inactive' ) { + $actions['um_reenable'] = array( 'label' => __( 'Reactivate this account', 'ultimate-member' ) ); } } - if ( current_user_can('delete_users') ) { - $actions['um_switch_user'] = array( 'label' => __('Login as this user','ultimate-member') ); + if ( UM()->roles()->um_current_user_can( 'delete', um_profile_id() ) ) { + $actions['um_delete'] = array( 'label' => __( 'Delete this user', 'ultimate-member' ) ); } - + if ( current_user_can( 'delete_users' ) ) { + $actions['um_switch_user'] = array( 'label' => __( 'Login as this user', 'ultimate-member' ) ); + } return $actions; } diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index b0758afa..6906efee 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -705,10 +705,11 @@ function um_filtered_value( $key, $data = false ) { * @return bool|int|null */ function um_profile_id() { + $requested_user = um_get_requested_user(); - if ( um_get_requested_user() ) { + if ( $requested_user ) { return um_get_requested_user(); - } else if (is_user_logged_in() && get_current_user_id()) { + } elseif ( is_user_logged_in() && get_current_user_id() ) { return get_current_user_id(); } @@ -1063,10 +1064,11 @@ function um_requesting_password_reset() { * @return bool */ function um_requesting_password_change() { - if (um_is_core_page( 'account' ) && isset( $_POST['_um_account'] ) == 1) + if ( um_is_core_page( 'account' ) && isset( $_POST['_um_account'] ) == 1 & isset( $_POST['_um_account_tab'] ) == 'password' ) { return true; - else if (isset( $_POST['_um_password_change'] ) && $_POST['_um_password_change'] == 1) + } elseif ( isset( $_POST['_um_password_change'] ) && $_POST['_um_password_change'] == 1 ) { return true; + } return false; } @@ -1766,102 +1768,108 @@ function um_get_default_avatar_uri() { * @return bool|string */ function um_get_user_avatar_data( $user_id = '', $size = '96' ) { - if( empty( $user_id ) ) { - $user_id = um_user( 'ID' ); - } else { - um_fetch_user( $user_id ); - } + if( empty( $user_id ) ) { + $user_id = um_user( 'ID' ); + } else { + um_fetch_user( $user_id ); + } - $data = array( - 'user_id' => $user_id, - 'default' => um_get_default_avatar_uri(), - 'class' => 'gravatar avatar avatar-' . $size . ' um-avatar', - 'size' => $size - ); + $data = array( + 'user_id' => $user_id, + 'default' => um_get_default_avatar_uri(), + 'class' => 'gravatar avatar avatar-' . $size . ' um-avatar', + 'size' => $size + ); if ( $profile_photo = um_profile( 'profile_photo' ) ) { $data['url'] = um_get_avatar_uri( $profile_photo, $size ); - $data['type'] = 'upload'; - $data['class'] .= ' um-avatar-uploaded'; - } else if( $synced_profile_photo = um_user( 'synced_profile_photo' ) ) { - $data['url'] = $synced_profile_photo; - $data['type'] = 'sync'; - $data['class'] .= ' um-avatar-default'; - } else if( UM()->options()->get( 'use_gravatars' ) ) { - $avatar_hash_id = get_user_meta( $user_id, 'synced_gravatar_hashed_id', true ); - $data['url'] = set_url_scheme( '//gravatar.com/avatar/' . $avatar_hash_id ); - $data['url'] = add_query_arg( 's', 400, $data['url'] ); - $rating = get_option('avatar_rating'); - if ( !empty( $rating ) ) { + $data['type'] = 'upload'; + $data['class'] .= ' um-avatar-uploaded'; + } elseif ( $synced_profile_photo = um_user( 'synced_profile_photo' ) ) { + $data['url'] = $synced_profile_photo; + $data['type'] = 'sync'; + $data['class'] .= ' um-avatar-default'; + } elseif ( UM()->options()->get( 'use_gravatars' ) ) { + $avatar_hash_id = md5( um_user( 'user_email' ) ); + $data['url'] = set_url_scheme( '//gravatar.com/avatar/' . $avatar_hash_id ); + $data['url'] = add_query_arg( 's', 400, $data['url'] ); + $rating = get_option( 'avatar_rating' ); + if ( ! empty( $rating ) ) { $data['url'] = add_query_arg( 'r', $rating, $data['url'] ); } - $gravatar_type = UM()->options()->get( 'use_um_gravatar_default_builtin_image' ); - if ( $gravatar_type == 'default' ) { - if ( UM()->options()->get( 'use_um_gravatar_default_image' ) ) { - $data['url'] = add_query_arg( 'd', $data['default'], $data['url'] ); - } - } else { - $default = get_option( 'avatar_default', 'mystery' ); - if ( $default == 'gravatar_default' ) { - $default = ''; - } - $data['url'] = add_query_arg( 'd', $default, $data['url'] ); - } - $data['type'] = 'gravatar'; - $data['class'] .= ' um-avatar-gravatar'; - } else { - $data['url'] = $data['default']; - $data['type'] = 'default'; - $data['class'] .= ' um-avatar-default'; - } - /** - * UM hook - * - * @type filter - * @title um_user_avatar_url_filter - * @description Change user avatar URL - * @input_vars - * [{"var":"$avatar_uri","type":"string","desc":"Avatar URL"}, - * {"var":"$user_id","type":"int","desc":"User ID"}] - * @change_log - * ["Since: 2.0"] - * @usage add_filter( 'um_user_avatar_url_filter', 'function_name', 10, 2 ); - * @example - * - */ - $data['url'] = apply_filters( 'um_user_avatar_url_filter', $data['url'], $user_id, $data ); - /** - * UM hook - * - * @type filter - * @title um_avatar_image_alternate_text - * @description Change user display name on um_user function profile photo - * @input_vars - * [{"var":"$display_name","type":"string","desc":"User Display Name"}] - * @change_log - * ["Since: 2.0"] - * @usage add_filter( 'um_avatar_image_alternate_text', 'function_name', 10, 1 ); - * @example - * - */ - $data['alt'] = apply_filters( "um_avatar_image_alternate_text", um_user( "display_name" ), $data ); + $gravatar_type = UM()->options()->get( 'use_um_gravatar_default_builtin_image' ); + if ( $gravatar_type == 'default' ) { + if ( UM()->options()->get( 'use_um_gravatar_default_image' ) ) { + $data['url'] = add_query_arg( 'd', $data['default'], $data['url'] ); + } else { + $default = get_option( 'avatar_default', 'mystery' ); + if ( $default == 'gravatar_default' ) { + $default = ''; + } + $data['url'] = add_query_arg( 'd', $default, $data['url'] ); + } + } else { + $data['url'] = add_query_arg( 'd', $gravatar_type, $data['url'] ); + } + + $data['type'] = 'gravatar'; + $data['class'] .= ' um-avatar-gravatar'; + } else { + $data['url'] = $data['default']; + $data['type'] = 'default'; + $data['class'] .= ' um-avatar-default'; + } + + + /** + * UM hook + * + * @type filter + * @title um_user_avatar_url_filter + * @description Change user avatar URL + * @input_vars + * [{"var":"$avatar_uri","type":"string","desc":"Avatar URL"}, + * {"var":"$user_id","type":"int","desc":"User ID"}] + * @change_log + * ["Since: 2.0"] + * @usage add_filter( 'um_user_avatar_url_filter', 'function_name', 10, 2 ); + * @example + * + */ + $data['url'] = apply_filters( 'um_user_avatar_url_filter', $data['url'], $user_id, $data ); + /** + * UM hook + * + * @type filter + * @title um_avatar_image_alternate_text + * @description Change user display name on um_user function profile photo + * @input_vars + * [{"var":"$display_name","type":"string","desc":"User Display Name"}] + * @change_log + * ["Since: 2.0"] + * @usage add_filter( 'um_avatar_image_alternate_text', 'function_name', 10, 1 ); + * @example + * + */ + $data['alt'] = apply_filters( "um_avatar_image_alternate_text", um_user( "display_name" ), $data ); return $data; } + /** * get user avatar url * diff --git a/includes/widgets/class-um-search-widget.php b/includes/widgets/class-um-search-widget.php index bae8cbce..15e2045f 100644 --- a/includes/widgets/class-um-search-widget.php +++ b/includes/widgets/class-um-search-widget.php @@ -26,7 +26,7 @@ class UM_Search_Widget extends \WP_Widget { __('Ultimate Member - Search', 'ultimate-member'), // Widget description - array( 'description' => __( 'Shows users they follow in a widget.', 'ultimate-member' ), ) + array( 'description' => __( 'Shows the search member form.', 'ultimate-member' ), ) ); } diff --git a/readme.txt b/readme.txt index 9eb1d6fd..d08e8907 100644 --- a/readme.txt +++ b/readme.txt @@ -131,6 +131,33 @@ The plugin works with popular caching plugins by automatically excluding Ultimat = Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin = += 2.0.18: July 2, 2018 = + +* Enhancements: + - Added an ability to create different email templates for each site on multisites installs + - Added major version notice + - Added an ability to make Profile Form visible for 2 or more roles + - Redesign some parts of field's conditional logic settings + +* Bugfixes: + - Fixed PHP memory limit issue on some installs. Created pseudo-constructor + - Disabled email notification to user, which wasn't approved about delete their account + - Fixed profile tabs privacy + - Fixed default avatars and Gravatar displaying + - Fixed get current URL function + - Fixed admin bar displaying + - Fixed members directory search + - Fixed nav-menu items restriction handlers + - Fixed user displaying on multisite (added 404 error in some cases) + - Fixed XSS at wp-admin settings screen + - Fixed user's "user_login" permalinks + - Fixed user's capabilities ("Edit", "Delete" user) and profile actions displaying + - Fixed field's conditional logic + - Fixed issue with account button ID's duplicates + +* Deprecated: + - REST API user's key option; + = 2.0.17: May 30, 2018 = * Enhancements: diff --git a/ultimate-member.php b/ultimate-member.php index eb040a25..068a707c 100644 --- a/ultimate-member.php +++ b/ultimate-member.php @@ -3,7 +3,7 @@ Plugin Name: Ultimate Member Plugin URI: http://ultimatemember.com/ Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress -Version: 2.0.17 +Version: 2.0.18 Author: Ultimate Member Author URI: http://ultimatemember.com/ Text Domain: ultimate-member