WordCamp UK – Great Stuff + a Little Controversy

I went to WordCamp UK 2010 in Manchester… this is my write-up of the event, and its controversies along with my presentations…

I’m just settling in at the office having spent the weekend at WordCamp UK 2010 which was staged in Manchester and is a community event for WordPress users and developers.  I gave two presentations, one about WordPress in Big Media, and another about WordPress in the Enterprise.  These followed on from presentations given at last year’s WordCamp.

The Craic

The second WordCamp UK Logo
Yes, this isn’t the logo actually used, but I prefer this one :o)

I’m going to say now that one of the key elements of a good conference or unconference is the socialising – this is where you meet people, bond with them over beers/food/dancing and form alliances that in the future could prove to be very powerful.  You certainly get to make friends and feel like you’re a part of an actual community, and this happens in a way that you’ll never be able to reproduce with online technology.  As a consequence it’s no surprise that the awesome Thinking Digital conference has been nicknamed Drinking Digital by some wags.

As ever,Tony Scott excelled himself by getting us access to the famous Factory Manchester (FAC251) which also happens to be across the road from a magnificently geeky pub that sells good beers, has various classic 8 bit and 16 bit computers adorning the walls, and classic arcade games on free play.  Awesome.

The Presentations

There was a typically varied range of presentations running across three rooms, along with other folk busy coding up for the WordHack (the fruits of their labours are online).  One particular stream that particularly caught my attention was that of a sequence of involvement from John Adams of the Department for International Development.  He ran a free-form discussion group on testing strategies which was followed by an interesting talk on PHP unit-testing Nikolay Bachiyski of GlotPress fame.  This session showed up some of the lack of structure in general testing of WordPress core code, plugins and themes.  Although the approaches used were probably fine for a publishing platform, they would struggle to gain ISO approval.  In other words, you wouldn’t want to fly on a WordPress powered plane!

Other presentations that I particularly enjoyed were Michael Kimb Jones’s WOW plugins, and Toni Sant’s very underattended Sunday morning slot where he discused the way WP has helped with a range of Maltese websites.

The Controversy

What’s a WordCamp without at least a little controversy?  However, for the attendees of this one, this was a biggie… Jane Wells is Automattic’s Master of Suggestion (seriously, that company has some weird job titles) and she made a suggestion that we shouldn’t have a WordCamp UK, but instead locally organised WordCamps for cities.

There’s a number of issues I have with this:

  1. Everyone in the UK knows that quite quickly WordCamp London would be the big one with all the attention in both media and attendance.  It would quickly dominate – in large helped by the enormous population density of the capital.  A WordCamp UK in London would be fine and popular (also considerably more expensive) but that’s all that’s needed.
  2. Many British cities have intense rivalries whilst we all still stand together as a nation – there are folk in Glasgow who would never attend a WordCamp Edinburgh, but would definitely be more interested in a WordCamp Scotland.  End result?  Cities would have small attendances by and large, and our impressive capacity for indifference for minor events would mean that they’d end up as little more than tiny, cliquey gatherings.  Anyone who’s tried to run GeekUps will understand this problem.
  3. A lot of work, energy and our own money has been spent on building up WordCamp UK.  Is Jane seriously suggesting we should dump that?
  4. What is Jane’s authority on this?  She’s simply an Automattic employee.  We chose WordCamp UK and its structure – it’s ours.  If someone else wants to run a WordCamp UK in the country they’re perfectly entitled and there’s no real reason why we couldn’t have three or four running each year – that would be a huge success.  A highly capitalistic organisation that is just one of thousands of contributors to the project and which plays no part in actually running most WordCamps shouldn’t get so involved.
  5. The UK is also very small – 90% of the population can reach all past WordCamp UKs in less than 3hrs – there is no real problem about accessibility.
  6. None of the UK’s key WordPress community members want to give up WordCamp UK.
  7. Jane admitted only six or seven people had complained to her about the situation, two of which turned out to be in Ireland – which except for a small part isn’t in the UK at all.  She couldn’t confirm whether they were Northern Irish or not, which was actually something of a poor mistake to make in front of 150 or so Brits.
  8. Us Brits are a pretty apathetic bunch at the best of times – actually running a WordCamp in each major city would be surprisingly unlikely to happen – there were only two bids submitted for this year’s event – one in Portsmouth and one in Manchester.
  9. The whole point of the *camp suffix is that it’s all free and easy with no big organisations sticking their oar in.  They are inconsistent and joyful.  They’re fun.  Automattic should keep out.
  10. The WordCamp name is not trademarked, and we’ve been using it in the UK for some time now.  It’s ours!

Of course, there are two sides to each argument.  Here’s some reasons and benefits to splitting up WordCamps in the UK:

  1. If somebody wished to run a WordCamp for their city they may feel that the UK badge is dominating and there’d be little interest as a consequence if it was called WordCamp Bristol, or WordCamp Salford.
  2. A national event called something like WordConf could happen.
  3. Erm…

Thing is – we can’t necessarily win this battle here in Britain.  We don’t control the WordCamp.org website – Matt Mullenweg does (he has the domain registration in his name) so if we fight to keep calling it WordCamp UK there’ll be no ongoing support for the event from Matt and his team if they wish to stop the use of the UK moniker.

Which would mean standing up to them.  Do we want to?  Are we prepared for a fight on this?  What do the likes of Mike Little (co-founder of the WordPress project) and Peter Westwood (a UK based core developer) feel about this?

Interestingly we were told the same thing applies to the likes of WordCamp Ireland which will now face this problem – but I wonder if Matt understands Ireland particularly well (we know Jane doesn’t) and that in that country the dominant WordCamp would quickly become an expensive Dublin event.  You may get one doing well in Cork, but Kilkenny, with a population of just 22,000 and which staged this year’s event, probably wouldn’t be able to sustain an annual WordCamp.

So, Jane has to really allow each country to understand its own social constructs and history and let their own communities choose how they do things.  One or two may complain, but it’s not possible to please everyone.

And we showed off too…

My company Interconnect IT have released, through our Spectacu.la brand, the following plugins which you may find useful:

I couldn’t help using the Discussion plugin to run some live discussion sessions.

And The Thanks

I can’t say thank you enough to the people who make WordCamp UK a success for no personal reward.  Tony Scott leads it up, with Mike Little, Nick Garner, Chi-chi Ekweozor, Simon Dickson and many many more working hard behind the scenes.  Also to Nikolay to letting me play with the fastest 85mm lens I ever saw!  Thank you, you’re wonderful people.

WordPress in the Enterprise Presentation

WordPress in Big Media Presentation

Live Threaded Commenting on WP

At Interconnect IT / Spectacu.la my colleague James has developed a new version of the popular Spectacu.la Threaded Comments plugin.  It’s not yet in release form, but you can grab it from the WordPress.org repository via svn if you know how at http://svn.wp-plugins.org/spectacula-threaded-comments/trunk/

I’m bringing it up here because I’ve decided to trial the plugin out here on my own site.  It was designed to work in conjunction with a webinars project, allowing visitors to have an active discussion, in real time, on a WordPress site.  It can be dropped into almost any theme, and adds nicely to the standard WP comments functionality.

Threaded comments are a powerful way to turn your WordPress site into a mini discussion forum.  Adding live commenting can now turn it into a chatroom full of ajaxey goodness.

Try it out below, if you like….

Of WordPress Training and Learning

Over at Interconnect IT, where I work, we’ve found that demand for our WordPress Training Courses has shot up over the past year or so.  And it’s certainly interesting to see where the work comes from.

Curiously, it’s very polarised – we either work with smaller one man band companies like Jason Nevin who runs a house removals company site who are looking to switch technologies, or big corporates and government agencies such as Shop Direct, The US Mission to the UN and the Department for Business, Innovation and Skills.

I’ve been thinking about why there’s such a big dip in the middle of our client base – 90% of our business is groups with over 500 staff or with fewer than three.

The Gap

Small, one man companies tend to involve highly motivated individuals.  They understand the important of their skills, and they know that in the tech sector they have to always stay up to date.  Large corporates tend to understand this too, and have allocated training budgets to make sure they keep up to date.  Government departments are often a little slower with new technology, but they too need to keep efficient or tax payers will kick up a stink.

And WordPress is a very efficient platform for running many informational websites.

But why are medium sized companies not coming to us in nearly such large numbers as micro enterprises and large corporates?  Let’s see…

Budgets

I’ve noticed that medium companies often have people who are extremely good at what they do, but I do find that there are often significant skills gaps.  I’ve dealt with someone from a school (medium) who didn’t realise that you don’t have to close an application in Windows in order to see another application.  Each time she cut and paste she’d open one document, select the text, close the document, then open the receiving application and paste the text there.  Productivity, as you can imagine, was pretty poor.

I think a lot comes from budgets – many firms around the 50 people size aren’t always able to make good money.  They have to be careful where they spend it – they’re not big enough to have training departments who make sure everyone is up to date, and they’re usually busy.

Culture

Another thing with smaller firms, I believe, is that they’re often started by individuals with a lot of skills – these are flexible folk who can teach themselves and learn quickly from books and the internet.  As they grow they try and hire similar people, but eventually there comes a point where a lot of staff are there for the job.  They need training because they aren’t going to go to the trouble of autodidactism.  They have a job to do, and they’re going to do that and no more or less.

At best, they’ll get on-the-job training.

Our Marketing

We don’t do a lot of it, to be quite frank.  But perhaps our website, approach and costs simply don’t ring true with people in medium sized companies looking for WordPress training?  Do we need to get advertising in business magazines, such as those sent out by the FSB?

Summary

I suspect that the truth is that a company always needs to look at the skills of staff, but as they reach a certain size they have too much going on to give it much thought.  Once they break through that difficult 50 man barrier things seem to start to change again.

But how do we change this?  I’m not sure we can, easily.  Governments often give generous grants, and around here we have Skillworks which helps a little, and we do get local approaches – however, the person paying still has to pay a significant contribution and specialist training is never all that cheap.

Do you have any ideas of how skills can be improved in small to medium sized enterprises?  Should we be marketing our courses more proactively?  What about scheduled classroom courses that keep things at a lower cost, albeit needing more time from the attendees?  I’d love to hear your thoughts – especially in the field of WordPress.

Liverpool Skyline

This is the view from our new office in Liverpool, right now.  Well, a few minutes ago.

I consider myself very lucky to have this just behind my desk and it has to rate as the best view of any office I’ve worked in.  You’d think the office would be very expensive, but it’s not, thanks to the way the Liverpool Science Park has been set up and funded.

IMG_2430 (Custom)

I can think of worse places to work….

Argh! Spiders!

To my great shame, I’ve allowed the cobwebs to build up somewhat during renovation work.

That’s going to have to stop, because today I just saw something scary.  An entire spider family, with big mummy spider sitting in the middle.  O_0

Cleaning time is about to start.  Sorry little fellas, but you're moving out!
Cleaning time is about to start. Sorry little fellas, but you're moving out! Your mum too. The lot of you, in fact.

What it’s Like to Present and Attend at WordCamp UK

Over the weekend just gone I made two planned presentations at WordCamp UK 2009 down in Cardiff. I also threw in a quick 45 minutes of show and tell on the Caribou Theme that runs this site and is available for download from Spectacula.

Over the weekend just gone I made two planned presentations at WordCamp UK 2009 down in Cardiff.  I also threw in a quick 45 minutes of show and tell on the Caribou Theme that runs this site and is available for download from Spectacula.

I also got to mix with some very interesting, talented and cool people that know a heck of a lot of stuff about what we’re working with.  In this conference were, potentially, the next generation of web creators.  People who will make things happen.  And this year, more than last, there was a real buzz at the potential of WordPress, its markets, and its uses.

Presenting at WordCamps

Presentation
Presentation

I’ve never actually done a formal presentation in front of more than about ten people before in my life, and even then only perhaps four five in my life.  I’m a techie – I would do technical discussions and demos, but never with Powerpoint and a laser pointer.  I did do an unconference show and tell at Barcamp Liverpool last year where about twenty to thirty people turned up, but that wasn’t planned… it just kind of happened.

But I could also appreciate the benefits of putting myself out there in front of a room full of my peers.  So in a fit of enthusiasm I volunteered for two presentations – WordPress in the Enterprise, and WordPress for News and Media.  I expect one or even both might be dropped by the organisers.  I have no history or background in public speaking.

Both got accepted.

Damn!

But it had some great potential too.  I could play with approaches and actually ‘test’ the results.  So what did I learn?  Read on:

1. L-Shaped Rooms are Tricky

The main room for the event turned out to be L-shaped… or, a better description, V-shaped, with the presented at the bottom of the V.  At this event three rooms were in operation, a large L-shaped room with up to 150 people, a medium sized rectangular room for up to 70 people, and a small boardroom type for about 15 people.

I had expected my first presentation on the Enterprise to be the tricky one – it’s not a fascinating subject.  But it was in the medium sized room, and it proved very easy to get engagement with the audience.  In the L-shaped room you’re trying to look in two different directions.  It’s almost impossible.

2. Consider an Assistant for Demos

One can work the computer, the other can talk.  Saves awkward silences, and it’s something I’m going to try in a future talk.

3. Get in Early

I did one of the first, and the very last, formal presentations of the event.  I noticed that in the first everyone was wide awake and very enthusiastic.  By the end of the conference people were flagging.  Getting and keeping attention becomes trickier at this stage.  You also have the advantage that nobody ever wonders off from the conference at the very beginning – it’ll never be fuller!

4. Start Funny

In the Enterprise talk I started with a humorous quote and in the News & Media I started with a pithy quote.  The funny one got the mood lifted and people in a cheerful mood.  It gave me a chance to relax and settle into the presentation.

5. It’s a Great Audience

I was dealing with fellow geeks.  People in the same situation as me.  It was, frankly, the best audience I can imagine.  The few presentations I’ve done before have been up in front of a board of hardened and cynical directors, or senior management, or people who have tough deadlines to meet.  This was a whole lot more relaxed.  Nobody’s going to consider firing you because of a minor mistake.

6. Get Engagement

I noticed that speakers who asked for shows of hands, asked questions of the audience and so on generally had a better applause at the end than those who didn’t.  It doesn’t take much to engage your audience, but I’ll admit that it’s trickier when you can only look directly at half of them at any one point.

7. Be Prepared

At conferences opportunities come up.  Have business cards, listen to people, smile a lot.

8. Freebies

You can’t believe how the mood of a room lifts when you hand out gifts.  Good gifts though.  I remember the really rubbish calculators we got given in my ICI Systems days.  What geek in the world needs a calculator?  So I handed out the penknives we had made for Spectacu.la and they went down a treat.

9. Matt

I finally met Matt Mullenweg at the weekend.  I’d promised him a beer months ago in reconciliation following our (now seemingly minor) argument over WordPress’s take on the GPL.  So I bought him a pear cider and had a good chat.  He’s an affable chap, easy going, says ‘awesome’ a lot (but he’s American, so that’s normal) and has clearly listened to the concerns of WP developers about how they’ll make any money.

Funny hat tho’ ;-)

Summary

An ace time, basically.  I’d like to say hi to everyone I met, but I’m scared of missing someone – so instead, let’s just say I look forward to chatting and, hopefully, working with some of you in the not so distant future.

Here’s to WordCamp UK 2010!

Saab 9-5 Aero (HOT) Estate For Sale – SOLD!

Given that I’m selling my motorbike at the moment as well, you may well wonder if I’ve had some kind of financial crisis of my own.

But thankfully, no.  I just don’t need such a large and fast car any more.  When I was doing a lot of sprinting I needed something capable of towing a car trailer comfortably and reliably.  But I also wanted something I could enjoy driving as my daily transport.

City Commuting Doesn’t Suit Big Cars

And that’s what happened, basically – for the past 18mths or so I’ve driven 12 miles to Liverpool city centre, and 12 miles back – congested roads, with a lot of stop-start action.  In the end I bought a Golf TDI which makes much more sense for that kind of driving.  Although I’m tempted to keep the Saab, which I will if I can’t get the right price, I know that in reality it’ll get far too little use in the coming year or two.  The sensible decision, then, is to sell it.

So, here goes…

Specification

This is a 2004  (04 plate) 9-5 Aero HOT Estate with 250bhp.  The full specification items worth listing are as follows:

Bi-Xenon headlights, headlight washers, factory alloy wheels, factory CD/Radio, Nokia Bluetooth Hands-Free (works with most phones), electric windows all round, electric mirrors, heated mirrors, split climate control, dual-colour leather seats, leather steering wheel, lots of airbags (5* NCAP Rating), ABS, Electronic Stability Program, new Vredestein Giugiaro front tyres and lots of life on the identical rears, detachable tow bar, FSH (main dealer or specialist only), two owners (first owner the dealership as it’s an ex-demo car), 58,000 miles, 10 months MOT, Tax until 10/09.

The car is in a gorgeous Capuccino Black.  In other words, most of the time the car looks black or very dark grey, but when the sun shines on it you realise that there’s a pearlescent bronze finish.  The photos below really capture this, which took some effort as it’s not easy to show in pictures – normally it just looks black.

Damage Worth Noting

I’m nothing if not thorough and feel it’s worth noting everything even if it’s minor so that you’re not disappointed if you travel – the car has a couple of tiny dings from the careless door opening of others.  It has a small ding that’s almost but not quite invisible under the nearside rearmost window with a matching scrape on the bumper – that was a van in Paris that did it, and no, he didn’t leave details.  But I’d say very few people can spot these marks – I’ve taken close-ups, however, to try and show marks.  Also, one of the alloys has a barely visible kerb scrape on it.  Picture shown.  There’s a few minor and normal stone chips that could do with being dealt with by chipsaway or similar, but one left a tiny ding on the bonnet.  Another tiny ding was caused by the biggest hailstorm I’ve ever seen, over in Italy.  I expected worse….

Get in Touch – Price to be around £6200

If you’re interested, you can contact me through the contact form on this site, or simply call me, during office hours or in the evening on 0151 709 7977.

If you’re wondering whether someone with the word ‘mental’ in his website address and a history of motorsport will have taken care of his car… well, in racing if you don’t take care of your car you often end up with an accident at some point.  Or losing.  I apply the same philosophy to my road cars – look after them and they look after you.

Enjoy the gallery – simply click on a thumbnail to get the big version, and you can then move between images by clicking on the arrows that come up.

 

And a Deep Zoom Seadragon view of the under-bonnet area

 

 

And now, PhotoSynth

Yes, I may have been playing – I’d be interested to know what you think of this use of technology…

1999 ZZR600 (ZX600-E7) For Sale

Sadly, after ten years, I’ve decided that I’ve really failed to make good use of the ZZR600 I treated myself to back in 1999.  It’s the only new motorbike I’ve ever bought… and I’ll hate getting rid of it.

But practically speaking, I don’t have much use for it, most of my friends stopped riding years ago, and I’ve put criminally few miles on the back since around 2003.

So, it’s time to go, get my garage re-organised, and space made for my car based toy.

It will have a 12 month MOT on it within a few days, though I’ll only tax the bike again if it runs out before sale.  I’m also not going to give the bike away just because it’s old.

The bike is in near perfect condition – as you’d expect for something with just over 4500 miles on it. It’s still very shiny and, frankly, when I polished it up I decided that there was no way I was going to give the bike away for a silly price. In other words, I expect a fair value that reflects its ultra low mileage, the care its received, the way its been stored, and the condition it’s in. I’m open to offers, however, because I know that valuing a bike like this can be quite tricky. For the right person it’ll be a bargain. For someone who just wants something to go to work on it’ll be too expensive. Simple as that.

Mileage appx. 4700
Year Registered 1999
Tax July 2009
MoT July 2010
Service History Some, but not annually due to lay-ups.  DIY checks too.  Will service it before sale.
Condition Almost as new.
Scratches A couple of minor chips on the left (pictured), and small dinks on the left-hand engine cover (pictured) caused by a very slow speed incident involving my disk lock, a gravel car park, and inadvertently doing the splits.

Five Things Bing Does Better than Google

MS have, at last, come up with what appears to be a competent rival to Google. Here’s five ways in which it beats Google.

Microsoft (MS), quite frankly, gets a lot of grief in the internet world.  Sometimes it’s fair (I never like MSN, for example, from way back in the mid nineties) and often a little unfair.

But Live Search simply wasn’t up to the job.  It didn’t work well.  And I know that people that found IE defaulting to it would either work out how to change it, or simply type Google.com into the address bar.  In other words, many tried it, but it didn’t find the answers they wanted.  The algorithm has been slowly improved with time, but the damage was done.  MS knew they had to relaunch.

Bing, they felt, was the answer.  And in some ways, it’s a better and more productive tool than Google:

Bing - pretty pictures to cheer you up
Bing - pretty pictures to cheer you up

1. It’s Prettier

While I’ve heard many question the function of the landing page photo, I personally really like it.  It’s attractive, well designed, and brings a little bit of beauty into the day.  You can’t sit and surf pretty images at work, so if they’re there as part of the ‘wallpaper’ of a daily tool then that’s a lift we all need.

2. Infinite Image Search

The infinite scroll facility of the image search makes it a quicker tool to use.  Chunking of text related searches makes sense, because we can scan a page relatively slowly, but with images the human eye can scan a huge amount of visual information incredibly quickly which means that Bing’s constantly scrolling visual tool is way ahead of Google’s image search.

3. Video Previewing on Video Search

bingvideo
Bing Video - content owner's nightmare or benefit?

Searching for video content can often be a slow and painful process.  In Bing, when you get a series of videos up on screen you can simply hover your mouse pointer over a video to preview the first 30s and get a feel for the video, rather than visiting the site and waiting for a slow load.  The previews are poor quality, in order to get quick loading, but they’re good enough.  I feel this is one of Bing’s most effective innovations.

One thing where they may struggle is that if you click the video and that video has an embed option, you get it on the Bing site, rather than going through to the source site.  So a YouTube video search result doesn’t send you off to YouTube.  Content owners may not like this.

4. Site Preview

When you hover over a search result, you’ll see a small orange marker appear over to the right.  Hover over that and up pops a preview of the content you’re looking for.  Again, saves a wasted visit as it lets you scan a little bit of content for relevance – something that’s quicker this way than clicking on yet another unnecessary site.

5. It’s Not Google

Bing is, purportedly, a recursive acronym that means Bing Is Not Google.  But there’s something important in that – Microsoft is a highly profitable, focussed company that has the resources to provide an alternative to Google.  This is important – without solid competition Google will cease to innovate appropriately.  MS suffered a similar fate on the desktop – they were too dominant and rivals couldn’t compete.  Apple’s OS9 was dreadfully dated when sat next to a Windows machine of the same era, yet Windows had significant flaws.  It’s only lately with Windows 7 that MS have really started to get their act together properly – because OSX finally gave it some decent competition in certain sectors.

When you start seeing articles on how to change from Google to Bing on Firefox, you know something’s happened.

It Can Get Better

Microsoft Seadragon, with it’s deep zoom and mobile capabilities, and Photosynth technologies could be tied into the image search, for example.  As cheap processing power expands and more and more images are geotagged, this could form an astonishing visual search capability.  A shame it won’t be coupled with Google Street View – imagine what that could be like?

Search is going to become more relevant and more powerful with time.  Developers (our own Interconnect IT included) are busy creating a lot of powerful geocoded databases which will allow for some amazing mashups.  If Google and MS start fighting for dominance in this space the opportunities for users and information suppliers are vast.  Are you looking into it?

mySQL Database Search & Replace With Serialized PHP [Updated]

Ever needed to migrate a database to a new server or website (especially with WordPress and other PHP applications) and been stuck because when you do a search and replace some of the data seems to get corrupted?

Please note that a newer version of this code is now available from my Interconnect’s site over at https://interconnectit.com/search-and-replace-for-wordpress-databases/ 

Ever needed to migrate a database to a new server or website (especially with WordPress and other PHP applications) and been stuck because when you do a search and replace some of the data seems to get corrupted?

Serialized PHP Arrays Cause Problems

In PHP one of the easiest ways of storing an array in a database is to use the serialize function.  Works a treat, but the downside is that you’re not storing data with a cross platform method.  In many product development environments this would get you a stern talking to, but in the world of web development where deadlines are tight and betas are the norm, this seems to be overlooked somewhat.

So what we have are tables full of data that can’t be easily edited by hand.  For example:

;a:3:{s:5:"title";s:17:"This Week\'s Poll";s:18:"poll_multiplepolls";s:0:"";s:14:"multiple_polls";N;}

Say you had thousands of records like the one above, and the word ‘multiple’ needs to be changed to ‘happy’.  Two bits would change – poll_multiplepolls would now read poll_happypolls and multiple_polls would read happy_polls.  In both cases you would have three characters fewer to deal with.

Fine, you may think, but you can only do the change by hand because where it says s:18:"poll_multiplepolls" it now has to say s:15:"poll_happypolls" – see the difference?  S18 spells out the length of the following string, and it has to be changed to s:15

I’ll say right now, that that was a pain.  For simple arrays I wrote the straightforward PHP Serialization fixer code, which got me out of many a pickle – do the search and replace without worrying, and then run the script.  Fixed about 90% of problems.

Multidimensional Array Problem

Sadly those 10% of problems left were a real pain.  I needed something more robust.  Something more powerful.  And finally today it was a Bank Holiday in the UK – that means no phone calls… I could have a quiet day of coding and concentrate on the best solution to this problem.

What I’ve done is to write a database search and replace utility in PHP that scans through an entire database (so use with care!) which is designed for developers to use on database migrations.  It’s definitely not what you’d call an end-user tool, though I may sanitize it at some point and turn it into an easy to use WordPress plugin.  Thing is – this is dangerous code – sometimes I think it’s better to make it deliberately a bit tricky, don’t you?

It’s not that bad though – if you can manually install WordPress, you can easily configure the database connection settings.

What the code does is to look at the database, analyse the tables, columns and keys, and then starts reading through it.  It will attempt to unserialize any data it finds, and if it succeeds it will modify that data then reserialize it and pop it back in the database where it found it.  If it finds unserialized data it will still carry out the search and replace.

Use in WordPress

In most WordPress migrations you tend to have the primary problem of changing the domain name entries in content, settings and widgets – you simply need to put in the $search_for string the old domain address (including the http if it’s there) as seen on the database, and the new one into $replace_with.  Then put this script onto your server, and run it by visiting it in your browser or inputting the appropriate command line – depending on your server configuration.

Other things you may want to check are for plugins or themes that have made the mistake of storing the full server path to the installation – cFormsII does this, for example.  You will need to find out your old and new server paths and use those, in full, for another iteration of this script.

After less than a second of running, you should have a freshly edited database.  It may take a little longer on slow or share hosting, or if you have a very large database, but on my laptop I can manage around 60,000 items of data per second.

I’ve just used the script to migrate, in its entirety, with content, settings, 87 widgets (yes, really!) and hundreds of images to my localhost server.  It took moments, and the site is perfectly preserved.

Search and Replace Database download.
download file

Search and Replace Database download

BIG WARNING: I take no responsibility for what this code does to your data. Use it at your own risk. Test it. Be careful. OK? Here in the North we might describe the code as being as “Rough as a badger’s arse.” Never felt a badger’s arse, but I’ll take their word for it.