| « Count Up/Down Plugin | Creative Commons plugin for v230RC1 » |
I just finished upgrading nelsonguirado.com to 2.4.0-RC1 and wow what a piece of work! I took on the project as a challenge to myself and something to focus on during my transition to sobriety. Worked well on the first count, and okay on the second. Still when I get edgy and start thinkin' about drinkin' nothing takes that away. The meds help but ... ah well yah?
So! His web started with 30 blogs using 17 skins, 15 of each that were visible to the public. Cruising his blogs showed me that most of the stuff was consistent across each blog, with minor changes for each. Back in the day using multiple skins for this type of thing was pretty much normal. Either that or an extremely complicated _main.php file to handle all the different situations. I figured since all his visible blogs were pretty much the same - and as near as I could tell were actually identical in their style sheet - he only needed one skin and we would make it do all the rest.
For his sidebar I went with a total hodge-podge of tricks. He now has three specialty files that use php's switch to grab different bits for each visible blog, and default to the main page version for when he adds a new blog. That's a little bit sloppy but it was soooooo much easier than doing a widget per visible blog. Plus he is part of the pajamas media conglomerate (a global secret society hell-bent on world dominion - google it if you dare), which means he has some code that uses a bit of php and javascript, which means it can't be widgets. The php part isn't widgetizable is why. So I figured a container for widgets that change on each and every blog is a silly bunch of widgets, thus I went with included switch files.
I also called a few widgets directly because a container for a single widget seemed like a waste of a container. Again this was due to finding only one widgetable bit between non-widgetable items or items that were better served with included switch files.
I then finally built three containers for his sidebar. Each has a couple of widgets in them, and one of them has widgets that are somewhat unique across his blogs.
His main content area was actually the easiest to upgrade. The only thing "funny" there is that his social bookmarking block is an included file because of the size of that section. I opted to make it be it's own file to make it easier for him to add or subtract bits there without cracking open a file that was already long enough.
The technical side of upgrading was quite a piece of work. Obviously when you upgrade you want things to be what they were, but upgrading won't work that way. It can't magically know you have a skin it doesn't know about, so I had to hack the installer/upgrader quite a bit. I first made it be an upgrader ONLY because with the hackage it is simply not ready to make a fresh installation. Some of the hackage was to install his new skin and the custom skin. Also I tweaked the default widgets to be the widgets he needs in the containers he has. That still wasn't enough because some of the widgets I simply couldn't get to work via the install/upgrade process. For those I gave him an SQL file to run immediately after upgrading. With that I was able to install a plugin that he needed active, switch all users to the 'chicago' admin skin, something else that escapes me right now, and inject the widgets I couldn't make happen through the installer.
Without it technically being part of upgrading, I rebuilt his skin so that his content came before the sidebar when you 'view source'. AFAIK that'll help him with search engine stuff, and maybe his page rank. It also means that on a slower connection his visitors will get his content before his sidebar which is how it should be to my way of thinking. Also cleaned up a hell of a lot of xhtml validation errors. His blog started with ~858 validation errors, and is now down to 127. Some of those remaining are really simple fixes that I should have caught but I didn't. Oh well eh?
All in all it was a hell of a piece of work. Found and documented a bug in the process. Thought up some groovy options that a single user with multiple blogs might find desirable going forward. Learned a shit-ton about how to upgrade. Plus he sent me a $50 gift certificate with amazon.com that I spent on me!
Next time I do this it'll be required that the person first get to 1.10.3 so that I can work from a stable starting point. 1.8.5 was totally short lived and simply shouldn't be out there anymore.
Thanks, my head started spinning at the widgets part :P
I almost finish upgrading 0.9.1 system with 130 blogs and 68 000 posts. The bad thing is that all blogs have an own domain, and they must use only 3 skins, located in main directory. Plus each blog has different colors, styles and images stored in other db
Going back to work...