EzGz: WordPress GZip Plugin

By default, WordPress (at least in the current generation, 2.8) does not enable any kind of compression on its output. Some plugins, like WP Super Cache, add gzip compression, but that’s an awfully big plugin if all you want is compressed output.

So I wrote EzGz this afternoon. It is, by far, the simplest plugin I’ve ever written. The actual source is probably two orders of magnitude smaller than the comments (plugin details and the license).

All EzGz does is enable the built-in PHP gzip/deflate handler. This does require output buffering, so it’s not right for everyone. Some themes or other plugins may already do this.

I’ve tried using the zlib.output_compression ini setting, but on my server, with zlib working otherwise correctly, the setting had no effect. So I stuck with the output buffering.

You can download it, or check it out of svn, then turn it on and see if it works.

WP: Better Search Widget 1.1

Better Search Widget 1.1 is a significant upgrade to Better Search Widget that adds new features and fixes an old bug with internationalization.

Features

(New features in bold.)

  • Optional default value.
  • Optional, custom widget title.
  • Optional onfocus and onblur listeners.
  • Optional, customizable focus and blur colors.
  • Custom button value.
  • Custom field size.

The built-in search widget has only one of these features, the optional, custom title.

Onfocus and Onblur

In order to use the blur and focus colors, you must enable the onfocus and onblur event listeners. In order to use the listeners, you must specify a default value (otherwise none of this makes sense). Here’s an example:

Bug Fixes

A pretty serious typo meant that none of the internationalization code worked correctly. This has been fixed, and en_US, en_GB, and fr_FR localizations are available. de_DE is coming. If you’d like to translate, there is a .pot file included in the languages directory.

License

Better Search Widget is released under the MIT License. If you use it, or have suggestions for new features or bug fixes, let me know!

Getting It

You can download Better Search Widget 1.1 now in a Zip file. Or, to save yourself some trouble,  you can check it out of Subversion from

svn co svn://jamessocol.com/better-search-widget/tags/1.1.0 ./better-search-widget

(Run that in your wp-content/plugins directory.) Subversion will make it easiest to upgrade later.

Roadmap

Soon, though probably not today, I will be releasing Better Search Widget 2, which will take advantage of the new Widget API in WordPress 2.8. This will add support for multiple instances of the widget, but will require at least WordPress 2.8. You should upgrade, anyway.

Widget l10n

I spent some of today working on bringing a couple of WordPress widgets up-to-date (Better Search and Most Comments) only to discover there is a new widget API. I guess I haven’t been paying attention.

I’ll probably start some 2.0 branches tomorrow to take advantage of the new API. I wish I didn’t know how many people don’t keep their WordPress installations up to date, so I wouldn’t care about backwards compatibility.

At least both widgets got nice new, and functional, internationalization (i18n) code and new localization (l10n) files.

And BSW got a good feature update, incorporating some suggestions from Marco Jung, who is also, kindly, doing a German localization, and a few of my own. The built-in search widget has stepped up it’s game, and fixed the thing BSW was originally designed to fix (no widget title) so I have a higher bar to clear to justify the name “Better Search Widget.”

I’ll write up the new features tomorrow.

WP Plugin: Better Search Widget

Today I upgraded from WordPress 2.3.3 to 2.6.1. I’m such a late adopter sometimes.

I had to go through and repeat a few hacks. For example, 2.3.x didn’t allow you to do get_sidebar($name), so I’d hacked the “get_sidebar()” function. And I replaced the still-broken Atom feed reading widget with James Wilson’s Google Reader Widget.

Then I finally got fed up with the default “Search” widget, which doesn’t look like the other widgets at all (no title), so I started hacking into that one. Then I realized “why hack, when I can extend?”

So, here it is, Better Search Widget.

All it does is add a search widget with a customizable title, submit button, and field size. Quick-and-useful. You can see the results in the sidebar.

If you decide to use it, leave a comment and I’ll check out your blog.

Skinning(/Leatherworking)

I’m (finally) working on the new theme. It’s obviously a work-in-progress, so just appreciate the effort for now.

I’m starting with the default WordPress theme by Michael Heilemann. I’m not going to lie: I really dislike this particular theme. (more…)