Archive

Archive for the ‘Wordpress’ Category

Upgrading from 1.5.x to 2.3.2 of wordpress

January 17th, 2008

This blog went into extended hibernation a few years ago; it is old and often falls asleep. Whilst it slept, Wordpress steadily upgraded leaving this poor blog behind. As the versions progressed, I got more and more fearful that an upgrade would be too much for this old bear of a blog, and it would be killed off, an upgrade too far.

However, not upgrading meant that the blog was more and more likely to get ill, security exploits and spam making it more and more ill. The spam traps were failing and I was getting email after email telling me some spam had been written to the blog or placed in moderation. Something like 2000 odd spam messages built up, growing like a cancer. Yet still I did not act.

I thought it would be too hard, too complicated and take too much time to upgrade. I was wrong.

Yesterday, I decided to bite the bullet and upgrade. Finally, reading the instructions about upgrading from 1.5 blog, I realised that it was quite straightforward. I decided to use the SVN version of upgrading, knowing how easy it was to upgrade from other blogs I run.

I can boil it down to 7 easy steps.

  1. Backup, backup, backup and check your backup. Backup again, once more for luck. Look, just make sure you backup in case, or when you mess this up. Make sure you backup the mysql database as well (this happens automagically for me on the server)
  2. Disable all your plugins – most plugins that worked in 1.5 won’t work in 2.3.2
  3. Create a new directory and use the SVN commands to grab the latest version of wordpress.
    svn co http://svn.automattic.com/wordpress/tags/2.3.2 .
  4. Copy your wp-config.php and .htaccess to the new blog
  5. Move the old blog into a different directory, move the new blog to where the old blog was
  6. Run http://blog.com/blog/wp-admin/upgrade.php
  7. That’s it

Note, you’ll still have to do stuff like make your blog look pretty, install new plugins etc and so on, but as I was using the default theme before, all I had to do was copy an image across.

I havn’t install any plugins as a) it was so long ago, I don’t remember what plugins did what anyway and b) most of the plugins had functionality that was now part of wordpress itself anyway.

So, if you have an old blog running an ancient version of Wordpress, just upgrade it, it is not that hard.

Paul Wordpress , , , ,

Hacking wp-recent-links

May 27th, 2004

I messed around with PHP this afternoon and hacked the wp-recent-links so it grabs the referrer information using the bookmarklet. Now it automatically fills in the via section in “Newspaper Cuttings”:http://www.dellah.com/orient/cuttings/ like “Simon describes in his blogmarks”:http://simon.incutio.com/archive/2003/11/24/blogmarks. In fact, not knowing any javascript either, I got the bookmarklet code from “a link in a comment in that post at clagnut”:http://www.clagnut.com/blog/264/

I’ve emailed the author of the plugin, so he can either ignore it, or write the PHP properly and fix all the mistakes I’ve probably made.

I’m now off for a bath to sooth a bruised foot. Playing football last night, a swung my foot at a beautifully deliveried cross only to kick the studs of the intercepting defended. Now I can’t move my foot at all. Shame, cos I’m sure it was going straight for the top corner. Maybe I’ve broken my metatarsal, but that was sooo last year.

Paul Wordpress

Newspaper Cuttings

May 26th, 2004

I’ve moved my linklog, “Newspaper Cuttings”:http://del.icio.us/sarabian, from del.icio.us to a WP powered side blog using “a plugin from rebelpixel”:http://rebelpixel.com/projects/wp-recent-links/. The main advantage of this is that it makes it possible for me to add via links to the entries and give due credit, and gives me control of the output in a way I didn’t quite have before.

“RSS Feed here”:http://www.dellah.com/orient/cuttings/feed/ and “the index page here”:http://www.dellah.com/orient/cuttings/ but as before you can see the links over on the side there.

“wp-recent-links”:http://rebelpixel.com/projects/wp-recent-links/ is a very neat “Wordpress”:http://wordpress.org plugin. I had to hack it a bit to get it to how I liked it. For example, it was hard coded to point to a /recent-links/ directory and I had to change it to /cuttings/. I’m glad I made the move to WP, as hacking plugins was something I found impossible in “MT”:http://www.movabletype.org. I understand PHP and can hack it, even though I can’t yet write it.

Paul Wordpress

WordPress 1-2

May 24th, 2004

WordPress 1.2 is released and it took me about 5 minutes to move from the beta to the production version. And very good it is too. I had a very busy day today, and there are a lot of WP links to review and talk about. I’ll get round to looking at those tomorrow.

Also, “Adam spotted my problem with mturls”:http://www.dellah.com/orient/2004/05/17/moved#comment-1016 and this is working fine now. I’ve had a recent surge in search referrals and I was wondering what had caused it; the move to Wordpress or something else. Then I check and found I was number 5 in a search for “christiano ronaldo”:http://www.google.com/search?q=christiano%20ronaldo and his little acheivement over the weekend has sparked a huge number of searches.

Paul Wordpress

Plugging, Hacking and Release Candidates

May 21st, 2004

Wordpress has a final RC available and I’ve installed it without significant issue.

“Papascott”:http://www.papascott.de/2004/05/21/3023.php says something that has been on my mind this week :-

bq.:http://www.papascott.de/2004/05/21/3023.php With WordPress, if you want to do anything slightly different from what it intends (for example, customizing the text of the monthly archive links, or listing the 5 latest comments), you end up writing a hack, essentially rewriting one of its PHP functions to do what you want. But PHP is at least logical and well-documented. Movable Type has it’s own well-documented but esoteric template language, for which you can find plugins to make it even more esoteric

You have two options if you are a coder and want to write weblog software that is specific to your needs. Firstly, you can write your own weblogging system (e.g. “Epistula”:http://www.aquarionics.com/#article-75) or you can use a pre-built package and write hacks or plugins for it. As long as the plugin system is flexible enough, and in a language you know, you have the benefit of not having to code a system from the ground up and have the benefit of a well written performant weblog without having to design it yourself.

MovableType didn’t work for me because I didn’t know Perl. Wordpress is better because PHP looks easier to learn, but I’m holding off writing any plugins or hacks until 1.2 is released. I don’t feel confident enough in the language to contribute yet. Also, when I did have time last night to look over the forums and see what others were doing, there was a database problem and I couldn’t access anything. (btw, the best plugin system was in “Vellum”:http://www.kryogenix.org/code/vellum/)

Paul MovableType, Wordpress

Moved to Wordpress

May 17th, 2004

Well that was relatively painless. The import was simple and easy, getting the permalinks correct was a little bit more tricky, but only took a couple of hours. If it wasn’t for the “dash-to_underscore change”:http://weblog.burningbird.net/archives/2004/04/18/smart-urls-converting-from-mt-to-wp-and-die-url-die/ I’d have been done a long time ago.

So, things I did and tried to get into order. Firstly, I started with “these conversion instructions here”:http://blog.carthik.net/vault/2004/05/14/movabletype-to-wordpress/ and from “a link here about slugs”:http://www.libraryplanet.com/2004/05/slugs, I used the “mt import keyword slug importer script”:http://www.carthik.net/wpdocs/import-mt-keywords-postslug.phps which worked without problem.

A little mod_rewrite to redirect the various RSS(ish) feeds (RSS 0.91,RDF and Atom) to the wp versions and the only problem was that before 2004 I didn’t use a keyword for entries, but was using MTEntryTitle with underscores, and WordPress uses dashes.

I tried a few things; “this looked the best option”:http://idly.org/2004/05/13/fixing-mt-urls-for-wp and it worked perfectly, but I started getting some odd PHP errors about headers. I can see the problem, but not knowing PHP, I can’t see a solution. Next I tried “a method from the wiki”:http://wiki.wordpress.org/index.php/MT-Redirect which wrote a custom .htaccess code. I didn’t like this as it generated some 700 lines for the server to parse. However, it didn’t work anyway. This was because I wasn’t using the archive directory, so my URL is 2004/01/01/some-title and when some_title was entered, none of the redirect rules were listened to because a different rewrite rule was sending the request to the wordpress index.php file. “This method”:http://wordpress.org/development/archives/2004/03/29/redirecting-mt-entries/ had the same problem as above.

So in the end, I went through my referer logs and simply changed any linked post to have underscores. I know this is going to miss some things, but it is a short term solution until I can have a look and figure out whether the header problem with the plugin is a known problem, or I can fix it. (It is 1am now and I’m going to bed).

I’ve decided to do a new design, so I’m not changing any of the templates yet, I’ve got the default Wordpress templates atm. The blogroll and linklog can come tomorrow.

Anyway, it seems that “SixApart have been doing some thinking and have gone someway to resolve the problems with the licensing”:http://www.sixapart.com/log/2004/05/movable_type_30.shtml#more.

bq. The single CPU usage statement was not intended to be in the license. It has been struck from the license, and everyone who has downloaded Movable Type 3.0 thus far can officially consider this change retroactive.

Oops! Schoolboy error.

bq. To be clear, sub-weblogs that make up weblog sites shouldn’t be counted toward your weblog total.

Should have been clear from the start. Either SixApart had no idea how their users used their software, or they just didn’t think about it, which if you are going to base a licensing structure on the number of weblogs is very silly indeed.

bq. We’re adding a new “Personal Edition Add-On” package that gives someone who has purchased a Personal Edition license the ability to buy 1 new weblog and 1 new author for $10. You can purchase as many additional author/weblog packs as you want, each for $10.

This is a clear case where they have listened to valid criticism and done well to address it. Still overpriced, but that is for up to them to work out. I get the impression of a young company not really knowing what they are doing. Growing too big, too soon? Or just not enough business knowledge? I mean, I wouldn’t have a clue about how much to change, and how many hackers would? That’s a boring job for some suit to work out. I’m off to learn a little bit about PHP (ssh Aquarius, it won’t be permanent).

Paul Wordpress