Fix for using Windows Live Writer with Bad Behavior

For those of you who use the Bad Behavior plugn for WordPress to block spam bot’s before they gain access to your blog, I found a problem when attempting to post using Windows Live Writer (WLW). By it’s design, Bad Behavior blocked Windows Live Writer from accessing my WordPress based blog preventing any posts being published or downloaded. It did this by blocking the IP address WLW uses to “talk” to the blog (posting, downloading, updating web-styles etc). The fix involves using phpMyAdmin to monitor the Bad Behavior log table (DB table) in one tab of my browser while attempting to publish a test post form WLW. Then I used my FTP client to modify one of the Bad Behavior files to allow WLW access to the blog as stated below.

Once the initial attempted publishing had failed, I refreshed the tab that had phpMyAdmin displayed on it and checked the latest additions to the Bad Behavior DB table. I found three new entries of blocked IP’s…two were fairly obvious as to where they came from and the third wasn’t two hard to figure out afterward.

Using phpMyAdmin to browse the Bad Behavior DB table, under “request url”, I found this…

/wlwmanifest.xml

/

/xmlrpc.php

…in that order. All were assigned to the same IP address. The fix was easy enough after that.

In the Bad Behavior plugin sub-folder (also called “Bad Behavior”) you’ll find a file called “whitelist.inc.php” (any IP address or address range entered in this file will not be blocked by BB). Open that file in a text editor such as Notepad or Notepad 2 and copy the IP address assigned to the above three entries in Bad Behavior’s DB table (as per phpMyAdmin) into the whitelist.inc.php file as in this example. Look for this block of text in the file’s code:

// Includes four examples of whitelisting by IP address and netblock.
$bb2_whitelist_ip_ranges = array(
“10.0.0.0/8″,
“172.16.0.0/12″,
“192.168.0.0/16″,
“69.89.25.189″
“WLW IP address goes here”
// “127.0.0.1″,

Once the WLW IP address is pasted as shown above, save the file and upload the modified “whitelist.inc.php” via FTP to (in most WP installations) wp-content/plugins/bad-behavior/bad-behavior directory where it will overwrite the original file with your modified one. Windows Live Writer should work fine now.

If anyone has any questions or requires more details than please leave a comment or contact me directly using the “Contact Me” email form.

If you try this and it works for you please let me know also. I like to keep track of my published “fixes”. Keeps me from making too many mistakes.

5 thoughts on “Fix for using Windows Live Writer with Bad Behavior

  1. The best solution is to just drop the bad behaviour plugin, it has a major coding problem that causes the SQL server to overload. The builders seem to be aware of this, but have yet to address the issue.

    I use it on both my own MU and on my own blog on a different server, i ended up getting between 4 or 5 emails aday on my MU from my host saying the plugin was causing the SQL to die and it needed to be removed.

    Copy of a letter sent by a friend who usued BB on thier server aswell:

    Due to issues with this plugin’s coding regarding its database access, we are having to disallow its usage on all AnimeBlogger.net blogs. The core issue is that the plugin’s database access routines can (and pretty much always do eventually) cause excessively high load on the database server. When this happens, we get an E-mail from our hosting company’s support telling us the plugin must be disabled on whatever blog it was running on.

    I reccomend you move to a better spam catcher, such as spam kama or akismet

  2. @Taliesin,

    I had a feeling that Bad Behavior was putting too much of a load on the the database but I was getting close to 400 spams a day so I reactivated it. Since then I’ve been experiencing slow downs and occasional script lock ups when attempting to log in.

    Guess it’s gone for good now or until the author fixes the problem.

    Thanks for the info.

  3. Taliesin, that’s news to me about BB behaving so badly!
    I am sorry to hear that. Can you recommend a better solution for spam blocking? I have Spam Karma. Perhaps I’ll try running that on its own and see how she stands up.

    Kirk, as for your fix…
    Thanks for this info. Only thing is I’ve noticed WLW uses more than just one IP addresses. So far I’ve had to whitelist two (one yesterday and one today).
    “58.28.130.241″,
    “58.28.131.225″,

    I am beginning to wonder how many it will end up using. Updating 5 blogs with these IP addresses each time I want to write an entry is going to get real tedious. Please post the list of IPs you have discovered WLW using. Perhaps we (any one reading your blog) can collaborate on generating an IP list.

    I’ll also email the BB creator and see what he’s doing about it, if anything… along with the mySQL server load issue.

    Regards,

    Jonathan

  4. Update to my comment::
    Okay, I’ve now realised the the IP WLW is using is my ADSL IP.
    The way you’d written your post led me to believe that WLW was using some third-party IP to access blogs. This struck me as rather odd, but I didn’t look into it further. I now have and realised this is erroneous.
    WLW users the IP of your internet connection. So no need to be using phpmyadmin for figuring out which IP to whitelist. We can just whitelist our own.

    With regards to the multiple IP issue I was having…
    Last night there was a power cut so this morning my IP address had changed from yesterdays one.

    Regards,
    Jonathan

  5. Hi Jonathon,

    Hmmm, that’s strange. The entries in phpmyadmin when I was tracking down the problem was just that one IP assigned to three entries. I later went in and emptied the BB tableusing phpmyadmin and checked again and those were the only entries listed when I published from WLW. The strangest thing is the IP address assigned to those entries isn’t the one that my DSL wireless router assigns to my computer. It’s something different altogether.

    At the time of my post I really didn’t think that WLW was using an IP from a third party, sorry I wasn’t clearer on that point. I just figured it was dredging that IP up from somewhere in my configuration. Either way, I only had to whitelist that one IP.

    Oh, and just so you know, I use Akismet and Spam Karma together but I liked having Bad Behavior along with it (the three did work well together). BB blocked the Spam Bots before they got into the blog and were caught by either Spam Karma or Akismet thus saving me a lot of wasted bandwidth. That was the biggest advantage of having BB installed since it kicked the “unwanteds” out into the street before they got onto my property. Akismet and SK2 let them on the property before they catch them. Hopefully the author will come up with a fix.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>