From 59ff52cdef21bb4d615734fdf62ec4bcb489b521 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sat, 27 Oct 2018 17:44:13 +0200 Subject: [PATCH] Merge if-clauses for cron job detection --- inc/class-statifyblacklist.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/inc/class-statifyblacklist.php b/inc/class-statifyblacklist.php index 0d7efbc..428991d 100644 --- a/inc/class-statifyblacklist.php +++ b/inc/class-statifyblacklist.php @@ -109,10 +109,9 @@ class StatifyBlacklist { } // CronJob to clean up database. - if ( defined( 'DOING_CRON' ) && DOING_CRON ) { - if ( 1 === self::$_options['referer']['cron'] || 1 === self::$_options['target']['cron'] ) { - add_action( 'statify_cleanup', array( 'StatifyBlacklist_Admin', 'cleanup_database' ) ); - } + if ( defined( 'DOING_CRON' ) && DOING_CRON && + ( 1 === self::$_options['referer']['cron'] || 1 === self::$_options['target']['cron'] ) ) { + add_action( 'statify_cleanup', array( 'StatifyBlacklist_Admin', 'cleanup_database' ) ); } }