Articles on writing WordPress Plugins

Looking back at one’s code from years prior is like looking back at a junior high school picture of one’s self.  I’m looking back at the code for my quick-and-dirty pie chart plugin and think, man, why did I write things THAT way?

In the 1,000 years since I wrote that plugin in 2009, I’ve been trying to learn and comply with best programming practices for WordPress plugins.  As a result my current plugins tend to be stripped down, simple, don’t create unnecessary options, don’t create unnecessary tables, taxonomies, special post types, or those kinds of things. 1  Learning some Object Oriented programming along the way has been super helpful.  By encapsulating your WordPress plugin code into a chunk of objected oriented programming, you reduce the likelihood that your plugins’ function and variable names will collide with those from WordPress or other potential plugins.

If you’re getting started or need to brush up on your WordPress plugin development skillz, you should definitely check out these awesome articles:2

I’d also recommend tinkering with jQuery and JSON, if you haven’t already. 3  I don’t know of any really good JSON tutorials, so if you do, please let me know so I can add it to this list.

  1. Admittedly, I’m not really shooting for super ambitious plugins either. []
  2. Mostly stolen from the WordPress Codex! []
  3. I only use JSON for passing data from the browser to the server via AJAX and then decoding into a PHP object. []

Simple Series with SEO! after just one day

I’m really happy to report that per the WordPress.org stats, this little post series plugin has been downloaded more than 100 times so far.  That’s really awesome.  And, now that I’ve figured out how to work this wacky SVN thing, I think it would be fun to release some of the other random little plugins I’ve developed over the last few years.

As of the latest version 1.4, the plugin is now easy to modify with some CSS added to your stylesheet.  I could have added this as a text field option a settings page for the plugin, but I really like the stripped down simplicity of the plugin as is.  Even with all the comment lines in the plugin, it is only 53 lines of code.  If super short code were a goal1 I could probably cut that in half.2

Now I have to find some of my old plugins that others might find useful.  I’ve got one for frame escaping, one for making pie charts…  I know there are a few other random ones as well.

Default Series Title
  1. And it isn’t []
  2. Obviously, I’m not going to do this since it would make the code next to illegible []

Simple Series WordPress Plugin

I’ve written a new WordPress plugin specifically designed to let you simply and easily create a series of related posts.  You can download Simple Series here.

1. What does “Simple Series” do?

Simple Series uses a WordPress shortcode to associate your posts together.  All you have to do is use the same shortcode in all of the posts you want to associate together and the plugin does the rest.  It will automatically find all of the posts with the same shortcode, organize them by publication date, and put them together in a professional and easy to read format.  If you wish to change the format, you can just add your own custom CSS to your theme.

2. How does “Simple Series” work?

Easy!  Just add the shortcode to each of the posts you want to put in the series.  Inside the shortcode you will need to specify the title for the series.  Like so:

Default Series Title

No problem!  The “Simple Series” plugin will always update the series lists in each of your posts whenever you publish a new post.  The newest post will always be added to the series in chronological order, by publication date.  You can see an example of what it looks like here in my own DrawBot series.

4. I have more questions!

Cool!  Please leave a comment to this post or send me an e-mail!

Default Series Title