cmd = str_replace( ':mailbox', $mailbox, $this->cmd ); $request_data = array(); $request_method = 'GET'; $validate_request = true; $response = $this->send_request( $request_data, $request_method, $validate_request ); $res = array(); if ( is_wp_error( $response ) ) { $res['status'] = 'error'; } else { if ( 'success' === $response['status']) { $res['status'] = 'success'; $res['data'] = $response['data']; } else { $res['additional_message'] = __( ' The test email did not reach our test server. Did you get any test emails on your email? This could be a temporary problem, but it can also mean that emails are getting stuck on your server, or getting rejected by recipients.', 'email-subscribers' ); $res['status'] = 'error'; } } return $res; } public static function get_verification_score() { $headers = get_option('ig_es_email_auth_headers', []); $points = 0; $remark = '
Not verified
'; if ( ! empty($headers) ) { $remark = '
Needs Improvement
'; foreach ( $headers as $header ) { if ( strpos( $header['test'], 'PASS') !== -1 ) { $points -= 0.1; } elseif ( strpos( $header['test'], 'FAIL') !== -1 ) { $points += 0.1; } } if ($points < -0.2) { $remark = '
Excellent
'; } elseif ($points < 0) { $remark = '
Good
'; } } $result = array( 'points' => $points, 'remark' => $remark ); return( $result ); } }