Configuring Google +1 Button With Word Press and Bad Behavior Plugin

The very valuable Bad Behavior plugin for WordPress causes conflicts with Google’s recently introduced +1 button. The fix is very simple.

Symptoms: When you attempt to “+1” on a Word Press site that is using the Bad Behavior plugin, the +1 icon appears for a few seconds and then is replaced with a red exclamation point Error Icon that links to https://www.google.com/support/profiles/bin/answer.py?hl=en&answer=1199142&p=plusone_button_error

Solution: Whitelist the Google-owned netblock 74.125.0.0/16 in Bad Behavior’s “whitelist.inc.php” file:

  1. Confirm that I’m telling the truth about who owns that block: open a terminal and run a whois
  2. In your /wp-content/plugins/bad-behavior/bad-behavior folder open the file whitelist.inc.php and add the netblock to the $bb2_whitelist_ip_ranges array:

[sourcecode language=”php”]$bb2_whitelist_ip_ranges = array(
"64.191.203.34",    // Digg whitelisted as of 2.0.12
"208.67.217.130",    // Digg whitelisted as of 2.0.12
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"74.125.0.0/16",
//        "127.0.0.1",
);[/sourcecode]
Save the file to your server and you should be all set.

  1. Donate some money to the Bad Behavior plugin project…

Literate Programming: Python-Style

I don’t think literate programming is something that will ever enjoy widespread popularity, but for those who write about programming, it’s something devoutly to be wished. It might be a good match for Python, which is a nice language for data exploration and demonstrating algorithms and techniques. This tool: pyreport: generate reports out of python scripts can be used for literate programming in Python.