From a28b1cad94f91317683f75e5f1ee4939af80492a Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Tue, 10 Sep 2024 22:30:31 +0530 Subject: [PATCH] Display notice to users to activate account incase they access settings page directly. --- includes/class-mailchimp-admin.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/includes/class-mailchimp-admin.php b/includes/class-mailchimp-admin.php index 9a6b7d7..b405917 100644 --- a/includes/class-mailchimp-admin.php +++ b/includes/class-mailchimp-admin.php @@ -344,6 +344,31 @@ public function admin_notices() { id ) { + $api = mailchimp_sf_get_api(); + if ( $api && 'waiting' === get_option( 'mailchimp_sf_waiting_for_login' ) ) { + $profile = $api->get( '' ); + if ( ! is_wp_error( $profile ) ) { + if ( ! empty( $profile['last_login'] ) ) { + // Clear the waiting flag if the user is logged in. + delete_option( 'mailchimp_sf_waiting_for_login' ); + } else { + ?> +
+

+ +

+
+