Sybase iAnywhere SQL AAnywhere Mobile and Embedded Database

Rows and Columns


SQL Anywhere perspective on technology

header image

WordPress 2.7 Upgrade Issues – Performance

February 20th, 2009 · 1 Comment

So, last week I *thought* I was ready for WP 2.7. It turns out there were a few things that I had to work through to get things working smoothly. Specifically, performance was terrible when I first activated the blog.

1) User Facing Blog Performance

The first thing I noticed when moving my blog live was that it was very slow to load the blog homepage (15 seconds vs. 1.2 seconds on the previous version). Several Google searches later, I discovered that the built-in WordPress cache had been removed in version 2.5 (a good description of this can be found here. Since I was upgrading from 2.3.3, I missed that little gem.
The resolution to the problem was pretty easy (or so I thought) – go to WordPress and type ‘cache’ in the plugin search. The WordPress Super Cache plugin looked to be the most popular, so I downloaded it.
I installed the plugin and activated it, then turned on caching on the WP Super Cache settings page. Looking forward to a lightning fast load of my blog, I clicked the “Visit Site” link on the dashboard and… nothing … no blog home page, no nothing. After a short panic, I moved the plugin directory and everything went back to the (slow) way it was.
I had a look at the web server error log, and it immediately showed me the problem. I was getting a “failed to open stream” error on wp-cache-base.php. Once again, Google to the rescue. I found this excellent blog post on installing wp-super-cache in a Windows environment.
Since there are several blogs running on the server, I modified the super cache plugin to (hopefully) fix the problem when other users enable it. I simply removed the WP_CONTENT_DIR reference on line 949 of wp-cache.php, since that looks to be the source of my problem.
After following the directions and re-activating the plugin, I clicked “Visit site” with my fingers crossed. The blog page took the same amount of time to come up. However, when I clicked ‘refresh’, bang! The homepage came up almost immediately. I clicked around and the performance of the blog is now pretty much the same as with the previous version of WordPress.

2) Administration Performance

The entire time I was trying to fix the public facing part of the blog, I noticed horrendous performance on the WP dashboard and for any administrative activities I did. It usually took about a minute every time I clicked on any dashboard activity. The caching plugin did nothing to improve that.
Once again, I returned to Google for help. I found several threads and support issues related to dashboard performance on WP 2.7. The most useful one (for me) was here.
Following the thread, I added the recommended code to http.php and found that my problem was the auto-update checking done by WP. Since the blog server sits behind a firewall, its access to the outside world is limited, and every request to wordpress.org to check for WordPress core, theme and plugin updates was timing out.
Luckily, I found 2 plugins which looked to solve my problem:
Disable WordPress Core Updates
Disable WordPress Plugin Updates
I installed and activated these plugins, and the dashboard performance improved significantly, though not as much as I had hoped. I did some checking (using the http.php mods from the link above), and noticed the plugin to disable plugin update checking didn’t catch all cases. I updated it, based on my limited knowledge of plugins, to remove all of the registered actions which caused wp_update_plugins to be called.
While I was at it, I also disabled the theme update checking.
That improved performance more, but it was still a little laggy on the dashboard page. I noticed the new widget layout on the dashboard page had several widgets which called external sites. I did some searching, and found the
Dashboard Widgets API page. Since WP 2.7 does not have a gui for adding/removing dashboard widgets, I used the sample code from the API page to create a simple plugin to remove the widgets that accessed sites that were timing out due to the firewall issues.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php 
/*
Plugin Name: Clean Dashboard
Plugin URI: 
Description: Remove unused/unnecessary widgets from the blog dashboard to improve performance
Author: 
Author URI: 
Version: 0.1
*/
 
function clean_dashboard() {
  global $wp_meta_boxes;
 
  //Remove Wordpress RSS
  unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );
 
  //Remove Wordpress News
  unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] );
 
  //Remove Incoming links
  unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
 
  //Remove plugins
  unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
}
 
add_action( 'wp_dashboard_setup', 'clean_dashboard' );
?>

After activating my plugin, the dashboard (and all admin activities) are much snappier.

Everything *seems* to be working well now performance-wise. All in all, this upgrade was much harder than previous upgrades I’ve done with WordPress. However, I learned a lot more about the WordPress internals.

Be Sociable, Share!

Tags: WordPress

1 response so far ↓

  • 1 ebflute // Mar 5, 2009 at 11:43 am

    This is just the information I was looking for, I am running a single user WordPress install inside a firewall and the page was taking almost 7 seconds to load, however, with the addition of your homemade plugin and the two plugins you recommended, page download is less than a second. Awesome!! Thank you for sharing your research.