diff --git a/admin/Ilove_Img_Wm_Plugin.php b/admin/Ilove_Img_Wm_Plugin.php index 0c1e313..d87df36 100644 --- a/admin/Ilove_Img_Wm_Plugin.php +++ b/admin/Ilove_Img_Wm_Plugin.php @@ -388,18 +388,33 @@ public function show_notices() { ) ); - if ( isset( $response['response']['code'] ) && 200 === $response['response']['code'] ) { - $account = json_decode( $response['body'], true ); - - if ( $account['files_used'] >= $account['free_files_limit'] && $account['package_files_used'] >= $account['package_files_limit'] && (int) $account['subscription_files_used'] >= $account['subscription_files_limit'] ) { + if ( ! is_wp_error( $response ) ) { + + if ( 200 === $response['response']['code'] ) { + $account = json_decode( $response['body'], true ); + + if ( $account['files_used'] >= $account['free_files_limit'] && $account['package_files_used'] >= $account['package_files_limit'] && (int) $account['subscription_files_used'] >= $account['subscription_files_limit'] ) { + ?> +
iLoveIMG - Please you need more credits. Buy more credits
+iLoveIMG - Please you need more credits. Buy more credits
+iLoveIMG - We were unable to verify the status of your iloveAPI account. Please try again later.
iLoveIMG - We were unable to verify the status of your iloveAPI account. Please try again later.
+iLoveIMG - We were unable to verify the status of your iloveAPI account. Please try again later.
+