I'm building a WordPress plugin that stores data in custom MySQL tables instead of post meta because of performance requirements. A user action triggers multiple operations: Insert a record into a custom table. Update another custom table. Create a WooCommerce order. Fire several WordPress hooks. Send a REST API response. The problem is that if one of the later operations fails (for example, WooCommerce throws an exception), the earlier database...
Originally asked by Aasim Ghaffar on Stack Exchange (stackoverflow) (CC BY-SA 4.0).