wp-background-processing
wp-background-processing copied to clipboard
Add option to choose the REST API over the AJAX API to make requests
As stated in the following Delicious Brains Article, the WordPress REST API performs 15% faster than the AJAX API. The following PR defaults all requests to the AJAX API, but allows developers to choose to use the REST API instead by setting the $use_rest
property in their child class to true
.
Only 3 of these commits relates directly to this PR:
- 5bd373f
- 6369663
- fffa3cb
As this PR includes a number of changes unrelated to allowing REST API usage, and is currently unable to be merged due to conflicts (possibly because some of those unrelated changes have already been applied via other PRs), I'm going to close this PR.
However, we'll keep at least one of the issues open that asks for this functionality, and may re-visit this idea of enabling dispatching to a REST API endpoint in a future version, after we've applied some improvements we have lined up for the library.