Wp_footer WordPress hack hidden links

Running a huge cycling blog and gaining a good reputation on Google I guess it was inevitable to attract some attention from spammers who want to benefit from my hard work without putting in any effort themselves.

I recently noticed a sharp drop in my Google traffic. Logging in to my webmaster panel I noticed the site was now popular with terms such as poker and viagra. Definitely not what I want to be linking to. An investigation at the blog revealed no visible links. However, looking into the source code they were there but hidden by a css trick of placing them outside of the viewable screen area.

By disabling wp_footer by simply commenting it out in the theme files the problem went away. However, it wasn’t a permanent solution. An upgrade of the theme I was using (WooThemes) didn’t fix issues.

Further investigation into the MySQL table revealed an MySQL insertion had occurred:

Table: wp_options
option_id: 1120
blog_id: 0
option_name: siteurlpath
option_value: (really long)

The option_value was huge with a base64_decode where the hack was hidden. I deleted this entry from WordPress and low and behold the hack disappeared. Re-enabling wp_footer the links were still not showing in the source code. Wp Footer hack removed!

I believe the hackers got in through the TimThumb vulnerability present in many WooThemes files. Therefore, I upgraded it to the new version to be sure no similar attacks can be made. As a precaution I also changed all of my passwords (admin, FTP, cpanel etc).

I hope this write up helps others deal with these issues. I’m happy to take questions in the comments but do be aware this isn’t my main area of strength. I’m a writer not a WordPress programmer.

I’ll update this post if any further WordPress hacks appear and let you know how I dealt with them.

Technorati Tags: ,,

How to link cloak in WordPress

Wordpress link cloaking in blueAs a blogger with over 50,000 visitors every month I need to find ways of monetizing my site. After all having a huge visitor count is great on paper and when approaching advertisers but it falls short of paying the rent every month and buying expensive toys that I can’t resist! I’ve still got my eye on you £600 camera..

One way of monetizing my cycling site is through the use of Affiliate Links. My audience is interested in cycling products so whenever I mention a product that I genuinely like, trust and would use myself (remembering trust is everything) I add a link. Often these links look very unsightly. Take for example this typical affiliate window link:

http://www.awin1.com/cread.php?platform=dl&awinmid=1857&awinaffid=87595&clickref=&p=http%3A%2F%2Fwww.wiggle.co.uk%2Fp%2Fcycle%2F7%2FErgon_GC2_Handlebar_Grips%2F5360036781%2F

It’s like Shrek of the affiliate links. The solution is to cloak the link. So it looks a little something more like this:

http://www.londoncyclist.co.uk/go/ergon/

That’s much more snazzy.

People are more likely to click on the second link as it looks more trust worthy. For a start it has your brand name behind it and secondly there is not a ton of scary looking characters that they don’t recognise.

It is links like the first one that I first discovered affiliate marketing because I typed in awin1.com to see what it referred to. It is how I came across affiliate window and the sites such as Wiggle and Evans Cycles that you can promote with it.

How you link cloak in wordpress

To do this all you need is a plugin called the Link Cloaking Plugin. It works wonders with WordPress and I’ve never had any issues with it. The founders behind the Link Cloaking Plugin have also recently released a premium version which adds some great new features in particular the ability to look at detailed statistics of how many clicks the link has received.

Once the link cloaking plugin is added to WordPress you can click on Tools > Cloaked links and add new links. You can also change the /go/ part of the link from the Settings > Link Cloaking page.

Give the plugin a download today and remove all the ugly links from your site.

Soon I’ll discuss in detail how to use the plugin. I’ll also take a look at some competing link cloaking plugins and go into the features of the advanced version.

PHP random content on wordpress

I wanted to split test my post footer in WordPress so I could try out two different Aweber forms. However the forms didn’t display in the way I wanted.

The code I ended up using:

$chosen = mt_rand(1,3);
switch($chosen){
case 1:
include ‘first.php’;
break;
case 2:
include ‘second.php’;
break;
case 3:
include ‘third.php’;
break;
default:
echo ‘something went horribly wrong’;
}

From: Random HTML snippets with PHP include?

This worked very well for me. I simply removed case 3 and changed mt_rand(1,3); to mt_rand(1,2);

This then randomly chose between my first block of text and my second block of text. This meant I could split test their effectiveness by embedding two different aweber forms. When the first form is randomly loaded it counts it in Aweber and then when the second form randomly loads again the results are counted. This meant I could customise the text in a way I wanted and not have to use Awebers built in e-mail forms which were not effective and looked ugly.

Hope this helps someone looking to randomise the way content appears on a page.

Transferring my wordpress after javascript not working

So I moved over my hosting plan from Dreamhost to Doreo and moved over the databases, files etc etc and began to notice various errors. In the admin panel I could not minimise the sidebar, or click the dropdown button, or add new tags or choose from the most used tags. Basically everything that revolved around javascript was not working.

Continue reading →

Initial Setup of WordPress – Things to Remember

I am officially in love with WordPress 2.5! It is so much easier to use and there are so many more features that are essential when writing a good blog. Part of the fun of setting up a new blog is all the little tweaks you have to make. This article/tutorial/work of art will take you through some of the things you should change to get your WordPress blog looking good.

I am going to assume you have installed the blog and have logged in as a user into the dashboard. Ready? Lets go!
Continue reading →