My Popularity Contest plugin for WordPress has been “broken”1 for more than a year (since the WordPress 2.5 release I believe). Luckily, the great WordPress community found and posted work-arounds and most people had working versions while updating the plugin sat on my to-do list.
The main issue with updating it was that I felt that the old implementation was somewhat broken. It didn’t work with caching, it didn’t handle tags and other new features introduced in recent versions of WordPress. In short, it needed a rewrite. And that is what it got in version 2.0.
- This version is completely cache compatible. It uses JavaScript and image loading techniques to do the view counting. It also has a nice widget options for showing various reports on the front-end.
- There is now an option to exclude views from site authors, which was a commonly requested feature.
- The back-end reports have been redone a bit, and tag reports still need to be added. Those will take a little more work to implement properly.
- We also updated the code to use more official WordPress API functions (many of which didn’t exist when this plugin was originally created).
It’s been a good deal of work getting it all updated and ready for release, but hopefully this version will work better than ever for everyone.
This is a beta release because it hasn’t had widespread testing (yet). Your feedback is requested – please let me know if you run into issues. Posting issues in the comments here is ok for this one. 🙂
The download and more information are available on my WordPress Plugins page.
If you have any general trouble with this, please contact the WordPress HelpCenter or you can try the WP Support Forums.
- Did not work on versions of WordPress greater than 2.3. [back]
This post is part of the thread: Content Presentation – an ongoing story on this site. View the thread timeline for more context on this post.
This post is part of the project: Popularity Contest. View the project timeline for more context on this post.
Get the following error when trying to activate:
Plugin could not be activated because it triggered a fatal error.
Fatal error: Cannot redeclare class ak_popularity_contest in /home/shudnown/public_html/wp-content/plugins/popularity-contest/popularity-contest.php on line 129
Ok, just refreshed and immediately saw beta3 available and that works.
I get the following error on my reports page:
Warning: Invalid argument supplied for foreach() in /home4/kingratb/public_html/reading/wp-content/plugins/popularity-contest/popularity-contest.php on line 1340
Hi. The plugin update is in conflict with Ajax Edit Comments and when I try to delete a comment on a post it shows this warning. Can you help solving this?
Warning: Missing argument 3 for ak_popularity_contest::edit_feedback(), called in /home/tvdepend/public_html/wp-content/plugins/popularity-contest/popularity-contest.php on line 1975 and defined in /home/tvdepend/public_html/wp-content/plugins/popularity-contest/popularity-contest.php on line 751
1
When are we going to get the option to exclude certain posts?
I have one posts that is at 100% and the rest of the top 25 are from 20% to 8%. I don’t want to delete the one post that is really popular, but it would be cool to remove it from being counted.
Actually an easy fix is to only display from the past 30 or 60 days when listing popular posts on a widget.
As usual you were way ahead of me. Thanks for the update!
On the report page, “Averages by Category” is actually displaying averages by Tags. …. all 653 of them for me.
Pages are being included in stats. Is there a way to exclude all pages?
Thanks for the reports, all of these items are resolved in the current version in SVN and will be in the next release.
Thanks for the update Alex.
The script added by line #2113 should be excluded when the API is turned off.
//don't include IDS script when API is not in use
if (AKPC_USE_API) {
$str .= 'AKPC_IDS += "'.$post->ID.',";';
}
Thanks, also fixed in SVN.
The text below is showing up on my front index page. If the post doesn’t have much text, you can see this at the end of the description for each post – AKPC_IDS += “xxxx,”; where xxxx= different # depending on the post. How do I stop that from showing. Only started after upgrading to 2.0b1.
Thanks in advance for your help.
Sorry, I can’t reproduce this David.
I am still getting the Error: Popularity contest cannot be installed. message. Basic 2.8 upgrade and the plugin insists on not working. Any workarounds? Help!
You might have a database permissions problem – I recommend contacting the WordPress HelpCenter.
Can you give me a reference for the files touched by your plugin? Happy to chase the db issues myself..
Whatever it was, the fix in my case was to drop the options table from the db. Reinstalled. Works. Great plugin, thx.
Alex,
Here is the link to my site – http://www.blackberr[...]rmfront.com/. Look at the end of the shorter posts on the main page, you will see, AKPC_IDS += “xxxx,â€. If you go into the actual post it’s not present. Any ideas, I’ve been trying to fix myself to no avail.
Thanks!
Version 2.0b1 loads fine, but them totally locks WordPress 2.8.
David – this is likely an issue with your theme. I’d recommend debugging the theme or contacting the WordPress HelpCenter.
Carmine – sorry, can’t reproduce this. I recommend contacting my friends at the WordPress HelpCenter – they can help you figure out what the issue is.
[…] Popularity Contest是比較著åçš„wordpress統計æ’ä»¶ï¼Œåœ¨æ¤æ¬¡æ›´æ–°å‰ä¸€ç›´å˜åœ¨ä¸€å€‹å°Žè‡´ç„¡æ³•啟動的å•題,其實也是一個éžå¸¸ç°¡å–®çš„å•題,在代碼裡ç¨ä½œä¿®æ”¹å³å¯ã€‚但æ’件作者一直沒åšä¿®æ”¹ã€‚æ¤æ¬¡Popularity Contest直接更新到2.0版本,首先就是解決了上述的å•é¡Œï¼Œè€Œä¸”ä¹Ÿå¢žåŠ äº†ä¸€äº›åŠŸèƒ½ã€‚ […]
I’m having the same issue as Kevin where he updates and gets the message:
Error: Popularity contest cannot be installed.
This takes over the whole WP page load and the only way to get the site back is to upload the old version of Popularity Contest… then everything is fine.
Kevin said he dropped his options table from the db and reinstalled?!? That’s crazy; this is an established site. I shouldn’t have to drop my WP options table and config all over again just because of one plugin update.
What’s really going on here? All my other plugins update perfectly and WP has full access to its own database.
That message will occur if Popularity Contest cannot create/update the database table it needs. I recommend contacting the WordPress HelpCenter if you need assistance resolving that issue.
since you’re only interested in shuffling people off to some paid help service why not a link to the old working plugin
Since Alex was not interested in figuring out why the automatic upgrade was killing some people’s blog (like mine), I sat down and figured it out myself. For the record, the problem was bad logic in the plugin not database permissions or all the other things that Alex was trying to send people to WordPress Help Center for. If you had the table but it was empty, like you had only defaults, it would kill the blog with the wp_die. Bad bad bad thing to do from a plugin.
http://www.evilgeniu[...]ll-of-shame/
I had an existing install of popularity contest and an existing wp_ak_popularity_options table with zero rows in it. I’m assuming that everyone with the problem has this situation. You are calling wp_die on that situation which previous installs can validly arrive at. This is a big big problem.
@graywolf – the older version of the plugin will not install on versions of WordPress 2.5 and later.
@Dave – I can’t reproduce this yet, but will give it another try. wp_die() is a very valid thing to call as a plugin dev. Also remember, this is a beta – expect bugs. That’s why you release a beta – to find them!
WordPress HelpCenter provides support for my plugins – which is a lot better than the previous situation where no one did. 🙂
[…] that unless seeing a “b” in the version number was supposed to communicate that. Over on his plugin page, Alex King defends the use of the wp_die call as being reasonable. I don’t see that rendering […]
@alexking yes but how about for all the people on 2.8 when your plugin goes into “auto update” mode and kill’s their blogs.
I get that there will always be some whacked out config, but at this point that doesnt seem to be the case.
This is definitely a “whacked out config” situation. I still can’t get the data condition that can trigger this issue to happen unless I manually go in to MySQL and delete all the rows in a certain table. It’s an edge case that wasn’t caught in testing – bugs happen.
Now that this particular issue has been described and replicated, the code for this issue is already changed in local testing and will be different for the next release.
Having full knowledge of the situation (including a number of things that are probably unaccounted for by those complaining rather loudly) I feel very comfortable with the decisions made that led to this situation. All decisions were made in good faith.
Hi Alex,
I took the risk to try upgrading to the new 2.0b2 version as soon as I saw it on my list of available updates and… it worked! No more “Error” and dead blog.
Whatever you did to fix it worked for me.
Thank you for the timely update.
–Greg
I’m closing comments here since this release is now obsolete.