From dc77ffd381fa1c81d6d73e92a963d4678263cda4 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Mon, 2 Oct 2023 17:54:36 +0200 Subject: [PATCH] minor code cleanup * remove unused private method _get_theme_name() * remove unnecessary parenthesis around return * use "elseif" instead of "else if" --- inc/class-antivirus.php | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/inc/class-antivirus.php b/inc/class-antivirus.php index 5430da5..ceb6065 100644 --- a/inc/class-antivirus.php +++ b/inc/class-antivirus.php @@ -193,7 +193,7 @@ private static function _get_options() { protected static function _get_option( $field ) { $options = self::_get_options(); - return ( empty( $options[ $field ] ) ? '' : $options[ $field ] ); + return empty( $options[ $field ] ) ? '' : $options[ $field ]; } /** @@ -460,25 +460,6 @@ private static function _strip_content_dir( $string ) { return str_replace( array( WP_CONTENT_DIR, 'wp-content' ), '', $string ); } - /** - * Get the name of the currently activated theme. - * - * @return string|false The theme name or false on failure. - */ - private static function _get_theme_name() { - $theme = self::_get_theme_data( wp_get_theme() ); - if ( $theme ) { - if ( ! empty( $theme['Slug'] ) ) { - return $theme['Slug']; - } - if ( ! empty( $theme['Name'] ) ) { - return $theme['Name']; - } - } - - return false; - } - /** * Get the whitelist. * @@ -650,7 +631,7 @@ public static function show_admin_menu() { // Stop cron if it was disabled. if ( self::_cron_enabled( $options ) && ! self::_cron_enabled( self::_get_options() ) ) { self::_add_scheduled_hook(); - } else if ( ! self::_cron_enabled( $options ) && self::_cron_enabled( self::_get_options() ) ) { + } elseif ( ! self::_cron_enabled( $options ) && self::_cron_enabled( self::_get_options() ) ) { self::clear_scheduled_hook(); }