May 24, 2004

And then it happens …

I’d tested the WP blacklist plugin quite extensively and it all seemed to work fine on my notebook machine and so I uploaded it yesterday and set it up for this site. And of course, I never tested the plugin on the site since it had worked before :p That is just asking for things to fail and fail they did – and most spectacularly too. Anybody who tried to post a comment probably got hit with a long string of PHP errors and not much else. Ainslie, who’d tried to post a comment earlier and couldn’t (due to a different error – this time due to me trying to set up permalinks with a nice directory structure :p) let me know about the problem and when I tried it, sure enough it wouldn’t work. So tried to fix it on the server itself for a bit. Bad idea! I finally simply turned off the blacklisting on the server and went back to my local machine. I could duplicate one of the PHP errors on the local machine and after a bit, I figured out what was wrong – there was a logical error in the code where I was checking for IP bans. If there were no IP addresses in the ban list (when I originally tested, there was of course an IP address entered for testing purposes), you get a PHP error. I fixed the code, tested on the local machine and it seemed fine. So I upload to the server and try again … another error! So I recreate the blacklist that I use on my local machine off Jay Allen’s blacklist file and try again and this time I get the error on the local machine too :p So I took a look at what was happening and it turns out that the blacklist that I’d originally imported off of had a few of the regular expressions modified so that they wouldn’t throw a fit with PHP. Unfortunately, when I pulled the list from Jay Allen’s site, I got the stuff as Jay Allen had them and PHP seemed to gag on that. I finally figured out how I should modify the fetched blacklist to play nice with PHP and ran through another round of testing and everything seemed to work fine. So back I went to the server with the blacklist and finally it all worked fine 🙂 Ah well, I’m glad that it works fine now – or at least it seems to … So I guess it’s time to add a few more plugins to the mix to see how soon things will break again :p

Tags: , ,
Posted by Fahim at 3:34 pm  |  4 Comments