Category Archives: WordPress

Tips, tutorials, and discussions on WordPress blogging software.

WordPress Upgrades

Wordpress IconWhen dealing with website upgrades, one of the main concerns is trying to make the upgrades go as smooth as possible, but the other concern is that upgrades need to be executed as fast as possible to minimize down time. When it comes to the web, it is a 24 hour cycle, and even 15 minutes of down time can cost web site owners money. Given this, I have come up with the following upgrade process for minor WordPress upgrades, that minimizes down time for web site users, and makes the process a little easier on me.

Verify Backup

Never perform any kind of upgrade without a backup! In the case of WordPress, make sure you have a current database backup and a backup of your wp-config.php file. Now on with the upgrade process…

Prepare Your WordPress Upgrade Files

1. The first thing I do is delete any unnecessary files from the new WordPress release. I do not use the classic theme at all, so I usually delete that theme.

  • wp-config-sample.php
  • license.txt
  • readme.html
  • wp-admin\install.php
  • wp-content\themes\classic
  • wp-content\plugins\hello.php

2. Rename the following folders:

  • wp-admin to wp-admin-new
  • wp-include to wp-include-new

Uploading Files

3. Upload the two folders that you renamed to your WordPress root directory. Note that this will not overwrite the current folders, since they are named differently. This results in not interrupting the up-time of your site until the next step.

4. Upload all the root files to your site, overwriting the current files already there. Sometimes, it is best to delete the root files first instead of overwriting them, so choose whatever method you prefer. Note that you should keep the wp-config.php file; do not delete this file ever or it will cause problems.

5. Upload the contents of the wp-content folder, meaning you now have to upload the contents of the wp-content/themes and wp-content/plug-ins directories.

Finish Upgrade

6. Most WordPress upgrades want you to confirm the upgrade.php file. This usually runs database changes and such, but for minor builds, it is a good way of confirming the upgrade process worked.

  • Run domain_name/wp-admin/upgrade.php

7. Lastly if all went well, you just need to delete upgrade.php and you are done!

Some Notes

Make sure you are familiar with the upgrade process for WordPress and note that some major upgrades may require changes to theme files and such. You may need to modify this upgrade process for a particular WordPress release.

Div Tags Formatting

I had a slight problem with the WordPress 2.1 upgrade, that I traced to defect #3669. However even after I applied the patch code from the defect, I still had problems. I ended up having to live with P tags inside my DIV tags. The problem was that depending on how I inputted a DIV tag in my posting, WordPress would automatically add a P tag inside the DIV, but would not close it properly. I noticed it only because it messed up the look of some of my advertisement blocks. The patch fixed the problem with the paragraph tag closing, but to fix my rendering, I had to actually add to my CSS stylesheet code.

Other than this slight issue, the 2.1 upgrade went well. It is even slightly faster than 2.0.6.

WordPress Internal Errors

Recently I had some problems with another site that I maintain and I had to move the entire domain to a different physical server, and of course the WordPress installation decided to break along the way. There were various problems, but I would have to sum it up as not being able to access anything in the wp-admin folder. Every time I tried to access the admin side of WordPress, I would receive an internal error 500, along with 403′s. After researching this issue for a while, it turns out my original .htaccess file was not restored. More importantly, the workaround for mod_security was not in my .htaccess file. Adding this to the root .htaccess file fixed the problem with not being able to access the admin interface:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

I also use the plugin WP-Cache, which can cause problems if you move your WordPress installation; this usually comes up as a php include error: wp-settings.php on line 69. The fix is to remove define(’WP_CACHE’, true); from the wp-config.php file. If that still does not fix the problem, then you might have to remove all of the files created by WP-Cache:

wp-content/advanced-cache.php
wp-content/cache/*
wp-content/plugins/wp-cache/*

If you recently moved your files to another server or renamed your home directory, then the problem is the symbolic link advanced-cache that is under wp-content. Most FTP programs will not show the link, so you must either delete it from within cPanel’s FileManager or shell into your account and do it that way. You can then usually just deactivate and re-activate the plugin, and when you enable caching, it should recreate the link.

And then there is this problem with WordPress 2.0.5.