I just checked a new plugin called Overwrite Uploads into the WordPress.org repository. It gives users the option to overwrite existing files when uploading rather than WordPress’ default behavior, which is to add a 1 to the end of the filename, e.g., filename1.jpg.
WordPress Plugin and Theme Security
Mark Jaquith recently gave a good presentation on writing secure WordPress themes and plugins at Wordcamp Phoenix 2011. The notes are also available. The main points are: Protect against SQL Injection by using the API whenever possible (because it automatically handles data sanitization). If the API can’t do what you need, use $wpdb->prepare(). Protect against […]
Body Classes Instead of Conditional Stylesheets
I’m thinking I should create a, ‘Duh, why didn’t I think of that?’ category for this. Instead of using conditional stylesheets or CSS hacks to fix Internet Explorer’s obnoxious lack of support for standards, you can conditionally set a class on the html or body tag and target that in your normal stylesheet. This is better for […]
Light and Clean CSS Message Box Styles
Here are a couple examples of good colors to use for clean CSS message boxes:
Getting a Blip.tv Thumbnail from the Embed URL
Here’s a function I wrote to get the thumbnail URL for a Blip.tv video when all you have is the embed URL. It can parse the embed URL out of a larger block of text (e.g., a blog post). It doesn’t use their API, which makes it easier to setup, but also means it might […]
Switching to a Dvorak Keyboard
The standard QWERTY keyboard layout was designed for typewriters in the 1800s with the purpose of preventing the type bars from jamming. They achieved this by arranging the keys in such an inefficient pattern that the operator was slowed down to the point where they couldn’t type fast enough to jam the the bars. So why […]
jQuery document.ready() Fires Twice
There’s a bug in jQuery 1.4.3 that causes document.ready() to fire twice if there’s an unhanded exception. You can avoid it by wrapping the code that is throwing the exception inside a try/catch block.