Aug 21, 2011
WordPress
Update: there is a new version of the UX update available.

For the next release of the Widget Context plugin I have two goals — simplified user interface and code clean-up to eliminate PHP notices. Read more »
#
Aug 15, 2011
Web Design
Akismet is a fantastic service that does only one thing and does it very well — it fights comment spam. Their homepage, however, is full of various keywords that dilute that simple message:

Here are a few things that are wrong with this design: dictionary definition cliche; why is the spam count so prominent and has two versions — I bet that most people can’t even pronounce that number; too many words to explain a simple idea.
Here is a suggested re-align:

#
Jun 12, 2011
Meta, WordPress

Page Speed score of my blog: 97/100
WordPress can be very fast. Here is the server-side setup for achieving the 97/100 Page Speed score (it is only because of Google Analytics that the score is not 100/100): Read more »
#
Jun 9, 2011
Free Software

– 451 CAOS Theory » The trend towards permissive licensing
It is worth noting that the number of projects using the GPL licenses has increased in real terms over the past few years. According to our calculations based on Black Duck’s figures, the number of GPLv2 projects rose 5.5% between June 2009 and June 2011, while the total number of open source projects grew over 16%.
[emphasis added]
#
Jun 1, 2011
WordPress
I have just released an update (version 0.4.1) to the Multiple Galleries plugin, which should fix all the compatibility issues with WordPress 3.1.x and the upcoming 3.2. An update should appear in your WordPress dashboard soon.
#
May 27, 2011
Web
Ever since the days of Google Gears which enabled local storage and offline syncing for online applications such as Google Reader and Docs, I have always wished for a very simple and instantly accesible notepad application that I could host on my server and use also without an internet connection. A place where I could instantly write down an idea or paste a link or a quote from an article.
Google Docs and Evernote is great but they have way more features than I would normally use. WordPress is fine, but it takes several steps to get to the actual writing, and you must be connected to the internet to use it.
The Solution
Now that we have HTML5 with support for localStorage and offline apps in all of the modern browsers, it seems to be the perfect solution. All that is needed is a little PHP script that synchronizes the content of localStorage with the server. Here is how it looks:

You have your files on the left and a very big plain text editor on the right.
How Does it Work
The app consists of the following:
- One HTML file with enabled offline access (cache manifest).
- jQuery for all the Javascript and AJAX magic.
- One PHP file with HTTP authentication for syncing with the server.
The files are stored in browser’s localStorage as key/value pairs with a unique timestamp ID as key and JSON formated content as value. An index of all files and their version timestamps is kept and used for synchronization during which all the content of localStorage is sent to sync.php in a POST request. The server reads its own index file and determines which new or edited entries need to be stored and which returned to the browser. All entries are stored on the server as JSON strings in simple text files.
Demo, Download and Installation
Please visit the project page of the HTML5 Notepad App. There is also a sample Chrome app.
#
Mar 20, 2011
WordPress
Inline CSS and line breaks <br style="clear" /> that are automatically added to the image galleries in WordPress is an example of how the needs of Automattic and WordPress.com influence the way new features are added to the WordPress core. So instead of editing every single theme on WordPress.com and adding the necessary CSS for galleries to look good in all of them, they decided to put it WordPress core.
Here is how to replace those double line breaks with a single <br /> and remove the inline CSS:
add_filter('the_content', 'remove_br_gallery', 11);
function remove_br_gallery($output) {
return preg_replace('/(<br[^>]*>\s*){2,}/', '<br />', $output);
}
add_filter('use_default_gallery_style', '__return_false');
#
Mar 16, 2011
Web
I wrote this little (quick & dirty) PHP command line utility to migrate around 10 email accounts from my IMAP server to Google Apps.
#
Feb 28, 2011
Web Design
There are several plugins out there that allow you to replace the WordPress logo on the login screen. Here is a simple way to replace that logo with your site’s name — place this in your theme’s functions.php:
add_filter('login_headerurl', 'my_login_url_local');
function my_login_url_local() {
return get_bloginfo('url');
}
add_filter('login_headertitle', 'my_login_title_attr');
function my_login_title_attr() {
return esc_attr(get_bloginfo('name'));
}
add_action('login_head', 'my_style_site_name');
function my_style_site_name() {
?>
<style type="text/css">
h1 a { width:auto; height:auto; text-indent:0; overflow:visible; text-decoration:none; color:#666; display:block; margin:0; padding:0 10px; background:none; }
h1 a:hover { color:#000; background:none; }
h1 { font-family:'helvetica neue', arial, sans-serif; font-weight:bold; text-align:center; font-size:2em; width:310px; position:relative; right:-8px; margin:0 0 1em 0; }
</style>
<?php
}
Here is how it will look:

#
Feb 26, 2011
WordPress
If you want to use either Fancybox or Lightbox scripts for image galleries, you need to add the rel attribute to all full size image links. Here is how to do it:
add_filter('wp_get_attachment_link', 'add_gallery_id_rel');
function add_gallery_id_rel($link) {
global $post;
return str_replace('<a href', '<a rel="gallery-'. $post->ID .'" href', $link);
}
We simply replace <a href with <a rel="gallery-n" href where n is a unique post ID. This filter is applied in /wp-includes/post-template.php.
#