get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $t ) ) !== $t ) { return; } $now = current_time( 'mysql', true ); $wpdb->query( $wpdb->prepare( "INSERT INTO `{$t}` (event_id, platform, event_name, order_id, session_id, user_id, status, http_code, fbtrace_id, attempts, request_payload, response_body, error_message, value, currency, test_mode, created_at, sent_at) VALUES (%s, %s, %s, %d, %s, %d, 'dispatched', 0, '', 1, '', '', '', %f, %s, 0, %s, %s) ON DUPLICATE KEY UPDATE status = 'dispatched', attempts = attempts + 1, sent_at = VALUES(sent_at)", (string) $event_id, (string) $platform, (string) $event_name, (int) $order->get_id(), (string) $order->get_meta( '_aieo_attr_sid' ), (int) $order->get_customer_id(), (float) $order->get_total(), (string) $order->get_currency(), $now, $now ) ); } endif;