Pimp Your WordPress Plugin

WordPress PimpMost WordPress Plugins are little more than small utilities but there are a growing number of them that can dramatically augment the way WordPress behaves or give WordPress advanced new features.

Platform Modifying Plugins

I like to refer to these plugins as Platform Modifying Plugins (PMPs or Pimps) because even though they exist in the same repository with all these other smaller, utility plugins, they are more substantial with more features. A few examples of PMPs include BuddyPress (and my own lighter-weight alternative — Mingle), NextGEN Gallery, WPTouch, Pretty Link and Formidable. Many of these PMPs have also become platforms themselves sporting their own hooks and APIs — with other 3rd party plugins in the repository that alter their behavior.

In my presentation at OC WordCamp, I’m going to show you an effective way to develop your own PMPs using a Model View Controller (MVC) approach with some additional tips and tricks that I’ve learned from coding and supporting two different PMPs.

Model View Controller

Even though there is no right or wrong way to program a WordPress plugin (as long as it works and doesn’t blow up the user’s website) — when writing a PMP, special thought should be given to how your it will be structured. One common design pattern to create a robust web app is MVC. Many other development environments across several other languages such as Spring (a Java Web Development Framework), Struts (another Java Framework), Ruby on Rails (an outstanding framework that I’ve used on many other projects), Cake (a pure PHP framework based on Rails) and even the iPhone Development Framework utilize an MVC approach.

I’ve found using a very lightweight, MVC approach in my development efforts has helped me to handle the complexity that can come in when writing a PMP.

  • MVC can make a larger code-base more manageable
  • MVC can make it easier to write more stable code
  • MVC can make it easier to pinpoint bugs and performance bottlenecks
  • MVC can make it easier to work along side other developers
  • MVC can make your plugin easier to readable and therefore extend-able by other developers

My WordCamp Presentation

So in addition to this focus on MVC, I’m also planning on sharing some other extremely valuable tips for those wanting to start their own PMP… I’m planning on covering the basics of the following items (hopefully I’ll have time to cover them all):

  • Routing Admin, Front end and AJAX requests through your Plugin — I really wish I knew some of this information when I first started writing wordpress plugins. These ideas (especially the AJAX routing) were based on some suggestions I got from Brandon (the organizer of ocwordcamp) — but building a routing concept into your plugin can save you countless hours of user support, debugging and bug fixing.
  • Optimizing your Plugin — I think that most plugin developers don’t really consider the impact their plugins can have on memory consumption, page loads, etc. Well, when you are putting together a PMP, you can really wreak havoc on your users systems so this is critical.
  • Translating your Plugin — There’s a lot of documentation out there for this — but I had some issues when I first started getting this to work in Mingle. I’ll cover some of the gotchas that I had so that hopefully you can get over some of the troubles I had.
  • Deploying your Plugin — This is an often overlooked topic for plugin developers. Many of them aren’t familiar with SVN or have no clue how to put together a process so that deployment is a seamless, repeatable process. This becomes even more critical when you start translating your plugin and if you do a premium version of your plugin. I’ll try to break down the steps I go through to create a release of my plugin.
  • Database Management — If you’re writing a PMP you will no doubt be adding  tables to the WordPress database. I’ll show you how I create, update and migrate these tables. Also, I’ll show you some easy conventions (taken from Rails) that will help you clean up your database tables for you and others looking at them.

I’m really pumped about this presentation and my other one on Premium Plugins — hope to see you at both of them!

This entry was posted in General Awesomeness, Presentation Topics and tagged , , , , , , , , , , , , . Bookmark the permalink.

10 Responses to Pimp Your WordPress Plugin

  1. Jason Nathan says:

    I posted a simple router class on my website to work with wordpress plugin development on my new blog! I think a Router really simplifies the process.

    You can have a look at it in my website link above…

  2. Yeah, I’m still debating on releasing a product around this concept… The mailing list over on MakeWPPlugins.com there will be used to disseminate some really great info on developing wordpress plugins but its still also a test ground for me to see what kind of demand there is out there for just such a product. I do have some additional information surrounding this presentation that I’ll be putting out there soon that I think you’ll really like. If this does become a product, I’ll definitely make you a part of it … I’m always looking for beta testing, and other kinds of help. Thanks!

  3. Larry Scott says:

    Blair,

    I love the concept and have signup at mywplugins. Is this a product that you are launching?
    If so, How do I get more info about it. (Possibly Beta Tester) I have downloaded and read the slides , but I am looking for more detailed info on how to produce plugins the way you suggest.

    Awesome Video and cant wait for more.

  4. Scott says:

    Thanks for the reply Blair.

    I’ll have a look at the material and see if it’s something I could handle, at least initially. I have xampp etc. on my computer and have played around with php but I’m certainly not a trained programmer. I do undertand hooks for the most part and have hacked my fair share of wp blogs but that hardly qualifies me as a developer or someone able to create a plugin but I still look forward to your guide.

    Cheers

  5. Scott — yeah, typically the business/idea guy will either have to pay or partner with a developer in order to create a plugin. The materials I’ll be providing will cover the very basics of php, getting code running on your machine, etc all the way up to building a well organized, awesome plugin. However, if programming isn’t a core competency and you are only looking at it as a means to an end then I’d recommend paying or partnering with a developer…

  6. Scott says:

    Hi Blair,

    I love your pretty link plugin and just signed up at your makewpplugins.com site. I hate to ask an obvious question but the materials (emails/tips/etc.) you’ll be providing…are they only for php/phpcake developers? I know very little php but have so many ideas to create plugins for my business and clients.

    If your material is just for experience php developers, then I guess I’ll read it and dream of someday learning how to code! lol 🙂

    Cheers

    Scott

  7. The slides for this presentation are up now — just go to http://makewpplugins.com to grab them… Let me know if you have any issues…

  8. Brandon Dove says:

    @dalehurley – We just announced that we’re going to be streaming the event live. Tune in and follow along with Blair (and maybe consider donating to the streaming fund while you’re at it!). =)

  9. Dale Hurley says:

    Hi

    I cannot make it to WordCamp, though I would love to see your presentation. Are you able to please share the deck and a recording of the presentation?

    Dale

  10. Paul says:

    Great article. This presentation will be good! I’m attempting on working out details on how I can make it possible.

Comments are closed.