WordPress Plugin: Visual.SpellCheck

Current Version: 0.95

I don't use the WYSIWYG Editor that comes with WordPress 2.0, and as a result have been getting extremely frustrated with the lack of a spell-checker. So I decided to try and get one working, preferably using AJAX to make it as fast and user-friendly as possible.

I am now proud to present Visual.SpellCheck – an AJAX-based Spell Checker for WordPress. It includes the ability to:

  • Highlight incorrectly spelled words
  • List suggested words from the aspell dictionary
  • List suggested words from your custom dictionary
  • Allow new words to be added to your Custom Dictionary

The Spell Checker works in Firefox, Internet Explorer, Opera and Safari.

Demo

Here is a demo of Visual.SpellCheck. It should work fine in Mozilla browsers (including Firefox) and Internet Explorer. It will also function in Opera, although there are some small issues. Follow the instructions in the textarea itself, and feel free to edit it's contents and then test.

Installation

Follow these basic steps:

  • Download this file: Visual.SpellCheck.zip (37Kb)
  • Unzip the file on your computer.
  • Upload the complete folder "Visual.SpellCheck" to your WordPress plugins directory (found in "/wp-content/plugins")
  • Login to WordPress and go to the Plugins module
  • Find the line that says "Visual.SpellCheck" and click "Activate"
  • Change the permissions on the file Visual.Syntax/personal_dictionary/dict.txt" to "757″ so that the server can write to the file

Note: Pspell must be installed on the server for this to work. Also this plugin is not compatible with the WYSIWYG HTML Editor that comes with WordPress (TinyMCE comes with its own spellchecker anyway). You will have to disable the WYSIWYG and be using the old-style editor (textarea).

Credits

This project is based on code from Broken-Notebook. Thanks to Garrison who has modified his original code to allow the plugin to integrate with WordPress and minimise issues with future compatibility.

Known Minor Bugs

This is the only bug I am aware of – and it is pretty minor:

  1. In Opera the popup menu that shows the suggested words always sits top-left of the textarea

If you are able to help with this that would be great. :)

ChangeLog

2006-02-04 - Firefox QuickTags conflict fixed. Now version 0.95
2006-02-04 - Public release of version 0.90

If you liked this plugin you can digg it here or please leave a comment.

Share:
  • Digg
  • Twitter
  • StumbleUpon
  • LinkedIn
  • del.icio.us
  • Reddit
  • Facebook
  • MySpace
  • Add to favorites
  • Google Bookmarks
  • Yahoo! Buzz

69 Responses to “WordPress Plugin: Visual.SpellCheck”

  1. WordPress Plugin: Visual.SpellCheck · Asymptomatic Says:

    [...] Here’s a new Ajax-based spell checker for WordPress that uses Pspell on the back end. Doesn’t work in the RTE, just in the textarea. [...]

  2. Chrono Cr@cker Says:

    Too amazing dude. I love. Infact I’ve recommended WP.com to have this as well. Could you tell as to how exactly you made this. It’s the best spell-check plugin I’ve seen so far. Already blogged about this and have posted this in WP Forums as well. You should post this in the Plugin Database and the Codex.

    http://wordpress.com/forums/topic.php?id=488&replies=1

  3. Chrono Tron - 100% » Blog Archive » The Best Spell Check for WP Says:

    [...] Called Visual Spell Check, this is made fully using AJAX. It’s clean, light, uber-fast and very user-friendly. It automatically checks the text for mistakes and highlights it and once you click there, correct words are suggest. Here is the URL.. Moreover, you can [...]

  4. Evan Says:

    Discovered this through Asymptomatic. Works great on my site.

    Thanks for a great plugin. :)

  5. Matthew Delmarter Says:

    Thanks for the feedback guys. Look for an update in the next week or so to try and make this bug-free for all users…

  6. Chrono Cr@cker Says:

    Excellent and I’ve posted about this in the WP forums.. The response is that if this could work for the WYSWYG editor, then definitely this can be added to WP.com. Would be a great credit to you if you could work on that. .

    Cheers and all the best!

  7. Ivan Minic Says:

    Excellent!

  8. Evan Says:

    Instead of refreshing the field when adding a word to the personal dictionary, why not just unhighlight that one word throughout the page? Seems like that would be quicker…

  9. Roberto Gomes Says:

    I was looking for a non-wysiwyg spell checker for wordpress 2 and this one looks really nice.
    But i get a few notices when i try to spell check, i think it is because i use error_reporting E_ALL on my server’s php.ini setup.
    I think you should fix these notices, there are only 4 or 5 i think and it would make the plugin even better for us E_ALL coders :D
    Other than that, thanks for the nice spell checker.

    Greets.

    ved

  10. Sean Says:

    Is there a way to get it to work on Write Pages too. Right now it only works on Write Posts. Great Plugin though.

    Sean

  11. Blogalistic » Visual.SpellCheck Says:

    [...] Visual.SpellCheck is an AJAX-powered plugin to check your spelling in WordPress. [...]

  12. John Says:

    Matthew, I am running WordPress 2.0.1 on IIS6. I have Aspell up and working using the Spelling Checker plugin by Brian “ColdForged” Dupuis. I have set define(‘ASPELL_BIN’,'D:\Aspell\bin\aspell.exe’); in spell_checker.php but I am getting this error:

    Fatal error: Cannot access empty property in c:\Inetpub\wwwroot\wordpress\wp-content\plugins\Visual.SpellCheck\pspell_comp.php on line 131

    Any help you could give me would be greatly appreciated.

     -john

  13. Ulysses Ronquillo Says:

    Matt,

    Thanks for making this available. Ajax is awesome.

    Ulysses

  14. Cosmic Lifeform Origin » Blog Archive » Wordpress AJAX Visual Spell Check Plugin Says:

    [...] http://matthew.delmarters.com/weblog/visual_spellcheck/ [...]

  15. Phil Says:

    How do I get Aspell to work? I have the files?

  16. j sekera Says:

    will it work with 1.5 or is it limited to 2 – (hoping)

  17. EcoGraphic Says:

    Is there a way to make this work on pages as well as posts? The Check Spelling link shows up when writing posts, but not when writing pages.

  18. engrowe.com » Blog Archive » Safari with Wordpress Says:

    [...] However, there seems to be a problem with the Visual.SpellCheck plug-in and Safari. When I check my spelling, the plug-in strips the HTML markup out of my post. The bug is not really a problem because Safari can spell check text areas without any special plug-ins. So from what I can tell, Safari nightly build plus Wordpress minus Visual.SpellCheck works great. [...]

  19. Ben Partch Says:

    Hello

    It seems this plug-in strips ‘class’ and ‘alt’ attributes from ‘img’ tags that are in the post. Is this a bug or have I done something wrong?

    Other than that it seems to be a great plug-in, thanks for making it.

  20. renaluelle Says:

    FYI… your demo includes an incorrectly spelled word that is not being detected. actionn with a double n is escaping the spell checker for me…

    Also, your comments seem to suggest that the WYSIWYG editor in 2.0 has it’s own spell checking? I’m a new WP user and I’m a bit confounded by that as I can’t seem to find one built in or listed on the Plugins list on the Codex. Could a friendly person out there set me straight on this??? Thanks!

  21. Deep Says:

    I wish it could work with WYSIWYG editor too…

  22. Dave Kaufman Says:

    I would love to see you decide to add this to the WYSIWYG editor in 2.0+. It is a great implementation. There are no plug-ins and WP2.1 could be a bit off in the future.

    This post isn’t inspiring I know, but a spell checker would be a great benefit to the world WP.org users. Please consider it.

  23. Russell Limprecht Says:

    Nice work.

  24. aeronova Says:

    Hi there,

    I’d like to say thank you for your awesome plugin.
    BTW, your plugin doens’t work when I activated ‘Audio player 1.2.2 ‘ plugin by Martin Laine.
    I guess yours have some conflictions with the audio player plugin.
    I hope I’m not the only one who bumped into this problem.
    Thank you.

  25. jeff Says:

    Fantastic Plugin!

    Is there a way to get it to work on Write Pages too, even if it’s a hack, it would make the RTE BS with cut and paste from Word not a problem.

    JS

  26. Jeremy Says:

    I have been looking for something like this for a while… and it seems that all the spell checkers out there are sub par. However there are a few Spell Checker plugins out there that are pretty decent, given whats out there. This seems to be one of the better ones. They will only get better.

    It is the most asked for feature right now,.. it is odd that there isnt more chatter.

  27. David M. Besonen Says:

    have you tested this with a pspell cgi install? if so, was it too slow to be usable?

  28. blog.bocsite.com » Blog Archive » Spell Checker Says:

    [...] To get the info just go to Matt’s excellent blog. [...]

  29. Walker Says:

    Any idea where to find other dictionaries (some listed on this page), and how to configure this plugin to use them? I’m interested in the British English one.

    Wonderful plugin btw. Uploaded and activated it and it just worked. No complaints.

  30. Sachin Says:

    hi dear
    I have seen your ajax based spell checker and i must tell you that its really amazing.
    I need some help from you, actually i am developing a mailing client and i have to use a spell checker in that which is something like yours.
    Can i use it in Textarea / RTE?
    Can you allow me to use it?
    Looking for positive response.
    Regards,
    Sachin Jain

  31. Michał Tkacz Says:

    I had to make a few modifications to make the spell checker work with Polish (and in general with other non-English languages). Feel free to include these improvements in the future versions of Visual.SpellCheck.

    1. In pspell_comp.php, I had to replace

    if($this->$jargon){
    $this->args .= ‘ –jargon=’.escapeshellarg($jargon);
    }

    if($this->$encoding){
    $this->args .= ‘ –encoding=’.escapeshellarg($encoding);
    }

    with

    if($this->jargon){
    $this->args .= ‘ –jargon=’.escapeshellarg($this->jargon);
    }

    if($this->encoding){
    $this->args .= ‘ –encoding=’.escapeshellarg($this->encoding);
    }

    otherwise PHP would complain with this error message:

    PHP Fatal error: Cannot access empty property in /wp-content/plugins/Visual.SpellCheck/pspell_comp.php on line 131

    or use an empty string.

    2. In spell_checker.php, I had to:

    a) replace

    $pspell_config = pspell_config_create(“en”);

    with

    $pspell_config = pspell_config_create(“pl”, null, null, ‘utf-8′);

    I think that both language and encoding could be taken from the configuration instead.

    b) in spellCheck function replace the regular expression

    /[A-Z']{1,16}/i

    with

    /\pL{1,32}/

    to take accented letters into account. Note that \w in place of [A-Z] didn’t work for me and when I tried to add the apostrophe back with /(\pL|’){1,32}/ it didn’t work either. Also I increased the length to take into account some longer words.

    c) in remove_word_junk function remove

    “\x85″=>”…”,

    from the table as \x85 is part of an utf-8 sequence for a Polish character which would get corrupted. I guess str_replace could be replaced with some more intelligent function instead.

  32. Michał Tkacz Says:

    In fact, I had to do one more modifications in spell_checker.php:

    d) replace

    if($usePersonalDict){
    pspell_config_personal($pspell_config, $path_to_personal_dictionary); // allows the use of a custom dictionary (Thanks to Dylan Thurston for this addition).
    }

    with

    if(function_exists(‘pspell_config_personal’) && $usePersonalDict){
    pspell_config_personal($pspell_config, $path_to_personal_dictionary); // allows the use of a custom dictionary (Thanks to Dylan Thurston for this addition).
    }

    Otherwise, if only aspell is installed, PHP would complain about missing function with this error message:

    PHP Fatal error: Call to undefined function pspell_config_personal() in /wp-content/plugins/Visual.SpellCheck/spell_checker.php on line 247

    Also, if only aspell is installed, there’s no way to add a word to the dictionary (PHP would complain about missing pspell_add_to_personal function).

    And last but not least, the following lines should be moved down a few lines, otherwise there’s no way at all to add a word when there’re no suggestions available:

    if($usePersonalDict){
    $retVal .= “Add To Dictionary”;
    }

  33. Matt M. Says:

    Excellent plugin…thanks! A couple things I noticed that could be fixed: (1) If no suggestions are found for a word, then it doesn’t give you the option of adding it to the dictionary and (2) If you correct the spelling for word1 and then add word2 to the dictionary, the correction for word1 is lost and needs to be done again unless you toggle resume editing after each word that gets corrected.

  34. Charles Krause Says:

    I downloaded your plugin – which seems to integrate into the wordress admin side well enough. However, I have Aspell installed in a directory outsider the htdocs directory. I was wondering where the paths to the aspell binary are defined in the scripts. I’ve changed two ‘path/to/aspell’ in two seperate scripts – but it still throws an error when the spell check is invoked. Can the plugin find binaries defined by absolute drive paths, not relative server paths? Is it easier to reinstall aspell inside the htdocs directory?

    I have a feeling I’m probably missing something quite elementary somewhere :)

  35. Wordpress Plugins: The Essentials at Subtractions and Nouns Says:

    [...] Presenting a professional, cohesive and consistent blog is essential to increasing traffic. However, if the majority of your blog posts are completely interwoven with erroneous spelling mistakes, and horrific grammatical errors you are immediately presenting an air of unprofessionalism. Therefore the introduction of the Visual Spellchecker by Matthew Delmater is an excellent AJAX solution which can ensure that your posts are spelling-error free. [...]

  36. gmustuk Says:

    Can this work with in the blog comments box too?

  37. Lost in… whatever » I’ve found my spellchecker Says:

    [...] Visual.SpellCheck an AJAX based spellchecker for the non-WYSIWYG Editor does the job for me – if I’m writing on my site, right now Aspell and Gnome-Blog do the work on my Desktop. [...]

  38. Rumi Says:

    Excellent plugin, thanks for sharing!

  39. Aigarius Blog » Spelling Says:

    [...] From the previous version of my last post, people with even moderate knowledge of English could have easily understood that I suck at spelling ad that, consequently, I did not have a spelling checker installed at this blog. Both of those two conclusions would be true. So I decided to break in and install something to help me and after some mishaps, I settled on Visual Spellcheck plug-in. I am editing my posts in HTML anyway, so lack of WYSIWYG editor support is not critical for me, more like the opposite. All I needed was to install the plug-in, activate it in wordpress, install php5-pspell package and restart Apache. I forgot to restart Apache at first and got a cryptic error from the included fake pspell wrapper. Also aspell and corresponding language libraries must be installed on server site. [...]

  40. Aigars Mahinovs Says:

    If I start the spellcheck, correct all errors and then immediatelly press “Save” or “Publish” buttons, changes are not saved. I think that is a bug, because people would not consider returning to editing mode mandatory for appying changes from the spellcheck.
    Thanks for the good work!

  41. DrFaulken Says:

    Hello

    It seems this plug-in strips ‘class’ and ‘alt’ attributes from ‘img’ tags that are in the post. Is this a bug or have I done something wrong?

    Other than that it seems to be a great plug-in, thanks for making it.

    ++++

    I am experiencing the same issue. If we’re not doing anything wrong, is there any chance of an update? Thank you for making a plug-in that I use far more than any other installed on my blog.

  42. Glen Lipka Says:

    I think it is working, but it is finding EVERY word as misspelled. Am I supposed to download a dictionary file somewhere? It didnt give an error, but could pspell be missing? Thanks for the help. I like your implementation.

  43. CommaDot.com » Blog Archive » WordPress Continued… Says:

    [...] Getting a little comfortable with WordPress now.  The way plugins work is actually pretty easy.  I tried out a whole bunch of standard editor plugins.  The reason for this is that the out-of-the-box WordPress does not include spell checking.  I tried 5 different ones.Ajax Spell CheckerEditorMonkeyVisual.SpellCheckWYSI-WordpressXinha4WP combined with Text ControlThe last one is the one I am using now.  Looks pretty powerful.  This is my first post with it.  Supposedly, the comments use it too.  It looks like I can make the editor fullscreen.  Let’s try.Ooooooooooh.  That’s nice.  Me likey.Ok, all the others looked interesting, but I have to give the nod to Ximha4WP, although they really really need to change their name to something in English. [...]

  44. Birdhouse Status » Blog Archive » pspell installed Says:

    [...] PHP has  been recompiled with the pspell libraries, which means users can now  use things like Visual Spellcheck for  WordPress. [...]

  45. rjdave Says:

    I recently installed Visual.SpellCheck for my blog and it works fine in firefox but Internet explorer gives me the javascript error:

    Line: 44
    Char: 68
    Error: Invalid procedure call or argument
    Code: 0
    URL: http://www.myroms.org/blog/wp-admin/post.php

    I am running WordPress 2.0.4. I have modded the files some but I tried the checker on a fresh install and it still didn’t work. The strange thing is that your example on this page works fine in internet explorer. Any ideas?

  46. Site updates at .: Sabarish :. Says:

    [...] 8. Visual.SpellCheck – AJAX Spell-Checker for my posts. [...]

  47. Dave Says:

    Hi,

    I have wordpress 2.0.4 and I’m having trouble with the spell checker. In internet explorer I get an: Error: Invalid procedure call or argument. The line and character number point to httobj.open on line 43 of cpaint2.inc.compressed.js. The really odd thing is that IE works fine with your little example on this page. I even tried downloading the exact cpaint2.inc.compressed.js that you are using on this page but it is identical to the one I have. Firefox works fine, it is only IE that has an error.

    Any suggestions?

  48. Jeromy Boyd Says:

    I know you don;’t ssupport it, but where could I find an idiot’s guide to installing ASpell. I just downloaded ASpell as well as the Dictionary I needed, but the installation instructions they provide almost seem as if they exxpect you to be a PhP genuis.

  49. Michael Pollock Says:

    Great plugin. I installed it and it was working fine. Now all of a sudden I’m getting this error:

    Fatal error: Call to undefined function: pspell_config_personal() in /homepages/8/d104609365/htdocs/savvysolo/wp-content/plugins/Visual.SpellCheck/spell_checker.php on line 58

    Any ideas?

    Thanks – Michael

  50. WordPress Spell Check Plugin Says:

    [...] There are several WordPress spell check plugin i found on the net, but only one that i really like, introducing Visual.SpellCheck by Matthew Delmarter, an AJAX spell checker that function almost like the one in Gmail, but Pspell must be installed on your server in order to use this plugin. [...]

  51. Visual.SpellCheck And Sociable Fix - hwa2u.com Says:

    [...] For those who use the WordPress plugin Visual.SpellCheck and Sociable, i don’t know whether this happen to you or not, but for me if i enable both plugin i will get this strange problem where the “Check Spelling” in my editor doesn’t show up. [...]

  52. PhiliPP Says:

    I get this error

    br /> Fatal error: Cannot access empty property in /var/www/wp-content/plugins/Visual.SpellCheck/pspell_comp.php on line 131

    pspell is installed, permissions on dict.txt changed and I run it on WP2.04 any suggestions?

    thx

  53. JustAnotherUselessPage » Wordpress-plugins Says:

    [...] Just a list of useful and mostly on this site running wordpress plugins Askimet Lightbox 2 Plugin Google Analyticator Google Sitemaps WordPress Database Backup Ultimate Tag Warrior Image Manager Visual.Spellcheck [...]

  54. PhiliPP Says:

    forget it – I solved it somehow..

  55. Chris Says:

    I installed this plugin on two different WP install (both running brand newest version of WP) and even with Rich editing turned off, the spell check button is not showing up? Is there a possibility that a newer patch may have broken this?

  56. Investing Intelligently » Blog Archive » Upgraded to Wordpress 2.0.5 Says:

    [...] I just upgraded to Wordpress 2.0.5 today. So far so good. While I was at it, I disabled the siFR stuff that gave me fancy headings (provided by the CG-FlashyTitles plugin). It was slowing page-loading time down a lot. I had always noticed the slowdown but didn’t bother to measure it until now. In some cases disabling brought the page-load time down to 5 seconds from 10 seconds. I also disabled the Visual.SpellCheck because Firefox 2.0 has built in spell-checking for text boxes. [...]

  57. To Serve you Better at ten billion butterfly sneezes Says:

    [...] I just installed the Visual Spell Check comment plugin. When you have 6 readers and commenters, you take real good care of them. [...]

  58. Suzanne’s blog » Blog Archive » Ella Says:

    [...] Well, I broke down and upgraded to Ella wordpress 2.1. It’s nice. Great to have auto spell check. Now if I can just remember to use it… Also auto save is nice. You know I don’t like the auto spell check in Ella as well as I like my spellcheck plugin. Having a drop down list is nice. [...]

  59. priya Says:

    I have installed this plugin in my blog. Its working fine in Firefox browser. But in Internet Explorer when i click “Check Spelling” its taking too much time to check the spelling and not working at all. Please suggest me the cause of the problem and how i can rectify that.

  60. priya Says:

    I am getting the javascript error “Invalid procedure call or argument” in Internet Explorer browser. So that spell checking is not working. Any help is appreicated.

  61. webDressing Says:

    Anyway this could be adapted so that it words with the comments section?

  62. Review: Visual Spellcheck Plugin Says:

    [...] One of the benefits of having PHP5 and pspell is that I get to use cool AJAX wordpress plugins like Visual Spellcheck. If you want to use it, you’ll have to use the more basic wordpress editor instead of the richtext (but I don’t like the richtext version anyway – it creates ugly code.) [...]

  63. Visual.SpellCheck word filtering / NextBigLeap - My life in ones and zeros Says:

    [...] Spell checking in Wordpress using the non-wysiwyg editor can be achieved using Visual.Spellcheck plugin. The plugin makes use of a spell checker written by Garrison Locke at Broken-Notebook which interfaces with PSPELL. [...]

  64. jim Says:

    Awesome plugin! Thanks for making it available.

    The only problem I have is saving a word to the dictionary. I have pspell installed on my host and it’s enabled. I also have the permissions set to 757. I still get the “Save Failed” message when adding a word.

    Any thoughts. I am running WP 2.3.2

  65. gouki Says:

    Download link is broken.

  66. gouki Says:

    Correct download link:

    http://matthew.delmarters.com/downloads/Visual.SpellCheck.zip

  67. WordPress Continued | commadot.com Says:

    [...] Visual.SpellCheck [...]

  68. Bob C Says:

    Hi there.. will this work with the Apple IPhone 3G? I am looking for a spell check that will function for the email apps on the IPhone.

    Thx!
    BC-

  69. Matthew Delmarter Says:

    Just a quick note, for my own reference as much as anything.

    To make sure this plugin works on Debian the following packages need to be installed:

    apt-get install php5-pspell
    apt-get install aspell
    apt-get install aspell-en

Leave a Reply