System Software Notes

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 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


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.



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 ../
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 ../ *

At this point you ship the file to the server. On the server

cd wordpress-top-level-directory

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