AJAX Shoutbox

Page last updated on December 12th, 2006

Attention: I am no longer actively developing Wordspew. Check out Pierre’s Blog for the latest and best wordspew versions.

I’ve preserved this page for archival purposes, and in case I ever want to get started again.

This WordPress plugin adds live chat functionality to your WordPress blog. Your visitors can chat with eachother right in your website without refreshing their browsers. It’s almost like chatting on an instant messenging network! And it’s all powered by AJAX, a hot new old technology that powers things like Gmail, Google Maps, and other brilliant web apps. Now, you can get a piece of all this in your own blog! This plugin makes it very easy. Just follow the simple instructions and you should be okay.

You can download the latest stable version of this plugin, version 1.16. When upgrading, you MUST activate and reactivate the plugin. Released: August 17, 2005.


  • Uses AJAX – No need to refresh ever. Other people’s comments will appear in real time.
  • WordPress admin panel that allows you to control colors, update times, and edit/delete comments.
  • Displays the the time of the last message at the top. Messages have a rollover-able title that shows how long ago the comment was made.
  • Any words with “http://” in them will be converted into hyperlinks. WordPress smileys also work.
  • WordPress users that are logged in automatically get their nickname filled in, and other users’ names get stored for later use.
  • No iFrames, ever. 100% valid XHTML strict

New in Version 1.16

  • Extensive updates to the readme. Check all the FAQs there before asking me/
  • New feature: Checkbox for only allowing registered users to participate in the chat.
  • View changeset
  • If you’ve got 1.15 and don’t need the new feature, this is not an essential download.

New in Version 1.15

  • Multibyte characters are no longer truncated, fixing many i18n problems
  • URLs typed into the shoutbox now work correctly
  • Added #wordspew wrapper div
  • Insignificant tweaks
  • View changeset

New in Version 1.14

  • Plenty of code cleanup.
  • Resetting user name and URL is now possible.
  • Fixes bug when writing URLs in the text box
  • Small CSS Tweaks
  • Working from the WP-Plugins.org Repository.

New in Version 1.13

  • The css is now compatible with the Rin theme.
  • Textareas now submit when a user presses the return key.
  • Found a much better way to achieve the i18n code, so it is more compact
  • Tweaked the algorithm a bit to be even more efficient.
  • Tweaked the FAT script so making new messages in rapid succession doesn’t make the fade stutter
  • Squashed Admin panel bug that showed slashes when editing messages.
  • Single words are now cut to 25 letters before adding a space. However, URLs are never cut.
  • Killed teensy bug that sometimes submits the message when it isn’t done
  • Added code to allow for censoring words. It’s commented out by default, but you can add it if you want. Just search for ‘CENSOR’

New in Version 1.12

  • Extensive internationalization improvements. All UTF8 characters are accepted. Wordspew now always translates entities to unicode. As a result, a lot of the code shrunk. Yay!
  • Renamed jal_getID to jal_deleteOld

New in Version 1.11 (wordspew.php diff & fatAjax.php diff)

  • Uses an algorithm to compute user activity to lessen the server load. Here’s how it works:
    • The shoutbox loads messages at the given rate in the admin panel (default: 4 seconds) for the first 10 times. After that, it multiplies the
      rate by 5/4 (1.25). This rate dictates how often the javascript pings the server for new messages.
    • So roughly, after 20 minutes of complete inactivity, the ping interval is 20 minutes. After 5 minutes, the interval is around 2 minutes. This way,
      if a user leaves their browser open, the server won’t suffer.
    • There are many ways for the interval to be reset. First of all, if the shoutbox ever discovers new messages, it will reset back to the default rate.
      Also, if a user ever mouses over the shoutbox, the form will reset. If they mouseover after being absent for more than 10 data loads, the data will reload right away. This prevents users from mousing over in rapid succession and killing the server.
    • If none of this made sense to you, don’t worry about it. It’s a Good Thing™!
  • Fixes bug where slashes appeared in the admin data display.
  • Fixes validity bug where a form was marked as method="GET" instead of method="get".
  • Fixed problem where shoutbox always declared that the total messages ever made was 35.

Version 1.102 fixes a tiny bug where the last message turned into 35 years. Now fixed.

New in Version 1.1 (Diff)

  • Delete All Messages button in the admin panel
  • Sanitized all MySQL inserts, updates, and deletes
  • Added support for non-js browsers. Now any browser can use the chat!
  • Fixed
  • Took all javascript Events from the HTML and added them to the external javascript.
  • Now requires only one message at all times
  • The latest comment is no longer loaded with javascript. All the information is in the browser on load.
  • Cleaned up code everywhere
  • Fixed rare bug where URLs for the javascript and css files didn’t cooperate.
  • CSS is a little better looking now.
  • Fixed abstract bug that occured when someone writes multiple messages in rapid succession.

New in Version 1.0 FINAL

  • Addresses huge security problems in previous versions. In order to protect users still not using the latest version, I won’t say what the problems were.
  • Added optional support for textareas for bigger message boxes.
  • Added optional support for URL boxes.
  • Works in Opera 8 now!
  • Fixed a few problems with huge URLs.
  • This version is a modification of 1.1 Alpha.

New in Version 1.1 Alpha

  • Added support for a URL box.
  • Installation is now a piece of cake. Just activate the plugin and it goes.

New in Version 1.0 RC2

  • Hopefully got rid of bug in RC1 that wouldn’t allow for directory installs.
  • Got rid of the sql[] array in the install-live.php. It’s now a string.

New in Version 1.0 RC1

  • Well I think Wordspew has finally matured to stable form. Many great changes in this version:
  • Should work with WordPress URL and Site URL set differently
  • If there are less than two messages, admin panel doesn’t freeze up.
  • New feature: Counts the number of messages every made and displays it in the Admin panel
  • User name cookies don’t expire after one session…They are saved for later use.
  • Fixed a potential problem with invalid HTML infiltrating the shoutbox
  • Optimized some code, and deleted old unused functions.

New in Version 0.71

  • User names now stored in a cookie if they aren’t logged in. Intelligently checks to see if there has been a change.
  • New variable added: $jal_number_of_comments. It is defined at the top of wordspew.php, and it determines how many posts to show at one time
  • From now on, Wordspew will insert an with the version number inside. This helps me figure out problems when you contact me.
  • A few tweaks to the readme.txt
  • Hopefully soon I’ll give a couple tutorials on how to include the shoutbox on its own page and only allowing your users to see it, etc.
  • Added a reminder of the default values of settings for the admin panel

New in Version 0.70.1:

  • This is a quick bug fix release.
  • Fixed ‘ bug where it changed into a ?
  • Added a few more FAQs.
  • For all users of 0.70, I suggest you just change line 152 of fatAjax.php to s = s.replace(/\'/g, '%27');

New in Version 0.70:

  • Unicode should work perfectly now..
  • Full support for links in smilies
  • Spans now have titles that tell when the comment was posted. But new comments and all comments handled by javascript do not have titles. This is because Last Message can handle it.
  • Sent comments are now escaped, so that & works and potentially non-english characters as well.
  • All three files are changed, so make sure to upload all three if you are upgrading. You don’t need to reinstall it though.
  • Users innerHTML on comments, so it’s easier to add html (smilies and links). All other HTML is stripped.
  • If Wordspew is not displayed, because of a if (!is_single()) conditional, it no longer produces Javascript errors.
  • Big thanks to Astrobot and ZZ85 for help on this version.

New in Version 0.64:

  • Got rid of Admin panel bug that caused a fatal error redeclaring some functions Thanks Astrobot!
  • Got rid of bug when there were less than two messages in the shoutbox..
  • Replaced all instances of < ? with

New in Version 0.63:

  • Got rid of Safari bug that caused the plugin to slack off after not receiving any info.
  • I’d like to further emphasize the improvement made in 0.62 where the plugin now reads wp-config. This greatly reduces server strain and it also should allow this plugin to function in private logs.
  • Added a folder of three screenshots. It may help you figure out problems better than writing.
  • Fixed major bug that made the database never delete old entries. It now keeps only the last 36 entries. If you want to make this more, go to line 342 of wordspew.php. Change ’35′ to the number you want. Maybe I’ll add this as an admin panel option…
  • All of the files are changed slightly. I realize there are a lot of non-english speaking users, so I’m open to suggestions about how to make it easier localize…

New in Version 0.62:

  • Actually killed the administration link bug
  • Encoded quotes for the admin panel, so if users have a ” in their comment it doesn’t mess up the admin panel
  • Fixed a rather large issue that involved including the wp-config.php file. This means it no longer clashes with some plugins, like Bad Behavior and Popularity Contest.

New in Version 0.61:

  • Updated readme.txt with better instructions and instructions for upgrading
  • Added Kubrick-bullet-defeating css
  • Killed bug where administration link went nowhere

New in Version 0.6a:

  • Bug Fix: Fixed bug that sometimes said that the Time since the last message was 34 years.
  • Fixed XHTML compliancy Bug.
  • Admin Panel
    • Edit Colors
    • Edit update time and fade time
    • Edit and Delete comments
  • If user is an admin, they get a link to the admin panel.
  • Fixed CSS specificity bug that required there to be a div with id="sidebar"
  • Code Clean-Up

New in version 0.52a:

  • Critical bug fix: the last version would only work with URLs that didn’t have the www subdomain…Very strange, but I figured out the problem, and it’s corrected in the lastest version. I changed these two lines (112,113):
    var GetChaturl = "< ?php echo dirname($_SERVER['PHP_SELF']); ?>/wordspew.php?jalGetChat=yes";
    var SendChaturl = "< ?php echo dirname($_SERVER['PHP_SELF']); ?>/wordspew.php?jalSendChat=yes";

New in version 0.51a:

  • Just simple fixes for registering globals and fixes some undefined variable errors. Thanks Etienne

New in version 0.5a:

  • Time since function allows you to see the amount of time that has passed since the last message was sent.
  • Prefs.php page allows your to control some functionality of the shoutbox. This will be replaced by an admin panel in future
    versions of the plugin.
  • Bug fixes everywhere. Especially for Safari, which now works perfectly with fade.
  • Instead of loading all the messages through javascript, the initial thirty are printed directly into the html. This relieves the server of a lot of repetitious loading.
    The very latest message is loaded by Javascript.
  • There is a problem I’m aware of: If you are in a chat with multiple people and it’s moving very fast, as in more than one message per javascript load (default is five seconds), and you aren’t the one making the comments, it will skip over some. See, when you make a comment, it automatically loads for you. But if you’re just watching, it loads every (default is 5) seconds. Not terrible, but definitely something that could be fixed.

I strongly suggest that if you are upgrading from a previous version, especially a non-working one, that you delete everything that is old and start over.

This works in all browsers that fully support XMLhttpRequest, Internet Explorer 6/Windows, Safari 1.2 – 2.0, and Firefox (and recent gecko browsers such as Mozilla and Netscape). I’ve been nailing out bugs with my implementation of Fade Anything Technique. It still has a couple of problems though, which should be very soon.

Now, to Thank-You’s. This plugin would not be possible without Alexander Kohlhofer’s excellent XHTML chat. Also, a big thank to Adam Michela’s Fade Anything Technique. And finally, thank you to all of the people who tried out this plugin when it was still wet behind the ears and offered improvements, especially Karan.

You can comment still on the old post.

5 discussions elsewhere