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.我不能讓它通過了思想,它只是偶爾或推遲,這為下一版本的網站。