WordPress 3.0.1 not publishing scheduled posts

Clock mechanism

Back in May I published a post about WordPress 2.9 not publishing scheduled posts. Recently I did an automatic update to WordPress 3.0.1 … and guess what: scheduled posting has been broken once again.

I’ll try the method I used before, which was to delete all the core WordPress files and upload them again manually, but in the meantime I found this WordPress plugin has done the job: Missed Scheduled.

By default the plugin is set to run every 15 minutes, but I’ve changed mine to 2 minutes by editing line 12:

12
define('MISSEDSCHEDULED_DELAY', 2); // Number is in minutes, change it according to your needs

If it turns out that uploading the files manually fixes the issue again I guess I’ll be running manual upgrades in future.

WordPress 2.9 not publishing scheduled posts

Clock mechanism

On Tuesday night I scheduled a post to publish at 08:30 on Wednesday morning. It didn’t happen. Did it have a broken clock, or something?

So I tried to reschedule it. That would surely wor… No! That didn’t work either.

In fact, no matter what I did I just couldn’t get scheduled posts to publish. I would just get a message in my list of posts saying “Missed Schedule”. It turns out I’m not the only person.

I patiently went through every suggestion offered, and not one of them worked. I updated core files (http.php and cron.php) to no effect. I disabled all my plugins. Still nothing.

Other installations

In the end I installed another instance of WordPress 2.9.2 and the latest beta version of WordPress 3.0 (beta 2) and tested those. And guess what: scheduling worked!

Solution

So my solution was to backup everything (blog files and MySQL database), delete all the old files off the server and re-upload them.

Maybe, I reasoned, after the last automatic upgrade something went amiss. Maybe certain key files weren’t overwritten correctly or indeed uploaded at all.

That did the trick. I kind of wished that I’d tried that first. But you live and learn, I guess.

WordPress upgrade: filling in the missing pieces

Missing piece

Well, where to start?

I’ve been meaning to blog about life for ages but since Reuben and Joshua were born in November 2008 other things took more of a priority.  Things like attending to twin boys, eating, getting enough sleep, and generally trying to muddle through the days.  I’ll likely write more about that in the future.

Simplifying life

Over the last few months I’ve been working at simplifying life as much as possible, and being a good Getting Things Done / Take Back Your Life disciple and disengaging from projects and tasks that I knew I wouldn’t/couldn’t complete or which were no longer priorities.  It’s felt good.

That’s given me more of a focus on the things that I do want to do.  Sorting out my web server was one of those things.

Server upgrade

I suspect that I would have blogged more about it at the time (and I now wish that I had) but I made a promise to myself that I wouldn’t blog again until I’d upgraded my server.  Of course, that took a good few months longer than I had anticipated (doesn’t everything these days?).

In February I moved from Webfusion to Heart Internet, after an abortive attempt to simply upgrade to a better hosting package at Webfusion.  The killer feature that was missing from the Webfusion package was subdomains; I didn’t want to lose my blog.garethjmsaunders.co.uk URL that I’d just had printed onto a custom-made laptop skin.

So far my experience of Heart Internet has been excellent.

Upgrade WordPress

The most pressing reason for moving to a better server was to enable me to upgrade WordPress, the software that manages my blog.  My old host had a bunch of really out-of-date features (MySQL 3.2 and PHP4) which just wasn’t enough to run the latest versions of WordPress.  What a relief to be able to upgrade from WordPress version 2.0.11 to the latest version 2.9.

And wow! there have been quite a few changes to WordPress in the interim: the addition of widgets and tags, as well as critical changes to the main API, a much nicer UI, etc.  So many changes in fact that my old theme broke.  So that had to be fixed.

The upgrade was pretty pain-free thanks to WordPress’s infamous 5-minute install and upgrade script.  (I tested it out first, of course, on my localhost machine using XAMPP.)  The only thing that I missed was matching the database character set encoding.  It was set to ISO-8859-1 (Latin-1) rather than UTF-8 (Unicode) so there are still a few odd character combinations on the blog that I need to track down.

Batch categories

WordPress now has tags.  Back it the day it only supported categories so I, like many other WordPress users, created tens of categories to organise what I was writing about.  I had 88 categories.

I found a tremendous plugin called Batch Categories which let me quickly (by which I mean over the course of two days, rather than weeks if I had to edit each post individually) move groups of posts from one category to another, and also add tags to groups of posts.

So I took the easy route of replacing most of the categories I had with tags and rationalising my categories down to nine:

  1. Books
  2. Computer
  3. Family
  4. General
  5. God Project
  6. Mah Jong
  7. Music
  8. Psion
  9. Web

Next …

I’m really keen to redesign my blog theme but I’m going to hang off on that for the time being.  I’ve got a couple of other things that I want to complete first.

CSS framework

The first thing is to complete work on what started as a plugin for the Blueprint CSS framework and which is now turning out to be a combination of different parts of my favourite CSS frameworks.

Website redesign

Once that’s done I’m going to work on a complete reworking of my main website www.garethjmsaunders.co.uk.  The last time I did any serious work on it was, I think, probably around 2003.  The code has a very serious dose of ‘classitis‘.

One of my biggest drivers is the number of emails and telephone calls that I still get for information about and software for the Psion range of PDAs.  I want to create some space for myself by putting a lot more of that information on my site, in a way that it can be found more easily.

Getting the WP-Syntax plug-in to work in WordPress 2.0.x

Plugin
Vintage socket photo by porah

I was looking for a WordPress plugin for code syntax highlighting that would work in the legacy WordPress 2.0 branch and discovered WP-Syntax which promised to do the trick.

The system requirements say

  • Requires WordPress Version: 2.0 or higher
  • Compatible up to: 2.7

Except that when installed on a WordPress 2.0.11 installation it threw up an error:

Fatal error: Call to undefined function do_action_ref_array() in \blog\wp-content\plugins\wp-syntax\wp-syntax.php on line 106

Tweaking required

It looks like that plugin doesn’t work in WordPress 2.0.x without a little tweaking. The exceptional WordPress Codex came to the rescue — if only all content management system documentation was that good.

This function is identical to do_action

So I tweaked the code and removed:

106
do_action_ref_array('wp_syntax_init_geshi', array(&$geshi));

and replaced it with

106
do_action('wp_syntax_init_geshi', array(&$geshi));

and lo and behold it worked!

Smarter web design article in .net magazine

Smarter and faster web design

The current edition of .net magazine (October 2008, issue 181) has an interesting feature article entitled “Smarter and faster web design”.

Magazine writer Craig Grannell promises “you don’t need to work harder, or for longer hours, to get better results. You just need to work smarter!” A sucker for productivity tips here’s my take on what he has to say:

1. Get away from the computer

This is one my favourites, and one that I use all the time. Well, not all the time, otherwise you’d never find me at my desk!

Lateral‘s Simon Crab offers this thought:

“… today’s web designers have a subconscious belief that the computer will provide an answer as long as they sit in front of it for long enough”

Instead of sitting staring at your design software of choice (Photoshop, Paint Shop Pro Photo, Publisher, Illustrator, Visio, etc.) he suggests going out and get a different perspective on the world. Go to exhibitions, browse magazines at the newsagent, walk around and look around you.

I can’t remember where I first learned this, but it’s been really helpful advice. Get inspiration from other non-Web environments. I’m forever ripping out pages from magazines, scanning them or simply gluing them into a scrapbook. I’ve found inspiration in books, magazines, TV, architecture, fashion, nature … step away from the computer!

2. Explain the idea to a non-techie

I don’t know how many times Jane has patiently sat and listened to me wittering on about some design idea, and then pondered carefully as I finish with the killer question “Does that make sense?”

Crab notes:

“A foolproof test is verbally explaining an idea to a non-designer. If you can’t succinctly explain a concept and get across how it will look and feel, it’s probably not a great idea.”

3. Paper and a pen

This was a tip that struck a chord with me: use simpler tools. Don’t rely on massive, expensive software applications. Get back to basics.

I have a home-made pad of A5 paper next to me on my desks, both at work and at home. Any scrap A4 paper that would otherwise go into the recycling box gets ripped in two and bound together with a foldback clip.

The next bit of advice is from usability guru Jakob Nielsen:

The most important tools for a smart designer are a pen and plenty of paper. This is all you need to do user testing — no fancy lab required. Just sit next to a customer as they attempt to use your website.

Mock things up on paper first. Show it around. Get the big things right first, before you waste time writing code that might never be used.

And for those who say “I can’t draw” advice from GapingVoid:

They’re only crayons. You didn’t fear them in kindergarten, why fear them now?

4. Simpler software

37signals founder Jason Fried:

[Our software products] do a few things really well and get out of people’s way. And when products do a few things really well, they’re more pleasant to work with, and easier to learn and understand.

Find software that does this for you. A few of my favourites:

I use these applications again and again for specific tasks because they’re quick, simple to use and reliable. I’ve got other, bigger applications that will do these tasks but these do it for me quickly.

5. Getting Things Done

Interesting advice from Khoi Vinh from NYTimes.com about GTD:

Unless you really feel GTD is perfect for you, don’t bother. It’s over-rated and just about the (admittedly satisfying) pleasure of organising a system for getting things done, rather than actually getting things done.

I can see that, but I would also say: don’t reject it simply because it doesn’t work for other people. Give it a go, and adopt the things that do work for you, such as a zero-inbox policy.

I was impressed with Andy Budd’s approach to email. He answers emails that take under five minutes, deletes the junk and then files the rest in folders with titles such as:

  • Action
  • Hold
  • Respond
  • Waiting

I’ve been inspired to try something similar.

6. Reuse code

Re-use tried and tested modules of code, for example:

  • Frameworks for CSS, PHP, JavaScript
  • Base it on the default WordPress code (clean, valid and well-structured code)
  • Create your own library of code (many code editors allow you to store these as snippets)

I loved Edward Barrow’s reason for using prebuilt libraries:

He likens using a prebuilt library to “getting an expert programmer to work on your project for free”.

Whenever I do something new I now ask myself whether this is something that I’m likely to need again. If it is I’ll store it as a snippet in WeBuilder 2008, my main code editor.

I categorize everything and have folders and subfolders in my code library arranged like this (I’ve expanded the HTML folder):

  • Apache
  • CSS
  • htaccess
  • HTML
    • !DOCTYPE
    • Basic Tags
    • Elements
    • Forms
    • IE Conditionals
    • Meta
  • JavaScript
  • jQuery
  • Lorum Ipsum
  • Microformats
  • PHP

I’ve got all sorts of goodies in here, that I don’t have to go searching for because I know they are there at my fingertips.

7. Source control

Before I discovered Subversion I used to create my own version control system. But I ended up with umpteen files and folders along the lines of:

[backup-070620]
[backup-070621]
index2.html
index3-test.html

It got ugly, and if I made a mistake or needed to roll back to a previous version I couldn’t very easily do it. I then discovered FileHamster but I couldn’t quite get the hang of it. I found it a little too intrusive.

I was then introduced to Subversion, and discovering that you don’t need to incorporate it into Apache server I installed the Subversion server onto my PC at home and it’s been great! I use the TortoiseSVN client.

Quoting once again from the article in .net:

“In fact, the simplest and smartest investment you can make for any project is to use some sort of version control system,” says Aral Balkan, web developer and conference organiser.

What are your tips?

What are the tools, tips that you find most useful, that make you most productive?

Nearly there … developing a WordPress theme


Nearly there with WordPress on 12seconds.tv

Today … yesterday … and the day before … in fact, why didn’t I just say “This week…”?!

This week I’ve been playing around with WordPress, trying to work out how best to get the navigation for a site that I’ve been tinkering with — for about two years now” — to work with the least amount of effort.

The site is for the Christian Fellowship of Healing (Scotland), and after much faffing about trying to decide which content management system to use (Joomla!, WordPress, Drupal, ExpressionEngine …?) I’ve finally come to my senses and settled on the mighty WordPress.

So now I’m working on converting my design into a static HTML page, and from there into a fully-fledged, working WordPress theme.

And I’m nearly there. Not least because WordPress has come on in leaps and bounds since I last developed a full site with it. When I last built something big it was with version 2.0.0.8 — we’re now at 2.6, which represents an enormous jump in functionality and usability.

I’ve been playing around with a number of themes making sure that the navigation works as I intend it to. Let’s hear it for:

  • The WordPress wp_list_pages() function.
  • The default wp_list_pages() classes
    • .current_page_item
    • .current_page_parent
    • .current_page_ancestor
  • er…
  • that’s it!

The trial continues tomorrow …

Book on WordPress theme design

Packt Publishing have a new book on WordPress theme design:

“This book walks through clear, step-by-step instructions to build a custom theme for the WordPress open-source blog engine.

The author provides design tips and suggestions and covers setting up your WordPress sandbox, and reviews the best practices from setting up your theme’s template structure, through coding markup, testing, and debugging, to taking it live.

The last three chapters cover additional tips, tricks, and various cookbook recipes for adding popular site enhancements to your WordPress theme designs using 3rd-party plugins as well as creating API hooks to add your own custom plugins.

Whether you’re working with a pre-existing theme or creating a new one from the ground up, WordPress Theme Design will give you the know-how to effectively understand how themes work within the WordPress blog system enabling you to have full control over your site’s design and branding.”