The WordPress database class and the other various APIs available make it pretty easy to interact with the WordPress database but often times you need to go a step further and create a custom API specific to your plugin’s database tables. Large plugins especially can benefit from having a custom database API as it standardizes common tasks, making them more reliable, more repeatable, and simpler to debug.
A club membership store is one that requires customers to pay a membership fee in order to purchase (or access for free) the products available in the catalogue. A common examples of this types of store would be a WordPress theme shop that grants access to all available themes with the purchase of a membership.
When it comes to handling large amounts of data, there is really only one way to reliably do it: batch processing. The concept of batch processing is simple. Instead of performing one large query and then parsing / formatting the data as a single process, you do it in batches, one small piece at a time. If you have ever attempted to query or export a large amount of data and had your server timeout, you’ll easily understand just how beneficial batch processing is.
WordPress includes an exceptionally useful API called the HTTP API that can be used for sending data to and retrieving data from remote APIs. If you are building a plugin that talks to Stripe, MailChimp, or just about any other service that provides an API, you can use the WP HTTP API to make your job significantly easier. For this tutorial, I’m going to show you how to use wp_remote_get(), one of the several functions included in the HTTP API, to retrieve and parse JSON data from a remote API.
For many plugins, writing adequate unit tests requires the creation of sample post, user, taxonomy, and other data inside of the test WordPress install. While the standard WordPress functions for creating data, such as wp_insert_post(), work just fine, WordPress provides a set helper classes called WP_UnitTest_Factory that make it exceptionally simple.
Restrict Content Pro version 2.1 has been in development for more than six months and finally, today, I am thrilled to announce that it has been released. This is a major release that introduces some very significant improvements and several major feature changes. The biggest change with 2.1 is the inclusion of the Stripe, PayPal Express, and PayPal Pro payment gateways in core. These gateways were previously only available as add-ons but are now included with the main plugin at no additional charge.