Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
* remove unused private method _get_theme_name()
* remove unnecessary parenthesis around return
* use "elseif" instead of "else if"
  • Loading branch information
stklcode committed Oct 2, 2023
1 parent e55943c commit ad1eefc
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions inc/class-antivirus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
}

/**
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit ad1eefc

Please sign in to comment.