From: Steve Sutton Date: Tue, 17 Sep 2019 19:52:18 +0000 (-0400) Subject: Update for trigger errors X-Git-Tag: v4.1.0^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=46c03972ef6f34dd760a34b047b5ce460bda9341;p=WP-Plugins%2Fglm-serverstats.git Update for trigger errors Only trigger errors if DEBUG is on for this plugin. --- diff --git a/classes/GlmServerStats.php b/classes/GlmServerStats.php index 6a83692..42b9a10 100644 --- a/classes/GlmServerStats.php +++ b/classes/GlmServerStats.php @@ -138,7 +138,9 @@ class GlmServerStats { // If the update transient exists don't get anything from the relay. if ( false === ( get_transient( 'ServerStatCacheUpdate' ) ) ) { - trigger_error( 'running updateCache' ); + if ( GLM_SERVERSTATS_PLUGIN_DEBUG ) { + trigger_error( 'running updateCache' ); + } $lastUpdate = $this->getLastUpdatedTime(); $timestamp = 0; if ( $lastUpdate ) { @@ -163,12 +165,16 @@ class GlmServerStats set_transient( 'ServerStatCacheUpdate', true, 20 * MINUTE_IN_SECONDS ); if ( !empty( $notices ) ) { - trigger_error( 'updating cache', E_USER_NOTICE ); + if ( GLM_SERVERSTATS_PLUGIN_DEBUG ) { + trigger_error( 'updating cache', E_USER_NOTICE ); + } foreach ( $notices as $notice ) { $this->cacheNotice( $notice ); } } else { - trigger_error( 'no new ones found', E_USER_NOTICE ); + if ( GLM_SERVERSTATS_PLUGIN_DEBUG ) { + trigger_error( 'no new ones found', E_USER_NOTICE ); + } } } diff --git a/defines.php b/defines.php index 920bb17..486a395 100755 --- a/defines.php +++ b/defines.php @@ -18,7 +18,7 @@ define('GLM_SERVERSTATS_DATABASE_PASSWORD', ',Wv4W*~^bL_vF3F4PbGsS'); define('GLM_SERVERSTATS_PROVIDER', 'www.gaslightmedia.com:192.168.44.82:localhost'); // Development System // Check if debug enabled -if (GLM_SERVERSTATS_PLUGIN_DEBUG) { +if ( GLM_SERVERSTATS_PLUGIN_DEBUG ) { trigger_error("GLM Data Usage Debug Enabled", E_USER_NOTICE); } diff --git a/views/glmInfoNotifications.html b/views/glmInfoNotifications.html index 5a8ef8f..fa0532b 100644 --- a/views/glmInfoNotifications.html +++ b/views/glmInfoNotifications.html @@ -20,7 +20,7 @@ {if $view_type == 'main'} {foreach $messages as $m}
-
{$m.updated.datetime|date_format:$dateFormat}
+
{$m.updated|strtotime|date_format:$dateFormat}

{$m.title}

{$m.message}
@@ -34,7 +34,7 @@ {foreach $messages as $m} - {$m.updated.datetime|date_format:$dateFormat} + {$m.updated|strtotime|date_format:$dateFormat} {$m.title} {$m.dashboard_message|strip_tags}