So the last few days I have been seeing a drop in comment activity. Spam comments were abundant as usual, but the kind of thoughtful and insightful commentary I’m used to has dwindled down to zero. I was a little bummed out by this. I figured that maybe I’m loosing my touch. Or maybe I was posting too many “wall of text” type rants that no one had time or energy to read. Granted, I’ve been busy with other stuff so I tried not to let it bring me down. It was just a little disheartening to hit the blog every other day and see there are no comments at all on any of the posts featured on the front page. Then last night Karthink messaged me on Steam asking why I closed the comments on the blog.
The thing is, I never disabled anything. I love the comments, why would I shut them off?
So I hit the site and… Yep, no comments. They are just gone. Vanished! What the actual fuck!
Let’s Talk PHP
When you are running PHP, by default it likes to vomit error messages into it’s standard output channel, which is your webpage. What usually happens is that you get half of the page, then a stack trace, and then the execution just stop. This looks kinda unprofessional, plus it gives potential attackers way too much information about your sever. So when you are running in a production environment you squelch these errors and they are written to an error log somewhere. The side effect is that PHP will still stop executing at the point where it encountered a fatal error. If this happens at the begging of your script before anything was output then you just get a blank page. If it happens somewhere towards the bottom, and your page is a usual tag soup (PHP mixed with raw HTML) then you will usually get everything up until the error and the rest of the page remains blank.
This was exactly what was happening with the comments.
For years now I have been using a Related Posts plugin by Jure Ham. It is a nifty little addition to the blog, that does some fuzzy logic matching and displays links to potentially similar topics at the bottom of each post. I like it because it enables the sort of aimless wandering – you finish reading a post and you go – “oh, this looks interesting too” so you click over and keep on reading. Sometime last week Jure released an update – a first one in quite a while, and a good one at that. Lots of new functionality, a lot of improvements… And also apparently some backwards compatibility breakage which I didn’t notice.
I applied the update without thinking much about it, as you do, because it is usually a painless process. Very rarely will a plugin actually cause trouble after an update, and 99% of the time it happens right away and you fix it or ditch the plugin. This time the issue remained hidden because it was only evident on individual post pages, and only if you scrolled all the way down to see the comments. Ooops!
The new update actually made the plugin simpler – it now injects itself into the pages on its own. Before you had to explicitly call it with a PHP hook from your template. That’s where it failed for me. Apparently the function call to the plugin I had right above my comment section got deprecated and was throwing some sort of an exception. Hence comments would not load.
Oh, and Steam…
Btw, I should probably mention this – I never turn of my desktop and it usually runs Steam in the background. So while it may appear like I’m idling on steam all the time, the fact is that I’m actually rarely there. The only time you can probably reliably catch me on there when it’s green and says “in game”. Otherwise I might not be at my desk at all. I say this, because every once in a while I will come home, and see a Steam chat window open with a message that was sent 8 hours ago, and then a long stream of “so and so just signed off, now he signed on, now he signed off again”. So it’s not that I’m avoiding or ignoring you. I’m just probably not there, and I suck at turning off chat thingies.
I broke the comments, but they are back now. Sorry! Also, as a consolation, related posts section now has mini-screenshots.