The problem(s): With some upgrades of the WordPress 2.5 branch, the Popularity Contest WordPress plugin is not working properly. Also, people trying to activate the Popularity Contest plugin on a brand new WordPress install are getting a fatal error or a “doesn’t exist” message when attempting to activate the plugin.
The solution(s): I actually ran into this problem on a fresh install of WordPress. After several attempts, I was unable to figure out the problem myself. Thankfully, a quick Google search showed a post over at WPGuy which gave details on fixing both problems!
Here is what you need to know if you have this problem:
Fix problems with the upgrade to WordPress 2.5
Open your Popularity Contest plugin (edit it) and search for this code:
require('../../wp-blog-header.php');
And replace it with this:
require('../wp-blog-header.php');
Fix problems with a new install of WordPress 2.5
In addition to doing the above, you need to search for the following code:
if (isset($_GET['activate']) && $_GET['activate'] == 'true') {
And replace it with this:
if (isset($_GET['action']) && $_GET['action'] == 'activate') {
I went through both of these steps on my fresh WordPress install and it fixed the problem perfectly!



Thursday, June 5th, 2008 at 5:36 am
Thanks, I was looking to fix this for quite sometime. P7
Thursday, June 5th, 2008 at 9:30 am
I was looking for the answer to it just as well, but it did absolutely nothing for me. I tried to use both hacks but all I ended up with was an error message: Table ‘corpblogwp.wp_ak_popularity_options’ doesn’t exist on line: 124
No clue, whatsoever :S
Thursday, June 5th, 2008 at 12:31 pm
It’s sad that a lot of Alex King plugins are no longer supported leaving all of us hanging dry. I have packaged this fix and a fix to make Popularity Contest cacheable here. I’ve notified Alex of these fixes and hopefully he can incorporate these fixes into his next release of Popularity Contest.
Thursday, June 5th, 2008 at 3:39 pm
Awesome, I didn’t know about the 2nd part you added. This is great, thanks for this!
Thursday, June 5th, 2008 at 4:36 pm
This is a great tip, I was hoping for the author of the plugin to update the plugin but this definitely saved me a lot of hassles.
Thursday, June 5th, 2008 at 6:00 pm
I thought my popularity contest was broken because of the WP-SuperCache, not because of WP 2.5. Guess it’s because of both! Thanks for the post.
Thursday, June 5th, 2008 at 6:04 pm
@Leland
You’re welcome. Please feel free to provide any feedback you have.
Thursday, June 5th, 2008 at 7:32 pm
Glad everyone found this post useful. Like I said above, I only found it because I was having the same problems.
I know Alex is busy, but it would indeed be great if someone took over supporting his plugins? He has a few that are almost required with any WordPress install.
Thursday, June 5th, 2008 at 7:40 pm
Great, I been a while since my site lost their popular post.
Thanks for the guide.
Thursday, June 5th, 2008 at 7:54 pm
@Kyle Eslick
I would love to take over support for Popularity Contest as I already learned a lot of its internals, but the last time I chatted with him, it seems like he’s not ready to let it go yet. The only thing I can do is maybe come up with a better statistics plugin and publish that instead.
Friday, June 27th, 2008 at 11:16 am
Thanks for the tip…i was going to fix it myself but lazy to read thru the code again…luckily i found this page…
Thursday, November 13th, 2008 at 4:16 am
I’ve changed both lines of code but still can’t get it to work under Wordpress 2.6.3
Any ideas will help.
Thursday, November 20th, 2008 at 3:44 pm
Same problem here with WordPress version 2.6.3.
Besides the changes suggested here I also created a php.ini file at wp-admin folder and added this following line: memory=20MB (due to memory limitations of my ISP).
I am getting this following error:
“It was not possible to activate the plugin due to a fatal error.”
Wednesday, November 26th, 2008 at 9:42 am
Yup, the same problem for me with Wordpress 2.6.3. Any idea how to solve it?
Tuesday, December 9th, 2008 at 3:12 pm
I patched popularity contest using the proposed fix. This plugin is running in WPMU. It seems to work, but the error_log file in the plugins directoy of WPMU contains hundreds of lines like:
[09-Dec-2008 13:07:40] PHP Fatal error: require() [function.require]: Failed opening required ‘../wp-blog-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home1/webdir/public_html/wp-content/plugins/popularity-contest.php on line 59
I fixed it like this:
require($_SERVER['DOCUMENT_ROOT'].’/wp-blog-header.php’);
Tuesday, December 9th, 2008 at 3:52 pm
Better to use the ABSPATH constant provided by WordPress:
require(ABSPATH.’/wp-blog-header.php’);
so that the WP files can reside inside a directory.
Trackbacks/Pingbacks
Leave A Comment
Become one of our
Featured Sites
Recent Trackbacks
Contributing Authors
Archives
Extras
WordPress Hacks Copyright © 2007-2009 | An Apricot Media Website
Template by StudioPress | Custom Design by Kyle Eslick and Blog Design Studio
RSS Feed Email RSS