Well, seeing as thought I have spent my last two days almost entirely in WordPress I may as well create a post!
I installed WP-SlimStat a day or two ago. At first, when I downloaded it, it didn’t support PHP 5.x. This was quickly fixed upon request.
Then the PHP 5 compliant version broke my WordPress dashboard. Or so I thought. Well, after a few hours of debugging the WordPress scripts and querying the plugin author, I finally came to the Snoopy object.
I eventually found, by placing print() statements throughout the code (and now I have to clean them all up — groan), that the script was terminating on the call to fopen() when it was reading from a network stream retrieving the RSS feeds for the WordPress development news on the dashboard. This was weird because it wasn’t returning any errors or any feedback at all. Even weirder was that it only did that while the wp-slimstat plugin was activated, leading me to think that wp-slimstat was the problem.
Well, I showed Dad the problem just about an hour ago and he commented that he didn’t like the look of the coding in the infinite loop contained in the _httprequest function. After studying it for a few moments, he asked me what the value of $maxlength was. I went and checked where all the constants were said and it had a value of 500000. 500000 bytes. That’s a whole half megabyte. Even hairier was that according to the PHP documentation, fread() only returns up to 8192 bytes anyway.
After changing the $maxlength value to 8192 bytes, everything worked fine.
Well, I’ve filed a bug report with Snoopy, asking them to change the default value of $maxlength so it doesn’t happen in the future.