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. [↩]

This is a test of the Simple Series post system… This is only a test

This is really just to see if I’ve solved the “Hey!  The series link doesn’t show up in my RSS feed” problem. 1

Default Series Title
  1. Thanks for telling my Dna! [↩]

My first published WordPress plugin! Simple Series!

This may seem silly, but I’m really happy with having published my very first plugin on WordPress.org.

My Simple Series plugin lets you easily create and helps you automatically maintain a list of posts.  I started writing this plugin because all of the existing ones seemed really clunky and over-engineered.  There’s no need for extra tables in WordPress, brand new taxonomies, or special system requirements.  If you can fire up any recent version of WordPress, you should be able to use this plugin without a problem. 1

As much of a WordPress fanboy as I am, I’ve never actually shared a plugin on the WordPress.org repository.  It was simultaneously easier and more difficult than I thought it would be.  The page that discusses how you can contribute your plugin and talks about “checking out” files makes absolutely no mention of how you’re supposed to do this!

Apparently you require a program to connect to the WordPress SVN to check out the file and commit changes.  On the advice of Schmarty I’m using TortoiseSVN.  Once that was installed and a sub-directory selected, it was relatively easy to commit changes.  If you haven’t tried it before, this whole SVN thing feels like a clunky slow version of FTP.

Default Series Title
  1. Of course, now people are going to start e-mailing me with problems… [↩]

i find i want to add more posts in some random series, just so i can use my new plugin

Wouldn’t that be something?  A bunch of posts… all associated with one another by nothing more than some kind of random brain process fueled by stubbornness, a fever, and too much caffeine?

Default Series Title

3.57% More Contempt

I really hate January and February.  This year, I have 3.57% more contempt for February since it is a leap year.  Historically, these are dark and foreboding months for me.  I am grateful this month is nearly at an end, but fearful for what lies ahead.  I’m not overly superstitious, but like any reasonable man I believe robots work better with Daft Punk and the first two months of every year the darkest months indeed.

One little bright note.  Not this year’s Doctor Who Christmas special, but last year’s, had such a brilliant opening monologue.

“On every world, wherever people are, in the deepest part of the winter, at the exact mid-point, everybody stops and turns and hugs. As if to say, “Well done. Well done, everyone! We’re halfway out of the dark.” Back on Earth we call this Christmas. Or the Winter Solstice.”

On December 22, 2011 I happened to be having lunch with a friend.  As I did so I noticed there was a nearby table with about eight or so people.  I happened to overhear them toast the winter solstice.  That, in turn, made me think, “Hey!  We’re halfway out of the dark!”  That thought does warm me some now.  If this were merely a matter of seasonal affect disorder or just a superstition about the dark, that would be one thing.  Instead, my personal attitude of loathing towards these first two months is borne of a long experience.  Bad things just seem to stack up in these months.

If the posts on this blog take a melancholy turn for a bit, please do excuse.

Goodbye Kitty

This past Thursday one of our kitties was acting very lethargic and withdrawn.  Highly unusual behavior for such a social, friendly, and outgoing creature.  We took her to the vet for tests that day and heard back from them on Saturday.  I was in a meeting in San Francisco when I got the news.  I left the meeting immediately and rushed home, picked her up, and took her to the vet.  Her kidneys were failing and there was very little to be done.  They tried to hydrate her, but she kept getting worse.  When it became apparent there was nothing more that could be done, we sat with her, talked, petted, and kissed her.

Our kitty had such personality – affectionate, friendly, curious, and adventurous and we will miss her terribly.

It was tough telling our daughter.  We answered her questions the best we know how.  But, how do you explain the absence of a thing?  As amazing as the Greeks were, they didn’t have a concept of “zero” of nothingness.  I must say, she’s dealing with all of this far better than we are.

DMCA dot com – I CANNOT believe I didn’t think of this…

I’m not going to actually link to DMCA dot com because I don’t want to send any Google juice their way. 1

This is just so freaking evil I cannot believe I didn’t think of it. 2  DMCA take-down services?  Are you kidding me?  They’ll charge you $10/month for the ability to send e-mails.  The only thing they really have going for them, from what I can see, is a really nice domain name and a snazzy website.  Watermarking images and little badges on your site does more to market them than it does to protect anyone.

Edit: Oh, yeah, thanks to Tbuser for the link!

  1. They’ve got their PageRank of 5 and I’m only a little jealous [↩]
  2. I have evil ideas from time to time, but I very rarely actually go through with any of them.  I try to use my powers for good. [↩]
Test