If WordPress Uploads Fail on a Dreamhost Shared Plan

TL;DR: DreamHost kills processes on their shared hosting plans if they run too long, which can screw up all kinds of things in non-obvious ways. To fix it, either disable lots of plugins, or upgrade to a better hosting plan. I spent too much time this week trying to track down this issue for a […]

Continue reading...

Generating Dynamic Placeholders for $wpdb->prepare()

$wpdb->prepare() is often called with each un-sanitized value explicitly passed as an individual argument; for example: $wpdb->prepare( "SELECT id FROM wp_posts WHERE id > %d AND `post_status` = %s", $min_id, $status ) The function will also accept an array of un-sanitized values, though, like this: $wpdb->prepare( "SELECT id FROM wp_posts WHERE id > %d AND […]

Continue reading...

Pagination UX Fails

Pagination is one of my biggest pet peeves, and Avoid the Pains of Pagination does a good job of explaining the primary reason: Users have better experiences with scrolling than clicking. The mouse wheels, touchpads and touchscreens of today make scrolling faster and easier than clicking. To get to the next page in a pagination, the user has […]

Continue reading...

Flushing Rewrite Rules on All Sites in a Multisite Network

TL;DR: View the code on Meta Trac. Every once in awhile I’ll run into a situation where something will break permalinks on all the sites in a WordPress Multisite network, like a plugin network-activation gone wrong. On a single site, it’s easy enough to fix by manually visiting Settings > Permalinks, which will flush and rebuild the rewrite […]

Continue reading...

Automatically Reloading Locally Modified CSS Files in the Browser

I’ve been looking for a good live CSS reloader and the Auto Reload extension for Firefox is the best one I’ve found. It doesn’t require any programs or services running outside of the browser, so it’s more self-contained, and doesn’t break when you proxy your outbound traffic or use remote sandboxes. You can use a regular expression for to […]

Continue reading...

Progressive Enhancement is Still Important

Jake Archibald makes a compelling case that progressive enhancement is still important, not because of users who’ve chosen to disable JavaScript, or because of outdated accessibility concerns, but because of graceful error handling and faster page rendering. He also dispels some myths, pointing out that building a progressively-enhanced application doesn’t have to require duplicating server-side logic and templating on the […]

Continue reading...

Attaching Uploads to Custom Post Types

I’m working on a plugin that implements a custom post type, and it doesn’t need the editor, but I do want to upload files. I setup the everything like you normally would, but I noticed that the files weren’t being attached to the post when they were uploaded. I couldn’t find anything online, so I dug through […]

Continue reading...

Progressive Enhancement with Backbone.js

I’m mostly focusing on back-end development these days, so I’m a bit behind the curve on a lot of the recent front-end practices, but I’ve been playing around with Backbone.js a bit, and one of the things that’s been nagging me is the hard dependency on JavaScript for the core functionality of the site. Looking around for some […]

Continue reading...