Home Articles Popularity contest plugin and WordPress 2.5

Popularity contest plugin and WordPress 2.5

1984
174
SHARE

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');

174 COMMENTS

  1. @Marco Luthe: I hadn’t noticed those errors, thanks for the heads up. I’ve been playing around with the plugin for a little while and I noticed the errors only come up when loading pages in the admin section (where the plugin doesn’t really need that require statement, that’s why the error given is just a warning by the way). So… I would add a @ right before the require, to avoid the warnings and hope that Alex King will release the official 2.5 compatible version.

  2. I have been trying to fix this all day, and I couldn’t figure it out…

    You’re fix worked with line 1528….THANK YOU!!!!

  3. THANKS SO MUCH!!!!!!!!! The “replacing the require field” trick didn’t work but the modified plugin worked for me.
    Thank you!!!!!!!!!!!!!!!!!!!

  4. It worked for me! yey, thanks so much!

    I have several questions though
    — is there a way to exclude a particular category and not show up on the list?
    — how to add a date below the title link?

    Any thoughts?

  5. Popularity contest plugin and WordPress 2.5…

    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….

  6. i can’t get mine to work either. mine’s not installed on the root directory but i altered it to be: ‘../news/wp-blog-header.php’ and everything in between and it still pulls a Fatal Error.

    i’m using WordPress version 2.5.1.

  7. I tried the original solution and it didn’t work for me then I read about the complicated solution where you have to edit your own database tables but didn’t have a clue what they were talking about. I’m so glad you posted this solution, its quick simple and it works – what a lifesaver! I hope othe people can find this fix cos its taken me months to find a solution after reading the same fix over and over again on other peoples sites. Cheers Mate top work!

  8. Thanks, for the best guideline how to fixed the error. I search more than 5hrs to solve the error. last I find-out your guideline and I currect within a min. your are realy grate.

  9. Thanks soooo much for this fix! I must have tried every fix out there and nothing was working as I had a new install of WP… this worked like a charm!

    Thanks a million!!!

  10. Hello,
    Unfortunately, this has not fixed the problem for me. I did edit the popularity-contest.php file as indicated, and loaded it to wp-content/plugins. I then refreshed the plugins page in WP, but activating this plugin still gives me a fatal error.
    I am running WP 2.6.

  11. Hello,

    I downloaded the modified plugin for WP 2.5 and installed that to my WP 2.6. Interestingly, this plugin works and I have been able to activate it.

  12. Hey mate
    thanks for your help with this plugin. Took me a while to get around it, since I don’t know too much about php. Works great with the Ikarus Theme.
    Cheers again

  13. Hello. I’ve a little problem since a few days with 1.3b3 on WP 2.6, it seems it just doesn’t count newer post anymore. The rankings are like frozen … Any idea what could have happened ? Everything was working fine and i suspect the problem is not related directly to the plugin, but have no idea where to look at.

  14. I’m on the verge of insanity.
    I’ve upgraded to wordpress 2.6.2, and I used your tips and it still doesn’t work! It continues to say that there is a fatal error when I try to activate it.
    Can you help me?

  15. ohhhhhh man…

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

  16. 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.

  17. 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!

  18. 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 😀

    regards and best wishes to you 🙂

  19. 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

  20. 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 🙂

  21. 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.

  22. 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

  23. 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

  24. Thank you!

    It’s great to have this working on 2.7.

    One issue I am having (and I see it works on THIS site). Is that it does not work on category pages. It only returns “none”.

    There are plety of “ranked” posts in the categories that show up on the “Most Popular Posts” page, but it isn’t working in the sidebar.

    Anyone else?

  25. I have installed the already modified plugin and when I tried to activate it I recieved the folloeing error message:

    “The plugin does not have a valid header.”

    So Please can you help me out? I am using wp 2.8.6

  26. Hi!
    Can you tell me what I have to do to fix this size of image box, and of course how to insert image in it (Popularity Contest).
    thanks
    Dario

  27. Hi,

    When I install wp-o-matic plugins then show me an error message

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare class WPOMatic in /home/favstock/public_html/wp-content/plugins/wp-o-matic/wpomatic.php on line 122

    Please help me

  28. When I install wp-o-matic plugins it shows me an error message
    Plugin could not be activated because it triggered a fatal error.
    Fatal error: Cannot redeclare class WPOMatic in /home/favstock/public_html/wp-content/plugins/wp-o-matic/wpomatic.php on line 122
    Please help

Comments are closed.