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');
Great tip, I have been looking for a few days to get my plugin sorted and the second part of this tut, sorted it. thanks.
Thanks, solved my problem!
Thanks bro it works like a charm, may you have long life with happiness and joy.
thanks i download the patch and it is work done
Thanks for your work on this. I’ve been working on popularity contest for two days with no luck. Your patch did the trick.
Hi,
I am also very interested in getting Popularity Contest to work under 2.5.1, because obviously and unfortunately, Alex King hasn’t presented a new version yet.
But considering your modifications:
what about this comment and Alex’s answer?
http://alexking.org/blog/2008/03/30/wordpress-25-plugin-compatibility#comment-62323
@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.
Thank you for solving this problem — It worked fantastic!!!
Ahhh — relief at last! This one was really stressing me out thanks for the fix.
Wow.. it’s working like a charm!. Thank you indeed WPGuy!
Cheers!
Awesome..thanks for putting this out there. It works great.
I was really racking my brain until I found this. Thanks again!
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!!!!
Thank you, I almoste love you.
thanks a lot a got it working on one of my new blog. i really appreciate your effort and help.
THANKS SO MUCH!!!!!!!!! The “replacing the require field” trick didn’t work but the modified plugin worked for me.
Thank you!!!!!!!!!!!!!!!!!!!
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?
thank man
working
I was waiting to fix this issue for quite sometime. Thanks P7
I can get the plugin work on WP 2.5.
I use mandigo themes : http://www.onehertz.com/portfolio/wordpress/
THANKS!! Nothing else worked (tried 4 other “patched” versions!)… you da’ man!!
corewerkz
Hi. Just wanted to say thanks. The fixes posted did not work for me but your mod worked just fine! Many thanks for posting it.
Woowo!!! Works like charm, dude!!!
Thanks so much.
PS: If you have time to spare, can you help me with this:
http://wordpress.org/support/topic/181355?replies=5
Well, still did not work for me on a fresh 2.5.1 WP install…
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.
@Mike & Groonk: I’m sorry my solution doesn’t work for you. I’ll see if I can find out why it isn’t.
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!
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.
Thank you very much! Worked like a charm.
You’re the man, Work like a charm to me. Thanks you very much.
Many thanks!! it work
Greetings from Italy
Thank you!
I did not go well, but was settled immediately.
I thank you very much.
Brilliant! Thanks for rescuing one of my favorite plugins.
thanks for making this so easy, worked just right for me too
Excellent! Thx for your support with this. Again we can use a ‘popular’ plugin!