Link Cloaking Plugin Update

Some time ago I created a WordPress plugin that can cloak affiliate links automatically. Today I’m releasing a new version, with all-new feature(s)!

The main improvement I’ve implemented is “static link cloaking”. The previous version of the plugin could only cloak links that you’ve actually used in a post, which is inconvenient if you want to use the cloaked link anywhere else, like forums or e-mails, because the cloaked URL might change or stop working if you edited the post. This is still true for automatically cloaked links, but now there’s a new feature available – static links.

Static Links Are Different

  • Independent from the rest of your blog’s content – add any links and use them anywhere!
  • No numbers tacked on the end.
  • The number of hits is tracked!

Here’s an actual example of how a (static) cloaked link’s URL looks –
http://w-shadow.com/goto/GTrends/ (goes to my keyword research tool).

Using Static Links
You can add, remove or view the links in the Manage -> Cloaked Links tab. This page contains a form for adding new links and a list of existing cloaked links, if any. The list also shows the number of hits for each link. Note that the plugin counts all hits, including those generated by search engines and the like. This means that the number will probably be a bit higher than the actual amount of clicks the link received.

A link is defined by a name and a destination URL. The name is what you’ll see in the cloaked URL – in the example above it’s “GTrends”. The name shouldn’t contain any special symbols, like spaces, question marks, non-latin characters and so on. For best compatibility, use only latin letters, numbers and underscores in the name field. The name is case-insensitive and must be unique for each link.

The destination URL indicates the address to which the visitor will be redirected when he clicks the link. No surprises here – just make sure the URL is correct.

Adding static cloaked links is easy – just enter the name and URL in the corresponding boxes and click “Add”. The resulting cloaked URL will look similar to this – http://your_blog_address.com/more/MyLink/. “more” is a prefix that you can set in Options -> Link Cloaking and “MyLink” is the link’s name. You can also view the cloaked URL by clicking the “show cloaked url” thingy near each links destination URL.

To delete a cloaked link, click the “Delete” link in the corresponding row.

Download : WordPress Link Cloaking Plugin, ver. 1.1 (9 KB)

Installation Notes
After you’ve uploaded and activated the plugin, you must go to Options -> Permalinks and click Update Permalinks. This is necessary even if you have the previous version installed. The cloaked links won’t work if you don’t do this! Complete installation instructions and more information about this plugin are available in the original post.

Related posts :

104 Responses to “Link Cloaking Plugin Update”

  1. Abel says:

    Reinstalled but the problem is still there.

  2. White Shadow says:

    If it’s a plugin conflict, you could try deactivating all other plugins and checking if it works then. If yes, reactivate them one by one and note which one causes the problem.

    Does the direct URL work?

  3. Hi White Shadow,

    Is your plugin the same as performing a 301 redirect?

  4. White Shadow says:

    Yes, it uses “301 Moved Permanently” redirects.

  5. Walt says:

    Hi. Great idea for a plugin.

    I loaded the latest version and followed the instructions, but I’m getting… well.. unpredictable results. Although the redirects seem to wok fine for the posts, links on pages all redirect back to the “home page”. And, not all of the links in pages get cloaked. Not seeing a pattern, so I’m not quite sure what to tell you.

    It there any way to “fine tune” the plugin a bit more? For instance, can I tell the plugin I only want Clickbank and/or Amazon links to get cloaked, and let everything else just sail through like normal?

  6. White Shadow says:

    The plugin uses the same exact algorithm for pages and posts, so there shouldn’t be any difference – unless there’s a conflict with another plugin.

    There’s the “Exclusions” feature to define which links you don’t want cloaked. There’s no “Inclusions” list, though you could use selective cloaking – adding the <– cloak –&gt tags – to achieve a similar result. I might add that feature in a later version, but … don’t count on it ๐Ÿ˜›

  7. earncow says:

    Ah cool tool bro ๐Ÿ™‚ recommended

  8. BigKahuna says:

    I am having some difficulty getting this plugin to work…I have it installed but several of the directions are in conflict with what I am seeing. For instance you say “go to Options -> Permalinks and click Update Permalinks.” I do not have any “Options” tab…is this the same as “Settings” (I am using wordpress(.org) 2.5. If I go to Settings->Permalinks there is no “Update Permalinks” setting; only a “Save Changes” at the bottom…please help…I have no idea what I am missing.

  9. White Shadow says:

    The instructions were written for WP 2.3, so in WP 2.5 it’s slightly different. In WP 2.5, “Settings” replaced “Options”, and you only need to “Save Changes” for the permalinks to be updated.

    The plugin works with WP 2.5, but you may need to manually move the cloaking-related redirection code to the top of your .htaccess file.

  10. BigKahuna says:

    I did figure out that the site didn’t have an htaccess file so I added one. I also chanced the permissions to 766. Unfortunately whatever I am doing is not updating the htaccess file with whatever code it needs to be able to utilize this plugin…hopefully I am getting closer…any help would be greatly appreciated.

  11. BigKahuna says:

    Here is what my current htaccess file looks like:

    Options All

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  12. White Shadow says:

    Try changing the permalink structure, saving the canges, and then changing back to the initial structure. This should update the file.

    Are you sure you looked in the right place for the .htaccess? In most cases, .htaccess would already be present on a WP blog.

  13. BigKahuna says:

    Ok…I tried to do what you said to do and that didn’t work. When I go to Manage -> Cloaked Links and fill in the 2 fields and select “add” a messed up version of my site shows up where I am assuming the new link should be showing. I tried to deavtivate the plugin and reactivate it but no luck.

    I am not sure about the htaccess file. I had always thought it would be in the “public_html” folder. When I looked for it there using Filezilla I didn’t see it. I found a post claiming that some WP versions omitted it and gave directions on how to include one (which I did in the “public_html” folder). Root directory (using Filezilla) looks like this:

    -Site (folder)
    -logs (folder)
    -public_html (folder)
    -home (folder)
    -wordpress (folder)
    -.htaccess (file)
    -index.php (file)

    Hope any of this helps…thx for everything thus far!

  14. BigKahuna says:

    Sorry for being such a pain…I realized something while I was typing my last response…I uploaded a file called htaccess.txt. Once I changed it to .htaccess it disappeared from the directory in Filezilla…thinking it was something I did I readded htaccess.txt, changed the permissions and renamed it to .htaccess…the file disappeared again. Now I am thinking that there are 3 copies of the file in my directory but that they are hidden…how can I unhide them?

  15. White Shadow says:

    So is your blog installed in the root directory, or the “wordpress” directory? I’m guessing it’s the second, though you might have some kind of different, advanced setup. Maybe the .htaccess should be in the “wordrpess” directory.

    Regarding the “Add” bug, it sounds like something that might be caused by an unusual site structure, but I’m not sure…

  16. White Shadow says:

    Filenames starting with a dot (“.”) are treated as “hidden” on Linux/Unix systems. You can probably make them visible by changing some settings in Flexzilla, but I’m not familiar with that software, so I can’t help you there.

  17. BigKahuna says:

    Ok found the right htaccess file and here are the contents…it looks right but I am still not getting the right results…what do you think?

    # BEGIN WordPress

    # Link Cloaker Plugin BEGIN

    RewriteEngine On
    RewriteRule promos/([^/]*)/([0-9]+)/([0-9]+)/? wp-content/plugins/plugins/wplc_redirector.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule promos/([^/]+)[/]? wp-content/plugins/plugins/wplc_redirector.php?name=$1&cloaked_url=$0 [L]

    # Link Cloaker Plugin ENDS

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

  18. White Shadow says:

    Interesting. Those lines shouldn’t look like “/plugins/plugins/”… why are they like that? Either the .htaccess file is wrong, or the plugin is installed incorrectly. The plugin files should be located inside “wp-content/plugins/link-cloaking-plugin/” – in their own directory inside “plugins”.

  19. BigKahuna says:

    Thanks a ton for helping me diagnose the problem…it looks like the files got uploaded but were not in a folder…my web guy removed the plugin and reinstalled it in the folder and it worked like a charm.

  20. White Shadow says:

    @BigKahuna – Congratulations ๐Ÿ™‚

Leave a Reply