mertner.com/allan

Upgrading to wordpress v1.5

Tags: — Allan @ 1:39 pm

wordpress has finally been released in a new version 1.5, meaning that the old v1.3 pre-release installation needed a bit of an upgrade. In order to remember what I’ve done, and perhaps help someone else who needs to go through the same steps, here is a list of the changes I had to make to make it all work and some of the caveats I encountered.

First, the good news:

  • I had to make fewer changes to the “core” files than previously. This is because WP now has “theme” support so most of the changes I would like can now be included in a “mertner” theme that presumably can be ported between versions.
  • WP 1.5 has lots of nifty new little features. I quite like many of them, such as the enhanced search, better category view, theme support etc 🙂

The bad news is that it wasn’t all straightforward, but at least it was easier than I had expected…:

  • I used the default theme as a starting point and combined it with the old stylesheet. This required lots and lots of editing, but was about as painless as editing CSS files ever is.
  • The category listing code is still broken in several ways, and my suggested changes to display the date of the last post for each category has not been included in the build.
  • The ability to display the “All” category is completely broken and I have had to disable it.
  • The ability to display an outline of categories is now broken if you choose to suppress empty categories. Expect to see a few categories with no entries as a result.
  • The database upgrade process did something to all of the posts: special characters (like apostrophes!) turned into a question mark sign. Highly annoying: editing all of the posts by hand is not my idea of fun, but I have not yet found a better way
  • I cannot find a way of showing only posts marked as “Front page” on the front page. Previously, I used a my-hack to do so, but this does not work any longer and so as a result you will see this relatively boring post – sorry 🙂

These are the files outside the themes directory that I needed to edit:

  • /wp-config.php
    The code I previously used to get WP to support multiple blogs still works, completely unchanged. Nice!
  • /wp-comments-post.php
    I had to edit this file to retain support for the AuthImage plugin. That’s the plugin that forces you to type in a few characters from an image in order to post a comment – and saves me from about 50 spam posts per day. Hopefully it will become a plugin that doesn’t require editing files one day.
  • /wp-includes/template-functions-category.php
    In order to retain the ability to display the date of the last post, I had to edit this file. I also added a few “div” tags to some of the items to be able to style them better than is possible by default. (As an aside, the WP team thinks that “class” attributes are evil and that they should not be used to identify classes of styles. Suffice it to say that I disagree.
  • /wp-includes/links.php
    There is still something that may be considered a bug in this file: It is not possible to display a graphic to the right of a link (such as a PDF icon). Unless of course this file is changed a little bit.
  • /wp-includes/template-functions-post.php
    I edited this file, hoping that I would be able to figure out why the Pages links don’t show up when the user is viewing a Page. Alas, I couldn’t figure it out, but I’m sure there is a bug in there.
  • /wp-admin/edit-form-advanced.php
    Added a Full Preview link to allow an article to be previewed in the right context before it is published. This is very useful since the stylesheet used on the edit page is different from the standard one, meaning that the regular preview at the bottom of the page is less useful.
  • /wp-includes/classes.php
    To ensure the Full Preview works, needed to change the query string to include draft posts as well as published ones. This code change used to be in functions.php, which includes much of the same code seemingly duplicated. I have no idea why that is so…
  • /wp-blog-header.php
    Added a call to filter_posts() when supplying an Atom or RSS feed. This is part of the View Levels plugin that only allows certain posts to be seen by a logged in user of a certain level. If the posts are visible through a feed, this is kind of pointless though 🙂

That’s it, I think! Now I just need to check whether it supports editing of Hindi characters too so the new version can be used by महावीर – my father in law’s blog.