Simple Thoughts Blog简单的思考博客 had a sporadic but consistent comment problem.进行了零星的,但一致的评论的问题。 On submitting comments a blank page was occasionally returned instead of the original page with the comment added.对提交的评论一个空白页是偶尔返回而不是原来的网页与评论。 How did I debug it?如何,我调试它呢?

First I wanted to reproduce the error consistently.首先,我要重现错误一贯。 I could very rarely see this error with my Firefox browser, possibly because I remain logged in most of the time and/or cookies.我可以很少看到这个错误与我的Firefox浏览器,这可能是因为我仍然记录在大部分的时间和/或Cookie 。 So I opened Internet Explorer and cleared the cache.因此,我打开Internet Explorer和清除缓存。 I created a test post and started adding comments.我创建了一个测试后,并开始加入评论。
I was lucky.我很幸运。 The bug was consistently reproducible in Internet Explorer.错误是一贯重现在Internet Explorer中。 All I had to do was refresh as post page (posting to wp-comments.php) and a blank page would be returned.所有我要做的就是重新整理后的网页(发帖可湿性粉剂- comments.php )和一个空白页将被送回。 My first job was done.我的第一份工作是做的。

BTW: In the process I discovered a stupid bug in WordPress’ implementation of first time moderation.的BTW :在这个过程中我发现愚蠢的错误在WordPress执行第一次温和。 It is purely email based.这纯粹是基于电子邮件。

Next I had to go in the code to find out the exact location of the error in wp-comments.php.接下来,我已去,在该守则,以找出确切位置的误差在可湿性粉剂- comments.php 。 However before I did that I wanted to remember which plugins hooked into wp-comments.不过之前,我这样做我想记得插件钩到可湿性粉剂-评论。 The only one was唯一一个被 wp-hashcash可湿性粉剂- hashcash , an excellent ,一个很好的 comment spam prevention垃圾评论的预防 plugin.插件。
So before going further I disabled the plugin.因此,前进一步而言残疾人士的插件。

Voila, the error was gone. voila ,错误是没有了。 I was using a really old version of the plugin, probably 1.5.我是用一个真正的旧版本的插件,可能是1.5 。 So I tried upgrading.因此,我试图升级。 However it started spewing strange database errors.不过,开始喷涌奇怪的数据库错误。 So I decided to keep it disabled for now.所以我决定以保持其禁用。

Now my blog is more vulnerable to comment spammers.现在我的博客更容易评论垃圾邮件发送者。 However it will not prevent legitimate commentators from commenting anymore.但它不会阻止合法的评论家评论了。

Thanks goes to感谢去 James Huff詹姆斯吞吐 , who kindly pointed me to this error for the second or third time. ,谁善意地指出我这个错误,为第二次或第三次。 I couldn’t let it pass anymore thinking it was only occasional or postpone it for the next version of the site.我不能让它通过了思想,它只是偶尔或推迟,这为下一版本的网站。