WordPress 2.7 RC1 update and a few tips

Today I upgraded Tech Gremlin to WordPress 2.7, it was pain free and I love what they have done with the admin section. I was expecting to have a bit of a learning curve with finding where everything is now however I am fairly surprised that everything is where I expect it to be.

A few issues of note, the Blogging Tips plugin is now situated in a spot that doesn’t look right, needs to be about 20 pixels lower.

Tip #1
If you are using the Google Sitemaps plugin and you experience php errors uploading the new sitemaps files after upgrading your WordPress version, this is a permissions issue and is fixed by deleting sitemaps.xml and the gzipped version of the file if you also use that and refreshing the page, posting the data you attempted to post before.

Tip #2
Try to just use the html version of the post add/editor as graphical post editors make a general mess of the html and make editing it later a slow and tortuous experience.

Tip #3
I know this seems pretty obvious to some however it is important to try to get a host situated physically closer to you, due to the latency it may take as much as an hour more to upgrade your blog via ftp than it would with a host that is situated in your country as each file is small, yet needs to be negotiated for on the connection each time, this ends up taking it much longer to upload than just one file of the same size, it is highly affected by latency. If however you cannot get around having a host a fair way away, uploading the wordpress zip file and using their admin panel (or the shell if you are familiar with it) to extract it into place is much faster even than the previous example, however not all hosts support this.

Firefox crashes, WordPress flash uploader and new host

Firefox has locked up again

Firefox has crashed again, I can always tell because It’s closed, in fact I probably closed it an hour ago, but it’s been slowly sitting there in the background hoping I won’t notice it, it does this occasionally when I close it, sometimes after I have used it for some time, sometimes when I only have it open for a short time, it doesn’t seem to matter, it just does it, further more I haven’t found anybody with a similar problem, except some sources that insist it might be the plugins causing it.

The WordPress flash based picture uploader has been giving me grief ever since I changed hosting providers recently, HTTP error was all I was given when trying to upload a file, using the browser based uploader worked fine so I used that instead, but it got annoying for me so I did a bit of googling and found out that the reason it wasn’t working is because on some providers you must have this directive in your .htaccess file:

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

Now flashed based uploading works fine.

UPDATE: James at The Theme Blog has experienced a similar error and has posted another workaround here, if this doesn’t work out try that one.

I have been a member of Aussiehost for over 6 months now, however this site has stayed specifically on Servage up until a few days ago when I realised this website is a little slow on Servage for my liking, the latency is shocking. The changeover was seamless and I’m very happy with the performance so far.

Update for Servage Referral Widget etc

Last night after over an hour of coding I was able to finish version 1.2, the new version is able to count how many times a user clicks the link, then report it in the Widget control panel. I might make an option later to report it under the widget, or in the Dashboard.

Google Analytics is quite a handy tool to see who reads my site and for what purpose, the Webmaster Tools is also great, however I am noticing the search ranking isn’t very accurate for some reason.

In other news I went out half way through writing this entry, the slimline sets of Mythbusters seasons appear to be slowly coming out, I got my copy of Season 1 today.

I also just bought the spamannoys.me domain, mainly for e-mail of course.

WordPress/Servage spam IP filtering

I have Akismet set up to keep spam out as well as keeping all comments for moderation, I initially decided to do some IP blocks seeming as there would be a few that would constantly send spam.

The only problem was that as WordPress only use

$_SERVER['REMOTE_ADDR']

to determine a user’s IP address which as most people who know PHP know it is a bad idea because it doesn’t take into account proxies etc. In my case it was actually giving Servage’s own IP for every result which wasn’t of much use unless I wanted to block comments/trackbacks altogether.

As there’s no documentation that I could find about where WordPress actually contains the code to find the IP and Google wasn’t much help I had to look manually.

I eventually found it in comments.php in the wp-includes directory.

$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] );

First to add in the neccessary code a variable must be created, change the above code to this:

$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$bp_IP );

Then add the required code above that stating:

$bp_IP = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

This allows the correct IP to be shown in most cases, most of the thanks must go to Jason for this.

Update: This piece of code also works in WordPress 2.6x.