Blog “Reboot”

Hello – here’s the refreshed blog. I’ve decided to revert to a more typical blog format, after many months of soul searching on the issue. I previously had a layout based on a framework we used at interconnect/it for a couple of clients

But not only have I opted to switch to a blog layout, I’ve decided to use an off-the-shelf theme.  I’m now using Khoi Vinh‘s Basic Maths WordPress theme.

Why?

Well, it’s a lovely theme, for starters.  The typography is pretty good.  The archives page is brilliant (check it out) and should be the standard bearer for all themes archive pages.

But the real question for many, I suspect, is why I’m not using an interconnect/it designed theme.  Well, for starters, interconnect/it hasn’t produced an off-the-shelf theme in years.  It’s just not our business.  So rather than use a product of ours, we’d have to spend good and valuable time on creating a new theme.  And, well, why would we want to do that?

Lots of reasons, actually.  I could have a theme coded at the office that really shows off what we can do.  But the problem with that is that there’s not much need.  My blog is not an important one.  It isn’t about WordPress (most WP related content will be on our company site, not my personal one) and it just doesn’t get much traffic.

I run a business.  Its purpose is to make money, employ five people, and, with a bit of luck, turn a reasonable profit.  Its job is not to service my ego or make me look good.  A really good theme costs the equivalent of around £10k-£20k of chargeable time to design, code, test and implement.

Given that we’re turning work away, I thought “why bother?”  And decided to go shopping for something.

So What’s It Like?

It’s actually quite weird using somebody else’s theme.  I actually tried a few out and here are the things I learned that will hold us in good stead.

Themes don’t do enough to make life easy.

No really, they don’t.  One of interconnect/it’s biggest challenges is making sure that WP is as easy to use for clients as possible.  This means following standards, but it also means using some little tricks that help out – for example, registering and setting plenty of different image sizes, and setting/over-ruling whatever the media settings say.

Migrating WP content really sucks.

There’s a fundamental flaw with the default WP export/import.  If you have inline images, although the importer has the ability to download and attach the image in your new site it won’t change the links.  And if you do a search and replace, and your image sizes have changes, your lost.  Totally – the img tag will point to a file that doesn’t exist.

So what do you do?  Well, usually if I’m moving a site from one server to another, even switching domains, it’s a non-issue.  I have my tools.  But if you’re starting from fresh and working like an end-user would then you have to go through every single damn post in order to fix the images.  Every post with an image in it.  That’ll take a while.

If you’re really geeky, you’ll sort it, but it takes time.  Way too much time.  This kind of stuff needs to be sorted and it’s something we may look into as a contribution to the WP project.

Some Plugins Leave Lots of Crud

The reason for a reboot was that I felt that my site’s DB had been filled up with all sorts of crud.  Lots of plugins create tables, leave options, and so on.  Surplus tables have little impact, but they clutter the place up.  But options, lots and lots of them, do have a minor performance hit, and they add up.

Other plugins leave hooks, don’t deactivate properly and so on.  And over the years, I’d been through an awful lot of plugins.  The site hadn’t been redone since WP 2.0 had been set up on it.  I felt it was getting sluggish.

So… there are beautiful and amazing themes out there, and WP is wonderful, but there are little things that could make life just that bit better.  Better migration tools, a better system of managing images within content and their migration, and a better system for activating themes so that image sizes are better handled.

Is it a lot to ask?  Well, we’ll see what we can do about that!

Homage to Beatrice Warde or a bad idea?

I recently saw in the book “Just My Type” by Simon Garfield a poster by Beatrice Warde, the famous American born typographer who spent much of her career in the UK*.  There seem to be many variations of typesetting for the poster, so I’ve no idea if she designed one herself or if it was simply something that printers liked to produce.

But I quite liked the idea of a strong message to visitors of a print shop that what went on there was important.  So why not the same for an office of web developers and designers?  What we do carries great potential, it is world changing, and we facilitate amazing things.  Why shouldn’t we as an industry have something similar to help trumpet our cause?  And where better to start than a classic set of words by an eminent typographer?

I’ve set this in Gill Sans Std rather than Albertus of the original I saw, but perhaps there’s a better typeface?

I’m not happy with this quick draft just yet, but wanted to put the idea out to see if it would fly.  Comments please!

With a hat-tip to Beatrice Warde
With a hat-tip to Beatrice Warde

* Enough, in fact, that I believed she was British until the helpful comment below informed me otherwise.

New Spectacu.la Discussion Updates

My colleague James has been extending the threaded comments plugin that I use(d)* on this site.  It’s available from http://svn.wp-plugins.org/spectacula-threaded-comments/trunk for those of you with SVN clients, and for download and easy installation from WordPress.org and Spectacu.la within a few days.

If you wish to test it out, feel free to comment here…

It adds a quote button for content (try selecting some text here and see what happens!), an extending comment box, so if you like people to write long comments they’ll find it easier, and a quote button for comments.  These features all enhance the WordPress commenting engine and make it easier for your community to engage with you.

A proper release after final testing and updates is due in a few days.

* Still a good plugin that we use extensively – but on this site we designed something custom. Better that way.

F%@*!?g Hell

image

I’ve done Arica > San Pedro before, albeit with a change at Calama. Thing is, I just remembered one of the more annoying bits…

Chile has concerns over various food pests and as a consequence you not only get checked for fruit, cheese etc on boarding the bus, there are also occassional checkpoints. So at 3.30 in the freakin’ morning the lights all come on it’s time to step into the cold.

So here I am, wide awake, irritable, and in full realisation that this bus was designed for a country where the average height is a good two inches (5cm) less than back home.  So I’ve got my music on, popped my fleece on and hoping for some sleep.  Soon.

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

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.

Liverpool Web Designer

Just a little plug, really, to mention that if you’re interested in an unofficial, casual and behind-the-scenes look at the work we carry out at Interconnect IT, along with opinions on the market, head on over to the blog entitled Liverpool Web Designer. It’s hosted at WordPress.com a rather wonderful blogging site that lets you create simple but effective blogs. For free.

We actually use the WordPress platform ourselves – it’s pretty darned good. If you host it on your own site it’s great from a customisation perspective. Yes, there’s limitations, but you can choose to either work within those limitations, or you can blast them to smithereens with good code. We started with blasting, but since chose to go for a more straightforward approach – treating WordPress as a blogging platform, and leaving the heavy lifting websites to the big CMS systems. Seems to be simpler that way.