$key,'json'=> $json_data]; $ar_api_url = $wp_url.'/wp-json/ar-display/update/'; $agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $ar_api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_REFERER, 'https://dev.augmentedrealityplugins.com/'); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); $response = curl_exec($ch); // Validate JSON response before output if (json_decode($response) !== null) { // Safe to output as JSON echo esc_html($response); // Or just echo if it's meant for JS } ?>