subscribe feed

Archive for the ‘Technical Stuff’ Category

Wordpress data import

Wednesday, July 14th, 2010

I imported 900 odd articles from a website we’re migrating from another system into Wordpress. The information was in CSV format, so I built a quick and dirty PHP script to import the data directly into the database. I thought this might cause issues, but thankfully, it didn’t!

The problem came however, when I switched permalinks to %postname% as per the proposed structure for the new site. The pages list in the admin system showed no entries, and the front end just 404′d.

I started by altering line 1112 of wp-includes/wp-db.php to die if a mysql_error() was raised.

This pointed me to the query where Wordpress updates it’s own rewrite_rules information in the wp_options table.

Reading around a bit, the exact error “the MySQL server has gone away” relates to MySQL setup, and specifically, the setting for wait_timeout. Altering this did nothing in my eyes, even after raising it to 600 (10 minutes). Poking around a bit more, I wondered if it was the pure size of this query. As I was using wampserver locally, I didn’t mind messing with the MySQL setup (my.ini), and thus, I also increased a couple of other variables. The one that did the trick was max_allowed_packet, which I increased to 64M (I believe the default is 1M).

The site now functions without a problem. When the site is deployed, this value will no doubt be tweaked, or may already be higher by default.

A useful one to remember in the future!

Safari 5 “reader” mode

Tuesday, June 8th, 2010

Interesting article over at theregister about Safari 5’s new “reader” function. And the page is also a living example of a page compatible with it too.

Apparently, if Safari 5 recognises that the page you’re visiting contains an “article”, it will enable reader mode. Clicking the link in your URL bar will pop up a stripped down, reformatted display of the article for ease of reading. It will be very nice if this new feature makes it over to the iPad or iPhone be it in iOS4 or a future upgrade with safari more specifically in mind.

I haven’t really looked in to this, but I’d love it if this was in fact Apple jumping on the HTML 5 band wagon and actually related to the <article> tag. This would make it the first browser I believe to have something out of the box that specifically caters for and enhances a new HTML 5 tag. Of course, I’m probably wrong, and Opera also probably did it first ;)

Console access

Thursday, April 29th, 2010

I use Firebug to debug webpages. I’m sure a lot of people do.

I also, find myself using “alert(variable)” quite often when debugging some JS that is infurating me at the time.

If you combine JS and Firebug, you can use console.log(variable); to show the variable value in the Firebug console instead of alerting it on a page. This, as I have learnt, is a much better way to debug code on a live site.

Google launches a URL Shortner for Google Products

Monday, December 14th, 2009

Google have released a URL shortner at http://goo.gl/ – following in the foot-steps of sites like http://bit.ly/ and http://pig.ly/. However, Google’s URL Shortner is only for use within Google Toolbar and FeedBurner.

More news in the press release here : Google Blog

Facebook – somewhat of an arch rival of Google – have been rolling out a URL shortner for a short while on their mobile system. Any link in the m.facebook.com stream is auto-shortened using using fb.me. For example – fb.me/chickenland would take you to my page on Facebook.

HTML Emails

Wednesday, December 9th, 2009

The subject of HTML emails usually ends up in a 2 hour long discussion about all the hacks and work arounds that need to be put into place to get it working in the series of test mail clients and online “clients” that you’re supporting.

That list of course could be tiny, or very extensive.

Whilst trying to find out why Hotmail wanted to fill my email with lots of margins breaking the layout, I Googled to find an answer and came across http://www.viget.com/inspire/hotmail-image-problems-in-html-emails/

From here, I visited the Email Standards Project which gives a good overview of mail clients and their current ability to ignore all the code you’ve been slaving over.

And I’ll leave you with a Flickr group depicting the hatred of GoogleMail’s current rendering:

http://www.flickr.com/groups/project-gmail-grimace/pool/

Google Chrome Extensions Overview

Wednesday, December 9th, 2009

I mentioned yesterday that Google Chrome Extensions are in the here and now as opposed to a distant figure on the horizon.

You’ll need to go grab the beta of Chrome from http://www.google.com/landing/chrome/beta/ as it’s not in the release version yet, but once you do, you can play to your heart’s content.

I have a feeling that innovation may be a little few and far between since Firefox has been out for so long, there is such a base of extensions there. It reminds me slightly of a conversation Gina Trapani and Matt Cutts were having on Twitter regarding the lack of truely original apps on Android. Almost everything has already been covered by Apple’s iPhone.

Chrome may also struggle as Android’s market-place has with getting the volume of content on the site in the first place as adoption by programmers may take some time.

However, I’m sure that won’t put developers or users off using Google Chrome extensions- as its still (for the time being) lightning quick. There are already some great extensions to get started, like:

Speed Tracer
https://chrome.google.com/extensions/detail/ognampngfcbddbfemdapefohjiobgbdl

Chromed Bird
https://chrome.google.com/extensions/detail/encaiiljifbdbjlphpgpiimidegddhic

Google Wave Notifier
https://chrome.google.com/extensions/detail/aphncaagnlabkeipnbbicmcahnamibgb

Google Chrome Extensions!

Tuesday, December 8th, 2009

I recently uttered the words “If Chrome supported the web developer tool bar, I’d switch from Firefox”.

Suppose it’s only a matter of time :)

https://chrome.google.com/extensions

Google PageRank Speed improvements

Tuesday, December 8th, 2009

It won’t have escaped note that Google are updating their PageRank algorithm soon to take into account the speed of the web server that supplies the information.

This throws up many questions like whos going to define how quick “quick” is? – what happens if Google indexes your site which is on a shared host when another site is taking a pounding? Alot of Google’s recent announcements have all involved “speed” as a central issue, and as such, Google have released a series of tools over at http://code.google.com/speed/page-speed/

Anyone wanting to know more about the algorithm hanges can check out http://www.blogstorm.co.uk/page-load-speed-may-be-in-google-2010-algorithm/

I think we can all expect this to become a big selling point for server providers – such as UKFast who already make great play of the fact in their documentation. Remember though, this isn’t an official announcement of intention as such – they ould still implement this in a different way if they wanted to.

I assume we’ll all hve to go back to text heavy sites with ascii art now.

Will Google DNS or even OpenDNS be quicker for you?

Tuesday, December 8th, 2009

Noticed an article over at Smarterware – http://smarterware.org/3898/namebench-benchmarks-dns-services – which introduces “NameBench” – a service for determining whether your DNS is services are quicker or slower than alternatives.

Great thing is, this is from YOUR machine and location – not just usage statistics and speed improvements you SHOULD see by switching.

Google DNS

Tuesday, December 8th, 2009

The words Google and DNS in the same sentence fill me with both excitement and apprehension.

For those that don’t know, we all rely on DNS (Domain Name Servers) to translate domain names (like www.google.com) into an IP address (66.102.9.99) – which allows your machine to correctly identify the machine on the internet somewhere that holds the site you’re looking for.

Google, being the massive company they are, with fingers in many pies have just stuck their hand into the DNS pie. Their DNS even have catchy, memorable IP addresses themelves – 8.8.8.8 & 8.8.4.4.

Many ISPs who provide DNS services to their subscribers use them to intercept mistyped URLs and supply a page of ads – something Google could easily integrate with AdWords. It also means that – should they want to – Google ould gather more and more data on the usage habits of anyone using their DNS.

Could this be the next step in taking over the world without anyone realising?

Copyright Douglas Radburn – douglasradburn.co.uk © 2010
Theme Author: MascaraDesign - Community based WordPress theme.