Solving the Authentication and Plugin Errors After an Upgrade to WordPress 2.5

The upgrade process to WordPress 2.5 was as smooth as it can possibly be — simple, fast and without a single error message. However, there were a few problems that became apparent only after the upgrade. This article will explain those issues in detail and show how to solve them. Here is a short list of problems solved:

  1. When trying to log-in after the upgrade, the following error message is displayed: “You do not have sufficient permissions to access this page.”
  2. Yet Another Related Posts plugin returns “Fatal error: Call to undefined function merge_filters() in … includes.php on line 73”.
  3. Popularity Contest plugin returns “Plugin could not be activated because it triggered a fatal error” when reactivated.

Here are the problems in detail with the suggested solutions:

Problem: “You do not have sufficient permissions to access this page” error

Description: You follow the upgrade instructions supplied by the WordPress 2.5 which state:

  1. Delete your old WP files, saving ones you’ve modified.
  2. Upload the new files.
  3. Point your browser to /wp-admin/upgrade.php
  4. You wanted more, perhaps? That’s it!

After creating a backup of all the files, I deleted them from the server (including the wp-config.php one) and uploaded the new ones, and pointed browser to /wp-admin/upgrade.php to discover that it asks me to create a new wp-config.php file.

For some reason I decided that instead of creating a new file, it would be easier to upload the previous wp-config.php which I thought contains all the information necessary also for the WordPress 2.5. That seemed to help as I was able to continue the upgrade and all the update scripts run successfully.

However, after supplying the credentials for the log-in, I was greeted with the following error message:

After a few Google searches, it was clear that it had something to do with the user permissions and the way they were handled in this new version of WordPress. I also remembered reading about the SECRET_KEY which has been introduced in WordPress 2.5. It all lead to the idea of actually modifying and using the version of wp-config.php supplied with this new version of WordPress.

Solution: Do not upload the wp-config.php from your previous (2.3 or earlier) installation of WordPress, but rather edit wp-config-example.php supplied with the WordPress 2.5, save it as wp-config.php and upload to the root directory of your blog. More detailed instructions are available in this section of WordPress Codex.

Equally you could simply follow the ‘Create a Configuration File’ link and supply all the information there.

Problem: Yet Another Related Posts plugin returns “Fatal error: Call to undefined function merge_filters() in … includes.php on line 73”

Yet Another Related Posts is a very useful and smart plugin created by Michael Erlewine.

Due to the fact that this plugin uses a “dirty, dirty hack” to:

avoid a loop in apply_filters('the_content') > yarpp_default() > yarpp_related() > current_post_keywords() > apply_filters('the_content'). The code is straight up stolen from wp-includes/plugin.php and, with the exception of the single hack line below, should match what happens in plugin.php

In WordPress 2.5 the apply_filters() function found in plugin.php has changed a lot, therefore the altered version of this function in Yet Another Related Posts plugin should resemble these changes as well.

Solution: Download Yet Another Related Posts (version 1.5.2) where I have modified the necessary portion of code to reflect the changes in WordPress core.

Note: This 1.5.2 version of Yet Another Related Posts plugin will not work with versions of WordPress prior to 2.5.

Although this plugin doesn’t offer widget support by default, I use it together with my Custom Function Widgets plugin and it works like a charm. And I am proud to say that Custom Function Widgets plugin didn’t require any changes at all — it just works.

Problem: Popularity Contest plugin returns “Plugin could not be activated because it triggered a fatal error”

Description: This problem occurs only during a fresh installation/activation of the plugin or when it is reactivated after an update.

Solution: Open popularity-contest.php, go to line 59 and replace require('../../wp-blog-header.php'); with require('../wp-blog-header.php');.

Solution was originally described in this section of WordPress Support forum.

On a Sidenote

It may seem that these errors could be a significant obstacle for the not-so-savvy WordPress users to successfully upgrade their blogs. In reality, however, it should be emphasized that the rest (and the majority) of plugins didn’t have any problems at all. And it is very likely that most of the solutions are just one or two searches away (or close). There is even an official Plugin Compatibility list on WordPress Codex.

How about you?

Did you upgrade? If so, how did it go? If not, what are the reasons for not doing it yet?

12 Comments

  1. Andrew says:

    Thanks Kaspars,

    I had the same problem with popularity contest but I just turned it off. I was planning to wait until it was upgraded but you have given me the solution. Nice one.

  2. Kaspars says:

    Andrew, it’s good you found this useful. It would be interesting to know if you experienced any other problems while upgrading or was it all smooth sailing?

  3. Suskun says:

    I’ve just upgraded to 2.5 and never seen such an error.I don’t know why you got a wp-config error.I kept the previous one.

  4. John Baker says:

    When I try to upgrade any plugins via the automatic method I get the following message:

    “Upgrade Plugin
    Downloading update from http://downloads.wordpress.org/plugin/(plugin-name).zip
    Unpacking the update
    Could not create directory”

    Has anyone else got this? It seems that I can’t upgrade plugins automatically. If anyone knows of a solution I’d be very grateful.

  5. Kaspars says:

    John, I haven’t had this problem myself. Maybe you have the WP Automatic Update plugin installed? There are reports that it is causing error similar to the one you described.

    Also you may try googling for wordpress 2.5 “Could not create directory”. Please let me know, if you do find a solution.

  6. Kaspars says:

    I also noticed that you have the Bad Behavior plugin enabled, which has been reported to cause problems with the new file uploader. I suggest that you disable most of the plugins and then try to do an automatic upgrade.

  7. John Baker says:

    Kaspar, thanks for the answer. But it turned out to be a matter of permissions. The plugins directory wasn’t writeable, so I made it 777 and now it works. As you say, this is probably down to the WP Automatic Update which does mess with permissions.

  8. Bodhipaksa says:

    Many thanks for the YARPP fix!

  9. lutfi allail says:

    I have similar problem with you, and now it’s resolved. Thanks

  10. Matthew says:

    WP Automatic Update also may fail for servers running with PHP safe mode option, see this post

  11. gp says:

    Thank you so much for that. I needed to implement a theme change and the darn thing broke. I really appreciate you taking the time to work on this!

Leave a Reply