add_action('wp_ajax_omaat_test_cf_credentials', function () { if (!current_user_can('manage_options') || !check_ajax_referer('omaat_nonce', 'nonce', false)) { wp_send_json_error(['message' => 'Unauthorized']); } $token = get_option('omaat_cf_api_token'); $zone = get_option('omaat_cf_zone_id'); if (!$token || !$zone) { $msg = 'Missing token or zone ID.'; omaat_log_event('CF Test', $msg); wp_send_json_error(['message' => $msg]); } $res = wp_remote_get("https://api.cloudflare.com/client/v4/zones/{$zone}", [ 'headers' => [ 'Authorization' => 'Bearer ' . $token, 'Content-Type' => 'application/json' ], 'timeout' => 10 ]); if (is_wp_error($res)) { $msg = 'Error: ' . $res->get_error_message(); omaat_log_event('CF Test', $msg); wp_send_json_error(['message' => $msg]); } $body = json_decode(wp_remote_retrieve_body($res), true); if (!empty($body['success'])) { $msg = 'Success!'; omaat_log_event('CF Test', $msg); wp_send_json_success(['message' => $msg]); } else { $msg = 'Failure: ' . ($body['errors'][0]['message'] ?? 'Unknown error'); omaat_log_event('CF Test', $msg); wp_send_json_error(['message' => $msg]); } }); News - One Mile at a Time
News

News

The latest in travel, aviation, and loyalty program news.

Latest News from OMAAT

TRAVEL REVIEW

Review: Hilton Dublin Airport (DUB) Review: Hilton Dublin Airport (DUB)

During my trip across the Atlantic on the Airbus A321XLR, I had an overnight in Dublin, and I ultimately decided to stay at the 166-room Hilton Dublin Airport (DUB).

Trip in progress now!
Meet Ben, OMAAT Founder
5,527,136 Miles Traveled

I’ve flown hundreds of airlines, primarily in first and business class.

39,914,500 Words Written

I write all my own content; there are no ghostwriters or AI at OMAAT!

42,354 Posts Published

17 years (and counting) of daily blogging adds up.