| @@ -20,18 +20,13 @@ | ||
| 20 | 20 | * Load trips via AJAX for pagination (same as regular trips) |
| 21 | 21 | */ |
| 22 | 22 | public function loadTrips(): void |
| 23 | 23 | { |
| 24 | - // Debug: Log AJAX request | |
| 25 | - if (defined('WP_DEBUG') && WP_DEBUG) { | |
| 26 | - error_log('Yatra Discount AJAX - Request received: ' . print_r($_POST, true)); | |
| 27 | - } | |
| 24 | + | |
| 28 | 25 | |
| 29 | 26 | // Verify nonce |
| 30 | 27 | if (!wp_verify_nonce($_POST['nonce'] ?? '', 'yatra_trip_shortcode_nonce')) { |
| 31 | - if (defined('WP_DEBUG') && WP_DEBUG) { | |
| 32 | - error_log('Yatra Discount AJAX - Security check failed'); | |
| 33 | - } | |
| 28 | + | |
| 34 | 29 | wp_die(esc_html__('Security check failed', 'yatra'), '', ['response' => 403]); |
| 35 | 30 | } |
| 36 | 31 | |
| 37 | 32 | // Parse shortcode attributes |
| @@ -75,12 +70,9 @@ | ||
| 75 | 70 | 'total_found' => $total_found, |
| 76 | 71 | ]); |
| 77 | 72 | |
| 78 | 73 | } catch (\Exception $e) { |
| 79 | - // Debug: Log error | |
| 80 | - if (defined('WP_DEBUG') && WP_DEBUG) { | |
| 81 | - error_log('Yatra Discount AJAX Error: ' . $e->getMessage()); | |
| 82 | - } | |
| 74 | + | |
| 83 | 75 | |
| 84 | 76 | wp_send_json_error([ |
| 85 | 77 | 'message' => (defined('WP_DEBUG') && WP_DEBUG) |
| 86 | 78 | ? 'Error loading discount trips: ' . $e->getMessage() |