Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

User Follow System – Part 1

Posted on September 4, 2012 by Pippin in Advanced, Member Restricted, Subscriber Only, Tutorials, Working with Users, Writing Plugins 14 Comments
Home» Tutorials » Advanced » User Follow System – Part 1
Tweet
Love It - 8
This entry is part 1 of 5 in the Creating a User Follow System Plugin Series
User Follow System – Part 2 →
  • 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
  • User Follow System – Part 3
Tweet Follow @pippinsplugins
Tom McFarlin, users

14 comments on “User Follow System – Part 1”

  1. Tom McFarlin says:
    September 5, 2012 at 7:15 am

    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.

    Reply
    • Pippin says:
      September 5, 2012 at 9:12 am

      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.

    • Tom McFarlin says:
      September 5, 2012 at 7:02 pm

      Definitely agree that it simply being done is extremely important, though the how (naming, placement, etc) is also really important in my mind.

      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 model directories and view directories to help clarify what each file in that directory (such as model/individual.php,model/company.php, etc. represents.

      Some may just use a lib directory or inc directory, 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.

    • Pippin says:
      September 6, 2012 at 11:41 am

      Absolutely agree. There’s never one single method or scheme that works for all scenarios.

  2. royeyal says:
    September 26, 2012 at 8:25 pm

    Great stuff!
    Waiting anxiously for User Follow System – Part 2…

    Reply
    • Pippin says:
      September 26, 2012 at 10:07 pm

      Bit of a slow start but should be out early next week.

    • Pippin says:
      October 10, 2012 at 5:17 pm

      part 2 is finally out! http://pippinsplugins.com/user-follow-system-part-2/

  3. cyber says:
    October 22, 2012 at 7:36 am

    where i can get this plugin?

    Reply
    • Pippin says:
      October 22, 2012 at 11:22 am

      The plugin is being written through this tutorial series. Once the series is done, it will be available for download to paid members.

    • cyber says:
      October 22, 2012 at 5:18 pm

      it available now if yes how can i pay for it?

    • Pippin says:
      October 22, 2012 at 5:42 pm

      It’s not available yet. Once it is available, you will have to be a paid subscriber to download it.

    • cyber says:
      October 22, 2012 at 6:24 pm

      hey Pippin,
      i paid for your site nice site but where i can find the plugin?

    • Pippin says:
      October 22, 2012 at 6:32 pm

      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.

  4. cyber says:
    October 22, 2012 at 6:49 pm

    ohh, ok great!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

  • Comments Not Replied To Plugin
  • Review: WP Audio
  • Should You Open Source Your Plugins?
  • User Bookmarks for WordPress
  • User Submitted Image Gallery – Part 3

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Test Your Plugins with RTL (0)

    Right-To-Left languages are those that...

  • Submitting Your First Pull Request to a WordPress Plugin on Github (5)

    Github is an extremely popular tool for managing WordPress plugins, and one...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

Enter your email to receive automated updates when new posts are published

Latest Tweets

  • RT @strickland: Afternoon crowd: To celebrate Memorial Day weekend @gittyapp is on sale through Monday. Now is the time to join in! http:/…
    May 25, 2013
  • .@itsananderson wins!
    May 25, 2013
  • @nhangen It is correct for some products, wrong for others
    May 25, 2013

Topics

register_setting contextual help attachments add_shortcode hook featured campaign monitor wp_enqueue_script Rémi Corson shortcodes the_content get_user_meta Sugar Event Calendar plugin authors attachment image forms login short codes do_action Related posts mail chimp comments recent posts post types apply_filters bbpress short code taxonomies custom post type gallery Ajax images Stripe taxonomy jquery users widgets add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2013 Pippin's Plugins