WordPress Guy

WordPress Guy designs and develops WordPress themes and plugins. WordPress Guy teaches you WordPress stuff.

One of my favorite plugins is Alex King’s Popularity Contest. Unfortunately it doesn’t seem to work with the latest WordPress release 2.5, nor Wordpress 2.5.1.

Fixing Problem #1

By doing a little searching on WordPress.org Forums I found this post which explains how to fix the Fatal Error problem I’ve been getting. What you need to do is change the line 59 of the popularity-contest.php file from this:

require('../../wp-blog-header.php');

to this:

require('../wp-blog-header.php');

Ok so, that fixed the fatal error problem, and those of you who had the plugin installed prior to updating to WordPress 2.5 shouldn’t have any other problems.

However, if you’re installing the plugin for the first time you might be getting another error ‘Table ‘database.wp_ak_popularity_options’ doesn’t exist on line: 124‘.

Fixing Problem #2

You can choose to create the database manually like Ken McGuire explains in this article.

That works, but it’s a little complicated, so I came up with my own solution.

All you need to do is open the ‘popularity-contest.php’ file go down to the line 1528 and change this:

if (isset($_GET['activate']) && $_GET['activate'] == 'true') {

for this:

if (isset($_GET['action']) && $_GET['action'] == 'activate') {

You can also download the modified plugin:

Popularity Contest for WordPress 2.5

That’s it, you shouldn’t have any other problems now. Enjoy!

Update:

As Marco pointed out, the solution to the first problem could fill your error_log with warning messages. To fix that change the “require(’../wp-blog-header.php’);” for:

@require('../wp-blog-header.php');

Blog reactions

Comments

  • October 2nd, 2008 at 6:04 pm

    The 2 fixes work great! thanks for the help and this article it was simple and only took a few minutes. Great!

  • October 4th, 2008 at 7:19 am

    Using Version 2.6.2 on a new blog and worked like a charm.

    Thanks for the quick fix.

  • October 9th, 2008 at 2:31 am

    Thanks so much for your help!! I don’t do any programming . However, your tips on getting this plug in to work i could handle. Thanks Again!

    Chad

  • Maddy
    October 12th, 2008 at 11:39 am

    ohhhhhh man…

    you are too goooooood..
    i was looking for the fix quite long time…glad i able to use it now…
    thanks man….

  • October 19th, 2008 at 5:17 pm

    Hi,

    Many thanks for the plugin. It solved the problem that I was having with the theme that I currently use.

    I have a question/problem though which I hope someone can shed some light on:

    On the Wordpress dashboard, when I go and look at the Most Popular Posts part. The post that is my most popular is showing as having over 800 comments, when it actually only has 3….

    My blog was recently hacked with a spam injection in my footer which I’ve now cleaned out and hopefully sorted. Could this be another hack?

    I’ve searched the post with a googlebot spoofer and the searched the google cache, but I’m seeing nothing out of the ordinary….

    Does anyone have any idea what is going on?

    Dan.

  • October 21st, 2008 at 10:46 pm

    Rock on! Thanks for the fix saved me a LOT of time.

  • October 23rd, 2008 at 1:27 am

    thank you so much. I wish this was the first resource I found. It would have saved me some frustration.

  • October 29th, 2008 at 9:25 pm

    Thanks for your Help

  • October 31st, 2008 at 10:52 pm

    simply superb it saved ma lot of time of RND. Hats of to you bro.

    Regards,
    Sam.

  • November 7th, 2008 at 3:01 pm

    Good job! I’ve made the same changes by myself and it didn’t worked, so I’ve downloaded your edition and now it’s fine! Thanks :)

  • November 7th, 2008 at 6:01 pm

    Wes, thanks a million. It seems baffling that Alex King hasn’t yet taken notice of these issues, and correct them himself. As with framespotting above, I had tried to edit the plugin file myself with your suggested edits, and still received the error. It was only after downloading & installing your edition that it worked. The sidebar.php also need substantial tweaking to work with my instance of pearsonified.com’s Neoclassical Theme. Thanks again - I’ve subscribed to your feed!

  • November 9th, 2008 at 3:09 pm

    I dunno how to thank, this is great

    it works

    Ohh god

    you saved me bro

    thanks

  • ... If you’re running WordPress 2.5 then you might need to make some changes as I noted here. ...

  • November 16th, 2008 at 7:46 pm

    Thanks very much, this worked for me!

  • November 20th, 2008 at 2:03 pm

    i’ll try it all day long when the first time download it but error, and then i came here and find the solution.

    that’s just too awesome man, great job and thank you very much :D

    regards and best wishes to you :)

  • November 23rd, 2008 at 7:17 am

    THANK YOU! I have been pulling my hair out trying to fix this fatal error! I tried all the code fixes and none worked…but, alas, your fresh download file above did the trick! Thank you so much!

    blessings,
    Wendy

  • November 24th, 2008 at 7:54 pm

    Hey. I found your site through WP forum. Thanks for the modified plugin. It works great. Thanks again!

  • November 25th, 2008 at 5:44 am

    Make sure to add this fix as well, which is taken from http://wordpress.org/support/topic/204168.

    In /wp-content/plugins/popularity-contest/popularity-contest.php, change line 531 from:
    SET pingback_views = pingback_views $action 1
    to:
    SET pingbacks = pingbacks $action 1

  • November 26th, 2008 at 5:30 am

    The Fixing Problem #2 workeds for me. Many thanks for your clever.

  • rudresh
    December 1st, 2008 at 10:27 am

    Thanks ..
    really its working and it is very useful for me….

  • December 7th, 2008 at 1:11 pm

    Thax mate ! It works ! ;)

  • December 9th, 2008 at 9:41 pm

    thanks man!

    it really worked… my respect

  • ... of this plugin, with the latest release compatible up to WP 2.3. However, WordPress Guy has updated the plugin to work with WP 2.5 and beyond, keeping all those delicious stats at my fingertips. To easily ...

  • ... Popularity contest plugin and WordPress 2.5:wordpress guy ...

  • December 14th, 2008 at 7:01 pm

    Cheers for this. :)

  • December 17th, 2008 at 10:15 am

    Thank you for sharing this. Awesome share.. best luck to you :D

  • malcom
    December 23rd, 2008 at 4:01 pm

    Didnt work i did it manually and also used the mod version still get fatal arror and wordpress is install on root

  • malcom
    December 23rd, 2008 at 4:04 pm

    I just look in my error log got errors for increase memory over the allowed limit. Since my host have php issues better ask them :)

  • December 25th, 2008 at 12:42 am

    WPGuy, thanks for this helpful article! I was commenting about this error on Popularity Contest official page but my comments never showed up.

    You have my thanks.

  • ... JQuery Tabbed sidebar, Popular posts tab require Alex Kings popularity contest plug-in ...

  • January 4th, 2009 at 9:58 am

    You da man!!!! Thank you so much for this, much appreciated as have been trying to get this plugin working for a few weeks on and off… Cheers!

  • January 6th, 2009 at 6:35 am

    How do I get to line 59. I opened up the popularity-contest.php and I do not see that line you refer to above.

    require(’../../wp-blog-header.php’);

    I used NVU to open the file now what!

    Just a little more basic explanation. I am using WP 2.7

    Thank Kim

    • January 6th, 2009 at 12:39 pm

      Maybe you’re using an older version of the plugin.

      Anyway… I’d recommend that you download the modified version of the plugin (at the end of the post)

  • January 6th, 2009 at 6:46 am

    Hey, I just downloaded the modified program above and that fixed the fatal error. I was able to activated the plug for popularity-contest.

    Now how do I get side bar.

    Talk about finding a problem and fixing you..thank you so much I was about to move on to another wordpress theme with less headache.

    But I like this one..thanks again.

    View my finished blog at

    http://www.MaverickMoneyBlog.com

    Kim Dion
    Blogger

Your Comment