Subscribe via

Make Popularity Contest Work with WP-Super-Cache

Thaya Kareeson

Previously I wrote ‘Make Your WordPress 10X faster During Traffic Storms‘, which is a post about automatically turning WP-[Super]-Cache on/off and automatically switching your WordPress theme to a lighter theme during heavy traffic. One of the main reasons that I had this setup was because I could not get statistics to work with WP-Super-Cache (i.e. my chCounter & Popularity Contest plugin is hosed).

After some tinkering, I was able to get chCounter and Popularity Contest to work with WP-Super-Cache. This involves using javascript to count instead of PHP. chCounter was a simple change, but Popularity Contest was a bit more challenging. Usually I would immediately post the “How-to” here, or rather release the modded plugin to the public myself, but I believe that I shouldn’t step on Alex King’s shoes (the original developer of Popularity Contest). I’ve sent the Popularity Contest code to Alex for code review. He’s been doing some of the same work, and hopefully he can incorporate some of my changes into the plugin and release it to the public soon.

If anybody would like to use my version of the Popularity Contest before Alex King releases it to the public, you may download the WordPress 2.3.3 and WordPress 2.5 compatible version here:

Download: Popularity Contest JS Mod for WordPress 2.3.3.
*Note*
- This method does not work with feed_views (since you can’t really inject javascript into XML feeds and get them to reliably execute), but this mod takes care of home_views, category_views, archive_views, and single_views (from what I understand: comments, pingbacks, trackbacks are always working).
- Plugin is tested only up until WordPress 2.3.3 (tested not working on WordPress 2.5, see below for version 2.5).

*Special WordPress 2.3.3 Install Instructions*
Intallation works the same way as the original Popularity Contest except that you will need to do ONE OF THE FOLLOWING:
1. Place a symbolic link from plugins/popularity-contest-js.php -> plugins/popularity-contest/popularity-contest-js.php
2. Move popularity-contest-js.php directly under your plugins/ directory

Download: Popularity Contest JS Mod for WordPress 2.5.
*Note*
- This method does not work with feed_views (since you can’t really inject javascript into XML feeds and get them to reliably execute), but this mod takes care of home_views, category_views, archive_views, and single_views (from what I understand: comments, pingbacks, trackbacks are always working).
- Plugin only works with WordPress 2.5 and is not backwards compatible with WordPress 2.3.3.

*Special WordPress 2.5 Install Instructions*
Intallation works the same way as the original Popularity Contest except that you will need to do ONE OF THE FOLLOWING:
1. Place a symbolic link from wp-content/popularity-contest-js.php -> plugins/popularity-contest/popularity-contest-js.php
2. Move popularity-contest-js.php directly under your wp-content/ directory

That should be all. I would really appreciate it if you can provide any feedback (security issues, better implementations, or other important thing that I’m totally not aware of). Also please feel free to post questions and keep me posted on how things are going with the plugin.

Enjoyed This Article?

You should check out other top articles on the Articles page.

Save and Share
Del.icio.us
StumbleUpon
Digg
Reddit

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Currently experiencing problems with Intense Debate commenting system. Please make sure your browser's Javascript is enabled and try again later.