WP plugins – 1 fix and 1 update

Following my recent upgrade to WordPress 2.5 (RC1) on my other blog/website I could not get my favourite statistic plugins working. The first, WP Slimstat, is no longer under development and is not compatible with WP 2.3 and above. The latter, Popularity Contest, is supposed to work with the latest WP versions but triggered a fatal error during install (at least for me).

At first glance it would appear I’d have to look somewhere else for alternatives. On the other hand I could dive into the code and try figuring things out myself. I decided on the last option.

Fix – Alex King’s Popularity Contest (v.1.3b3)

Fixing the installation error was far easier than anticipated. This is what you need to do if you experience any difficulties or plan on upgrading:

  • If you have an older version deactivate the plugin.
  • Download the latest release (link above).
  • Open popularity-contest.php and scroll down to line 59. Replace
    require('../../wp-blog-header.php');

    with

    require('../wp-blog-header.php');
  • Upload the edited file to your plugins folder (sub directory popularity-contest)
  • Reactivate the plugin

I tried posting a comment mentioning the problem, but it went into comment heaven. The issue will most likely be solved with the next release (but I couldn’t wait…).

Update: In case you are doing a fresh install you might also need to create the DB tables manually. More about how to do this here.

Update – Camu’s WP Slimstat (v.0.92)

To avoid repeating myself please see my post “How to view and collect visitor statistics” for a proper solution. This tiny update should keep WP Slimstat working until the WordPress team decides on more DB changes. With any luck this might take awhile…

The “IP to Country database” update is not necessary, and will only apply for new log entries. However, to keep the data more or less correct it is probably a wise decision to have the database more up to date.

Feel free to let me know if you have any difficulties running these updates, or know of other plugins you’d liked “fixed”.

109 thoughts on “WP plugins – 1 fix and 1 update

  1. From what I can find out, the line 59 fix only applies if you upgraded to WP 2.5 and already had Popularity Contest running.

    If, like me, you put it on a fresh install, the line 59 fix will not work. You need to do some manual editing as well (if you’re comfortable with that.)

    Go Here

  2. @Sheamus – you’re right, you need to create the DB tables manually as well. I’ve made that clear in my update in the post above (we’re linking to the same page…).

  3. Pingback: Blogvaria » The New Alexa Rankings

  4. Hey I still have the problem. Even after replacing the code I get “fatal error” can’t figure out what the problem is. Help me.
    You can comment on my blog with the solution would be really helpful.
    Thank You.

  5. Pingback: WordPress 2.5.1 Upgrade at The OS Quest

  6. Pingback: Online Seo Service » Wordpress Plugins

  7. Pingback: joachimott | journal » Blog Archive » Wordpress 2.5: Popularity-Contest

  8. Pingback: Deuts.NET - Upgraded to Wordpress 2.5.1

  9. Pingback: WordPress Guy » Blog Archive » Popularity contest plugin compatibility with WordPress 2.5

  10. Pingback: How to Install and Set Up WP-Magazine Theme 1.0 : Premium WordPress Magazine Theme

  11. Pingback: Fix Alex King’s Popularity Contest Plugin for WordPress 2.5

  12. Pingback: скоро… » Blog Archive » Fix Popularity Contest issue with WordPress 2.5

  13. While this fix allowed me to update and Activate the new version, it COMPLETELY broke my WordPress blog, giving me the following errors:

    Couldn’t write to: /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/cache/wp-cache-ece47e3c947b4178b99228ff32ca3276.html
    Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/cache owned by uid 48 in /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 240

    Warning: fopen(/var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/cache/wp-cache-ece47e3c947b4178b99228ff32ca3276.meta): failed to open stream: No such file or directory in /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 240

    Warning: fputs(): supplied argument is not a valid stream resource in /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 241

    Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/lemonlaw.com/httpdocs/wordpress/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 242

    I don’t even want to begin troubleshooting this…

  14. It seems rather obvious to me that this doesn’t have anything to do with WP in general but rather your cache plugin. Try clearing the cache or deactivating the plugin and see what happens…

  15. What error? Was it a fresh install? Have you changed the DB prefix? What version are you running?

  16. Thanks for providing these solutions! I found your site through the wordpress forums, very nice layout and design! Thanks for the great information as I will be back to learn more to fix some other issues.

    Elliott
    ejcross.com

  17. Hi Alex,
    Its for me rather difficult, i’ve replace this: require(‘../wp-blog-header.php’); but there is still a error…i’m using wordpress. 2.5 1

  18. Did you have the plugin installed before you upgraded to WP 2.5.x? Also make sure you add the quotes (‘) by hand. They should be completely vertical, otherwise you’re using the wrong quotes which will trigger a syntax error.

    If it’s a fresh install you will also need to add the popularity tables to your database “manually”. Meaning using phpmyadmin or any other DB tool.

    Let me know of you still have problems after trying this out…

  19. Thanks for the fix for Popularity contest. I finally upgraded today to 2.5.1 from 2.3 using your tip

    I was already using it prior to that so I had the database already.

  20. Pingback: Wordpress 2.5 versiyonu ile uyumlu Eklentiler | Fırtına 30 05

  21. Not working on WordPress 2.51 : ( , I even tried copying and pasting, and re-writing the code from scratch – still gives a Fatal Error

  22. Pingback: Popularity contest plugin and WordPress 2.5 | WordPress Guy | Get IT From The Loo

  23. Pingback: Wordpress 2.5 Uyumlu Eklentiler (Liste) | Wordpress Tema Ve Eklenti

  24. Pingback: Rebirth!: 53m1 Becomes Novus.Volce @ novus.volce

  25. @AlexD – are you sure you have the necessary DB tables installed? Also, if you are not using wp_ as your DB table prefix, this needs to be edited as well…

    The plugin DOES WORK on 2.5.1 (I’m running it here!).

  26. Pingback: WordPress Working Plugins | Utricks

  27. Pingback: 2.5 Sürümüyle Uyumlu Eklentiler | WordPress Destek

  28. Pingback: wordpress 2.5 Uyumlu Eklentiler Listesi | Nazlı Reklam Reklam ve Hosting

  29. Pingback: Wordpress 2.5 Uyumlu Eklentiler Listesi | Taha'nın Yeri

  30. Pingback: Blogvaria » Upgrading to WordPress 2.6

  31. Pingback: A`dan Z`ye Wordpress eklentileri | Aninda Yorum, Msn messenger ifadeleri, Avatar, gif, smiley, Resimli Siirler, izle, indir, Komik Resimler, programlar, Resimleri, Haberler

  32. Pingback: Работающие плагины для WordPress - Блокнот

  33. Pingback: Wordpress 2.5+ Uyumlu Eklentiler (Liste) - Yorumla.Net

  34. Pingback: Wordpress eklenti listesi | h7x Software & Technology Center

  35. Pingback: Wordpress plugin wordpress eklenti arşivi wp yüzlerce açıklamalı eklenti | Türkiyenin en büyük mail grubu

  36. Pingback: Wordpress plugin wordpress eklenti arşivi wp yüzlerce açıklamalı eklenti | Türkiyenin en büyük mail grubu

  37. Pingback: k. thx. | Utah Tech Jobs

  38. Pingback: Fix Popularity contest error in WordPress 2.5 | Tips5

  39. Pingback: k. thx. - Robert Merrill