A project at work needed me to write a UI to find and delete duplicate attachments on a single post, from a client’s WordPress website. Creating a couple of queries where I could look over each post in turn, and check a hash for each file attached, then spot the duplicate hashes wasn’t too hard. Where I was struggling was making the rows with the duplicates stand out visually, file hashes, e.g. bc38d8d8993b5e9f4617576d2adeb875, are just not that easy to distinguish from other hashes, e.g. dbe0256fe35b88ebd4e4e433604b7487… see the problem?
What I wanted was some way of mapping a file hash to a colour, or something strongly visual. Which is when it occurred to me; Gravatar could do this! Continue reading →
I’m currently running Apple Mail with the unified inbox option, so I can connect to my old company email address as well as my Code for the People address and see everything in one place. There’s settings in Mail to allow you to set the default sending address, and when you reply to a mail it should pick the correct account. Trouble was, I kept noticing that my mail was going out under the new account when I was sure I’d specified the new account to be the sending address. Infuriating and embarrassing.
This approach was primarily devised for use with WP Engine staging sites, but will work in any situation where you have no access to Apache’s config and need to use a single .htaccess file for multiple domains (e.g. a multisite setup).
We’ve recently had a couple of projects hosted on WPEngine where we need to have a staging site protected by Basic Authentication so only authorised users can access it. Normally I would configure Basic Authentication in the Apache VirtualHost, but on WP Engine (for example) they handle all the server configuration for us, meaning we don’t have access to the Apache configuration. WPEngine also provide a Git push to deploy facility, which we tend to take advantage of because Version Control Rools, OK? Because all the web files are within Git version control, we are using the same .htaccess file for the developer, staging and live sites. (We could Git ignore the .htacess file, but I prefer to version control more, rather than less.)
We’re using WP Engine to host various clients, notably the Rolling Stones site, and we’ve been very pleased with both the service and the performance of their hosting platform. There’s always something though, isn’t there? I don’t think I’d really be happy if there wasn’t. In this case it’s the fact the Varnish caching layer that sits between the site and the visitors caches “non-200″ responses for 24 hours. So what does all that mean? What’s the actual problem here? Continue reading →
If you want to learn more about what’s going on, you can see the summaries posted on the day for the morning and the afternoon, and watch the “notes” category archive as the session notes are going up now.
For many of our projects, the .htaccess file is under version control… but at the same time, I need to put HTTP Basic Authentiation on just the staging site. Unfortunately the host weren’t able to do this for me, but with a little .htaccess trickery I was able to detect the staging site URL and trigger the authentication.
Why do I want to do this? Well, pretty often the client is keen to see how some new, embargoed, content is going to fit together, whether that’s a group of new pages or a new masthead, etc. I don’t want just anyone guessing my staging site URL and wandering around getting information they shouldn’t! Continue reading →
“Cooperate on a technical level and compete on a business level.”
Jeffrey McGuire, Acquia
Seen on a slide at PHPNW12, I like this summary of how companies interrelate in open source.
John Cleveley (@jcleveley) from Auntie BBC talking about the responsive development of BBC News. Usual caveat applies, (a) these are my notes on my thoughts as well as his words, and (b) I may have misheard or misunderstood.
Current site is static files and a lot of Apache includes! Responsive sites: cool… but hard! Moving from an easy compartmentalised set of sites, mobile and desktop; mobile was simpler, for less capable devices.
A really entertaining talk, with great slides, by Sebastian Marek at PHPNW12 on Code Reviews. As usual, the notes below are a mix my understanding of what Sebastian said and what I was thinking as he said it. If I’ve misunderstood or misheard, just let me know in the comments.
Introducing the characters (cute little character drawings in the slides):
Tom “I want it done” the owner
Harry “just get it done” the manager
…I missed the others
Take a process: design, coding, code review, testing. But do we really need to review the code? “Surely the testing covers the testing, and you guys already know how to code, right?”
“We’re nearly done, just need to review the code”
“But we’re busy, we have no-one spare, let’s just push it out…”
“I need John Senior to review my code.”
“He’s busy, you can have Bob Junior”
“We do all these code reviews, it’s still buggy, we’re spending all this time, it’s just not working. We’re abandoning the reviews.” Continue reading →