This is the personal website of John Watson: father, software developer, artist, guitar player. Follow me on Mastodon or Twitter or Twitch or itch.io or GitHub.

Word Statistics plugin for WordPress

I’ve created a plugin called Word Statistics for WordPress 1.2 2.0 that displays readability statistics on the post editing screen whenever a post is edited or saved (and you continue editing). The plugin also provides similar functionality to the MovableType plugin MTWordStats. I’ve never used MT or tried the MTWordStats plugin so I can’t really say how the two compare.

Update 12/30/2005: A new version has just been released that is compatible with Wordpress 2.0. The older version is still available and works with versions prior to 2.0.

Comments

  1. Carla on 2004-11-24 10:12:47 wrote: Does it play nicely with 1.3x?

  2. john on 2004-11-24 19:59:47 wrote: I’m using it with 1.3-alpha-4 right now.

  3. john on 2005-03-21 13:52:57 wrote: It also works nicely with 1.5.

  4. tylerwillis on 2005-05-12 03:41:41 wrote: Hi, I was interested in your plugin, but I can’t seem to download it correctly - the zip file appears to be damaged according to both WinZip and WinRar. I tried multiple downloads on different browsers and never got it correctly. Are you still hosting this?

  5. john on 2005-05-12 11:32:00 wrote: It should be working now. Something has been corrupting files at my web host… it may be time for me to switch. Thanks.

  6. tylerwillis on 2005-05-13 02:39:40 wrote: Thanks for fixing that up. I’ve installed and it works great. Thanks for the plug-in. :)

  7. giovanni on 2005-05-19 00:44:28 wrote: I’ve read readability statistics software on your net.it is good.but how can I get this readability statistics software .tell me ,please.thank u!~

  8. john on 2005-05-19 10:57:35 wrote: giovanni, follow the link in the post, above, to download it.

  9. Dan on 2005-05-25 11:34:22 wrote: Very cool plug-in. Would it be possible to expose the variables holding the readability scores as a template variable? I’d love to be able to put the Fog Index inline with my posts.

  10. blau on 2005-07-25 03:50:53 wrote: Can you point out some internationalization efforts of Fog Kincaid Flesh? I’m experimenting with your plugin in an Italian language blog, but I guess their indexes are out of synch when dealing with a non-english text

  11. john on 2005-07-27 09:07:18 wrote: The algorithms make assumptions about the difficulty of reading by counting the number of syllables in a word and the number of words in a sentence. I don’t know if those theories hold for languages other than English. Every language probably needs its own algorithm for breaking a word into syllables. Or you could change the algorithm to use a dictionary with syllable data.

  12. blau on 2005-07-27 23:13:09 wrote: I found two Italian readability indexes, Flesch-Vacca and GULPEASE. I’ll check if those need its own hyphenation rules. I’d like to localize this plugin, for now it’s on my august perhaps/maybe list. Does the plugin ignore HTML tags?

  13. john on 2005-07-27 23:37:49 wrote: Yes. It uses the PHP strip_tags() function.

  14. Justin on 2005-08-10 10:57:36 wrote: Hi, I’m using the current version of WordPress 1.5.1.3 and I can’t seem to get your plugin to work. I was wondering if it does indeed work with this version, and if so, was there anything else I needed to do to install this plugin except for activating it? I’m totally confused, any help would be greatly appreciated. Thanks in advance -Justin

  15. blau on 2005-08-11 11:02:35 wrote: It works with WP 1.5.1.3. Make sure you have javascript enabled (check if quicktags are active in the Write page) and follow the installation instructions literally:

    To install the plugin: * Unzip the plugin archive, keeping the directory structure intact. * Copy the unzipped folders into wp-content/plugins. Your directory structure should now look like this: wp-content/plugins/wordstatsplugin.php wp-content/plugins/wordstats/ wp-content/plugins/wordstats/wordstats.php …other plugins… * Activate the plugin from the Plugins tab in WordPress.

  16. Justin on 2005-08-17 22:07:48 wrote: Hiyas, sorry I didn’t get back to you sooner, but I had a few issues with my blogger that needed to be squashed, heh. Anywho, I’ve done as you’ve said and it has been activated without any errors. When I write a post, I don’t see the extra line underneath the quicktags. However, when I attempt to edit a comment, I see them there. Is that where they’re supposed to be or…am I just really bad at this? Haha (which is probably the case)

  17. badrad on 2005-12-03 05:33:42 wrote: Hey, I’m a big fan of this plug in. I just upgraded to Wordpress 2.0. The plugin mostly works, all the template commands still work like a charm. Due to the vastly remade Write Post section, however, the stats no longer automatically show up there. Are you planning on updating this plugin for complete 2.0 support?

  18. john on 2005-12-30 11:23:40 wrote: The plugin has been updated for 2.0. Just replace the old files with the new. There were a few changes so read the version history for those.

  19. Dave Wolf on 2006-02-05 09:23:29 wrote: Great plug-in! Love it. . . Nice to know how readable my “stream of consciousness” posts really are! Having the ability (I’m still using WP 1.5.2 and the older “beta” version of the plug-in) to: . . . throw some returned values onto the pages is great as well. Now, for me to admit my ignorance and ask my question! How would I turn the above code into something that would return values for the total of all published posts (instead of some specific page, etc.)? I would like to put the total “readability” sum of all posts on the index page of the blog. Remember, the syntax would need to apply to WP 1.5.2 – not 2.0 (yet ;)) Your help would be greatly appreciated! Thanks. – Dave

  20. john on 2006-02-06 12:13:33 wrote: Well, you’d need to get all of the text for every post and run it through the same code for a single post – but I don’t recommend it. It would be a pretty big resource hog. I don’t think a readability index generated in this way wouldn’t be very accurate since it would just become an average. And there are more efficient ways (I don’t know what they are, but there MUST be) of getting a total blog word/sentence count.

  21. JC on 2006-03-05 07:56:09 wrote: How would it be possible to get the information displayed within the actual post so my readers can see it? (I know I can create custom fields and enter the information myself. However, I’m lazy and would like it done automatically. I also don’t trust myself to be honest.)

  22. JC on 2006-03-05 07:59:26 wrote: Ignore my stupid comment above, I just found the answer in your documentation.

  23. Daniel on 2006-03-21 01:37:29 wrote: Installed it and it works perfectly. I’m running WP 2.0. Thanks for your work, well done.

  24. Allen on 2006-08-08 15:25:18 wrote: Thanks, it works nicely! Although is there a way to make it so it ignores links?

  25. Todd on 2006-08-08 19:09:15 wrote: strip_tags isn’t working quite right. If I have header tags (H1, H2, etc.) around Title of Film, that counts as 9 words: the opening bracket is one word, h1 is one word, and the closing bracket is one word. So I’m already at 3 words and I haven’t even gotten to the actual words in the post. This is a solid plugin and much better than the way I’ve been doing this for the past 6 months (opening edit-form-advanced.php and dropping raw code in place, making updating that much more problematic). But this plugin doesn’t work that great for blogs. There’s one line to change in wordstats.php that makes this a much more accurate count of words. Look for the comment “What about dashes (vs. hyphens).” Leave the next line commented out and paste this after that: return(count(preg_split(’/\s+/’, $this->text))); That will give a much closer number to the actual words in the text. One of my posts was 563 words with that change and 622 without, so it makes a big difference if there’s HTML in the post. Still, even with that change something like text.

  26. Joel on 2006-08-24 04:43:13 wrote: can’t get this to work in wordpress 2.0.4 in the write tab… any ideas?

  27. Mnd on 2006-09-14 05:09:18 wrote: Great plug-in works fine in wordpress 2.0. But i want to use it in Moodle as module or blog. Is it possible?

  28. john on 2006-09-14 17:06:08 wrote: Your free to adapt the code, of course, as it is GPL. The plugin comes with a library that does all of the analysis. You just need to write an interface to Moodle on top of that. (This is how the Wordpress plugin works—as an interface to Wordpress on top of the library.)

  29. Mnd on 2006-09-15 04:30:44 wrote: Thank you John, i would write the interface to Moodle.

  30. Jenny on 2007-04-11 10:30:27 wrote: It’s not showing up when I go to post. Is there something I didn’t do or should do?

  31. John on 2007-04-11 15:11:24 wrote: It only shows up after you write something when you click Save and Continue.

  32. Profesor Blog » Los Mejores Plugins Para Worpress on 2007-04-14 04:00:39 wrote: […] Word Statistics: Muestra estadísticas sobre la facilidad de lectura de una entrada al guardarla o editarla. […]

  33. ovizii on 2007-05-13 02:37:30 wrote: hello, the download link here: http://flagrantdisregard.com/wordstats/ is broken, could you fix it please?

  34. John on 2007-05-13 12:17:54 wrote: Thanks, it’s fixed.

  35. Word count plugin for Wordpress » Forums Blogs Wikis on 2007-06-02 09:18:37 wrote: […] you find yourself needing to count how many words you have in a post? The Word Statistics Plugin does just what you need. In addition to counting words it also counts sentences and generates 3 […]

  36. Danny Howard on 2007-07-01 11:09:46 wrote: Hello, I have been using this plugin for a good long time now, and recently had to update it for compatibility. Thank you for keeping this thing going! Sincerely, -danny

  37. » Enchula tu Blog,Plugins Para Worpress Información Tecnología Internet y Gadgets on 2007-07-13 21:25:06 wrote: […] Word Statistics: Muestra estadísticas sobre la facilidad de lectura de una entrada al guardarla o editarla. […]

  38. La Mansion » Blog Archive » Plugins Wordpress on 2008-05-16 12:59:41 wrote: […] Word Statistics: Muestra estadísticas sobre la facilidad de lectura de una entrada al guardarla o editarla. […]

  39. 282 plugins para WordPress (5ª parte de la R a la Z) | Pichicola.com on 2008-08-21 16:03:45 wrote: […] Word Statistics: Muestra estadísticas sobre la facilidad de lectura de una entrada al guardarla o editarla. […]

  40. Más plugin para Wordpress « El Cubanito Web on 2008-11-01 05:29:40 wrote: […] Word Statistics: Muestra estadísticas sobre la facilidad de lectura de una entrada al guardarla o editarla. […]