diff --git a/.wordpress-org/blueprints/blueprint.json b/.wordpress-org/blueprints/blueprint.json index 1572d6ac..57962bb8 100644 --- a/.wordpress-org/blueprints/blueprint.json +++ b/.wordpress-org/blueprints/blueprint.json @@ -15,7 +15,7 @@ "step": "installPlugin", "pluginZipFile": { "resource": "url", - "url": "https:\/\/downloads.wordpress.org\/plugin\/ultimate-member.2.10.6.zip" + "url": "https:\/\/downloads.wordpress.org\/plugin\/ultimate-member.2.10.7.zip" }, "options": { "activate": true diff --git a/README.md b/README.md index b8e6a86d..187b8e15 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ GNU Version 2 or Any Later Version ### IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION -[Official Release Version: 2.10.6](https://github.com/ultimatemember/ultimatemember/releases/tag/2.10.6). +[Official Release Version: 2.10.7](https://github.com/ultimatemember/ultimatemember/releases/tag/2.10.7). ## Changelog diff --git a/assets/js/um-functions.js b/assets/js/um-functions.js index e83e324b..7056d926 100644 --- a/assets/js/um-functions.js +++ b/assets/js/um-functions.js @@ -348,6 +348,7 @@ function initImageUpload_UM( trigger ) { var cache_ts = new Date(); + img_id.removeAttr("loading"); img_id.attr("src", d.url + "?"+cache_ts.getTime() ); img_id.data("file", d.file ); diff --git a/assets/js/um-functions.min.js b/assets/js/um-functions.min.js index e3e2db4f..9f2bd412 100644 --- a/assets/js/um-functions.min.js +++ b/assets/js/um-functions.min.js @@ -1 +1 @@ -function UM_domenus(){jQuery(".um-dropdown").each(function(e,o){UM.dropdown.setPosition(o)})}function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var o=jQuery("input[data-key=user_password]").val(),a=jQuery("input[data-key=confirm_user_password]").val(),t=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");o||a?o!==a?t.removeClass("um-validate-matched").addClass("um-validate-not-matched"):t.removeClass("um-validate-not-matched").addClass("um-validate-matched"):t.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function um_responsive(){jQuery(".um").each(function(){(element_width=jQuery(this).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")):960'+d.data("upload_help_text")+"":"",icon=d.data("icon")?'':"",upload_text=d.data("upload_text")?''+d.data("upload_text")+"":"";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),d.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:d.data("key"),set_id:d.data("set_id"),set_mode:d.data("set_mode"),_wpnonce:d.data("nonce"),timestamp:d.data("timestamp"),user_id:e},fileName:d.data("key"),allowedTypes:d.data("allowed_types"),maxFileSize:d.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:d.data("max_size_error"),extErrorStr:d.data("extension_error"),maxFileCountErrorStr:d.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){d.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,a){d.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(d.parents(".um-modal-body").append('
'+o.data.error+"
"),d.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(o.data,function(e,o){var a=d.parents(".um-modal-body").find(".um-single-image-preview img"),t=d.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;a.attr("src",o.url+"?"+i.getTime()),a.data("file",o.file),a.on("load",function(){d.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),d.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),t.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(t){upload_help_text=t.data("upload_help_text")?''+t.data("upload_help_text")+"":"",icon=t.data("icon")?'':"",upload_text=t.data("upload_text")?''+t.data("upload_text")+"":"",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),t.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:t.data("key"),set_id:t.data("set_id"),user_id:t.data("user_id"),set_mode:t.data("set_mode"),_wpnonce:t.data("nonce"),timestamp:t.data("timestamp")},fileName:t.data("key"),allowedTypes:t.data("allowed_types"),maxFileSize:t.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:t.data("max_size_error"),extErrorStr:t.data("extension_error"),maxFileCountErrorStr:t.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){t.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,a){t.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(t.parents(".um-modal-body").append('
'+o.data.error+"
"),t.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(o.data,function(e,o){t.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),t.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),t.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?t.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(o):"icon_bg"==e?t.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":o}):"filename"==e?t.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",o):"original_name"==e?(t.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",o),t.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(o)):"url"==e&&t.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",o)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function um_new_modal(e,o,a,t){var i,d,s,r=jQuery(".um-modal-overlay"),r=(0!==r.length&&(r.hide(),r.next(".um-modal").hide()),UM.common.tipsy.hide(),UM.dropdown.hideAll(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),jQuery('
')),u=r.filter(".um-modal");u.append(jQuery("#"+e)),jQuery("body").append(r),a?(i=jQuery(''),d=jQuery(window).width()-60,s=jQuery(window).height()-.25*jQuery(window).height(),i.on("load",function(){u.find(".um-modal-photo").html(i),u.addClass("is-photo").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}).show().children().show(),i.css({opacity:0,"max-width":d,"max-height":s}).animate({opacity:1},1e3),um_modal_responsive()})):(u.addClass("no-photo").show().children().show(),um_modal_size(o),initImageUpload_UM(jQuery(".um-modal:visible .um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible .um-single-file-upload")),um_modal_responsive())}function um_modal_responsive(){var e,o,a,t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,d=jQuery(".um-modal:visible").not(".um-modal-hidden"),s=d.find(".um-modal-body.photo:visible");(s.length||d.length)&&(e=(i-d.innerHeight())/2+"px",d.removeClass("uimob340").removeClass("uimob500"),s.length?(s=t-60,a=i-.25*i,(o=jQuery(".um-modal-photo img")).css({opacity:0}),o.css({"max-width":s}),o.css({"max-height":a}),d.css({width:o.width(),"margin-left":"-"+o.width()/2+"px"}),o.animate({opacity:1},1e3),d.animate({bottom:e},300)):d.length&&(t<=340?d.addClass("uimob340"):t<=500&&d.addClass("uimob500"),UM.frontend.cropper.init(),t<=500||i-parseInt(e)>i?d.animate({bottom:0},300):d.animate({bottom:e},300)))}function um_remove_modal(){wp.hooks.doAction("um_remove_modal"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('body > .um-modal div[id^="um_"]').hide().appendTo("body"),jQuery("body > .um-modal, body > .um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").not(".um-modal-hidden").addClass(e)}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&&(wp.hooks.doAction("um_before_modal_removed",jQuery(".um-popup")),UM.common.tipsy.hide(),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),UM.common.tipsy.init())}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(350<(ag_height=jQuery(window).height()-jQuery(".um-popup .um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80)&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").prop("checked",!1).prop("selected",!1)}"object"!=typeof window.UM&&(window.UM={}),UM.dropdown={hide:function(e){e=jQuery(e);e.parents("div").find("a").removeClass("active"),e.hide()},hideAll:function(){var e=jQuery(".um-dropdown");e.parents("div").find("a").removeClass("active"),e.hide()},setPosition:function(e){var o,a=jQuery(e),t=200,e=jQuery("html").attr("dir"),i=a.attr("data-element"),d=a.attr("data-position"),s=a.attr("data-trigger"),r=i&&jQuery(i).length?jQuery(i):a.siblings("a").length?a.siblings("a").first():a.parent(),u=(r.addClass("um-trigger-menu-on-"+s),0),n=(r.outerWidth()-t)/2,l=r.outerHeight(),i=r.offset();switch(r.is(".um-profile-photo")&&(o=r.find(".um-profile-photo-img"),l=r.closest("div.uimob500").length?r.outerHeight()-o.outerHeight()/4:(n=(o.outerWidth()-t)/2,o.outerHeight()/4)),r.is(".um-cover")&&(o=r.find(".um-cover-e"),l=r.closest("div.uimob500").length?(n=(o.outerWidth()-t)/2,o.outerHeight()/2+24):(n=(o.outerWidth()-t)/2,o.outerHeight()/2+46)),"lc"===d&&"rtl"===e&&(d="rc"),r.outerWidth()'+d.data("upload_help_text")+"":"",icon=d.data("icon")?'':"",upload_text=d.data("upload_text")?''+d.data("upload_text")+"":"";var e=0;jQuery("#um_upload_single:visible").data("user_id")&&(e=jQuery("#um_upload_single:visible").data("user_id")),d.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_imageupload",key:d.data("key"),set_id:d.data("set_id"),set_mode:d.data("set_mode"),_wpnonce:d.data("nonce"),timestamp:d.data("timestamp"),user_id:e},fileName:d.data("key"),allowedTypes:d.data("allowed_types"),maxFileSize:d.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:d.data("max_size_error"),extErrorStr:d.data("extension_error"),maxFileCountErrorStr:d.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,returnType:"json",onSubmit:function(e){d.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,t){d.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(d.parents(".um-modal-body").append('
'+o.data.error+"
"),d.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(o.data,function(e,o){var t=d.parents(".um-modal-body").find(".um-single-image-preview img"),a=d.parents(".um-modal-body").find(".um-single-image-preview"),i=new Date;t.removeAttr("loading"),t.attr("src",o.url+"?"+i.getTime()),t.data("file",o.file),t.on("load",function(){d.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),d.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),a.show(0),um_modal_responsive()})})},onError:function(e){console.log(e)}})}function initFileUpload_UM(a){upload_help_text=a.data("upload_help_text")?''+a.data("upload_help_text")+"":"",icon=a.data("icon")?'':"",upload_text=a.data("upload_text")?''+a.data("upload_text")+"":"",jQuery("#um_upload_single:visible").data("user_id")&&(user_id=jQuery("#um_upload_single:visible").data("user_id")),a.uploadFile({url:wp.ajax.settings.url,method:"POST",multiple:!1,formData:{action:"um_fileupload",key:a.data("key"),set_id:a.data("set_id"),user_id:a.data("user_id"),set_mode:a.data("set_mode"),_wpnonce:a.data("nonce"),timestamp:a.data("timestamp")},fileName:a.data("key"),allowedTypes:a.data("allowed_types"),maxFileSize:a.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:a.data("max_size_error"),extErrorStr:a.data("extension_error"),maxFileCountErrorStr:a.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(e){a.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(e,o,t){a.selectedFiles=0,o.success&&0==o.success||void 0!==o.data.error?(a.parents(".um-modal-body").append('
'+o.data.error+"
"),a.parents(".um-modal-body").find(".upload-statusbar").hide(0)):jQuery.each(o.data,function(e,o){a.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),a.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),a.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==e?a.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(o):"icon_bg"==e?a.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":o}):"filename"==e?a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-file",o):"original_name"==e?(a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("data-orignal-name",o),a.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(o)):"url"==e&&a.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",o)}),setTimeout(function(){um_modal_responsive()},1e3)},onError:function(e){console.log(e)}})}function um_new_modal(e,o,t,a){var i,d,r,s=jQuery(".um-modal-overlay"),s=(0!==s.length&&(s.hide(),s.next(".um-modal").hide()),UM.common.tipsy.hide(),UM.dropdown.hideAll(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),jQuery('
')),u=s.filter(".um-modal");u.append(jQuery("#"+e)),jQuery("body").append(s),t?(i=jQuery(''),d=jQuery(window).width()-60,r=jQuery(window).height()-.25*jQuery(window).height(),i.on("load",function(){u.find(".um-modal-photo").html(i),u.addClass("is-photo").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}).show().children().show(),i.css({opacity:0,"max-width":d,"max-height":r}).animate({opacity:1},1e3),um_modal_responsive()})):(u.addClass("no-photo").show().children().show(),um_modal_size(o),initImageUpload_UM(jQuery(".um-modal:visible .um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible .um-single-file-upload")),um_modal_responsive())}function um_modal_responsive(){var e,o,t,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,d=jQuery(".um-modal:visible").not(".um-modal-hidden"),r=d.find(".um-modal-body.photo:visible");(r.length||d.length)&&(e=(i-d.innerHeight())/2+"px",d.removeClass("uimob340").removeClass("uimob500"),r.length?(r=a-60,t=i-.25*i,(o=jQuery(".um-modal-photo img")).css({opacity:0}),o.css({"max-width":r}),o.css({"max-height":t}),d.css({width:o.width(),"margin-left":"-"+o.width()/2+"px"}),o.animate({opacity:1},1e3),d.animate({bottom:e},300)):d.length&&(a<=340?d.addClass("uimob340"):a<=500&&d.addClass("uimob500"),UM.frontend.cropper.init(),a<=500||i-parseInt(e)>i?d.animate({bottom:0},300):d.animate({bottom:e},300)))}function um_remove_modal(){wp.hooks.doAction("um_remove_modal"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('body > .um-modal div[id^="um_"]').hide().appendTo("body"),jQuery("body > .um-modal, body > .um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").not(".um-modal-hidden").addClass(e)}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&&(wp.hooks.doAction("um_before_modal_removed",jQuery(".um-popup")),UM.common.tipsy.hide(),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),UM.common.tipsy.init())}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(350<(ag_height=jQuery(window).height()-jQuery(".um-popup .um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80)&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}):jQuery(".um-popup-autogrow2:visible").length&&jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").prop("checked",!1).prop("selected",!1)}"object"!=typeof window.UM&&(window.UM={}),UM.dropdown={hide:function(e){e=jQuery(e);e.parents("div").find("a").removeClass("active"),e.hide()},hideAll:function(){var e=jQuery(".um-dropdown");e.parents("div").find("a").removeClass("active"),e.hide()},setPosition:function(e){var o,t=jQuery(e),a=200,e=jQuery("html").attr("dir"),i=t.attr("data-element"),d=t.attr("data-position"),r=t.attr("data-trigger"),s=i&&jQuery(i).length?jQuery(i):t.siblings("a").length?t.siblings("a").first():t.parent(),u=(s.addClass("um-trigger-menu-on-"+r),0),n=(s.outerWidth()-a)/2,l=s.outerHeight(),i=s.offset();switch(s.is(".um-profile-photo")&&(o=s.find(".um-profile-photo-img"),l=s.closest("div.uimob500").length?s.outerHeight()-o.outerHeight()/4:(n=(o.outerWidth()-a)/2,o.outerHeight()/4)),s.is(".um-cover")&&(o=s.find(".um-cover-e"),l=s.closest("div.uimob500").length?(n=(o.outerWidth()-a)/2,o.outerHeight()/2+24):(n=(o.outerWidth()-a)/2,o.outerHeight()/2+46)),"lc"===d&&"rtl"===e&&(d="rc"),s.outerWidth()user_id` is empty. + - Fixed: The `emotize` function regexp for better emoji converting. + - Fixed: The conflict between the image uploader and lazy-loading attribute added by 3rd-party plugins. + - Fixed: PHP warnings for roles without meta data. + - Fixed: Typo in labels. + = 2.10.6 October 02, 2025 = * Enhancements: diff --git a/includes/admin/class-extensions-updater.php b/includes/admin/class-extensions-updater.php index 11d3aa40..313001c9 100644 --- a/includes/admin/class-extensions-updater.php +++ b/includes/admin/class-extensions-updater.php @@ -10,6 +10,10 @@ if ( ! defined( 'ABSPATH' ) ) { */ class Extensions_Updater { + const EXTRA_TIME = 30; + + const PAGINATION = 50; + /** * @var array */ @@ -33,41 +37,109 @@ class Extensions_Updater { ); add_action( 'admin_init', array( $this, 'maybe_run_updater' ) ); + add_action( 'um_' . $this->updater_data['slug'] . '_package_start', array( $this, 'package_start' ), 10, 4 ); + add_action( 'um_' . $this->updater_data['slug'] . '_package_complete', array( $this, 'package_complete' ) ); + } + + public function package_start( $version, $file_path, $delay, $per_page ) { + $hooks = array( + 'start' => 'um_' . $this->updater_data['slug'] . '_package_start', + 'complete' => 'um_' . $this->updater_data['slug'] . '_package_complete', + ); + + $debug = defined( 'UM_UPDATER_DEBUG' ) && UM_UPDATER_DEBUG; + + include_once $file_path; + /** + * IMPORTANT!!!: Last action that we need to do after package is complete. + * `UM()->maybe_action_scheduler()->schedule_single_action( + * time() + 1, + * $hook, + * array( + * 'version' => $version, + * ) + * );` + */ + } + + public function package_complete( $version ) { + $this->set_last_version_upgrade( $version ); + $this->reset_in_process_package_version(); } /** * Maybe run upgrade if needed. */ public function maybe_run_updater() { - $last_version_upgrade = $this->get_last_version_upgrade(); - if ( ! empty( $last_version_upgrade ) && version_compare( $last_version_upgrade, $this->updater_data['version'], '>=' ) ) { - // Don't need update. + // Cold start to avoid scheduled actions duplicates. Don't remove it. + $init = get_transient( 'um_' . $this->updater_data['slug'] . '_updater_init' ); + if ( ! empty( $init ) ) { + return; + } + set_transient( 'um_' . $this->updater_data['slug'] . '_updater_init', true, 10 ); + + $next_package = $this->get_next_package(); + if ( empty( $next_package ) ) { + $this->set_last_version_upgrade( $this->updater_data['version'] ); + $this->reset_in_process_package_version(); return; } - $packages = $this->get_packages(); - if ( ! empty( $packages ) ) { - $packages_dir = $this->get_packages_dir(); - foreach ( $packages as $package_version ) { - if ( version_compare( $package_version, $last_version_upgrade, '<=' ) ) { - continue; - } + list( $package_version, $file_path ) = $next_package; - if ( version_compare( $package_version, $this->updater_data['version'], '>' ) ) { - continue; - } - - $file_path = $packages_dir . $package_version . '.php'; - if ( ! file_exists( $file_path ) ) { - continue; - } - - include_once $file_path; - $this->set_last_version_upgrade( $package_version ); - } + $in_process_package = $this->get_in_process_package_version(); + if ( ! empty( $in_process_package ) && version_compare( $in_process_package, $package_version, '=' ) ) { + return; } - $this->set_last_version_upgrade( $this->updater_data['version'] ); + // Initialize start package action. + $action_id = UM()->maybe_action_scheduler()->schedule_single_action( + time() + self::EXTRA_TIME, + 'um_' . $this->updater_data['slug'] . '_package_start', + array( + 'version' => $package_version, + 'path' => $file_path, + 'delay' => self::EXTRA_TIME, + 'per_page' => self::PAGINATION, + ) + ); + + // As soon as scheduler single action is created - then set in progress package version to avoid duplicates of the package start action. + if ( ! empty( $action_id ) ) { + $this->set_in_process_package_version( $package_version ); + } + } + + private function get_next_package() { + $last_version_upgrade = $this->get_last_version_upgrade(); + if ( ! empty( $last_version_upgrade ) && version_compare( $last_version_upgrade, $this->updater_data['version'], '>=' ) ) { + return null; + } + + $packages = $this->get_packages(); + if ( empty( $packages ) ) { + return null; + } + + $packages_dir = $this->get_packages_dir(); + foreach ( $packages as $package_version ) { + if ( version_compare( $package_version, $last_version_upgrade, '<=' ) ) { + continue; + } + + if ( version_compare( $package_version, $this->updater_data['version'], '>' ) ) { + continue; + } + + $file_path = $packages_dir . $package_version . '.php'; + if ( ! file_exists( $file_path ) ) { + continue; + } + + return array( $package_version, $file_path ); + } + + return null; } /** @@ -121,4 +193,29 @@ class Extensions_Updater { private function set_last_version_upgrade( $version ) { update_option( 'um_' . $this->updater_data['slug'] . '_last_version_upgrade', $version ); } + + /** + * Gets the last version upgrade from options. + * + * @return string The last version upgrade. + */ + private function get_in_process_package_version() { + return get_option( 'um_' . $this->updater_data['slug'] . '_in_process_package_upgrade', '' ); + } + + /** + * Set the last version upgrade for the updater. + * + * @param string $version The version to set as the last upgrade version. + */ + private function set_in_process_package_version( $version ) { + update_option( 'um_' . $this->updater_data['slug'] . '_in_process_package_upgrade', $version ); + } + + /** + * Set the last version upgrade for the updater. + */ + private function reset_in_process_package_version() { + update_option( 'um_' . $this->updater_data['slug'] . '_in_process_package_upgrade', '' ); + } } diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 13d66d89..19dedc40 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -325,7 +325,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { break; case 'members': if ( ! has_shortcode( $content, 'ultimatemember' ) ) { - $page_setting_description = __( 'Warning: Members page must contain a profile form shortcode. You can get existing shortcode or create a new one here.', 'ultimate-member' ); + $page_setting_description = __( 'Warning: Members page must contain a member directory shortcode. You can get existing shortcode or create a new one here.', 'ultimate-member' ); } break; default: @@ -2969,11 +2969,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } $request = wp_remote_post( UM()::$store_url, $post_attr ); - if ( ! is_wp_error( $request ) ) { - $request = json_decode( wp_remote_retrieve_body( $request ) ); - } else { + if ( empty( $request ) || is_wp_error( $request ) ) { if ( self::is_license_debug_enabled() ) { - error_log( '> Got `wp_error`, try again with `sslverify=true`' ); + error_log( '> Got `wp_error` or empty request body, try again with `sslverify=true`' ); } $post_attr['sslverify'] = true; @@ -2982,6 +2980,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { if ( ! is_wp_error( $request ) ) { $request = json_decode( wp_remote_retrieve_body( $request ) ); } + } else { + $request = json_decode( wp_remote_retrieve_body( $request ) ); + if ( empty( $request ) ) { + if ( self::is_license_debug_enabled() ) { + error_log( '> Got empty request body, try again with `sslverify=true`' ); + } + + $post_attr['sslverify'] = true; + + $request = wp_remote_post( UM()::$store_url, $post_attr ); + if ( ! is_wp_error( $request ) ) { + $request = json_decode( wp_remote_retrieve_body( $request ) ); + } + } } if ( self::is_license_debug_enabled() ) { @@ -2989,6 +3001,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { error_log( '> Finally got `wp_error`. Details below.' ); error_log( '>> Error code: ' . $request->get_error_code() ); error_log( '>> Error message: ' . $request->get_error_message() ); + } elseif ( empty( $request ) ) { + error_log( '> Finally got empty UM website response.' ); } else { error_log( '### Response from UM website:' ); error_log( '>' . maybe_serialize( $request ) ); diff --git a/includes/admin/templates/role/role-edit.php b/includes/admin/templates/role/role-edit.php index 175ba84f..a750adba 100644 --- a/includes/admin/templates/role/role-edit.php +++ b/includes/admin/templates/role/role-edit.php @@ -55,7 +55,7 @@ if ( ! empty( $_GET['id'] ) ) { // roles e.g. "潜水艦subs" with both latin + not-UTB-8 symbols had invalid role ID $role_id = sanitize_title( $_GET['id'] ); - $data = get_option( "um_role_{$role_id}_meta" ); + $data = get_option( "um_role_{$role_id}_meta", array() ); if ( empty( $data['_um_is_custom'] ) ) { $data['name'] = $wp_roles->roles[ $role_id ]['name']; diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php index 8b93e386..50c41c15 100644 --- a/includes/class-dependencies.php +++ b/includes/class-dependencies.php @@ -31,23 +31,23 @@ if ( ! class_exists( 'um\Dependencies' ) ) { */ public $ext_required_version = array( 'bbpress' => '2.0.7', - 'followers' => '2.1.6', + 'followers' => '2.3.5', 'forumwp' => '2.1.5', - 'friends' => '2.1.4', + 'friends' => '2.3.4', 'groups' => '2.4.2', 'jobboardwp' => '1.0.7', - 'mailchimp' => '2.2.0', + 'mailchimp' => '2.6.2', 'messaging' => '2.2.5', 'mycred' => '2.2.4', 'notices' => '2.0.5', - 'notifications' => '2.1.3', + 'notifications' => '2.3.8', 'online' => '2.1.1', 'private-content' => '2.0.5', 'profile-completeness' => '2.2.7', 'profile-tabs' => '1.0.0', 'recaptcha' => '2.3.4', 'reviews' => '2.1.5', - 'social-activity' => '2.2.0', + 'social-activity' => '2.4.0', 'social-login' => '2.2.0', 'stripe' => '1.0.0', 'zapier' => '1.0.0', diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index ff86b3be..4b73767d 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -217,24 +217,29 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) { return $args; } - /** * Emoji support * - * @param $content + * @param string $content + * @param bool $stripslashes * * @return mixed|string */ - function emotize( $content ) { - $content = stripslashes( $content ); + public function emotize( $content, $stripslashes = true ) { + if ( $stripslashes ) { + $content = stripslashes( $content ); + } foreach ( $this->emoji as $code => $val ) { - $regex = str_replace(array('(', ')'), array("\\" . '(', "\\" . ')'), $code); - $content = preg_replace('/(' . $regex . ')(\s|$)/', '' . $code . '$2', $content); + $regex = str_replace( array( '(', ')' ), array( '\\' . '(', '\\' . ')' ), $code ); + $content = preg_replace( + '/(' . $regex . ')(?=\s|$|<)/', + '' . $code . '', + $content + ); } return $content; } - /** * Remove wpautop filter for post content if it's UM core page */ diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index 520c42c2..da1c67d5 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -863,25 +863,22 @@ function um_profile_header_cover_area( $args ) { data-user_id="" data-ratio=""> Make any custom action in the User Profile cover wrapper. + * function my_cover_area_content( $user_id, $args ) { * // your code here * } - * ?> + * add_action( 'um_cover_area_content', 'my_cover_area_content', 10, 2 ); */ - do_action( 'um_cover_area_content', um_profile_id() ); + do_action( 'um_cover_area_content', um_profile_id(), $args ); if ( true === UM()->fields()->editing ) { $hide_remove = ' style="display:none;"'; diff --git a/includes/frontend/class-user-profile.php b/includes/frontend/class-user-profile.php index 5a155640..14a0fca5 100644 --- a/includes/frontend/class-user-profile.php +++ b/includes/frontend/class-user-profile.php @@ -87,14 +87,18 @@ if ( ! class_exists( 'um\frontend\User_Profile' ) ) { /** * Retrieves the user profile URL for the given comment author. * - * @param string $comment_author_url The URL of the comment author. - * @param int $comment_id The ID of the comment. - * @param WP_Comment $comment The comment object. + * @param string $comment_author_url The URL of the comment author. + * @param int $comment_id The ID of the comment. + * @param WP_Comment|null $comment The comment object. * * @return string The user profile URL for the comment author. */ public function change_comment_author_url( $comment_author_url, $comment_id, $comment ) { - return um_user_profile_url( $comment->user_id ); + if ( ! is_null( $comment ) && ! empty( $comment->user_id ) ) { + return um_user_profile_url( $comment->user_id ); + } + + return $comment_author_url; } } } diff --git a/package.json b/package.json index 546f2deb..66f933ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ultimate-member", - "version": "2.10.6", + "version": "2.10.7", "author": { "name": "Ultimate Member", "email": "team@ultimatemember.com", diff --git a/readme.txt b/readme.txt index ee126525..fba8bf26 100644 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Tags: community, member, membership, user-profile, user-registration Requires PHP: 7.0 Requires at least: 6.2 Tested up to: 6.8 -Stable tag: 2.10.6 +Stable tag: 2.10.7 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.txt @@ -167,6 +167,22 @@ No specific extensions are needed. But we highly recommended keep active these P IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION += 2.10.7 2025-11-20 = + +**Enhancements** + +* Added: Extra condition for checking the license activation requests. +* Added: 2nd `$args` attribute to the action hook 'um_cover_area_content'. +* Tweak: Updated `Extensions_Updater` class to use Action Scheduler in the upgrade process of the UM extensions. + +**Bugfixes** + +* Fixed: User profile links in the comments section on the frontend when the `$comment->user_id` is empty. +* Fixed: The `emotize` function regexp for better emoji converting. +* Fixed: The conflict between the image uploader and lazy-loading attribute added by 3rd-party plugins. +* Fixed: PHP warnings for roles without meta data. +* Fixed: Typo in labels. + = 2.10.6 2025-10-02 = **Enhancements** diff --git a/ultimate-member.php b/ultimate-member.php index 74686686..6905ab84 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.10.6 + * Version: 2.10.7 * Author: Ultimate Member * Author URI: http://ultimatemember.com/ * License: GPLv3 @@ -36,6 +36,7 @@ define( 'UM_VERSION', $plugin_data['Version'] ); define( 'UM_PLUGIN_NAME', $plugin_data['Name'] ); define( 'UM_WP_FUNCTIONS_VERSION', '6.8.0' ); // Updates every major WordPress release. define( 'UM_LICENSE_REQUEST_DEBUG', false ); // Set true then need to debug the license request. +define( 'UM_UPDATER_DEBUG', false ); // Set true then need to debug the upgrade packages. // define( 'UM_DEV_MODE', true ); require_once 'includes/class-functions.php';