I have written a WordPress plugin that analyzes a post and extracts some data from the body on save (using the save_post action).
My installation has almost 8,000 posts, and I need to perform this retroactively on every single post. So, I need a batch job of some kind that will iterate every post and perform this operation without timing out.
There are a number of ways to architect this, but is there a commonly accepted way of doing this?
Ashley Rich from Delicious Brains created a Background Processing class that was designed to solve this exact problem. You can find the source code here. You can also find an example of it being used inside the WooCommerce plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With