All posts in WordPress

Creating Object-Oriented WordPress Plugins That Implement MVC

by Ian Dunn

I’ll be giving a presentation at the  Seattle WordPress Developers Meetup tomorrow about how to write WordPress plugins that are both object-oriented, and implement the Model-View-Controller pattern. If you plan on attending, you can follow along with the slides and download the lab files .

Grandchild Themes in WordPress

by Ian Dunn

It’s not possible to create grandchild themes in the same way that you create child themes, but you can use a plugin to dequeue/enqueue stylesheets and scripts, and also override the locations of the main query templates. It’s obviously not the ideal solution, but there are cases where it may be the least-bad one.

Preventing a Plugin from Automatically Updating

by Ian Dunn

In an ideal world you’d never have to fork a plugin, because developers would always make their plugins extensible with hooks , just like WordPress itself does. But unfortunately that’s not usually the case, and it’s sometimes necessary to directly modify a plugin to make it do what you need. In those cases, you want to make sure that the plugin… [more]

XML-RPC Enabled by Default in WordPress 3.5

by Ian Dunn

XML-RPC will be enabled by default in WordPress 3.5, but I personally think that’s a bad idea from a security perspective. A fellow Seattle WP developer, Ben Lobaugh, explains why on the Trac ticket .. Luckily, it’s easy to disable it. Just add this to a plugin: I’ve added that to my security checklist for new installations, and updated my installation skeleton to include… [more]

Designing Object-Oriented Plugins for a Procedural Application

by Ian Dunn

Note: This was originally a post to the Seattle PHP Meetup mailing list, but I’m reproducing it here to generate a discussion about the topic with people outside the meetup. * * * * I write a lot plugins for WordPress, and I like to make them object-oriented, even though WordPress itself is mostly procedural. I think it… [more]

The Importance of Usability Testing

by Ian Dunn

Shane Pearlman just published an article on the importance of usability testing that has some good advice. One of the tools mentioned is usertesting.com , which looks like an easy way to get feedback on projects.

Don’t Move wp-config.php Outside the Document Root

by Ian Dunn

Most WordPress security guides recommend moving wp-config.php outside of the Apache document root in order to prevent the database password being exposed if the PHP engine fails to parse the file, or from being readable to infected scripts running in the domain. Despite the conventional wisdom, though,  this technique doesn’t solve those problems , and can actually create new problems if… [more]

WordPress Bug Causes Error in XML-RPC Clients

by Ian Dunn

I’ve been having a hard time figuring out an error that a client’s been getting in the Android and iOS apps for WordPress, but finally found the reason. The problem was that, when adding new posts with images, the post would be saved and the image would be uploaded and attached to the post, but… [more]

Getting Pricing Right

by Ian Dunn

Code Poet just released a free eBook called Getting Pricing Right that interviews Mark Jaquith, Remkus de Vries and Shane Pearlman on setting consulting rates and miscellaneous related topics. It’s short and contains a lot of good advice, as well as links to a lot of resources.

Cross Site Scripting Vulnerability in Subscribe2 Plugin

by Ian Dunn

News of the XSS bug in Subscribe2 didn’t show up in any of my RSS feeds or mailing lists, even though it’s a fairly popular plugin,  so I wanted to make a note of it in case anyone else missed it. Version 8.2 has a fix for it . Update: It also sounds like an official WordPress mailing list for plugin security notifications is in the works.

Creating Admin Notices From a WordPress Plugin

by Ian Dunn

I just threw a couple small PHP classes up on GitHub that I use in almost every WordPress plugin I write. The first is  IDAdminNotices , which is a clean and easy way for plugins and themes to send messages/errors to the user within the Administration Panels. The second is IDDescribeVar , which will outputs the type, length and contents… [more]

Preventing Callback Functions From Executing Multiple Times

by Ian Dunn

Many actions in WordPress will fire multiple times, which can lead to performance drags and undesired/intuitiveness results. Pippin Williamson points out that you can check how many times an action has already run , and modify your code to respond accordingly.

Using Constants for a Text Domain in WordPress

by Ian Dunn

Normally any kind of global values that don’t change within a program’s execution should be defined as constants, but text domains within internationalized WordPress plugins are an exception to that rule. Mark Jaquith explains why it’s important to use a string instead .

WordPress Developer’s Meetup Presentation on Child Themes

by Ian Dunn

I’ll be giving a presentation on building Child Themes at the Seattle WordPress Developer’s Meetup tomorrow . You can follow along with the presentation if you plan on attending.

BackPress PHP Library

by Ian Dunn

BackPress is a useful project that packages the re-usable code from WordPress into an independent library you can use in non-WordPress projects.

Including External View Files in WordPress Widgets

by Ian Dunn

I ran into a problem today while cleaning up and modifying some widgets. I moved all of the markup inside widget() to an external view file, and then included it via require_once(), which worked fine. I then tried to do the same thing inside form(), but didn’t get any output. It turns out that you can’t use include_once() or require_once() inside form() ,… [more]

Comparing WordPress, Drupal and Joomla in 2011

by Ian Dunn

Ok, so it’s already 2012, but I just came across an article comparing the three from last year and it was a good read. Like a lot of articles, though, the real value is in the comments more than the article itself. Going into it I had the impression that Joomla was a stagnant mess, but it sounds… [more]

WordPress Backup Options

by Ian Dunn

Nathan Ingram put together a thorough post on backing up WordPress and a chart comparing various plugins and services .

Add this ribbon to your WordPress website re-abolish slavery