From b1dbfb579881562bd7e091e83f284525f27fd2a4 Mon Sep 17 00:00:00 2001 From: sdobreff Date: Tue, 4 Jun 2024 11:09:10 +0000 Subject: [PATCH] Error notices fixes --- assets/dist/js/notices.js | 4 ++++ assets/dist/js/notices.min.js | 1 - bin/create-builds.sh | 2 ++ includes/classes/class-settings.php | 4 ++-- includes/functions/core.php | 2 ++ 5 files changed, 10 insertions(+), 3 deletions(-) delete mode 100755 assets/dist/js/notices.min.js diff --git a/assets/dist/js/notices.js b/assets/dist/js/notices.js index e57279d..4c64f20 100755 --- a/assets/dist/js/notices.js +++ b/assets/dist/js/notices.js @@ -82,6 +82,10 @@ return 'error'; } + if (jqNotice.hasClass('error')) { + return 'error'; + } + if (jqNotice.hasClass('notice-info') || jqNotice.hasClass('notice-information')) { return 'information'; } diff --git a/assets/dist/js/notices.min.js b/assets/dist/js/notices.min.js deleted file mode 100755 index ee04821..0000000 --- a/assets/dist/js/notices.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";!function(l,e){({container:null,counter_link:null,migration_delay:100,migration_interval:null,migration_start:0,migration_limit:5e3,popup_delay:50,popup_interval:null,popup_start:0,popup_limit:1e3,removal_interval:null,system_messages:[],init:function(){for(var e,n=this,t=this,i='
',a=("popup"==anm_i18n.settings.popup_style?(l("body").append('"),this.container=l("#anm-container")):(e=34,0
'+i+"
"),this.container=l("#anm-slide-in-content")),this.counter_link=l("#wp-admin-bar-anm_notification_count"),this.initTriggers(),this.migration_start=(new Date).getTime(),this.migration_interval=setInterval(function(){n.transferNotices()},this.migration_delay),0),o=setInterval(function(){3===(a+=1)&&t.CheckAndStoreNotices(),4===a&&clearInterval(o)},150),r=anm_i18n.system_messages.length,s=0;sthis.migration_limit&&(clearInterval(this.migration_interval),this.migration_interval=null,this.CheckAndStoreNotices(),0<(e=l(".anm-notices-wrapper")).children(this.getIgnoreSelector()).length&&(e.children().not(this.getIgnoreSelector()).remove(),e.show()))},getIgnoreSelector:function(){var e='.hidden, .hide-if-js, .update-message, [aria-hidden="true"]';return 0'+e+" "+n+"",this.counter_link.attr("data-popup-title",n),this.counter_link.find("a").append(e),this.counter_link.addClass("has-data"))},adjustModalHeight:function(){l("#TB_ajaxContent").css({width:"100%",height:l("#TB_window").height()-l("#TB_title").outerHeight()-22+"px",padding:"2px 0px 20px 0px"}),this.popup_interval&&(new Date).getTime()-this.popup_start>this.popup_limit&&(clearInterval(this.popup_interval),this.popup_interval=null)},checkNoticeRemoval:function(){var e;l("#TB_ajaxContent").height()?(e=l("#TB_ajaxContent").find(".notice").not(":hidden").length,this.getCurrentCounterValue()!==e&&this.updateCounterBubble(e)):this.removal_interval&&clearInterval(this.removal_interval)},CheckAndStoreNotices:function(){var n=jQuery(this.container).find(".notice"),t=[],i=this;n.each(function(e,n){jQuery(n).find(".anm-notice-timestap").remove();n=n.outerHTML;t[e]=n}),jQuery.ajax({type:"POST",dataType:"json",url:anm_i18n.ajaxurl,data:{action:"anm_log_notices",_wpnonce:anm_i18n.nonce,notices:t},complete:function(e){i.appendTimeDate(n,e.responseJSON.data),l(".anm-notification-counter").addClass("display")}})},appendTimeDate:function(e,i){var a=this;e.each(function(e,n){var t;"do-not-display"==i[e]?(jQuery(n).remove(),t=a.getCurrentCounterValue(),a.updateCounterBubble(t-1)):(t='
'+anm_i18n.date_time_preamble+i[e][1]+'Hide notice forever
',jQuery(n).find(".anm-notice-timestap").length||jQuery(t).appendTo(n))})},initTriggers:function(){var a=this;this.counter_link.click(function(){return a.popup_interval&&(clearInterval(a.popup_interval),a.popup_interval=null),0==a.getCurrentCounterValue()||("popup"==anm_i18n.settings.popup_style?tb_show(a.counter_link.attr("data-popup-title"),"#TB_inline?inlineId=anm-container"):l("#anm-container-slide-in").addClass("show"),a.popup_start=(new Date).getTime(),a.popup_interval=setInterval(function(){a.adjustModalHeight.call(a)},a.popup_delay),a.removal_interval&&clearInterval(a.removal_interval),a.removal_interval=setInterval(function(){a.checkNoticeRemoval.call(a)},a.popup_delay)),!1}),l(e).resize(function(){"popup"==anm_i18n.settings.popup_style&&a.adjustModalHeight.call(a)}),"slide-in"==anm_i18n.settings.popup_style&&l(document).on("click","body *",function(e){l(e.target).is("#anm-container-slide-in a")||l(e.target).is("#anm-container-slide-in")||l("#anm-container-slide-in").removeClass("show")}),jQuery(document).on("click","[data-hide-notice-forever]",function(e){e.preventDefault();var e=jQuery(this).attr("data-hide-notice-forever"),n=jQuery(this).closest(".notice"),t=l(".anm-notification-counter span.count").text(),i=a;jQuery.ajax({type:"POST",dataType:"json",url:anm_i18n.ajaxurl,data:{action:"anm_hide_notice_forever",_wpnonce:anm_i18n.nonce,notice_hash:e},complete:function(e){n.slideUp(),i.updateCounterBubble(t-1)}})})}}).init()}(jQuery,window); diff --git a/bin/create-builds.sh b/bin/create-builds.sh index ea77744..eb4605b 100755 --- a/bin/create-builds.sh +++ b/bin/create-builds.sh @@ -60,6 +60,8 @@ freeVersion() { # ./bin/make-pot.sh # ./bin/substitute-year.sh # ./bin/set-free-version.sh + + composer update --no-dev rm -rf bin php-scoper scoper.inc.php third-party/woocommerce rm -rf assets/css/ diff --git a/includes/classes/class-settings.php b/includes/classes/class-settings.php index ff11100..dbd812e 100755 --- a/includes/classes/class-settings.php +++ b/includes/classes/class-settings.php @@ -183,8 +183,8 @@ public static function init() { * @return array */ public static function get_settings() { - return wp_parse_args( - get_option( self::$option_name, array() ), + return \wp_parse_args( + \get_option( self::$option_name, array() ), array( 'success_level_notices' => 'popup-only', 'error_level_notices' => 'popup-only', diff --git a/includes/functions/core.php b/includes/functions/core.php index 47892c4..2cadb1a 100755 --- a/includes/functions/core.php +++ b/includes/functions/core.php @@ -195,6 +195,8 @@ function admin_scripts() { esc_html__( 'User removed from this site.' ), esc_html__( "You can't remove the current user." ), esc_html__( 'Other users have been removed.' ), + esc_html__( 'Please enter a nickname.' ), + esc_html__( 'Please enter an email address.' ), // Themes. esc_html__( 'The active theme is broken. Reverting to the default theme.' ),