flush(); $written = $wpdb->query( "INSERT INTO {$table} (event_id,order_key,operation,envelope,state, capture_attempts,attempts,next_attempt_gmt,created_gmt,updated_gmt) SELECT '','','order','','capture_pending',0,0, '2000-01-01 00:00:00','2000-01-01 00:00:00','2000-01-01 00:00:00' FROM DUAL WHERE 1=0 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id), next_attempt_gmt=VALUES(next_attempt_gmt), updated_gmt=VALUES(updated_gmt)" ); return 0 === $written && property_exists($wpdb, 'last_error') && '' === (string) $wpdb->last_error; } catch (Throwable $error) { unset($error); return false; } } }