Simple URL Shortener will shorten a supplied URL using one of over 100 online services.
From version 1.6 you must install the WP Plugin Cache plugin to be able to cache the shortened URLs.
Simple URL Shortener is the simplest, yet most powerful URL shortening plugin available, with over 100 shortening services available.
The code to access Simple URL Shortener can be put anywhere within your WordPress theme, where you need to convert a long URL to a short one.
Here is an example...
<?php echo simple_url_shortener('http://www.artiss.co.uk','is.gd'); ?>
This will display the is.gd shortened URL for http://www.artiss.co.uk.
There are 2 parameters..
The first parameter is the URL that you wish to have shortened. If left blank it will use the URL of the current post/page.
The second parameter is the shortening service that you want to use - see the seperate tab for a full list.
Here is a further version of the original example, but this time with a check to confirm that the plugin is active...
<?php if (function_exists('simple_url_shortener')) : ?>
<?php echo simple_url_shortener('http://www.artiss.co.uk','is.gd'); ?>
<?php endif; ?>
From version 1.6 you must install WP Plugin Cache to provide a cacheing feature whereas the shortened URL is only fetched once from the shortening service provider - after that it is saved and retrieved from a cache. This greatly improves performance.
However, even with the plugin installed you can still switch it off via the second parameter. When doing this, the service name must be prefixed. For example, using the above example, but switching the cache off, you'd type...
<?php if (function_exists('simple_url_shortener')) : ?>
<?php echo simple_url_shortener('http://www.artiss.co.uk','service=is.gd&cache=no'); ?>
<?php endif; ?>
Note the ampersand which is separating the parameters.
Some of the shortening services require additional information. Again, this can be supplied via the second parameter. The three new sub-parameters are apikey=, login= and password= and represent a supplied API Key, a login ID and a password.
bit.ly+key, 9mp, j.mp+key and to.vg requires before apikey and login to be specified.
coge.la+key and linkbee+key requires login and password to be specified.
307.to+key, adjix, ad.vu, cort.as+key, ez.com, l.pr, Puke.it, qux.in, tra.kz, url.co.uk and urlBorg require the apikey to be supplied.
For example, here is the above example, but now using bit.ly+key as the shortening service...
<?php if (function_exists('simple_url_shortener')) : ?>
<?php echo simple_url_shortener('http://www.artiss.co.uk','service=bit.ly+key&apikey=3003948393993&login=test&cache=no'); ?>
<?php endif; ?>
I've not used a valid API key in the above example - you will need to get one for yourself.
If you are having issues with the URL not being shortened, then a final sub-parameter of debug=yes is available. This will output useful information about the shortening process, including any attempt to cache.
For help with this plugin, or simply to comment or get in touch, please read the appropriate section in "Other Notes" for details. This plugin, and all support, is supplied for free, but donations are always welcome.
Requires: 2.0 or higher
Compatible up to: 3.1.4
Last Updated: 2011-3-11
Downloads: 5,336




