• How-tos on creating WordPress plug-ins

    I have been working my way through Vladimir Prelovac’s new book WordPress Plugin DevelopmentMr Prelovac is an active contributor of quality WordPress plug-ins.  If you’re an active user of plugins take a look and you’ll probably find a couple of his in your mix.  So in his latest book you can rest assured you’re hearing from a writer with extensive experience in this area.

    And the book is a valuable resource.  In just the first chapter I picked up a tidbit that fixed a troubling issue for me on a current project — so the book has already paid for itself!  Working you way through the chapters will build your understanding of how plugins are structures, and how they interface with the WordPress core functions.  It also builds an appreciation of how really robust a platform WordPress offers.  With libraries like jQuery, rss parsing functions, and other goodies there is a lot to work with.

    But a couple of points — the book is not a reference, it is really a workbook.  You’ll pick up some ideas from skimming through it, but to really get the full experience you need to work through building the applications.  So now a couple of quibbles.  First, while the book provides code for the completed plugins in each chapter, it does not provide the interim steps.  In progressing through the chapter you start with a simple framework for the plugin, and then gradually add functionality and test to see how what you did works.  It is a great way to progress, but unfortunately it requires that you type all the coding by hand.  You can’t save time by copying and pasting from the sample code because it only matches the final version.  The frustration with hand typing is a simple misplaced quote can keep a pages worth of code from running, and the error searching can distract from the lesson at hand.  Of course you could copy and paste from the PDF version of the book which is a great addition to the Packt offerings — BUT the code in the book has enough typos to make the code unrunnable.  Suprisingly those mistakes exist in both the print form AND the pdf.  In fact if I’d been working through the examples in a simple text editor I would certainly have given up in frustration.  But using the NetBeans IDE, it nicely indicated where error exist, making the troubleshooting process much faster.

    As I work through the examples I am also left wondering if this real-plugin approach is the best one.  Mr. Prelovac does a very nice job stepping through the various elements of the plug-ins, explaining how things work and why.  But the eamples all relate to the specific plug-in, so at the end if you don’t want to replicate the function of that plug-in many of these examples may not fit your actual needs.  What I’d like to see is some type of pattern resource, with common activities laid out.  The example I referred to above was a side issue to the main plugin in Chapter 2, changing core WordPress functionality.  He showed how to alter the_excerpt behavior.  And in this simple example, really just two pages of text and a half page of code, provided the building blocks for all sorts of customizations.  More organization along these lines would give a valuable resource that would be a great go-to reference to use on an ongoing basis.

    Again, the book is a good resource, and will get you on your way to plug-in writing.  And look forward to a future book that is more of a cookbook/pattern resource.

    WordPress Plugin Development: Beginner's Guide

    Some other plugin references:

    Top 10 Characteristics of a Great WordPress Plugin | Weblog Tools Collection

    From that experience I have consolidated these good ideas into a checklist that you can follow when reviewing or coding a new WordPress plugin. Here are my picks of the top characteristics that make a great WordPress plugin.

    WordPress Plugin Development Beginner’s Guide released

    The book I am presenting you today was created during 2008-2009. This was very lively period in the life of WordPress, during which three major versions (2.5, 2.6 and 2.7) saw the light of the day.

    WordPress Plugins News: Coffee2Code Plugin Marathon, Plugin Podcast, Plugin Developer Center, Plugin Checklist « Lorelle on WordPress

    Here are some past goodies to warm you up. Some of these related to older versions of WordPress, but don’t discount them. There are invaluable lessons to be learned from such articles. The topics cover a wide range of WordPress-specific tips and techniques for Plugin and Theme developers, as well as PHP, MySQL, JavaScript, AJAX, and jQuery.

    Related Posts

    Tags: , , , , , , ,
  • Author: Randy

    In my day job I serve as Information Technology Director for the Yale School of Drama. Otherwise I garden, play guitar, build stuff out of wood, take photos, play around with technology and have been blogging since 2003.

    Share on: LinkedIn

    Stay Informed!

    Did you enjoy this post? Then subscribe to my email newsletter and have the daily posts delivered directly to your inbox. Enter your email address here:

    ADD YOUR COMMENT
    Comments are moderated.

Welcome to RodeWorks

Randall Rode's online home for thoughts, notes, and experiments with a wide range of technology topics. Visit the about page for info on my recent projects and professional background. I welcome your comments!

  • Recent Comments

  • Coming Soon

    Open Source Way in creating community

    March 17, 2010

    Drupal 7 promises big UX improvements

    March 17, 2010

    Site Topics