From e058830fe05f0971bb1ffe50417258fdfc4a9afe Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Fri, 2 Jun 2023 07:59:03 +0200 Subject: [PATCH] fix: broken spam count mechanism --- src/Admin/DashboardWidgets.php | 2 +- src/PostProcessors/UpdateSpamCount.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Admin/DashboardWidgets.php b/src/Admin/DashboardWidgets.php index e8b5c593..c948d27e 100644 --- a/src/Admin/DashboardWidgets.php +++ b/src/Admin/DashboardWidgets.php @@ -69,7 +69,7 @@ public static function add_dashboard_count( $items = array() ) { * @since 2.4 */ private static function get_spam_count() { - $count = intval( Settings::get_option( 'spam_count' ) ); + $count = intval( Settings::get_option( 'spam_count', '' ) ); return ( get_locale() === 'de_DE' ? number_format( $count, 0, '', '.' ) : number_format_i18n( $count ) ); } diff --git a/src/PostProcessors/UpdateSpamCount.php b/src/PostProcessors/UpdateSpamCount.php index f961068d..2d86f7f6 100644 --- a/src/PostProcessors/UpdateSpamCount.php +++ b/src/PostProcessors/UpdateSpamCount.php @@ -13,7 +13,7 @@ class UpdateSpamCount extends Base { protected static $slug = 'asb-update-spam-count'; public static function process( $item ) { - if ( ! Settings::get_option( Statistics::get_option_name( Statistics::DASHBOARD_COUNT_OPTION ) ) ) { + if ( ! Statistics::is_active() ) { return $item; }