How to Fix Landing Sites Plugin

I finally got around to testing the Landing Sites plugin for WordPress.

Don't let the name fool you. The plugin does not create or direct visitors to a landing page. Instead, the plugin displays related links when visitors come to your site via a search engine. The idea is that when visitors are referred to your site from a search engine, they are looking for something specific – often they quickly check the page they land on and then leave if what they are looking for isn't there. This plugin creates additional links for your search engine visitors to increase the stickiness of your site.

Incorrect Instructions

In my test, the plugin worked as advertised. However, I did encounter a few problems. First, the instructions mentioned renaming the files (as in plural) extension to .php. However, my zipped file only contained one file and it was already a .php file. I downloaded the file again and got the same result. I looked around the plugin site and did not find any newer version. So, I concluded the instructions must have been for an older version.

Error After Installing

The second problem I encountered was copying and pasting the code to generate the related links. When I did so, I got an error message when I tried to load the page in the browser. After spending more time than I care to admit, I finally discovered the problem has to do with WordPress converting quotes into stylized quotes. So, when you copy a quote from a WordPress page and paste it into a text editor like Homesite, you don't actually get a quote. Instead, you get a special character that looks like a quote, but doesn't behave like one. As a result, the plugin crashes and you get an ulcer. After I converted the special characters to normal quotes, the plugin worked.

RSS Feed via Google

The third problem I encountered was with RSS feeds via Google. If you click on a RSS feed link to your site from Google, the plugin is triggered. You get something like the screen shot below (notice the missing keyword after "searching for" and no related posts):

Landing Sites Plugin via RSS

To fix this problem, you need to add a short line of code to the landingsites13.php file. The new line of code tells the plugin not to activate if no keywords are found. Between these two lines (around lines #161-2):

$terms = ls_get_terms($delimiter);
if($what == 'isref') { return true; }

Add this line:

if (!$terms) return false; // skip if from google rss feed

So, the end result is:

$terms = ls_get_terms($delimiter);
if (!$terms) return false; // skip if from google rss feed
if($what == 'isref') { return true; }

Unrelated Pages Displaying as Related

The next problem I encountered is unrelated pages showing up in the related posts results. As you can in the screen shot below, my newsletter confirmation and verification pages are showing up as related.

Landing Sites Plugin

I blogged about this problem with the Related Posts plugin previously and the solution can be applied here as well. Remove the reference to ‘static' around line 126.

Before change:

. "AND (post_status IN ( 'publish', ‘static' )) ";

After change:

. "AND (post_status IN ( 'publish' )) ";

After the change, pages are no longer displayed as related posts:

Landing Sites Plugin w/o pages

10 thoughts on “How to Fix Landing Sites Plugin

  1. Pingback: Unfancy Quote Plugin for WordPress

  2. Thanks so much for this – I've been cursing merrily away for the past hour or so, and it was the curly quote marks that tripped me up as well.

    You've saved me an unbelievable amount of frustration.

    Why on earth hasn't the plugin's author addressed this issue on his post???

  3. Pingback: 8 Wordpress Plugins You Must Have For Your Wordpress Blog | Internet Business Opportunities

  4. Pingback: Wordpress-plugin “Landing Sites”.. | Pians

  5. Ken, Great article and very helpful.

    I tested this plugin in IE7 and FF3 and it works like a charm. However IE6 does NOT work and it gives blank value for _SERVER[HTTP_REFERER$] variable when the request comes from IE6.

    Are you aware of this and what is the work around for this?

    Please share with us your thoughts.

    Thanks, JK

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>