Hidden Affiliate Links update version 0.2


Thanks for visiting! If you're new here, you may want to subscribe to my RSS feed. This blog posts regular information about web development, unix/linux, How-tos and patches. Go ahead, subscribe to my feed! You can also receive updates via email, instant messenger, skype or tweeter.

After the first release of the Hidden affiliate Links plugin some bloggers wanted to know if this plugin would be able to automatically replace some keywords in posts and turn them into affiliate links.

John Chow bought a plugin for wordpress that does something like that from DealDotCom (yes it's an afiliate link and it was created automatically ) but I know it wouldn't be that hard to add such a functionality to my plugin. So here's the real deal they should put on DealDotCom:

Now my plugin will let you define keywords and it will replace those keywords (when you save/update a post) with a new link you can specify. And it will still work for adding such links manually as the first version does (just don't put anything into keywords or Link fields ) .

The keywords field is actually a field where you can specify a regular expression ( so make sure you escape special characters like - or . (dot ) by placing a \ ( backslash ) in front of them.

Example Use

Let's say you write a post and you want this plugin to replace both the keywords/phrases DealDotCom and "Deal Dot Com" then the content of the keywords column should look like DealDotCom|Deal Dot Com . The "Match slug" field can be go/dealdotcom and the "New link" should be something like "/go/dealdotcom" or "http://patchlog.com/go/dealdotcom" ( without the quotes ) - this is what it looks like on your blog.

Download new version

Hidden Affiliate Links v0.2 zip file / tar.gz file

Installation

If you have already installed version 0.1 you will have to deactivate from wp-admin -> Plugins and delete the table wp_hal_links then just install the new plugin like any other plugin.

Notes

Because the plugin allows you to specify regular expression for the " Match Slug" field you will have to escape some special characters like . (dot ) , _ , - and / by placing a backslash in front of them . I could make the plugin so that this will not be necessary but that would make it lose the great flexibility that regular expression matching can offer.

ToDo:

  • make it configurable so that the user can chose to match case sensitive or insensitive keywords and link slugs. At the moment the match is case sensitive but some users may not like that. It would also be nice to be able to specify this for each link.
  • give the user the option to replace the keywords at runtime (every time the post is rendered). This has the advantage that the keywords on all posts will be replaced ( not just the ones you update after you install the plugin ) but has the disadvantage that it can slow down your blog
  • Anything else you would like ? feed free to let me know in the comments...
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Reddit
  • del.icio.us
  • Slashdot
  • Spurl
  • StumbleUpon
  • Furl
  • description
  • Netscape
  • NewsVine
  • Technorati
  • YahooMyWeb
  • Simpy
If you enjoyed this post, you should subscribe to my full RSS Feeds

RSS feed | Trackback URI

63 Comments »

collapse thread Comment by Webmaster Blog
2007-09-19 11:34:53

Plugin uploaded and activated, now where can I find the options to enter the keywords and related URLs?, I cant see that anywhere..

 
collapse thread Comment by Mihai
2007-09-19 11:43:38

go in wp-admin -> Manage -> Hidden Affiliate Links tab

 
collapse thread Comment by Webmaster Blog
2007-09-19 13:50:47

I’m there.. I run through some values corresponding to those you have above, click the “Add hidden link” button, and absolutely nothing happens, in FF and IE6. No errors, no values added, nada

collapse thread Comment by Contestblogcat Subscribed to comments via email
2007-09-19 18:27:02

Getting the same problem here, any solutions?

 
collapse thread Comment by Mihai
2007-09-19 18:46:48

what wordpress version are you running ?
The plguin uses wordpress ajax api to for adding those links so it may be incompatible with your version of wordpress.

collapse thread Comment by KingJacob
2007-09-22 19:16:24

The exact same thing happens for me and I am running the RC for 2.3,

collapse thread Comment by Mihai
2007-09-22 19:35:24

My best guess is that there are some browser security settings that prevent this from working. Do other ajax apps work for you ? go into wordpress admin and edit a post, at the bottom of the page there is a section named : “Custom fields” try to add a custom field… does it work? If it works does it reload the page ?

(Comments wont nest below this level)
 
collapse thread Comment by KingJacob
2007-09-22 20:14:27

The add customs field works and the ajax runs fine and doesnt reload the screen. I tried the add hidden link IE and FF and it wont allow me to click in either.

(Comments wont nest below this level)
 
collapse thread Comment by Mihai
2007-09-22 21:46:23

could you install firebug ( https://addons.mozilla.org/en-US/firefox/addon/1843 ) in firefox and then try the plugin again , and see if firebug reports any errors ( the firebug icon on the status bar would be red, if you click it you should see more about the error messages )

(Comments wont nest below this level)
 
collapse thread Comment by NSpeaks Subscribed to comments via email
2007-11-13 07:12:44

The Problem is in your plugin. Please change $hal_version=0.1; in your plugin file: hidden-affiliate-links.php to $hal_version=0.2;

This is the only problem, why people are not able to add a redirect link.

(Comments wont nest below this level)
 
collapse thread Comment by gnamusic
2007-12-29 15:30:20

very nice NSpeaks! i checked this scripts online via cpanel and live editing with this, i try to replace $hal_version=0.1 with $hal_version=0.2; and this plugin responds my clicked! nice now im working with new hal. anyone have the same problem try to read from the top and botton this comment list, backup your files and try to edit, use full.

something that i want to warn anyone who using this scripts from old version into new version, before updating your script, make some backup of you database from wp_hal_links database table, if something goes wrong.

anyway thanks for the plugin, nice !

(Comments wont nest below this level)
 
 
collapse thread Comment by Webmaster Blog
2007-09-25 08:19:02

Using v 2.2.2 at the time, about to be 2.3

 
 
 
collapse thread Comment by Karthik
2007-09-19 14:13:21

Very nice plugin, could you tell me how different this is from the aLinks Plugin?

Also, does this replace keywords in comments?

collapse thread Comment by Mihai
2007-09-19 18:49:16

I haven’t really used Alinks, from what I know alinks automatically creates affiliate links from your keywords but does not hide the affiliate links. ( I may be wrong )
At firts I just wanted a simple solution to manually add hidden affiliate links. but then some wanted to automatic replace feature and since it wasn’t hard to add I just added it

 
 
collapse thread Comment by Jay Subscribed to comments via email
2007-09-19 15:59:03

Does this provide any clickthrough stats? The cloaking aspect is nice, but the stats are also important for knowing what’s working and what isn’t.

collapse thread Comment by Mihai
2007-09-19 18:53:45

I does not provide any stats yet. Maybe there will be stats in a new version.
another idea if you want stats quickly is that you can modify the redirect code ( actually just a html page ) so that the redirect is done fully from javascript ( right now it’s done from meta and js ) and before the redirect you execute some javascript tracking code ( think google analytics code ) … google for something like “tracking rss subscribers with google analitytics ” and you shold find the solution…Maybe I’ll write a post about how you can do this …

 
 
collapse thread Comment by Susan Suarez
2007-09-19 16:21:40

This sounds great, I’ll have to try it out! (I just downloaded it)

 
collapse thread Comment by Anraiki
2007-09-19 19:46:28

Nice work on the WordPress Plugin, so you are basically using regular expression to replace these words?

collapse thread Comment by Mihai
2007-09-19 19:52:29

Thanks. Yes it’s using regular expressions to replace them. Actually what you put in the “Keywords” field is considered a regular expression not just a keywords list. So this is very powerful cause you can match a lot of stuff with it.

 
 
collapse thread Comment by Karthik
2007-09-19 20:19:42

Thanks for the quick reply, does this replace keywords in comments too? The way it is setup, I would think not - since it doesn’t determine it in run-time?

Also, could you tell me if this is compatible with the aLinks plugin at all? The reason being that I would like to use the deep linking module of alinks and your plugin for everything else - is that possible?

Again, nice plugin - stumbled the post :)

collapse thread Comment by Mihai
2007-09-19 20:24:31

It doesn’t replace keywords in comments but I added that to my todo list. Watch out for the new version.
I don’t know if it’s compatible with alinks because I never used alinks. If you try it let me know. In theory it should work…
Thanks for stumbling the post!

 
 
collapse thread Comment by Chris
2007-09-20 11:49:02

Having the same problem as a few others. Installed fine, but when I complete the fields, nothing happens when clicking on the ADD HIDDEN LINK button.

I’m using IE7 and Wordpress is 2.2.1

Any ideas?

collapse thread Comment by KennyP Subscribed to comments via email
2007-09-25 07:27:05

I have the exactly same problem

 
 
collapse thread Comment by Mihai
2007-09-20 15:40:26

I just tested it on IE7 and wp 2.2.1 and it worked without any problems.
Maybe you have some security settings that don’t allow AJAX calls.

 
collapse thread Comment by KennyP Subscribed to comments via email
2007-09-24 15:52:34

Is it my own problem or what? nothing happens when I pressed the button, “Add hidden Link”, I can’t add any link or do anything

 
collapse thread Comment by Karthik
2007-09-27 05:47:59

Mihai, thanks for the great plugin and support!

I was wondering if the plugin works on WP 2.3 too?

 
collapse thread Comment by GCS Subscribed to comments via email
2007-09-29 17:01:29

I tried on WP2.3. managed to install but it does not work :-(

 
collapse thread Comment by Kaching
2007-10-03 11:48:59

i’m having problem as well with wp version 2.3. it doesn’t add the link in.

 
collapse thread Comment by LazyBux
2007-10-03 19:22:01

I was having the same problem as most of the people here and then I looked at my 404 stats and noticed it was looking for a .js in the old versions folder, which I only had version 0.2 so I looked at the hidden-affiliate-links.php and found the version was still set to 0.1 if you change that to 0.2 it will work

collapse thread Comment by KennyP Subscribed to comments via email
2007-10-04 05:10:16

I did what you said and it works!

Thank you

 
 
collapse thread Comment by Curtis Penner
2007-10-09 01:25:26

Well, I’m getting closer. I got it to accept a new link by implementing LazyBux’s suggestion (Thank You).

I still don’t know if what I’m typing into each field is correct. If someone has some examples, I’d really appreciate it. Right now, I’m not messing with the keywords. I just want to create a hidden link for one of my affiliate links, not switch certain key words into affiliate links.

Any suggestions and/or help is appreciated.

collapse thread Comment by Mihai
2007-10-09 03:27:11

The first field defines what will be redirected
for example if the firs field is go/tla every link that matches that like http://patchlog.com/go/tla will be redirected

The second column defines the keywords you want to replace . if you don’t want to replace any keywords automatically just leave it empty.

The third column makes sense only if you fill in the keywords. Any matched keyword will be linked to the link defined in this third column

The forth ( Redirect to Link/Code ) column defines the actual affiliate link where the visitor will be redirected if he clicks any of the nice looking links . This can be a link or some javascript code ( like the one you use for google adsense )

The description is not that important but it is used on the pages that do the actual redirection so in case for some reason ( broken browser/network ? ) the redirection does not succeed this is what the visitors will see in the titlebar of their browser…

I hope this clears things a bit…

 
 
collapse thread Comment by GCS Subscribed to comments via email
2007-10-09 03:22:21

Thanks LazyBux It is working for me now. Cheers. :-)

 
collapse thread Comment by LazyBux
2007-10-12 14:51:42

I have it to where it replaces the keywords etc but when I click on them it gives me a 404, so I have been going into my cpanel and creating redirects. Am I missing something with it automatically redirecting?

 
collapse thread Comment by N. Miller
2007-11-07 22:41:02

FYI, both versions of HAfL are incompatible with Headspace 2, a meta-data management plugin from urbangiraffe.com. I may poke around to see if I can get them working together, and will report back.

 
collapse thread Comment by Chris
2007-11-13 16:10:03

I’m not using the keyword facility, just simply replacing affiliate links but I am having a bit of a problem.

When I add a link such as go/link123 it doesn’t take immediate effect and causes my blog to send users to a 404 page for a good couple of hours. Any idea why this is?

 
collapse thread Comment by Mihai
2007-11-14 19:48:19

this seems like a caching problem.
Do you use any cache on your blog ?

collapse thread Comment by Chris
2007-11-18 16:14:03

Don’t use any caching as far as I am aware, however I have managed to find a solution. If I create a link, save it then go edit and update it works. Bit of a pain as it creates double work for me, but get there in the end.

I have just come across another issue however;
I create a link and call it “go/link3″ this works fine. However later on I have created another link and called it “go/link30″. When I then use “go/link30″ in a post for some reason it sends people to the URL listed in “go/link3″ and NOT “go/link30″.

I’ve tried this on different numbers and find “go/link20″ doesn’t go to the required link, but sends people to “go/link2″.

Is this a known issue?

 
 
collapse thread Comment by bonafide
2007-12-14 22:21:15

ok, I love the concept here. but I’d like some clarification if I can get it?

what I think is supposed to happen is this.
post in my wordpress blog, include a link to something, with a title ref, ala
fakecat
set the title ref, >fakecat in the first field to link to someother link that I’m promoting, like http://www.loliticz.com.

So I’m thinking the text in the post should look like this?

blah, blah, blah, fakecat blah, blah, blah… When you click on the fakecat link it should not take you to http://fakecat.wordpress.com/, but rather to http://www.loliticz.com

Am I right? Is this what’s supposed to happen? If I’m just being too stupid for words, please feel free to tell me that, but also point me to what I’m doing wrong… kthxbai…

 
collapse thread Comment by bonafide
2007-12-14 22:47:38

ok, I like the concept of this. having some real issues making it work.
my take on the process is:
create post with link and title href and title tags
use hafl to tag the link with new destination link? original link “some link” will now redirect click to “new link” and not show what the code is?

If I’m correct so far, let me know? if I’m totally clueless, let me know the exact process, please.

I’m running wp 2.3, I have HeadSpace2 turned off

thanks.

 
collapse thread Comment by khuram Itmiaz Subscribed to comments via email
2008-01-13 22:35:54

I get this error, Mozilla, 2.3.1 wordpress?

WordPress database error: [Unknown column 'keywords' in 'field list']
insert into wp_hal_links (slug,keywords,new_link,link,description)values (’go/shareapic’,”,”,’http://www.shareapic.net/ref.php?owner=kimtiaz’,'Shareapic’)
0

 
collapse thread Comment by Ally
2008-01-19 20:44:06

Hi, I can’t active the plugin (I am in a local network WP for now), it says:

Parse error: parse error, unexpected $end in C:\Program Files\EasyPHP 2.0b1\www\wp-content\plugins\hidden-affiliate-links\hidden-affiliate-links.php on line 340

Can you help me? Thanks!

 
collapse thread Comment by Jeff Subscribed to comments via email
2008-01-29 17:42:19

I get a fatal error when I attempt to activate it.

 
collapse thread Comment by Fred
2008-02-03 19:38:18

Installed. Applied fix as suggested in comments (why not just fix the download and save us all some time?) And lo and behold, hidden links just 404. Nice idea. Needs to work though (or have some clearer instructions)

 
collapse thread Comment by Webguard
2008-02-27 14:40:07

Hi,

i want to replace all my links in the blog with match like “http://www.weblink123.de” to “http://www.weblink123.de/?aff=321432″. How does it works? I try, but without any result…

 
collapse thread Comment by Justn Subscribed to comments via email
2008-03-02 22:26:48

I’ve tried the fix and it now reads version .2, however I still click the “add hidden link” and nothing happens. I’m using WP V. 2.3.2. Please help tried for hours to get to work.

 
collapse thread Comment by Paul
2008-03-25 09:48:42

“I still click the “add hidden link” and nothing happens.”

Me too I’m using WP V2.3.3 and had the same problem…

 
collapse thread Comment by Matthias Subscribed to comments via email
2008-04-02 18:17:06

To bad. Thats not working with WP 2.5 I still click the “add hidden link” and nothing happens. Older versions of WP works fine with the plugin.

 
collapse thread Comment by s00per
2008-04-06 17:35:04

A re-write that works with 2.5 would be much appreciated!

collapse thread Comment by Mihai
2008-04-06 19:21:52

coming soon. I’m working on it.

collapse thread Comment by Oleh Subscribed to comments via email
2008-07-01 10:34:53

Hello, 3 months gone since your message, any luck?

 
 
 
collapse thread Comment by Shorty
2008-04-15 22:56:10

Hiya,
Any news on the update??

Thanks and looking forward to using this plugin!

 
collapse thread Comment by blogger need help
2008-04-20 02:24:38

it’s not working for me either - and I’d love it to! I am not a techie so the fix above it outsid of my knowledge base? Please fix - I would love to tell more blogger friends about it once the bugs are gone!

 
collapse thread Comment by Dez
2008-04-21 05:07:39

This has been the best affiliate link cloaker I’ve ever used — even among “professional” non-Wordpress cloakers. It’s quite possible I’ve come to rely on it TOO much.

I really, REALLY hope you update this soon to work with WP 2.5!

Thank you so much for your time and effort!

 
collapse thread Comment by ANONYMOUS
2008-06-15 04:06:34

Please update this plugin to work with WP 2.5.1!!!!!!!!!!!!!!!

 
collapse thread Comment by Steven Subscribed to comments via email
2008-08-08 15:33:39

I’m also very keen to use this with version 2.5, would be happy to make a donation in return. Clicking on the ‘Add Hidden Link’ button gives no response at the moment

 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Trackback responses to this post


Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License

Technology Blogs - Blog Top Sites Search For Blogs, Submit Blogs, The Ultimate Blog Directory Blogarama - The Blog Directory 5starsblog Computers Blogs - Blog Flare blog search directory gob BlogHop