Twenty Twelve Title Contain No Spaces

There is a conflict between the Twenty Twelve WordPress and the All in One SEO Pack plugin. When the plugin is installed and you happen to be using the Twenty Twelve theme, the result is, there will be no space between your site title and blog title. You’ll notice this if you look at the title bar of your browser. After a couple of searches, I found a fix online. It involves editing the Twenty Twelve functions.php file and commenting out line 185 which contains the code below.

You will need to change:

add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

and comment out:

// add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );

Also, you need to clear your browser cache to see results.

Block Spam Using Math

In a normal day, I usually get over 1000 spam comments on my blog. Although I don’t have to delete the spam, it still takes up resource on the database. By the way, Akismet deletes all spam comments after two weeks. This gives the blog owner time to recover if a valid comment was mistakenly classified as spam.

If you really want to cut down on spam comments, you can implement Captcha. But, lots of people hate Captcha including myself, especially the ones that are unreadable. What is more frustrating than trying to guess a mangled captcha only to be thwarted again and again because it’s unreadable. Enter a solution using simple math.

So, I decided to install a WordPress plugin called Block-Spam-By-Math. The plugin adds a custom field to the comments form by posting a simple math problem. Anyone who passed at least first grade should be able to answer the addition problem. After all, 8 + 2 = is not that difficult to solve.

Automated bots that send spam will have problems submitting past the math problem. Unless, the bots become sophisticated enough to read text and solve the math problems themselves. It sounds like a whole lot of trouble, just to add that feature to send spam.

At least temporarily, spam has been cut down to almost zero. Now, I just have to deal with humans who send them. And that’s infrequent compared to bots.

Twitter Shutting Down Basic Authentication

On August 31, the Twitter API team will shutdown all basic authentication on the Twitter API. If you are using any of the third-party Twitter-based applications that uses basic authentication, the application you’re using will no longer work as of August 31.

Twitter has given developers enough warning of the switch. In fact, Twitter has postponed the cutoff date at least twice in the past few months to accommodate developers into adopting the OAuth authentication protocol. This time, the cutoff date will most likely stick. What this means is there will be a number of applications that will no longer work after the deadline.

How does this affect you? If you are a WordPress user and you are using a Twitter-based plugin that requires authentication, there is a good chance your plugin does not use OAuth authentication. There at least 250 Twitter plugins written for WordPress. A number of them do not require authentication, but some require authentication.

If your plugin requires authentication, better check.

One way of finding out which plugin uses OAuth is to check the plugin’s Option pages. If you’ve entered your Twitter credentials such as username and password, then you are using the older and soon to be obsolete basic authentication.

If you’ve entered a consumer key and a consumer secret key, then you are using OAuth authentication protocol.

Another way of finding out if your plugin uses OAuth is that the login process should take you back to the Twitter’s login page such as the example below.

To be sure, check for updates of your plugin. If the developer does not plan to update the plugin, better start looking for an alternative.

I didn’t get a chance to look at each plugin because of the sheer number of Twitter-based plugins in the Plugins directory. One plugin that supports OAuth is Twitter Tools.

Add Twitter Trends To Your WordPress Blog

Several months ago, I wrote a post on how to retrieve Twitter trends. Today, I’ll show you how to add and display Twitter Trends in your WordPress theme. First, the code to retrieve Twitter trends.

function get_twitter_trends() {
  $contents = @file_get_contents("http://search.twitter.com/trends.json");
  if (strpos($http_response_header[0], "200")) {
    $json = json_decode($contents);
    foreach ($json->trends as $trend) {
      echo $trend->name;
    }
  }
}

Add this function in your theme’s functions.php file. If you want to make the trends clickable, then use the Twitter search link. This will send users to the Twitter Search page when they click on a trend.

echo '<a href="http://twitter.com/#search?q='.$trend->name.'">'.$trend->name.'</a>';

Finally, place this code in your WordPress theme where you deem appropriate.

if ( function_exists( 'get_twitter_trends' ) ) get_twitter_trends();