Using the WordPress Rewrite API without tanking performance
A junior dev fixed a 404 by flushing WordPress rewrite rules on every page load, which wrecked performance. Here’s how to register rules on init and flush them only once, when they actually change.