From cafa7ed5ef11c7077efcb3e343abc8265ae4e1ba Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 18 Aug 2022 14:17:18 -0400 Subject: [PATCH 1/2] make sure value exists and that it is array before checking for keys --- includes/Customer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Customer.php b/includes/Customer.php index 5787144..abebbfa 100644 --- a/includes/Customer.php +++ b/includes/Customer.php @@ -39,7 +39,9 @@ class Customer { public static function collect() { $bh_cdata = Transient::get( self::TRANSIENT ); - if ( ! array_key_exists( 'signup_date', $bh_cdata ) || + if ( $bh_data && + is_array( $bh_cdata ) && + ! array_key_exists( 'signup_date', $bh_cdata ) || ! array_key_exists( 'plan_subtype', $bh_cdata ) ) { $bh_cdata = false; Transient::delete( self::TRANSIENT ); From 70c0c29b4e8789030cad7fabe957d801e9580eb9 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Thu, 18 Aug 2022 14:36:11 -0400 Subject: [PATCH 2/2] only check for empty guapi value --- includes/Customer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Customer.php b/includes/Customer.php index abebbfa..d8cf6a2 100644 --- a/includes/Customer.php +++ b/includes/Customer.php @@ -50,7 +50,7 @@ public static function collect() { if ( ! $bh_cdata ) { $guapi = self::get_account_info(); $mole = self::get_onboarding_info(); - if ( empty( $guapi ) || empty( $mole ) ) { + if ( empty( $guapi ) ) { return false; } $bh_cdata = array_merge( $guapi, array( 'meta' => $mole ) );