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
  • Threaded commenting powered by Spectacu.la code.

  • Jonnya 13 July, 2010 at 12:26 pm

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

    • Jonnya 13 July, 2010 at 12:27 pm

      …and now I’m testing threading

      • Dave 13 July, 2010 at 12:28 pm

        Thanks for dropping in Jonnya – I think it’s working really well for us…

      • Jonnya 13 July, 2010 at 12:28 pm

        Cool – that all works great, well done guys! Even works on my iPhone (with a bit of screen jump)

        • Dave 13 July, 2010 at 12:29 pm

          Damn right! Anything with decent js support should support this. And if you don’t have js it does, of course, go back to acting just like ‘normal’ commenting – something P2 doesn’t do, incidentally ;-)

    • Dave 13 July, 2010 at 12:32 pm

      As you may have noticed, it also supports the WP setting for limiting the depth of comments. You can also choose to ‘roll-up’ comments beyond a certain depth as well.

      Thanks for the kind words – and you can already use it if you check out the trunk version from the wp.org repo.

  • Dave 13 July, 2010 at 11:31 am

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

    • Dave 13 July, 2010 at 11:39 am

      Quite a few tweaks now made, including getting the cursor into the reply box. Hope it’s good for you.

  • Laurie 12 July, 2010 at 4:16 pm

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

    • Dave 12 July, 2010 at 4:33 pm

      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.

  • Laurie 12 July, 2010 at 4:09 pm

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

  • Dave 12 July, 2010 at 4:07 pm

    Hello Laurie!

    • Laurie 12 July, 2010 at 4:09 pm

      Well hello. Here I am helping to test it woohoo

  • Don McAllister 12 July, 2010 at 3:52 pm

    No problemo Dave.
    Be seeing you!

    • Dave 12 July, 2010 at 3:55 pm

      Much appreciated! See you soon.

  • Mark Wilkinson 12 July, 2010 at 3:51 pm

    This could be really useful – hope it works well.

  • Ross 12 July, 2010 at 3:49 pm

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

    • Dave 12 July, 2010 at 3:51 pm

      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 12 July, 2010 at 3:52 pm

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

        • Dave 12 July, 2010 at 3:53 pm

          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 12 July, 2010 at 3:56 pm

            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 ….

  • Michael Atkins 12 July, 2010 at 3:48 pm

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

  • Dave 12 July, 2010 at 3:47 pm

    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…

    • Dave 12 July, 2010 at 3:48 pm

      In fact, we’ll have a fix to that very soon, James just told me he’s aware of the problem and is fixing it.

  • Don McAllister 12 July, 2010 at 3:42 pm

    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!

  • Glen 12 July, 2010 at 3:42 pm

    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……..

    • Dave 12 July, 2010 at 4:00 pm

      Collapsing is indeed supported… you can choose how many levels deep to go.

  • Adrian McEwen 12 July, 2010 at 3:41 pm

    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 ;-)

    • Dave 12 July, 2010 at 3:42 pm

      I’m wondering whether highlighting new comments with a slow fade might help? If you scroll up you’ll see them in pink, say?

      • Adrian McEwen 12 July, 2010 at 3:43 pm

        Maybe. The problem is that once they’re off screen I’m not even going to notice that. Not sure there’s a solution really :-s

        • Ross 12 July, 2010 at 3:48 pm

          Maybe some sort of growl like notification might help if you are interested in previous off-screen comments? Maybe something like … http://projects.zoulcreations.com/jquery/growl/ – although that would get cluttered very quickly

        • Dave 12 July, 2010 at 3:51 pm

          There’s always a solution! We’ll come up with something, for sure :o)

          • Adrian McEwen 12 July, 2010 at 3:59 pm

            An NNTP gateway? ;-) (I did consider building such a beast many years ago when I was first getting into blogging…)

          • Dave 12 July, 2010 at 4:01 pm

            Well, it’s an open source project Adrian – you could always code that up for it ;-)

  • Adrian McEwen 12 July, 2010 at 3:39 pm

    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

    • Dave 12 July, 2010 at 3:40 pm

      I might have to set the refresh to be a little slower if things get busy… but does seem to be working well at last…

  • Don McAllister 12 July, 2010 at 3:39 pm

    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

    • Dave 12 July, 2010 at 3:39 pm

      Are you sure it wasn’t just awaiting moderation?

  • Don McAllister 12 July, 2010 at 3:37 pm

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

    • Dave 12 July, 2010 at 3:39 pm

      Hey Don – thanks for dropping by. Should take no more than around a second to load… will look into it…

    • David on another account 12 July, 2010 at 3:45 pm

      Interesting thing about moderation….

  • Dave 12 July, 2010 at 3:12 pm

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

  • Kevin Peyton 12 July, 2010 at 1:03 pm

    Nice work Dave – leaving the window open

  • Dave 12 July, 2010 at 12:48 pm

    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!

  • SimonW 12 July, 2010 at 12:45 pm

    So, football is over.

  • Dave 12 July, 2010 at 12:41 pm

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

  • Dave 12 July, 2010 at 12:19 pm

    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 12 July, 2010 at 12:28 pm

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

    • Andrea_R 12 July, 2010 at 12:29 pm

      Ooooo this is fancy schmancy…

      • Dave 12 July, 2010 at 12:30 pm

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

        • Andrea_R 12 July, 2010 at 12:35 pm

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

          • Dave 12 July, 2010 at 12:37 pm

            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 12 July, 2010 at 12:37 pm

          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?

        • Donncha 12 July, 2010 at 2:43 pm

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

          • Dave 12 July, 2010 at 3:37 pm

            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…

  • Simon Dickson 12 July, 2010 at 12:15 pm

    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 12 July, 2010 at 12:17 pm

      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.

      • Simon Dickson 12 July, 2010 at 12:30 pm

        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 12 July, 2010 at 3:35 pm

          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 12 July, 2010 at 12:27 pm

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

      • Andrea_R 12 July, 2010 at 12:28 pm

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

        You know, to help… :D

      • Donncha 12 July, 2010 at 12:31 pm

        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!

  • Donncha O Caoimh 12 July, 2010 at 12:12 pm

    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 :(

    • Dave 12 July, 2010 at 12:15 pm

      It’s been coded differently to P2 in order to try and keep performance reasonable. But tomorrow we have a client using the plugin on a webinar with around 400 attendees, which should be an interesting test!

    • Andrea_R 12 July, 2010 at 12:31 pm

      Really? We’ve been using it locally and doing some tweaks.

  • Dave 12 July, 2010 at 12:10 pm

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

    • Dave 12 July, 2010 at 12:11 pm

      Would love to know what you think… I think there’s a couple of things to sort out still before this turns into a full release.

      • Rob 12 July, 2010 at 12:13 pm

        Nifty!

      • Adrian McEwen 12 July, 2010 at 3:48 pm

        A textarea.focus() would be nice when you click reply, so I wouldn’t have to click inside the text area to write my comment and could just start typing… :-)

        • Dave 12 July, 2010 at 4:35 pm

          It should do that… will check after the next commit, however, before bothering James with it! I know he has a long list on his notepad of things to polish off.

    • ramtops 12 July, 2010 at 12:16 pm

      Testing, testing, 1-2-3

    • Remkus 12 July, 2010 at 3:50 pm

      Off? You’re telling me I’m off? The nerve..

      • Dave 12 July, 2010 at 3:54 pm

        :-)

      • SimonW 17 July, 2010 at 4:10 pm

        Ahem. Testing.

        • Dave 17 July, 2010 at 5:00 pm

          Hello down there :-)

          • John 4 September, 2010 at 6:21 am

            Hi.. I’ve tried installing this plugin on my blog, which is using the third-style theme and there’s always an error saying “Warning: Cannot modify header blah blah!”.
            How can it happen?

Trackbacks
  • Monday 12th July « Laurie's Blog 13 July, 2010 at 3:11 pm

    [...] far. We’ve been testing the WordPress Live Commenting feature on Dave’s website – davesgonemental I have posted a link but for some reason it doesn’t want to [...]