diff --git a/inc/Engine/CDN/RocketCDN/AdminPageSubscriber.php b/inc/Engine/CDN/RocketCDN/AdminPageSubscriber.php index eeba4355b3..fe9319e19d 100644 --- a/inc/Engine/CDN/RocketCDN/AdminPageSubscriber.php +++ b/inc/Engine/CDN/RocketCDN/AdminPageSubscriber.php @@ -86,18 +86,21 @@ public function display_rocketcdn_status() { $subscription_data = $this->api_client->get_subscription_data(); + $container_class = ''; + $status_class = ''; + $label = ''; + $status_text = ''; + $is_active = false; + if ( 'running' === $subscription_data['subscription_status'] ) { - $label = __( 'Next Billing Date', 'rocket' ); - $status_class = ' wpr-isValid'; - $container_class = ''; - $status_text = date_i18n( get_option( 'date_format' ), strtotime( $subscription_data['subscription_next_date_update'] ) ); - $is_active = true; + $label = __( 'Next Billing Date', 'rocket' ); + $status_class = ' wpr-isValid'; + $status_text = date_i18n( get_option( 'date_format' ), strtotime( $subscription_data['subscription_next_date_update'] ) ); + $is_active = true; } elseif ( 'cancelled' === $subscription_data['subscription_status'] ) { - $label = ''; $status_class = ' wpr-isInvalid'; $container_class = ' wpr-flex--egal'; $status_text = __( 'No Subscription', 'rocket' ); - $is_active = false; } $data = [ diff --git a/inc/Engine/CDN/RocketCDN/views/cta-big.php b/inc/Engine/CDN/RocketCDN/views/cta-big.php index cb5b3608d7..f5ccf86b32 100644 --- a/inc/Engine/CDN/RocketCDN/views/cta-big.php +++ b/inc/Engine/CDN/RocketCDN/views/cta-big.php @@ -15,6 +15,8 @@ */ defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); + +$data = isset( $data ) && is_array( $data ) ? $data : []; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound ?>