It was tough finding the right plugins, because older plugins are still being promoted across the web, which may or may not be of any use. Some offered features which are now standard in the latest versions of WP. Some, apparently have been purchased by WP to be in corporated in later versions. But, here are the ones I found, which include many I’ve installed for clients.

1. WP-Optimize.  This is very handy in cleaning up the mess left from WPs database usage. It can optimize the tables as well as clean out unused drafts. I’ve installed this on clinets’ web sites.

2. WP to Twitter. This one will tweet your latest post to Twitter, but will require your Twitter login and has an optional cl.gs API function that would also require that API key. I haven’t tried it, but was considering writing one that did this, so its usefulness is obvious.

3. Sociable. Until I’m able to package up the social links I did for some clients, this would probably be the next best thing.

4. WP-FacebookConnect. I haven’t tried this, and apparently no one else has and verified that it works. It’s obviously needed, and is the only one I could find. I have clients asking for this functionality, so I’ll be testing it, and if it doesn’t will need to build one.

5. Facebook Dashboard Widget. Also a handy one, if it works.

More and more people are using their smart phones to access the internet, which obviously includes blogs. So it’s important to make sure your blog is mobile friendly.

When researching I was surprised to find that while WordPress had a nice selection of plugins, apps and other options for making blogs mobile friendly, Movable Type had very little. So for today we’ll just discuss WordPress, and maybe in the future I can outlines some options for Movable Type, which would probably require some behind the scenes scripting to work.

My mobile phone is an iPhone, so it’s tempting for me to assume everyone else has one, too. Be that as it may, there is a handy iPhone app, http://iphone.wordpress.org/, for managing your WordPress blog via your iPhone.

The plugin I’ve found most useful is WPTouch. I just installed it here, and have used on several clients’ blogs. Unfortunately it only works for iPhones.

For other phones you’d need the WordPress Mobile Pack. It catches all the other types of phones (and both plugins can run simultaniously).

I’ll also note the iPhone Interface for Movable Type, which is a plugin you can install to allow you to manage your MT blog via your iPhone, but apparently doesn’t provide a mobile frontend for your MT blog.

Occasional you’ll want to control how people leave your site. Maybe it’s to let them know they will be going to a different site, maybe it’s just to control who gets linking credit for search engine spiders, or maybe you want the to see one more ad before leaving. In any case, here’s how I’ve solved the problem when asked by clients.

First some javascript to turn all links into redirects to a specific page…

<script>
function catchOutLinks()
  {
  for (i=0; i < document.links.length; i++)
    {
    var url = window.location.protocol + "//"
        + window.location.host;
    if((document.links[i].href.indexOf(url)>-1))
      {
      // ignore local links
      }
    else
      {
      oldref=document.links[i].href;
      document.links[i].href='/leaving.php?url='+oldref;
      }
    }
  }
</script>

Place that in the <head></head> portion of whatever template will be used to display pages you want outlinks on. To activate it you can either use an onLoad statement in your <body> tag, i.e….

<body onLoad="catchOutLinks()">

…or use this in the footer, below any other links…

<script>
catchOutLinks();
</script>

Next you’ll want to create a page using your regular template, but for the content use the following…

<?
$url=$_GET['url];
?>
You will be redirect to <?=$url; ?>
<META http-equiv="refresh" content="3;URL=<?=$url;?>>

Save the file, and make sure it’s a php file (has the extension .php) and in the javascript above, change “/leaving.php” to the url of the file you just saved.

A lot of people like the idea of making blogging a two way street. That’s why they have comments. But that’s also why they post their email address often accompanied by the encouragement “Email me”. Ironically, some of those people get annoyed when you actually do email them.

It’s good to provide a way for people to contact you beyond comments. Unfortunately just simply putting your email address on your blog means it can then be harvested by spam spiders. It’s better to make it harder for spammers to get it. Some people like to use HTML to disguise the email address, like coding it as “name<!– ignore this –>@domain<!– ignore this –>.com” (which would be rendered by the browser as name@domain.com.

There are a lot of sites that will create an email image for you…the trouble being, will they create the image, then sell your email address to spammers. You can always use photoshop, or some other graphics program and make your own email image, but not everyone has access to those.

To make it easy I’ll provide one here. I have no interest in collecting email addresses, and any you enter in this file will be lost once the image is created…

There’s a simple way and a hard way to do this. The hard way also adds a shortened url, allowing the reader to include more of the headline in the 140 characters twitter allows.

First the easy way.

WordPress…

<a href="http://twitter.com/home?status=<?
the_title('','',FALSE);
?>%20<?
the_permalink();
?>" target="_blank">re-Tweet this</a>

Movable Type…

<a href="http://twitter.com/home?status=
<$MTEntryTitle$>%20<$MTEntryPermalink$>
" target="_blank">re-Tweet this</a>

Now the hard way involves going to http://bit.ly/pages/tools/developer-tools/ and joining. Get your API Key and username. Then create the following PHP file (you can name it whatever you want, but just remember the name, because we’ll be using it). Make sure to replace [bitly username] with your bitly username and [API Key] with your bitly API Key.

<?
$link=urldecode($_GET['l']);
$title=urldecode($_GET['t']);
$rtData=implode('',file("http://api.bit.ly/shorten?
version=2.0.1&longUrl=$link&login=
[bitly username]&apiKey=[API Key]"));
$out=json_decode($rtData, true);
$results=$out['results'];
$articleLink=$artData['article_link'];
$myLink=$results[$articleLink];
$shortUrl=$myLink['shortUrl'];
header("Location: http://twitter.com/home?
status=$title%20$shortUrl");
exit();
?>

Once that’s created with the correct username and API Key, save it to your server in a location reachable from the web. Let’s say you save it at http://myserver.com/retweet.php. We’ll then use the following for out links.

WordPress…

<a href="http://myserver.com/retweet.php?t=<?
the_title('','',FALSE);
?>&l=<? the_permalink();
?>" target="_blank">re-Tweet this</a>

Movable Type…

<a href="http://myserver.com/retweet.php?
t=<$MTEntryTitle$>&l=<$MTEntryPermalink$>
" target="_blank">re-Tweet this</a>

This then will take the title and url, convert the url into a shortened url and make your twitter status look something like this…

How to make a "Retweet this post" link http://bit.ly/ddmFZr
About me

I've been developing web sites for over 12 years. I started with HTML, moved on to Perl and now do mostly PHP with a lot of MySQL and Javascript as well.

The purpose of this blog is to write about many of the simpler scripting solutions bloggers are either unaware of or unable to implement. Hopefully I'll have something you can use

Danny Carlton

Advertising
Advertising

Switch to our mobile site