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….
So, basically, you just comment away down here, click ‘Post your comment’ and you’re off….
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.
Nifty!
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… :-)
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.
Testing, testing, 1-2-3
Off? You’re telling me I’m off? The nerve..
:-)
appearing now, coolio :)
Ahem. Testing.
Hello down there :-)
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?
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 :(
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!
Really? We’ve been using it locally and doing some tweaks.
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.
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.
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 :-/
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!
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.
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…
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.
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!
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?
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…
Heh – I think the theme’s own js might be interfering. How ironic… let’s just try something. BRB.
Testing testing…
So, football is over.
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!
Nice work Dave – leaving the window open
Thanks…
Now it should work – memory table wasn’t being created…
Seemed to take an age for the page to load in safari on my Mac?
Hey Don – thanks for dropping by. Should take no more than around a second to load… will look into it…
Interesting thing about moderation….
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
Are you sure it wasn’t just awaiting moderation?
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
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…
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 ;-)
I’m wondering whether highlighting new comments with a slow fade might help? If you scroll up you’ll see them in pink, say?
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
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
There’s always a solution! We’ll come up with something, for sure :o)
An NNTP gateway? ;-) (I did consider building such a beast many years ago when I was first getting into blogging…)
Well, it’s an open source project Adrian – you could always code that up for it ;-)
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……..
Collapsing is indeed supported… you can choose how many levels deep to go.
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!
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…
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.
OK I’ll help test this – posting a comment & leaving the window open. Hopefully I won’t get any wasps flying in.
It tells me my newly posted comment is deleted, but then a refresh makes it re-appear :(
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.
Would love to know what’s on the back-end …
Just follow the link above to the svn repo – you can play with it and inspect the code as much as you like :o)
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 ….
This could be really useful – hope it works well.
No problemo Dave.
Be seeing you!
Much appreciated! See you soon.
Hello Laurie!
Well hello. Here I am helping to test it woohoo
ah as someone said above, it does say ‘deleted comment’ before it allows it on
what is ‘link’ supposed to do? and what happens if you want to delete a comment you have made?
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.
So – newest comment at the top seems to feel a bit more natural for discussions.
Quite a few tweaks now made, including getting the cursor into the reply box. Hope it’s good for you.
Just dropping by to test – looking great guys and yes, this order is much more natural!
…and now I’m testing threading
Thanks for dropping in Jonnya – I think it’s working really well for us…
In fact, it had its first real use in a live situation at http://webinars.telecoms.com/webinar/strategies-for-successful-evolution-to-lte/
This is great work – wish I had a chance to properly play with it! Really look forward to implementing this in the future:)
Cool – that all works great, well done guys! Even works on my iPhone (with a bit of screen jump)
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 ;-)
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.