After manually upgrading one of our client’s sites to WordPress 2.9.2. we noticed that the only thing that went awry was the automatic plugin upgrade.

WP asked me for the FTP information, and then gave me this error message:

Cannot find Content directory (WP-Content)

The first solution I found suggested to make sure that all the necessary folders and files had a permission level of 755 or 777 (wp-content folder, plugin folder, upgrade folder) and to  add the following to the wp-config file as indicated by Hui Wang:

if(is_admin()) {
add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ ));
define( ‘FS_CHMOD_DIR’, 0751 );

But,  this caused the plugin list to show duplicate plugins – the older version and the upgraded version of the plugin. For some reason, it wasn’t deleting the old files.

Then, I tried deleting the code from the wp-config and trying again.  This time, I got a different error (don’t ask me why):

Could not remove the old plugin

Plugin upgrade Failed

So I found this fix from the Support Forum which seems to have fixed everything for now.

1. Make sure your wp-config.php file is chmodded to 0644.

2. Also make sure your .htaccess file is protecting the wp-config file using these lines:

<Files wp-config.php>
order allow,deny
deny from all

3. Backup your wp-config.php file.

4. Edit your wp-config.php file putting these lines in underneath <?php:

define(‘FS_METHOD’, ‘ftpsockets’);
define(‘FTP_BASE’, ‘/path/to/wordpress/’);
define(‘FTP_CONTENT_DIR’, ‘/path/to/wordpress/wp-content/’);
define(‘FTP_PLUGIN_DIR ‘, ‘/path/to/wordpress/wp-content/plugins/’);
define(‘FTP_USER’, ‘username’);
define(‘FTP_PASS’, ‘password’);
define(‘FTP_HOST’, ‘‘);

Crossing our fingers that the automatic upgrade to version 3.0 will go smoothly!