owen

I had a great idea in the shower this morning.

As you may or may not know, Windows servers don’t have access (please correct me if I’m wrong) to the aspell spelling resources of PHP that Linux servers do. As a result, many of the spell-checkers that one might install for WordPress just won’t work on Windows.

Here’s my idea: Create aplugin that exposes an XMLRPC method for spelling. The method would accept an array of unique words and return an array of misspelled words, each with an array of suggested replacements.

When you “Save and Continue Editing” a post, the plugin would route the preview (you know, that text under the editing box) through the “the_content” filter. This particular filter plugin would only be active in the admin console.

The text would be exploded and uniqued, then sent to the XMLRPC procedure for processing. (The XMLRPC thing could be skipped on servers that have a working aspell.) The plugin would then replace misspelled words the content with a specially styled and crafted div tag.

The div tag would contain the bad word plus a tag hidden via CSS that contains the replacements and a word of context from either side of the bad word. The div would allow the word to appear with a red underline, and when you click on one of these words, script would pop-up the replacement candidates.

When you choose a replacement, the script would use the context words to located that exact word in the post text edit box, and replace it with the chosen replacement.

Easy as pie.

Ok, it sounds difficult, but I already wrote this in Delphi for my custom CMS a while ago, so I cna’t imagine it’s too hard.

On the administrative side, an options page could allow you to accept spelling XMLRPC requests only from certain servers. So all you need to do if you don’t have aspell is to ask your blogging friend to borrow their speller plugin, and they activate you in their options.

Of course, I could try to integrate something like spellchecker.net, but that’s $150 per year. That’s crazy.

Alternatives would be nice. Something that would highlight poor spelling inside the post editing textbox would be awesome.