The Popularity Contest plugin is a great way to show a list of popular posts for your blog, however many people run into the same “Fatal Error” when trying to install and activate the plugin on their own WordPress blogs. There are two common issues that are the cause of this.
Open the popularity-contest.php file for editing either via your FTP client or via the plugin editor in the WordPress dashboard. To fix the first common problem find the line with this code:
if (!isset($wpdb)) {
require('../../wp-blog-header.php');
akpc_init();
}
Modify the code to read like this:
if (!isset($wpdb)) {
require('../wp-blog-header.php');
akpc_init();
}
Next, find the line with this code (hint: line #1528 of about 1700 total lines of code):
// CHECK FOR POPULARITY TABLES
if (isset($_GET['activate']) && $_GET['activate'] == 'true') {
Modify the code to read like this:
// CHECK FOR POPULARITY TABLES
if (isset($_GET['action']) && $_GET['action'] == 'activate') {
If you’re editing via the WordPress dashboard click on Update File to save the changes. If you’re editing via FTP save and upload the modified file. After the file has been modified you can now activate the plugin without the fatal error.
If you found this post useful please leave a comment below. To receive new blog posts automatically subscribe for free to the mailing list or RSS feed.












{ 1 comment… read it below or add one }
This post is from a year ago but the fix still works for Wordpress 2.9.2 and Popularity Contest 1.3b2!
Thanks Paul :)