Safe mode and WordPress registration mail

WordPress failed to send email, such as when registering a name or trying to retrieve a password. The problem turned out to be in the wp_mail function in wp-includes/functions.php.

It takes an optional argument $more, which it passes on to mail() as its fifth argument. The php mail() function is documented not to accept that fifth argument when in safe mode. The fix is to call mail() without that $more argument either when in safe mode and/or when $more == ”.

I have since found that this change is already in the development source of WordPress. See changesets 2365 and 2415.

[Update, May 12, 2005] WordPress 1.5.1 has been released and contains the fix to this problem.

Theme Switcher Shim plugin now obsolete

It appears that the author has updated Theme Switcher Plugin to version 1.1 and now includes the functionality I put into Theme Switcher Shim Plugin. So I’ll see if I can delete the shim from the Plugin Manager database.

I have noticed that Theme Switcher Plugin really slows down my WordPress page display. When I install all 140 or so plugins from the theme site, it takes about 5 seconds to display my WP home page. With the plugin disabled it takes 0.78 seconds, according to the timing stats in the footer.

The problem is that the plugin calls get_themes in order to have the theme file names for the links, because all it stores in the plugin options are the theme names. get_themes reads all the theme information in the themes subdirectory, reading not only the directory contents but some information from files in every theme in the directory whether or not it is selected for the Theme Switcher list.

The solution is very simple: Store the file name in the plugin options along with the theme name.

The few line change to the plugin reduces the load time of my front page from 5 seconds down to under a second. Even better, it makes the time independent of the number of themes in the themes directory.

I’m going to email the changes to the author.

You can download this zip file containing the patch in diff format.

Toe in the water

I haven’t wanted to start a blog, not knowing if I was ever going to get around to updating it, or have things worth saying. But now that I’m playing with WordPress, I realized that I can blog without blogging by just making the test site visible. I’ll document what I do with it. Maybe once in a while I’ll have something else to say.

If nothing else, hints on any customization that is necessary on the sonic.net web server that I’m hosting on should be helpful to other sonic.net customers who want to set up a blog.