Live Threaded Commenting on WP

At Interconnect IT / Spectacu.la my colleague James has developed a new version of the popular Spectacu.la Threaded Comments plugin.  It’s not yet in release form, but you can grab it from the WordPress.org repository via svn if you know how at http://svn.wp-plugins.org/spectacula-threaded-comments/trunk/

I’m bringing it up here because I’ve decided to trial the plugin out here on my own site.  It was designed to work in conjunction with a webinars project, allowing visitors to have an active discussion, in real time, on a WordPress site.  It can be dropped into almost any theme, and adds nicely to the standard WP comments functionality.

Threaded comments are a powerful way to turn your WordPress site into a mini discussion forum.  Adding live commenting can now turn it into a chatroom full of ajaxey goodness.

Try it out below, if you like….

Comments

81 Comments so far. Leave a comment below.
  1. Dave,

    So, basically, you just comment away down here, click ‘Post your comment’ and you’re off….

  2. Does it impact performance much? I found that using P2 on my main blog killed the server as there were dozens (or hundreds?) of clients making dynamic requests for comments all the time. It got worse with time as users left their browsers open in the background :(

  3. Very curious to know how you’ve done this, Dave. We’ve done a ‘live commentary’ app for a client, based on WP comments entered and viewed with ajax – but the toughest part, by far, was working out how to handle the server load… which would (presumably?) be beyond the scope of a WP plugin.

    • Dave,

      Simon – there’s an option to set the polling frequency. The default is 30s, with a 10s possible. It could be made shorter, but you really do have to be careful.

      • Donncha’s point certainly echoes the experience we had. We got it to work in the end, but had to do some serious reconfiguration at server level.

        It’ll be interesting to see how people react to a 30 second delay. Instinctively that feels too long to me: you’re competing with people’s prior experience of instant messaging, so (a potential) 30 seconds could feel like a lifetime in comparison. In my mind, it has to be as close to zero as your server can possibly bear.

      • Dave,

        Simon, we use memory tables for handling what is in essence a cache of what’s happening. Keeps performance up. We’ll find out tomorrow when a site gets 400 concurrent users :-/

    • Dave,

      Worth noting that server load at the moment seems fine ;-) Need more commenters and viewers on here!

      • Hmmm, I could comment repeatedly and leave my window open. ;)

        You know, to help… :D

      • I’ll leave this window open :)

        I think something like this will need to have the updates cached. I’m sure there won’t be any updates 90% of the time and it would be a simple matter to cache it in a file and clear the cache file when a comment is made or deleted.

        Works a treat though!

  4. Dave,

    One thing worth noting is that until a comment is approved, others won’t see it.

    However, there are a number of ways in which you could make that smoother – you could have subscribers log in and allow them to comment freely, for example, or do as I do and allow pre-approved commenters to comment as they wish.

    • Dave,

      This is me trying to sneak a comment in from a different source to check what browser back buttons do to it…

    • Ooooo this is fancy schmancy…

      • Dave,

        Curiously I’m not seeing the auto-updates myself at the moment, but that was having gone ‘back’ to the page. Hmmmm….

      • I was just about to ask if it had auto-updates. I had to refresh to see if anyone relied.

      • Dave,

        It does – it just doesn’t seem to be working here! Might be an interaction with something else, of course. I know it works fine on another install. OK, back to the testing!

      • Dave,

        Hmmmm – not sure what’s happening, just tried deactivating caching to see what’s going on here. But there really should be fresh comments popping in. Can others see them?

      • Yup, haven’t seen any of the new comments either! Can you see the requests go in for updates?

      • Dave,

        We discovered a problem with the code for creating the memory table. Works in standard installations, but failed on my old site where a long line of plugins and a not terribly clever installation five years ago have all left their mark! I really must get around to a ‘reboot’ of this site – probably on my more ‘grown-up’ domain…

  5. Dave,

    Heh – I think the theme’s own js might be interfering. How ironic… let’s just try something. BRB.

  6. SimonW,

    So, football is over.

  7. Dave,

    Darn it – the live commenting isn’t working on this site, but is fine on another – suggests an issue with a plugin. Thanks everyone for the feedback and help so far!

  8. Nice work Dave – leaving the window open

  9. Dave,

    Now it should work – memory table wasn’t being created…

  10. Seemed to take an age for the page to load in safari on my Mac?

  11. Boo hoo – Dave deleted my comment – I hope that was due to testing and nothing personal – oh! It’s there now. I definitely saw a message saying comment deleted

  12. Ah, just as I’m starting to type this comment it updates with a reply, and then another before I’ve finished typing it. Nice

  13. Is there any way to notice when comments arrive in reply to an earlier comment? I mean, it’s easy to spot new comments coming in at the bottom here, but hard to see if there are new replies once the threading starts to kick in…

    Guess I just want it to work as nicely as usenet did back in the day ;-)

  14. Glen,

    Is this going to support collapsing or at least some way to limit it to the top ‘n’ posts as on a busy blog this will be mahooooosive.

    Also its annoying to type as the text area keeps getting lower……..

  15. It went into moderation mode then definitely said comment deleted before suddenly appearing. I’ve exited the page and reloaded it – worked in less than a second that time and looks like I’ve now got all the CSS styling. The first time it looked a bit rough!

  16. Dave,

    Don – Glen – it does indeed show as deleted for a while! We’ll look into that, though it’s worth noting that this is definitely still work in progress beyond the original client specs…

  17. OK I’ll help test this – posting a comment & leaving the window open. Hopefully I won’t get any wasps flying in.

  18. Ross,

    It tells me my newly posted comment is deleted, but then a refresh makes it re-appear :(

    • Dave,

      Yeah, we’ll fix that – this really is alpha style code :o) Not such a problem for our client site as they set it to approve subscriber comments.

      • Ross,

        Would love to know what’s on the back-end …

      • Dave,

        Just follow the link above to the svn repo – you can play with it and inspect the code as much as you like :o)

      • Ross,

        Haha, was so interested to see if working I went straight to the comments and didn’t actually read the post.

        Oh potential bug, whilst I am typing this, other comments are being posted in-line and my comment box is moving down the page – I’m going to wait and see what happens when/if it gets pushed off the bottom because I took so long writing a long reply and other people posted responses to other comments.

        And yes, it does ….

  19. This could be really useful – hope it works well.

  20. Laurie,

    ah as someone said above, it does say ‘deleted comment’ before it allows it on

  21. Laurie,

    what is ‘link’ supposed to do? and what happens if you want to delete a comment you have made?

    • Dave,

      Hi Laurie – there’s no facility to delete your own comments (so you have to be nice!).

      Link provides a link directly to the comment – for example, if somebody posts something interesting in a comment (it does happen, sometimes) then it can be easily linked to directly.

  22. Dave,

    So – newest comment at the top seems to feel a bit more natural for discussions.

  23. Just dropping by to test – looking great guys and yes, this order is much more natural!

Trackbacks

One Trackback

Add Your Comments

Disclaimer
Your email is never published nor shared.
Required
Required
Tips

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <ol> <ul> <li> <strong>

Ready?