I was asked a few weeks ago why I structured my WordPress plugins the way I do. Anyone who has spent any time looking at my code knows that I like to keep my main functions in a class and wire up action hooks and filters in the root of the plugin. But few people […]
Continue reading...Start with a Unit Test
Not everyone is a fan of test-driven development. Writing unit tests for your code can be a laborious task, and it has no immediate benefit to your customers. So why waste any time writing the tests, right? This past week, a colleague of mine summed up the problem pretty well: I’ve finished writing the code for that […]
Continue reading...Theme-ready Widgets in WordPress
If you use WordPress, you’ve probably used a handful of widgets in your sidebar. Some display statistics. Others print out recent comments. Others display posts related to the content in the main window. But all of them do this in the exact same way. They take some data, wrap it into a hard-coded HTML template, […]
Continue reading...Javascript Event Listeners
Most websites today are stuck in the mud. They sit there, present content, and fail to solicit any interaction from the user. This site is no exception. I write content, you read it. End of story. But some websites are far more interactive. They present rich, immersive interfaces and simulate the kind of interactive behavior typical of […]
Continue reading...Dependency Injection and Abstract Interfaces in C#
If you’ve ever written code, you’ve probably written a unit test. If you haven’t written unit tests, you should start. Now. Really. Unit tests let you quickly verify that your code is operating in a predictable fashion. When you make changes down the road, you re-run the same unit tests to make sure nothing broke. […]
Continue reading...Theme-ready Custom Post Types in WordPress
If you’ve ever built a large, custom site in WordPress, you’ve probably built a few custom post types. They are fantastic ways to manage custom content in an application traditionally geared towards blog and news posts. You can manage events, downloadable publications, music archives. CPTs are only limited by the bounds of your imagination. Many […]
Continue reading...Welcome Back!
A few weeks ago, I had the opportunity to be shadowed in my day job by a computer science student. He was interested in web development and eCommerce, so I thought I’d show off a few of my sites. He was pretty impressed. Well, until we got to this site. The old Jumping Duck Media website […]
Continue reading...WordPress Feature Pointers
First, a quick caveat. While you can use WordPress’ new feature pointers in your themes and plugins today, the practice is highly discouraged. There are a number of reasons why, but let’s leave it with one: Feature pointers were introduced with WordPress 3.3 as a core feature, but need further development before they’re ready for distributed […]
Continue reading...