mattgadient.com

A WordPress “related posts” plugin that works with InnoDB

The last few hours were a bit of a journey… trying to find a WordPress related-posts plugin that didn’t need the database’s wp_posts table to be in MyISAM isn’t an easy task.

I did finally find one, though it’s got it’s own mix of pros and cons to it. It’s called nrelate. I’ll assume that if you made your way here, you’ve spent some time looking at other plugins (you know, the ones that won’t work with your InnoDB tables), so I’ll break down a few of the differences you’ll find, because nrelate is drastically different in some ways.

 

nrelate vs YARPP and Contextual Related Posts

How they work:

nrelate is essentially a service that runs on another server. The nrelate plugin that you install inserts some javascript into your pages, and sends a request to the nrelate servers asking them to scan your website. Over the course of a few hours, the nrelate servers visit/index your website, put the information together, and come up with “related posts” for your pages. From then on, when a visitor loads your webpage the javascript on your pages has the visitors browser pull your “related posts” from nrelate’s servers. That might all sound a bit complicated, but in many ways it’s similar to Adsense (for those who run an Adsense plugin). Except that instead of displaying ads, it’s displaying your related posts.

YARPP and CRP on the other hand are typical plugins. They reside on your own server, literally scan your database, do their fancy magic on your web host, and provide the “related posts” via the plugin itself.

I won’t go into all the differences, but I’ll give a few pros and cons to dump out some info while trying to help you decide whether it’s worth a look.

Just before I get started, note that if you’re using CRP it will work with InnoDB as long as you’re using MySQL 5.6 or higher (version 5.6.4 supports the FULLTEXT search in InnoDB that’s been keeping these related posts plugins from working). In fact, looking at the php it looks like if you’re using MySQL 5.6 or higher, the plugin will just go on ahead and convert your wp_posts table to InnoDB. And if you’re using an earlier version of MySQL, it will go ahead and convert your wp_posts table to MyISAM.

All without telling you.

Pretty ballzy imo.

 

nrelate Pros:

  • doesn’t care whether you’re using InnoDB or MyISAM
  • doesn’t (shouldn’t) add much to your server load since all the real processing takes place on nrelate’s servers.
  • if you’re monetizing your blog, you can opt to sign up for “sponsored” ads which will be added to your related posts. Note that this is completely optional, is “opt-in”, and there’s no downside if you decide not to go this route.
  • there are 2 main ways to display related posts (2 different nrelate plugins actually). The typical method – generally at the bottom of your post; or you can have them “slide in” to the page – you may have seen this functionality on other sites. I have some screenshots below so you can see both methods.
  • there are a few display methods to choose from – the standard text lists, pretty bars, and thumbnails (which it will find/generate), with a fair bit of customization between them

nrelate Cons:

  • adds a few extra browser requests for your visitors – the .css and .js are hosted externally, and for those of you who run caching programs… you’re not supposed to cache them. If you’ve gone to lengths to combine js/css, sprite images, etc, to reduce page load times…. this may annoy you.
  • you can not assign weights or tweak what nrelate looks at when determining relevance. For example, YARPP allows you to chose whether to take titles, bodies, tags, and categories into consideration and even allows you to specify whether to give extra weight. CRP doesn’t make use of weights, but will allow you to decide whether to rely on titles or use both titles and content. nrelate gives you no choice in the matter – while you can disable certain categories and adjust the relevance setting to be more picky, if it’s guessing wrong and you’re getting poor “related posts”, there’s absolutely nothing you can do about it.
  • needs to index (scan) your entire site before showing results. This can take a few hours and nothing will be shown until the indexing is complete. Certain changes to the main plugin settings require a full rescan.

 

In the cons, I mentioned a bit about the “weighting”, so here’s a screenshot to help illustrate the implications:

Implications of weighting in related posts
top=CRP, mid=nrelate, bottom=YARPP (click for larger image)

 

You’ll have to click for the full-size, but an explanation will help here anyway… The page is about how to fix an issue with a particular wordpress plugin (page title is circled in green at the top). You can’t see the text, but suffice it to say, the 1st step revolves around edits to the MySQL database via phpMyAdmin, and the 2nd step takes place within the WordPress admin panel.

You’re seeing the “related” results from all 3 plugins. I placed a green checkmark by the results that make sense. The orange boxes are for results that are somewhat related – as in they wouldn’t be my first choices, but they’re in the same ballpark, and aren’t terrible. The red signs are blatantly wrong – completely unrelated to the actual topic.

Oh, and before anyone cries foul, I hand-picked this set of results as it clearly shows the type of issue you can run into. So to be fair, yes, usually the first 2 plugins will get more than 1 right. And YARPP doesn’t always get a 5/5.

CRP (top) doesn’t do a stellar job. The original post is titled “the fix – WP….“, and it clearly thinks that anything which has “the fix” in the title must be related. This is despite having the content-portion of the plugin enabled.

nrelate (middle and slide-in) doesn’t do a great job either. The 1st result is actually quite good, but for the next 4 it seems to also fixate on having “the fix” in the title.

YARPP (bottom) on the other hand pulls a 5/5 here. At first, you might think that it simply fixated on having “WordPress” in the title. Actually, I had titles turned off in YARPP. And if you look at the quality-score (which it will show if you’re logged in as admin, another bonus), you’ll see there was much more to it than that. Recall that I said the article revolved around edits to MySQL via phpMyAdmin, and WordPress. The first two results are perfect in that regard. And the rest are reasonable too.

Despite a good showing already, YARPP can be tweaked even further. I didn’t use tags or titles – just the body(content) and categories. But if things weren’t going right at all and I needed to start implementing some awesome tags, I could do so and use that as an “extra weight”. And all would be well.

That’s one area where nrelate just plain falls short – if your titles are named in such a way that they’re easy to correlate, great. If not… there’s not a lot you can do about it.

To finish up, I found it tough to find screenshots of the nrelate backend, so here are a few:

related-posts-02-nrelate related-posts-03-nrelate related-posts-04-nrelate related-posts-05-nrelate

I didn’t grab screenshots of the dashboard and advertising section, but the above should give you an idea as to what sorts of things can be adjusted (click the thumbnails for larger images).

 

If you’re determined to stick with InnoDB (and not able to upgrade to MySQL 5.6.4 to use InnoDB with the other plugins), nrelate is certainly a valid option, with a few significant benefits of it’s own. For some, the fact that the work takes place on somebody-else’s-server might be a huge advantage. And let’s not forget the potential for advertising revenue for those looking for new ways to monetize their blog.

However, while others may have more luck than I did, I found nrelate lacking when it came to actually finding good related content. Having a result or two wrong isn’t the end of the world (and sometimes a different topic can be interesting), but more often than not I felt like my related content was being selected by a random-post-selector.

 

My suggestion: Try it out. Until cPanel (and the majority of webhosts) pick up MySQL 5.6.4 your only options for “related posts” seem to be as follows:

  1. Services like nrelate
  2. Switching to MyISAM
  3. Not having “related posts”

 

nrelate’s website can be found at http://web.archive.org/web/20141227085755/http://nrelate.com/ (Web Archive) .
nrelate’s “Related Content” plugin can be found at nrelate Related Content (Web Archive) .
nrelate’s “Flyout” plugin can be found at nrelate Flyout (Web Archive) .

Yet Another Related Posts Plugin (YARPP) can be found at Yet Another Related Posts Plugin . (note that it will provide a warning and have limited functionality if your wp_posts table is currently MyISAM)

Contextual Related Posts can be found at Contextual Related Posts . (note that depending on your MySQL version, it will auto-convert your wp_posts database table to MyISAM or to InnoDB the moment you install it – back up first!)