My plugin needs to run an overnight process
-
Hi
I’m running WordPress in 2 environments. 1) on Windows for development, 2) on Linux for production (via a hosting provider).
Note, I’ve tried WP-CLI with respect to the following but it chokes badly on Windows. I’ve not tried it on Linux.
I’ve created a plugin which works perfectly fine in all environments. There iss one thing I need help with, however. The plugin requires an overnight process to run. I’ve fudged a way of making it work by running the process using a WP-JSON end point e.g.
curl https://example.com/wp-json/plugin-namespace/batch-run-route
This is poor practice for at least 2 reasons. 1) This is a REST endpoint and should return json. It doesn’t, it just echo’s progress on the batch process. 2) output is buffered before being output in 1 big output when the process completes – as you would expect output to flush for http.
Am I missing something obvious? If anyone could give me any pointers I’d appreciate it.
Many thanks
The page I need help with: [log in to see the link]
- The topic ‘My plugin needs to run an overnight process’ is closed to new replies.