| @@ -22,11 +22,9 @@ | ||
| 22 | 22 | { |
| 23 | 23 | |
| 24 | 24 | // Verify nonce |
| 25 | 25 | if (!wp_verify_nonce($_POST['nonce'] ?? '', 'yatra_destination_shortcode_nonce')) { |
| 26 | - if (defined('WP_DEBUG') && WP_DEBUG) { | |
| 27 | - error_log('Yatra Destination AJAX - Security check failed'); | |
| 28 | - } | |
| 26 | + | |
| 29 | 27 | wp_die(esc_html__('Security check failed', 'yatra'), '', ['response' => 403]); |
| 30 | 28 | } |
| 31 | 29 | |
| 32 | 30 | // Parse shortcode attributes |
| @@ -77,13 +75,9 @@ | ||
| 77 | 75 | 'total_found' => $destinations_data['total_found'] ?? 0 |
| 78 | 76 | ]); |
| 79 | 77 | |
| 80 | 78 | } catch (\Exception $e) { |
| 81 | - // Log error for debugging | |
| 82 | - if (defined('WP_DEBUG') && WP_DEBUG) { | |
| 83 | - error_log('Yatra DestinationShortcode AJAX Error: ' . $e->getMessage()); | |
| 84 | - error_log('Yatra DestinationShortcode AJAX Trace: ' . $e->getTraceAsString()); | |
| 85 | - } | |
| 79 | + | |
| 86 | 80 | |
| 87 | 81 | wp_send_json_error([ |
| 88 | 82 | 'message' => (defined('WP_DEBUG') && WP_DEBUG) |
| 89 | 83 | ? 'Error loading destinations: ' . $e->getMessage() |