How do you I go about setting WordPress to a read-only state?
I have a setup that scales slaves instances with read-only database access but I'm seeing a lot of log data where WordPress still tries to write to the database.
wpdb... basically stopping anything attempting to write would be ideal. I can easily check to see if I'm on a MASTER instance vs. SLAVE instance so I could modify hooks pretty early.
Trying to short-circuit the update metadata function seems like possibly eliminating one vector, but the rest I fear involve modifying WP Core.
add_filter ( 'update_post_metadata', '__return_false', 99 ); $result = update_post_meta( -1, 'test-key', 'test-value' ); echo $result;
HyperDB looks promising as a more long-term solution.