From 9695bc41837915ff48553ffda51a2b3d86bca4ae Mon Sep 17 00:00:00 2001 From: Jonathan Belcher Date: Thu, 7 Dec 2017 11:47:33 -0500 Subject: [PATCH] Small code review changes --- includes/admin/class-wc-admin-addons.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/includes/admin/class-wc-admin-addons.php b/includes/admin/class-wc-admin-addons.php index 3f715d53fc2..8b4e1b12855 100644 --- a/includes/admin/class-wc-admin-addons.php +++ b/includes/admin/class-wc-admin-addons.php @@ -513,24 +513,22 @@ class WC_Admin_Addons { * Should an extension be shown on the featured page. * * @param object $item - * * @return boolean */ public static function show_extension( $item ) { $location = WC()->countries->get_base_country(); - $show = true; - if ( isset( $item->geowhitelist ) && ! in_array( $location, $item->geowhitelist ) ) { - $show = false; + if ( isset( $item->geowhitelist ) && ! in_array( $location, $item->geowhitelist, true ) ) { + return false; } - if ( isset( $item->geoblacklist ) && in_array( $location, $item->geoblacklist ) ) { - $show = false; + if ( isset( $item->geoblacklist ) && in_array( $location, $item->geoblacklist, true ) ) { + return false; } if ( is_plugin_active( $item->plugin ) ) { - $show = false; + return false; } - return $show; + return true; } }