Patching WordPress

I have a *lot* of WordPress blogs that are served up on a Mac OS X Server platform.
The server has the web performance cache enabled. This causes problems with assumptions about how Apache identifies things.

REMOTE_ADDR vs. HTTP_PC_REMOTE_ADDR

REMOTE_ADDR always contains the IP address of the server itself. HTTP_PC_REMOTE_ADDR contains the IP address of the remote PC. We need to make WordPress aware of this “entertainment”

wp-includes/comment.php and wp-content/plugins/akismet/akismet.php

RAQUO

The RAQUO (right-angle-quote) that is used in feeds is annoying since lots of things that read feeds don’t grok what to do with it. I want it replaced with a vertical bar instead.

wp-includes/feed.php

Workplan

I have done this by hand any number of times. Currently looking at this set of tasks.


mkdir wp-232 # create the old directory
cd wp-232 ; unzip ../wp-232.zip
unzip wordpress-2.3.3.zip
mv wordpress wp-233
diff -Naurw wp-233/wp-includes/comment.php wp-232/wp-includes/comment.php >wp-comment-patch
diff -Naurw wp-233/wp-includes/feed.php wp-232/wp-includes/feed.php >wp-feed-patch
diff -Naurw wp-233/wp-content/plugins/akismet/akismet.php wp-232/wp-content/plugins/akismet/akismet.php >wp-akismet-patch
# verify that the patches a correct (changes in modules happen)
patch -p0 <wp-comment-patch
patch -p0 <wp-feed-patch
patch -p0 <wp-akismet-patch
cd wp-233; zip -r ../wp-233.zip *

At this point you ship the wp-233.zip file to the server. On the server

cd wordpress-top-level-directory
unzip location-of-wp-233.zip

repeat as necessary. Use the browser to run the wp-admin/upgrade.php procedure.