The hardening release of wordpress 2.8.5 has just been released. This release aims to fix a lot of the issues generated with 2.8.4 namely the explotion issues that came up for a lot of users who were seasoned wordpress veterans.

If you think you fall into this category, check out the Wordpress exploit scanner to see if your site has been hit.

Be sure to remove all traces of any exploits before you upgrade.

{ 0 comments }

GeoTargetting, or being able to tell the country/city/state of your visitor, is applicable to most verticles but, in the gambling industry, there are situations where it becomes especially key in improving conversions. Some rooms do not accept US players, some rooms do. By combining this useful script and the API from Maxmind, you can create pages that not only convert better but also provide a more positive experience for your user.

I created this guide as an easy get started method for geotargetting with maxmind’s geolocation db. In this example we will be using the API provided to avoid having to setup a database and for simplicity of use.

Disclaimer: I say that this is “easy” but it may not be “simple”. If you follow the step by step instructions you will be able to effectively use this script.

What You Will Need to Know BEFORE You Get Started

  • How to access your site via FTP
  • The ABSOLUTE PATH to your server – This is NOT www.whateverdomain.com, this looks like /home/public_html/mb/inc. If you do not know this path, you can ask your hosting company or search their website for the phrase “What is the absolute path”

Getting the GeoTargetting Script Installed on Your Server

Now that you have the above information, the next step is to install the script on your server.

  • Step 1 – Download the binary format from maxmind’s website.
  • Step 2 – Uncompress the file using gzip, winrar, or whatever program you use to unzip files.
  • Step 3 – Download and uncompress EasyDayGeo.zip. There are two files in this package, geoip.inc and geo.php. The first file contains the class necessary to access the API, the second file contains the calls to the API. In this case, we will just want the two letter name of the country that the visitor is from (US, etc).
  • Step 4 – Create a directory named “inc” in the root folder of your website. You should be able to access this folder by going to www.whateverdomain.com/inc/.
  • Step 5 – Open geo.php and change ‘YOUR/PATH/TO/inc/GeoIP.dat’ to reflect the actual path of “inc” folder you just created on the server. Once again, this should look something like /home/public_html/mb/inc/GeoIP.dat when it’s done.
  • Step 6 – Upload the three files: GeoIP.dat, geoip.inc, and geo.php to the “inc” folder.
  • The script is now installed on your server. In this final section, you will call the script and use it as you see fit.

    Using the GeoTargetting Script

    Now that the script is installed on your server, you need to use it to determine the visitor’s country. Since there are literally thousands of possible combinations available, I will just stick to the simplest one that pertains to the gambling industry. Is my visitor from the US? If so, I want to show them US only content. If not, I want to show them other content.

    At the top of your page, in the head section, add the following code:

    <?php include ('YOUR/PATH/TO/inc/geoip.inc'); global $country; ?>

    Remembering, of course, that you need to change the path to reflect your ABSOLUTE path. Next, wherever you want to geotarget content, add the following snippet.

    <?php if($country=='US'): ?>
    /// US CONTENT GOES HERE
    <?php else: ?>
    /// NON-US CONTENT GOES HERE
    <?php endif; ?>

    That’s It

    A few points to note. For SEO purposes, google only crawls with US IP addresses, so any content you geotarget away from US visitors will not be crawled by googlebot. Also, AOL visitors (I guess a small % still use AOL) will show as US visitors regardless of what country they are visiting from. This has to do with the location of the AOL servers.

    Feel free to comment with suggestions or better yet, post a link to where you are using this script so other’s can see it in action.

    Coming soon, the re-release of the wordpress geotargetting plugin.

    { 3 comments }

Going to start this blog off with a simple coding problem that was presented to me earlier today.  Kaus (Cheryle) over at the PokerAffiliateListings.com forums asked for help with displaying a wordpress feed using simplepie on a static html page.

A Little Background

Cheryle is using wordpress to power the news section of her website but she wants to display the posts on the static portion of her site. She is accomplishing this by grabbing the feed from wordpress and parsing it using simplepie. The full feed that is available from her website contains “img” tags which she also wants to parse but she does not want to show the full content, only a brief description.

SimplePie contains two different functions for displaying the main portion of a feed:

<?php
echo $item->get_content();
?>

and

<?php
echo $item->get_description();
?>

The first example displays the full content of the feed while the second example displays a brief description.

The Problem

Using $item->get_description(); does not parse the “img” tags the way she would like. In fact, it completely removes them. In addition to that, she would like to be able to control the amount of content that is being displayed for asthetical purposes.

Mike’s SimplePie – Simple Solution

By creating a snippet of code, we can truncate the $item->get_content(); function to display only the required number of words. Here is the code:

<?php
  $content = $item->get_content();
  $numwords = 40;
  preg_match("/([\S]+\s*){0,$numwords}/", $content, $desc);
  $shortdesc = trim($desc[0]);
echo $shortdesc;
?>

{ 2 comments }