Tag Archives: plugin

Hidden Affiliate Links 1.0

Finally after a long time, The Hidden Affiliate Links plugin for WordPress 3.0.1 is here.

The previous version stopped working a long time ago when wordpress 2.5 was released ( yes it's really that long ago ).

I tested the current version on WordPress 3.0.1. It might work on older versions but I don't plan to support them.

The download, install and usage instructions are on the plugin's page.

I tried to host this plugin on the official wordpress plugins repository so you could see update notifications right in wordpres admin but apparently someone there doesn't like the fact that this plugin hides links so it was not accepted.

I think this is wrong because there are other plugins there that can somehow hide links ( like the redirection plugin ) and even without a plugin if someone wants to hide a link they can still do it easily by using any url shortner.

Anyway the idea is if you want to be notified about updates make sure you subscribe to my RSS feed.

Feel free to ask any questions about this plugin in the comments.

Manual Wordpess Version Check

When a new wordpress version is released you'll probably find out about it sooner then it will be available for automatic installation in your wordpress admin.

This is because wordpress checks for new versions twice a day,but the check is scheduled based on the time when you installed wordpress so unless you're lucky you'll have to wait for up to 12 hours before the update shows up in your wordpress admin and use it.

This gave me the idea that it would be nice if you could check manually as soon as you find out about the upgrade, so I created this plugin that just gives you a button that you click and it will check to see if there's an update available right away. If it finds on it shows you the upgrade link.

Download: WP Version Check-0.1 (95.2 KB)

To check for an update go to wordpress admin -> Tools -> Version Check

WP-Twitter-ID Social Profiles Integration

A few days ago I wrote a post about a wordpress plugin that will add a twitter id field to the comments form and I was reporint two problems with it. One was solved in that post and for the second one I'm going to show you a solution in this post.

The Problem

The second problem was that the twitter id field was show assigned to a comment when a registered user was commenting.

Basically I needed a way to specify the twitter id of a registered user in the profile and then just make the WP-twitip-id plugin use that value form the profile. I could have done this by implementing the necessary code to show the field on the profile page and save it's value when the profile was saved but I was lazy and I wanted a quicker solution.

The Quick Solution

The quick solution was to install the Social Profiles plugin, set my twitter id in my profile and then do a simple modification to wp-twitip-id.

To make the modification just open wp-twitip-id.php in any editor, look for "function addtwitterfieldmeta($comment_data){" and right after that line insert the following code:

  1. if(!empty($_POST['atf_twitter_id'])){
  2. $twitter=$_POST['atf_twitter_id'];
  3. }else{
  4. $current_user = wp_get_current_user();
  5. $user_id = $current_user->ID;
  6. $twitter=get_usermeta($user_id,'cyc2_twitter');
  7. }

That's it. Simple don't you think ? Now next time you post a comment as a registered user you should see your twitter id in the comment header.

Download

Here's the zip file with all modifications including the one in the previous post.

WP-Twitip-ID-0.9.2 (13.3 KB)

Twitter id comment field

I saw this post on problogger about how Darren implemented a new field in the comment form for his new blog about twitter tips powered by wordpress. Basically he used a plugin for adding and extra field to the comment form and then modified the comment template to show the link to the twitter profile page.

There are two problems with this approach. #1 Unlike the author name, email and web site, the twitter id field is not saved in a cookie so your comentators will have to fill it in every time they post a comment, this migh be annoying for some of them. the second problem is that if you're logged in and want to reply to a comment there's no way you can set the twitter id.

The first problem was almost solved by a new plugin named wp-twitip-id by Andy Baily specially created for setting up the twitter id field. I said almost solved because this plugin uses javascript to add the new field and in some cases ( depending on the template you are using ) javascript would not be the best way to do this.

Luckily you can use this plugin without javascript and add the new field manually by modifying the comments.php template file but then the cookie would not work anymore so it needs some modification to set the cookie from the php script instead of javascript .

Simply calling setcookie before the comment is saved will do the work, then when you display the form field just use $_COOKIE['atf_cookie'] to set the value of the twitter field.

If you like to modify some plugin code get the wp-twitip-id plugin, open wp-twitip-id.php look for addtwitterfieldmeta function and add

  1. setcookie('atf_cookie',$twitter,time()+60*60*24*60);

right after the line with this code: 'if($twitter){'

Then go into wp-content/themes/<yout_theme>/ edit comments.php  look for the URL field and add a new field after it like this:

<input name="atf_twitter_id" type="text" value="<?php echo $_COOKIE['atf_cookie']?>" />

You might have to add some other html code and css to make the field look like the others but that depends on the theme you are using.

For convenience I have attached the modified plugin but you still have to modify the comments.php file in your theme.
wp-twitip-id-091

Let me know how this works for you. Do you think the twitter id comment field is worth the effort ? Does it bring value to you it as a commentator?

Hidden Affiliate Links WordPress Plugin

There is a new version of this plugin. Please download it from the plugin page

This post is about a wordpress plugin that will help you to manage your hidden affiliate links a lot easier then what others have suggested.

If you don't know why you should hide the affiliate links then continue reading, but if you already know this then skip to the plugin part of the post.

One of the best monetization methods for blogs is using affiliate programs.Money making blogs don't get their income from a single source like adsense, they also use affiliate links for a lot of services like Text Link Ads and other products.

Why hide your affiliate links?

Many bloggers think it's good to hide the affiliate links, not because they don't want their visitors to know they are affiliated but because of other reasons like:

  • Changing your affiliate links is a lot less work because you have to change in just one place then on hundreds of pages where you use those links
  • It hides the ugly part of affiliate codes. People tend to not trust long links with a lot of characters and unknown codes. A nicely formated and clean link is more likely to be clicked then one that contains an affiliate code in it.
  • It kind of forces them to click the link instead of just typing the link (without your affiliate code ) in the browser.
  • better SEO, the links don't look like affiliate links, the redirect is done from a html page that has noindex on it so search engines shouldn't look at it.

Methods to hide Affiliate links

There are a lot of methods to do this like:

  • writing a .htaccess rule
  • doing a http redirect from a script. Setting the HTTP location header to the destination url.
  • doing a redirect from the meta of a html page
  • doing a redirect from javascript by setting the window.location to the destination URL

Those methods are not hard to use but they do involve write a small piece of code and require this for each affiliate link. I will not show you in details any of those methods because there's a better, easier way to do this.

My Method to hide affiliate links

I wrote a plugin for wordpress that will let you define such redirects from a nice (AJAXy ) web interface inside your wordpress admin.

The plugin installs just like any other wordpress plugin and once installed you can start defining your affiliate link without having to write any code.

The plugin uses a meta and javascript redirect inspired by a post on John Chow dot Com about hiding affiliate links for better seo

License

The plugin is released under GPL and the usual "No Warranty" disclaimer applies

Download

Hidden affiliate links v0.1.zip
Hidden affiliate links v0.1.tar.gz

Installation

The script was tested on wordpress 2.2.3, so it you use any other version and it doesn't work let me know about and problems and I'll try to write a fix. If you use a previous version you should really upgrade to the latest version of wordpress.
Copy hidden-affiliate-links.zip and unzip or copy hidden-affiliate-links folder in wp-content/plugins then go to wp-admin -> Plugins and activate the Hidden Affiliate Links plugin

Using the plugin

After you activate the plugin you can go to wp-admin -> Manage -> Hidden Affiliate Links and add/edit/delete hidden affiliate links. For each link you have to define a slug, a destination link/code and a description.Manage Hidden Affiliate Links

The "slug" is what the link looks like on your blog, the link/code is the part where the visitor will be redirected and the description is something to remind you what's this link about, but it's also used in the title of the page that's doing the redirect ( in case the redirect does not succeed ).

For example if the slug is go/tla and the link/code is my affiliate link for Text Link Ads http://tinyurl.com/2kasce then if you write a post on your blog and you use a link like http://patchlog.com/go/tla in your post, anyone that clicks that link will be redirected to http://tinyurl.com/2kasce

Why link/code and not just Link? In case you want to hide an affiliate link where you cannot just do a redirect, like adsense referral links that are generated by javascript, then you will have to put the javascript instead of the link.
Because you cannot redirect to a link that is generated by javascript ( because there's no link until the javascript executes ) you'll have to redirect to a page where the javascript is inserted and will execute to generate the link. In this case the user will have to actually click the generated link. So if you put anything else then a link ( starting with http or https ) in the link/code box then the script will think this is a code and will not try to redirect to the code but to a page containing the code. You can customize the look of that page by modifying : redirect_code.php

In case the redirect does no succeed for some reason then you will see a page with the affiliate link in it and the title of the page will be the one specified in the description for the link. You can also customize that page by modifying: redirect_link.php

Advanced Feature

The script is very easy to use but if you want some power and you have some knowledge of writing regular expressions then here's how you can use it. The slug part can be any regex, and anything that will match that regular expression will be redirected to the real affiliate link.

For example I could make the slug like this: (.+)/tla and everything that ends in /tla like http://patchlog.com/go-to/tla or http://patchlog.com/recommended/tla, would be redirected to my text-link ads affiliate link. Or something like go/(tla|text-link-ads) would match both links like http://patchlog.com/go/tla and http://patchlog.com/go/text-link-ads

I hope you like the plugin and let me know of any questions or problems you might have. Feedback is highly appreciated in the comments section of this post.

If you like the plugin you might want to subscribe to my full RSS feed, other great plugins might be on the way.

Update:

there's a new version that can also automatically replace keywords you define with hidden affiliate links Click here to get it.

The whole Post

When using the <!--more--> tag to split your posts wordpress will generate a link that will take to a bookmark in the full post text.

I wanted the link to take the user to the top of the page so that the user will also see the page's header.

There is an entry on wordpress.org faq about this named How can I customize the "more" tag? that suggests a modification to: wp-includes/template-functions-post.php or wp-includes/post-template.php for wp 2.1 . The modification is fairly easy to do and it's about removing the "#more-id" anchor from the link but I don't want to do this because this means I'll have to remember to do it every time I upgrade wp.

My solution was to implement this as a plugin. Basically my plugin just removes the anchor from the link that takes you to the post page. This is slower then the modification suggested on wordpress.org but it's more convenient to me.

Update: this plugin is now published in wordpress plugins directory and can be installed directly from wordpress plugin admin. Just search for "the whole post"

Google Sitemaps – Jerome’s Keywords Plugin

I wrote this little wordpress plugin to integrate Jerome's Keywords plugin with Google Sitemaps plugin so that the generated sitemap will also include tag pages. This plugin was inspired by a an addon that integrates Ultimate Tag Warrior with Google sitemaps.

You will need WordPress 2.0.x, Google sitemap 3.0beta and Jerome's keywords 1.9 for this plugin to work. It would be easy to make this work with Google sitemap 2.x so if you need it just let me know.I don't know how this would work on older versions of Jerome's Keywords cause I haven't tried that.

Download: Google Sitemaps - Jerome’s Keywords Plugin