Black Friday & Cyber Monday sale, save 30%! Valid until November 30th at 11:59:59 PM (UTC - 6). Enter BFCM2015 at checkout or Click here to apply discount →

Custom Database API – The Basic API Class

In the previous sections of this series, we have looked at reasons you should build a custom database API, we have discussed how to structure your data, and we have looked at how to create the database tables. Now it is time to build the basic API that we will use to actually interact with our database. This will involve writing an API class with all of the necessary methods for retrieving, inserting, updating, and deleting data.


Custom Database API – Creating the Tables

Once you have laid out the structure for your database table, it is time to create the actual tables. This is where it gets fun. When the tables are created, you can really begin building your API for interacting with the database and that’s when this whole project begins to truly take shape.


Batch processing for big data

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.


A look at the posts_where filter in WordPress

The WP_Query class in WordPress is extremely robust and allows you to construct just about any kind of query you need for retrieving data from the wp_posts table, but there are still scenarios you will encounter when building your plugins that WP_Query doesn’t support. Before WordPress 3.7, the posts_where filter was used primarily for setting up date-range queries and…

Template File Loaders in Plugins

Template files are very standard for themes and heavily used in child themes. For example, if a user wants to modify the layout of their site pages, they can simply copy page.php from their parent theme to a child theme, modify the HTML structure, and the changes will be reflected on the site. While it’s…

User Follow System – Part 7

In this final part of the User Follow System tutorial series, we will create two short codes, one for displaying a follow/unfollow link for a user and one for displaying a list of recent posts from users you (the currently logged-in user) follow. We will wrap up the series by also showing a few areas…

User Follow System – Part 6

In part 5 of this tutorial series we wrote the Javascript that is responsible for firing off the ajax events when a user is followed or unfollowed. Now, in this part, we are going to write the PHP side of the ajax events that takes care of processing the requests and sending a response back…

Using the WordPress Heartbeat API

WordPress 3.6 introduced a new API called the “WordPress Heartbeat”. This is the API that behind a lot of the improvements in WordPress 3.6, including better revision tracking, user’s session management, and more. I’m going to show you a quick example of how you can use the API to perform “live” actions. What is the…

User Follow System – Part 5

This part of the User Follow System tutorial series will focus on writing the necessary javascript for trigger the follow/unfollow actions. When a follow or unfollow link is clicked, the javascript will trigger an ajax action that then talks to the server and tells it which user is being followed or unfollowed, and which user…

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match