- User Follow System – Part 1
- User Follow System – Part 2
- User Follow System – Part 3
- User Follow System Part 4
- User Follow System – Part 5
In part one of the Creating a User Follow System tutorial series, we are going to take a quick look at how our final product may be implemented into a real live site, and the basic functionality it will contain.
Watch the video above for a demonstration of a live site utilizing the final product of this series.
Once complete, the plugin will give us the ability to follow and unfollow users, view content from the users we are following, view the total number of users we (or anyone) else is following, and the total number of users following any particular user. We will also be implementing ajax in the complete plugin so that everything works smoothly without page reloads.
File and Folder Structure
If you have watched or read any of my other extended tutorials about create complete plugins, you will know that I always advocate a good file/folder structure for your plugin files. Tom McFarlin recently wrote a great article on WP Tuts+ that covers the importance of file organization, and I’d highly recommend that you read it.
For this plugin, we will separate our code into meaningfully named files, just as we always should, and we will also have folders specifically for javascript, images, and language translation files. See the screenshot below for the final organization:

File / Folder Organization
Main Plugin File
Every plugin has a “main” file, which is usually named the same thing as the plugin’s folder. In this case, our main plugin file will be called user-following.php. Inside of this file we will have our plugin headers (used to make WordPress recognize it as a plugin), a couple of constants, initialization for plugin translation, and also some file includes.
The complete contents of our file are below:
You must be logged in and have an active premium membership to view the rest of this content. Register or login from the sidebar.
Related Items

Pippin – thanks for the mention here and for pushing for better file organization.
You and I obviously have slightly different approaches and for me, it’s never been about how it’s done as long as it’s done.
This pays absolute dividends when maintaining the product especially when you open source it.
Killer work here.
Definitely agree that it simply being done is extremely important, though the how (naming, placement, etc) is also really important in my mind. Really I don’t think the two can be separated.
I was looking through the source for one of the single most popular plugins out right now (I won’t call it out), and I was extremely disappointed that they didn’t have the code separated hardly at all. For a plugin that has well over 20-30K lines of code, it had just 4-5 files, and the most meaningful name was “{plugin name}-functions.php”. That doesn’t mean anything in terms of letting devs know what the file contains.
I didn’t mean to imply that there shouldn’t be some type of logic behind how the files organized, just that how you do yours may not be how I do mine may not be how John Doe does his. For me, clarity and cohesion are key.
For example, for some of the apps that I’m creating on top of WordPress, I’ve literally created
modeldirectories andviewdirectories to help clarify what each file in that directory (such asmodel/individual.php,model/company.php, etc. represents.Some may just use a
libdirectory orincdirectory, or whatever.For me, yes – totally import that it’s done and needs to be done in a cohesive way, but I don’t think there’s an absolute single way to do it.
Absolutely agree. There’s never one single method or scheme that works for all scenarios.
Great stuff!
Waiting anxiously for User Follow System – Part 2…
Bit of a slow start but should be out early next week.
part 2 is finally out! http://pippinsplugins.com/user-follow-system-part-2/
where i can get this plugin?
The plugin is being written through this tutorial series. Once the series is done, it will be available for download to paid members.
it available now if yes how can i pay for it?
It’s not available yet. Once it is available, you will have to be a paid subscriber to download it.
hey Pippin,
i paid for your site nice site but where i can find the plugin?
I’ll say it again, the plugin is NOT yet available. It will be available for download when the entire tutorial series is complete, which is at least a month away.
ohh, ok great!