WordPress Woes

Posted 2009.11.20 13.13 in Computers/Internet/Technology by Stephanie

All in all, wordpress seems to be a very fine blogging and CMS platform. I’m generally pleased with it. There are just a few things which drive me up the wall.

Today there are two things which have been bothering me for a while. First is emails – I’m supposed to get an email when there is a new comment, or a comment awaiting moderation. That worked at first, some long while ago, but then it just stopped working one day. I also have this ‘subscribe to comments’ thing which is supposed to let commenters get an email when there’s a follow-up comment, but I figure that stopped working too – if it can’t email me, it probably couldn’t email anyone else either.

So today I finally got frustrated enough to do some digging and debugging. First thing I found was the PHP mail() function. Appearantly this was the culprit and needed to be tested. I tested it, and it worked like a charm. No problem. Hmm. More digging, more debugging.

It seems that perhaps with WordPress 2.8, someone decided that the mail() function was a wheel that needed re-inventing. So some low level behind-the-scenes thing that was hardly worth mentioning got tweaked, and mail stopped going out. I know this didn’t just affect my blog or my server, since there are dozens and dozens of threads, support queries,and me-too comments about other peoples’ blogs no longer sending mail.

Anyhow, I got a bigger stick, poked at it some more, and now finally it seems to be emailing again. Halleluya.

The other thing that is still bugging me, is a bug in the sidebar calendar.

From what I can tell, it only manifests when looking at a single-post page or an archives. Not a static page, not the home page. I just noticed it this month, where the first of the month is the first day of the week. For some reason, the padding is out of whack and buggers up the first line of the calander. It seems to affect other months at random though, with wierd results:

09-June 09-November

I can’t figure it out. I’ve checked and double-checked my theme files, I can’t see anything in there that could possibly be messing with the calendar. Yet everything else works. I’ve found that other people have reported the same problem, but without resolution.

I think there’s something buggered in the core WP files, but I can’t figure out what, or why it doesn’t affect other people. This one still has me stumped, and is going to be bugging me all the rest of November.


  1. Stephanie says:

    Further research shows it is something wrong in the get_calendar() function, or rather, something is causing that function to behave incorrectly. It is blog-specific and not theme-specific. If I switch to the default theme, the problem persists. Yet another blog running on the same server and the same version of WordPress does not exhibit this problem.

    I have tried deleting the calendar widget and all its database options then recreating it new, and the problem persists, so I know it isn’t a corrupted option record.

    All I can think of now is that it might be due to a problematic plugin, so I’ll have to disable them one at a time to find out if that solves it.

  2. Stephanie says:

    Well it doesn’t seem to be a plugin problem either – I’ve disabled them all one-by-one and it still doesn’t work right.


  3. Stephanie says:

    HAHA! I fixed it! You bastards!

    It was a timezone issue, and I choose to blame those wankers who keep screwing around with standard time versus daylight savings time!

    In the file wp-includes/general-template.php is this line:
    $unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);

    That sets the $unixmonth timestamp to 00:00:00 on the first day of the current month, current year. But with going back and forth from GMT to local and local changing by an hour, it meant that for some retarded reason, the timestamp would sometimes, seemingly at random, be off by an hour – meaning that what it thought was midnight Nov 1st was 23:00 on October 31st, and so on.

    So I changed the line to read:
    $unixmonth = mktime(2, 0 , 0, $thismonth, 1, $thisyear);

    So now it’s 02:00 on the first day of the month, and whether the timezone is forward or backward by an hour it won’t matter.

    Why did this only affect some blogs and not others? Why did it only affect single posts and archives instead of the whole blog? Who the heck knows. It’s computer voodoo, programming in the black arts. All I know is it seems to work, until the next wordpress update.

Leave a Comment