» Who knew that Mister T was such a fashion maven? (0)

» "And right then," Knox said, "I heard, 'Excuse me, would it be OK if we carried her around and she touched each bag?'" Sportsmanship defined. (0)

» Web-based sequence diagram generator. Whoda thunk? Next thing you know you'll be able to buy stuff online. (0)

Spelling Checker plugin for WordPressSpelling Checker plugin for WordPress

IMPORTANT NOTE FOR WORDPRESS 2.0 USERS

This plugin doesn’t play well in WordPress 2.0. I’m well aware of this. Some day I may update it but it is nowhere near the top of my priority list. Support questions for 2.0 installations will not make it out of moderation.

Latest version is 1.18, released 06/23/05.

I’ve been looking for a spelling checker plug-in for WordPress for a while. Didn’t find anything to my liking, so I figured I’d create one myself. The fruits of those labors are now here!

The Spelling Checker plugin for WordPress

With this plugin a new button appears alongside the rest to pop-up a spelling checker derived from the Speller Pages SourceForge project. No more typos!

This is a 1.18 release and it has been tested on WordPress 1.5.1.2. Please direct any questions or problems to me in this post.

Digg!

457 Responses to “Spelling Checker plugin for WordPress”

  1. 1

    marcalj Says:

    Plugin looks great but there’s a bad relationship with special characters like accents (à,á.è,é, ….).

    There’s a solution?

  2. 2

    ColdForged Says:

    Good question, I’ll have to investigate.

    EDIT: After taking a look at the underlying code, this seems like a design decision of the Speller Pages project. I’ll mull it over some to see if there’s a way around it. Thanks for bringing it to my attention.

  3. 3

    Ron Says:

    I get a script error saying “’spellChecker’ is undefined.”

  4. 4

    ColdForged Says:

    I get a script error saying ”’spellChecker’ is undefined.”

    Sounds like it couldn’t find the js file… is your WordPress installation in a subdirectory? If so, modify the spell-plugin.php file to have the correct path to the javascript file. Search for “wp-content” and make sure that it goes to the right place.

    <script language="javascript" type="text/javascript" src="/wp-content/plugins/spell/spellChecker.js">

    I may have to adjust how that path is derived in a follow-on release.

  5. 5

    Chris J. Davis Says:

    You run into the same problem that I did when I was writing a spell-check plugin. You must have aspell on your server, and that is not as ubiquitous as it should be, case in point my MacOS Z Panther server doesn’t have it, so this won’t work.

    Nothing you can do about it really, just thought I would let you know about that limitation.

    Good work on this though, very posh.

  6. 6

    Ron Says:

    I corrected the path to my plug-ins directory, and now the pop up window displays the front page of my web log.

  7. 7

    ColdForged Says:

    I corrected the path to my plug-ins directory, and now the pop up window displays the front page of my web log.

    Check the paths in the spellChecker.js file as well, namely:

    function spellChecker( textObject ) {
    // public properties - configurable
    this.popUpUrl = '/wp-content/plugins/spell/spellchecker.html';
    this.popUpName = 'spellchecker';
    this.popUpProps = "menu=no,width=440,height=350,top=70,left=120,resizable=yes,status=yes";
    this.spellCheckScript = '/wp-content/plugins/spell/spellchecker.php';

  8. 8

    ColdForged Says:

    You run into the same problem that I did when I was writing a spell-check plugin. You must have aspell on your server, and that is not as ubiquitous as it should be, case in point my MacOS Z Panther server doesn’t have it, so this won’t work.

    Yeah, I had named that as a prerequisite but it bears repeating. Is there an alternative executable that’s common on Panther?

  9. 9

    Ray Says:

    Great plugin. Installed and worked first try - like a breeze. Anybody know of a way to make the dictionary ignore the XHTML tags themselves?

  10. 10

    ColdForged Says:

    Anybody know of a way to make the dictionary ignore the XHTML tags themselves?

    Another good question. Something else I’d like to work into a follow-on release. I’m trying to think up a methodology that would succeed for this, but nothing’s come to mind yet. Thanks for the input.

  11. 11

    Richard@Home Says:

    Have you checked out SpellBound?http://spellbound.sourceforge.net/

    It’s a Firefox spell checker plug-in and works in any input or textarea.

  12. 12

    Ron Says:

    The spellChecker.js points in the right directory. The top half of the screen will begin with “Spell check in progress…” and then go to the front page of my web log. The bottom half seems like it is displaying properly.

  13. 13

    Brendan B Says:

    Hrm..

    I know this may not be possible, [insert long shot here], but is there any way of being able to “add” words from the spell checker popup back into aspell?

  14. 14

    Mark J Says:

    Instead of requiring people to manually set the URI to Wordpress, why not just do it for them using

    <?php bloginfo('home'); ?>

    ?

  15. 15

    Mark J Says:

    Also, on the regular Write screen, the Check Spelling button is in the bottom-left corner of the browser (way at the bottom). It appears correctly only on advanced edit screen.

  16. 16

    ColdForged Says:

    The spellChecker.js points in the right directory. The top half of the screen will begin with “Spell check in progress…” and then go to the front page of my web log. The bottom half seems like it is displaying properly.

    Odd. Anyone else seeing Ron’s problem? Ron, you say the bottom half displays fine… do any spelling suggestions from the actual post show up?

  17. 17

    ColdForged Says:

    I know this may not be possible, [insert long shot here], but is there any way of being able to “add” words from the spell checker popup back into aspell?

    They’re looking at that as a future feature of the base Speller Pages project. If they get that in there — or I get bored and feel like contributing — we’ll get it here :) .

    Instead of requiring people to manually set the URI to Wordpress, why not just do it for them using…

    Exactly what I was looking for… I knew I was overlooking something simple. Thanks for the nudge.

    Also, on the regular Write screen, the Check Spelling button is in the bottom-left corner of the browser

    So it does! Along with the “eval() Content” from RunPHP. Guess they fooled both of us. I have Advanced Controls as the default so didn’t notice it. Thanks for the heads up, I’ll fix it today.

  18. 18

    ck Says:

    I installed it as instructed and Word Press is in my root so I didn’t really have to alter anything. However, when I click on the “check spelling button” the spell checker interface pops up but the top frame after checking for errors always returns a blank page, even when misspelt words were in the post. This happens in both latest Netscape and IE and IE displays an error message:

    Line: 44
    Char: 1
    Error: Object expected
    URL: http://www.jewlicious.com/wp-content/plugins/spell/spellchecker.php

    Any suggestions?

  19. 19

    ck Says:

    I should also probably add that I am running WP 1.2

  20. 20

    ColdForged Says:

    Any suggestions?

    I’ll investigate, thanks for the detailed information. Looks like I’ll need to install a test 1.2 installation :) .

    Ron, you running 1.2, too?

  21. 21

    Thor Says:

    I’m sure I’ve missed something silly, but I’ve installed the plugin (several times now), and although it appears to activated, no spell check button appears on the “write post” screen. I have tried several different path entries to the plugin files in each of the spell-plugin.php, spellchecker.php and spellChecker.js files. I also tried settting the full path to the aspell application.

    I am running WordPress 1.3 alpha 5.

    Help?

  22. 22

    ColdForged Says:

    I’m sure I’ve missed something silly, but I’ve installed the plugin (several times now), and although it appears to activated, no spell check button appears on the “write post” screen.

    Check the bottom of the screen, does it appear there? If so, that’s a known issue that will be addressed today. If not, can you view the page source and look for the word “spell” in there somewhere and tell me what you see?

  23. 23

    ck Says:

    Thor: My spell check button appears where it should in advanced controls, but not so much in the standard editing page. But that’s been addressed already.

  24. 24

    Thor Says:

    Coldforged: Viewing the page source for the compose screen, the word “spell” is not found, and the button is missing in action. Does the path have anything to do with the button’s appearing? I’ve tried using the absolute path with it making no difference for me.

    ck: Unfortunately, the button does not appear either way.

  25. 25

    Ron Says:

    Odd. Anyone else seeing Ron’s problem? Ron, you say the bottom half displays fine… do any spelling suggestions from the actual post show up?

    The HTML portion of the bottom half shows up fine; however, there is no spelling suggestion from the post. (I had intentionally spelled some words wrong to test the plug-in.) I have gone through and corrected all of the paths that I found. I have also tried this in several browsers, to include Internet Explorer, Fire Fox and Netscape.

    P.S. I am using Word Press 1.2.1.

  26. 26

    ColdForged Says:

    Coldforged: Viewing the page source for the compose screen, the word “spell” is not found, and the button is missing in action. Does the path have anything to do with the button’s appearing? I’ve tried using the absolute path with it making no difference for me.

    No, basically if the plugin is installed in your “wp-content/plugins” directory and Activated in the plugins page, there shouldn’t be any way that it won’t appear on your “Write Post” page. I have a 1.3a5 as well as a 1.2 installation now, and it appears on both.

  27. 27

    ColdForged Says:

    P.S. I am using Word Press 1.2.1.

    Ron and Thor, could you try the updated version listed here? Perhaps these adjustments will help you both. I have since tried it on a subdirectory 1.2 WP installation without difficulty, so I’m curious about what’s going on for you. We’ll get to the bottom of it somehow.

  28. 28

    Ron Says:

    I tried the updated plug in and it seemed to be working, but then I got:

    System Error: Aspell program execution failed (’aspell -a –lang=en_US <./aspell_data_24|3qv2>&1′)

  29. 29

    Thor Says:

    I put the updated plugin up, but it made no difference. As requested, I email the source file. Also, I tried updating my WordPress from the newest CVS; it made no difference.

  30. 30

    mariuss' weblog Says:

    Spell Checker for WordPress

    Quite a few WordPress blogs mentioned today that there is a new spell checker plugin for WordPress: Spelling Checker. It is still in alpha and works only with WordPress 1.3 (which is also still in alpha).

    This plugin is based on Speller Pages, a ser…

  31. 31

    Blogmarks | mathibus.com Says:

    Spelling Checker plugin for WordPress

    Someday I’ll be able to make posts without a single spelling error. I’ll be waiting for a Grammar Checker plugin…

  32. 32

    ColdForged Says:

    System Error: Aspell program execution failed (‘aspell -a—lang=en_US &1’)

    Just keeps getting weirder. What happens when you try to run aspell from your command line on your host?

    and works only with WordPress 1.3 (which is also still in alpha)

    Note that I have tested it on 1.2 now and it appears to function.

  33. 33

    Anton Says:

    I just installed the 0.2 version on WordPress 1.2, other than needing to install aspell, everything seems to work great, Thanks!

  34. 34

    ColdForged Says:

    I just installed the 0.2 version on WordPress 1.2, other than needing to install aspell, everything seems to work great, Thanks!

    Excellent, thanks for letting us know!

  35. 35

    ThorFarrow.com Says:

    Spell checker plugin

    Yesterday, ColdForged released a spelling checker plug-in for WordPress. Just what I need! I’ve been looking for this!

    What is it?
    The Spelling Checker plug-in for WordPress provides a built-in facility for spelling checks on posts from within…

  36. 36

    J.A.S.O.N. Says:

    coldforged.org Spelling Checker plugin for WordPress

    coldforged.org Spelling Checker plugin for WordPress

    Sweet! Now maybe John will leave me alone about my spelling! :wink:

  37. 37

    ColdForged Says:

    Ron and ck:

    Try out this version and see if it gets you through. Note the additional installation step of setting the aspell path. Let me know if this helps you, please.

  38. 38

    CarLBanks Says:

    Can you make a version that is in zip form?

  39. 39

    ColdForged Says:

    Can you make a version that is in zip form?

    Sure. Head to the page and enjoy.

  40. 40

    Thor Says:

    I downloaded, edited, uploaded and reactivate the new .3 version. I’m now getting a JavaScript error relating to english.dat. That file does not exist on my host server, at least not where I’d expect it to be. There are other files that might be relevant, but I don’t know enough yet to determine that.

    A very BIG thank you for your help yesterday, by the way.

  41. 41

    ColdForged Says:

    Thor, the personal dictionary support is what’s killing you there, so I may have to back that out. I’m trying to come up with a more generic solution. In the meantime, anyone having similar issues with the personal dictionary can back it out by editing the “spell/spellchecker.php” file and changing $aspell_opts to the following:

    $aspell_opts = "-a –lang=$lang";

    I’ve since determined that ck’s problem is an overall incompatability with servers that run with PHP safemode on. I can get past half of it, but the actual execution of the aspell executable seems impossible right now. If I come up with a solution, I’ll advertise it. Until then, this plugin simply can’t support safemode PHP environments. Sorry.

  42. 42

    CarLBanks Says:

    The zip file link can’t be found.

  43. 43

    CarLBanks Says:

    Also what is the aspell_path?

  44. 44

    ColdForged Says:

    Also what is the aspell_path?

    Open up a terminal window to your web host. Type “which aspell”. It should respond with something like “/usr/bin/aspell”. It may say “/usr/local/bin/aspell”. It may say something else. Whatever it says before the “aspell” is the path. So, edit your wp-content/plugins/spell/spellchecker.php file and find the line that looks like this:

    $aspell_path = '/usr/bin/';

    and make sure that that path matches your host’s path.

  45. 45

    CarLBanks Says:

    Aspell seems to be installed since it’s working.

  46. 46

    AdamStac Says:

    Hmmm…I got this to work…no problems! VERY cool plugin I might add!

    A big thanks from me…

  47. 47

    AdamStac Says:

    Hey, my gravatar’s messed up here… :(

  48. 48

    Burningbird Says:

    Spell Check your Comments

    Cold Forged did a very nice encapsulation of spell checking as a plug-in for Wordpress. I grabbed the code and incorporated it as a new option in my comments’ pages so you can spell check your comments–both the live comment, and the saved comment in …

  49. 49

    Sorin Sbarnea Says:

    It doesnţt seamns to work with HtmlArea plugin. I don’t see spell buttons after activation :(

  50. 50

    ColdForged Says:

    Hey, my gravatar’s messed up here…

    Doh! I assume you have a transparent one, eh? Never thought of that.

  51. 51

    ColdForged Says:

    It doesn’t seamns to work with HtmlArea plugin. I don’t see spell buttons after activation

    I’ll check it out, thanks for the heads up!

    EDIT: Fixed in version 0.5. Be sure to read the release notes, though.

  52. 52

    CarLBanks Says:

    There’s a gzipped version of 0.5

  53. 53

    CarLBanks Says:

    Meant to add that I don’t see a zipped version of 0.5. Sorry for double posting but it’s a great plugin also.

  54. 54

    Adam M. Says:

    This is great! Any way to make this work on comments?

    It’s not so much that my commenters can’t spell as it is that… um, I can’t.

  55. 55

    Mark Payne Says:

    I am very relieved now, because I had just started working on my own spellchecker using aspell; I had no idea that Speller Pages was out there. One thing that I ran into is that you can use a ‘-H’ option if you are going to be checking any HTML (or any SGML, really) and it will filter through it.

  56. 56

    ColdForged Says:

    Meant to add that I don’t see a zipped version of 0.5.

    Gah, again with the forgetting the zip version. My bad. Check again, it should be there now :) .

    This is great! Any way to make this work on comments?

    Yes, there is, though Shelley remained mum in her method. Fear not, though, I’ll probably make it a standard feature of a future version if Shelley doesn’t dish ;) .

    One thing that I ran into is that you can use a ’-H’ option if you are going to be checking any HTML (or any SGML, really) and it will filter through it.

    Didn’t know that! Thanks for the tip, I’ll have to check that out and incorporate it.

  57. 57

    Russell Says:

    I use SpellBound 0.7.1 which is a FireFox extension… just a right click away, and works perfectly for me.

    If in IE I use ieSpell… also just a right click away.

    I’m not meaning to be a killjoy, but in what way is Spelling Checker better?

  58. 58

    ColdForged Says:

    I’m not meaning to be a killjoy, but in what way is Spelling Checker better?

    In no way. Use what works for you! But apparently a lot of people don’t know about those tools that you mention. Even if they did, some people don’t make that leap from “there’s a tool for my browser” and “I can use it for my WordPress installation.” But, give them a plug-in explicitly for what they’re trying to do — say, write a post in WordPress — and they find it useful.

    Judging by the buzz and apparent popularity, there was seemingly an unfilled need.

  59. 59

    Ken Nerhood Says:

    I’m having similar problems as ck and others. I’ve installed versions .3-.6 on both a linux and Mac OS X box. In both cases I know that aspell works and have the correct path set for $aspell_path.

    When I go to check the spelling, I get the pop, it Spell check in progress… message, then the top half of the window goes blank. When I view the source for that frame, I can see the suggestions for the misspelled words. (I’ve tried with both IE and Firefox)

    The error that I get in IE is error on line 47, char: 7, Error: ‘wordWindowsObj’ is null or not an object

    Any suggestions would be greatly appreciated.

  60. 60

    Nat Carson Says:

    I was also having problems. In several of the php files it assumes that wordpress is installed in the root directory of the website. Mine is installed in a subdirectory. I edited the paths by hand adding the extra directory level and got it to work. Seems like the plugin should detect what the WordPress root is then build paths from there on.

  61. 61

    ColdForged Says:

    Seems like the plugin should detect what the WordPress root is then build paths from there on.

    Nice work, Nat. Yes, Ken agreed to work with me to help track it down and I made that particular discovery last night but could only confirm it today. Yet another path I overlooked. Sorry about that. Thanks for helping!

    Version 0.7 Alpha already incorporates significant changes to the path derivation, so it should be addressed then. That will be released tomorrow… not tonight only because the source is on my work machine repository and I can’t get to it :) .

  62. 62

    Ron Says:

    I am also getting the 'wordWindowObj' is null or not an object' error. Other than that, everything seems to be working. I am hoping I can get this to work!

    Thank you for your work on this, I have been looking for something like for a long time.

    I’m not meaning to be a killjoy, but in what way is Spelling Checker better?

    Spelling Checker is better for people like me because I travel at least 180 day s a year and do most of my web log accessing and posting on the road from public computers. Most of these do not have IeSpell or Fire Fox installed.

  63. 63

    Taylor Says:

    It tells me I need a word list.. specifically for the language en_US

    HELP?!

  64. 64

    ColdForged Says:

    It tells me I need a word list.. specifically for the language en_US

    Hmm… first try would be to remove any file named “plugins/spell/aspell.personal” if it exists. That will force the plugin to create a new personal dictionary. If that doesn’t do it, I would try to track down where your aspell install is and determine if it has a master word list. Try this to see if there is a master word list:

    aspell dump master

    If there is you’ll get a load of stuff.

    Another thing to try is to remove the entire “–lang=$lang” parameter from the file “plugins/spell/spellConfig.php” file. All instances of it and see if it makes any difference.

    I’m no expert on all the myriad installation options of aspell, so it may take some experimentation on your part to determine options that work for you. Hope this helps!

  65. 65

    Taylor Says:

    Here’s the deal. I can’t trace my aspell install because my host doesnt offer shells. So I think that I got the config right (check freshpolitics.us to see) but it says there is no Word List. How do I install one?

  66. 66

    Taylor Says:

    If I can’t do those calls “which aspell” and “aspell dump” how can I figure this out?

  67. 67

    Thor Says:

    No joy with the Add Word feature. I click the button, and… nothing happens. Just to check that a word was not being added, I closed the page with out saving, reopened and ran the spelling checker again. Same words found that I tried to add.

    Checking the plugins/spell/ directory, no “aspell.personal” file is being created.

    What have I missed?

  68. 68

    ColdForged Says:

    No joy with the Add Word feature.

    Somehow I knew you’d be a troublemaker :D . IM me when you get a chance… I know we had difficulties with aspell personal dictionaries with you before.

    So I think that I got the config right (check freshpolitics.us to see) but it says there is no Word List.

    Unfortunately there’s no way to verify you have the aspell configuration correctly by looking at your site… you may have the other paths set up right such that the window comes up but still have an aspell configuration that is incorrect, as seems to be the case since it can’t find the word list. It may be time to get your hosting provider involved to see what their aspell support is. Ask them perhaps where their aspell master word list is located. Once you have that, then you can specify that in all of the aspell configuration variables as:

    --dict-dir="path-to-the-word-list"

  69. 69

    Thor Says:

    Troublemaker. Yep, That’s me. Mostly out of not knowing any better, I guess.

    I didn’t keep your IM address, sorry. I’ll keep plugin’ away. Send me an email if you think of something for me to try.

  70. 70

    Mark Says:

    I’ve added your Spell Check plugin and it works GREAT! It was a bear for me to install aspell on my shared Linux webhost account, but I figured out how to do it without being root. :)

    However, I can’t seem to get personal dictionary to work. I click on “Add” and when the spell check is done, it says “Failed to add 3 words to dictionary.”

    Also, this plugin only works with IE - which is not good. I prefer Firefox, but I set firefox to open popups in tabs. When I try to check spelling using Firefox, it opens a new tab that says:

    This page cannot be displayed

    The window was not opened from another window.

    Any suggestions for the 2 things?

    THANKS!!!