WP-OfflineAs many of you are already aware, Google announced a new product last week called Google Gears (I wrote an intro to the toolkit a few days ago). After playing around with Gears for a while I realized that I could use it to solve a problem that has bothered me for some time: I can’t read blogs offline! WP-Offline is a WordPress plugin that lets your readers cache your entire blog for offline reading using Google Gears.

I’ve been working feverishly trying to get this thing done as quickly as possible. It’s not quite production ready, but I decided to release what I have now since I’m leaving for a two week vacation tomorrow afternoon. Below you’ll find some installation instructions, and a list of problems that I am aware of, but did not have time to fix (if you find any more problems or bugs, please leave a comment). When I get back I’ll try to address these problems and put together a proper release (if anyone wants to fix these issues while I’m away, you have my blessing).

Download WP-Offline

Installation

  1. Unzip in your plugins directory.
  2. Make the manifest.json file writable by the web server, if it’s not already (either chown it to your webserver UID or run chmod a+w manifest.json).
  3. Open wp-offline.js and edit the first line, setting BLOG_ROOT to the root directory of your blog (with no trailing slash). If your blog is served out of the root directory (i.e. there is no subdirectory) set BLOG_ROOT = ”;
  4. Add a div with id=”wp-off” in your theme file wherever you want the “Read offline” UI element to show up.
  5. Enable the plugin on the WordPress admin panel.
  6. Create a new manifest by going to the “WP-Offline” tab under the “Options” on the admin panel.

Known Problems

  1. I didn’t have time to work on the UI in Internet Explorer, so for now this is Firefox only (but over 80% of my readers use Firefox, so most of you should be ok). It shouldn’t be hard to tweak the UI code for IE. I think it’s just a CSS problem. I’m almost positive that you’ll need to tweak the UI anyway to work on your blog.
  2. There’s no way to tell the status of the managed resource store, so you can’t make an accurate progress bar (unless you use a normal resource store and manage it yourself).
  3. You can’t tell a managed resource store to update a single page, so whenever the manifest file changes the LocalServer will re-request every page (well, it does a HEAD request first, but WordPress doesn’t seem to handle HEAD requests very efficiently).
  4. The manifest may not be auto-updated at all the right times, I didn’t have time to do the proper research on this… Right now it updates whenever there is a new post, page, or comment (or if a post, page, or comment is edited or deleted). You also can manually update the manifest by clicking on the WP-Offline tab under “Options” on the administrative menu.
  5. The plugin lacks a proper admin panel. The admin panel should allow you to specify which static files to include in the manifest and when the manifest should be updated, at the very least.