Category Archives: Wordpress

A few brief things

Some people aren’t so happy about Google suggest… certainly not Eric Rice, who gets his name listed with words like “child molestor”. Wouldn’t be delighted about that, myself. (via the G’Day World podcast)

New version for WordPress (minor fixes) (hopefully it fixes the thing where if you forget your password and need it mailed to you, it sends it in some incomprehensible encoding format that can’t be read… at least not on any web or Windows email client I have access to).

New version for Trillian (major new release). Haven’t had the chance to try it yet… no time Bellamy, no time.

WordPress siteurl/path bug

Today geekrant.org’s stylesheet was fading in and out of existance. Well, to be precise, the path to it got screwed up a bit, because somehow it thought it was in a directory called (deep breath):

http://www.geekrant.org/wp-login.php/wp-images/smilies/ wp-images/smilies/wp-images/smilies/wp-images/smilies/ wp-images/smilies/wp-images/smilies/wp-images/smilies/ wp-images/smilies/wp-images/smilies/wp-images/smilies/ wp-images/smilies/wp-images/smilies/wp-images/smilies/ wp-images/smilies/wp-images/smilies/wp-images/smilies/ wp-images/smilies/

rather than the much more succinct (and correct):

http://www.geekrant.org/

This appears to be caused by a bug in WordPress 1.21, where under some circumstances registered users go to login, and a particular browser/server configuration is present (looks like something to do with proxies) and it thinks the WordPress directory has moved, and tries to compensate. It’s detailed in the WordPress support forums, and if anybody’s having problems with it, the fix is to manually fix the siteurl setting in the wp_options table (it’s the first row) and to get into wp-login.php and comment out the two lines following

// If someone has moved WordPress let’s try to detect it

…because really, if someone’s moved it, they should have done it properly and updated the siteurl setting themselves.

See, not even WordPress is perfect. But it does have a strong user community, open source code that’s not too confusing to dabble in even for PHP-newbies like me, and a straightforward database structure holding all it’s stuff together. And that counts for a lot, I think.

Protect WordPress against comment spam

I was asked to go step-by-step through how to protect WordPress from the current rash of spam comment attacks, so here it is. It’s fairly easy to get them to go into the moderation queue, but it’s a pain having to continually clear it out.

The way the current attacks (hold ’em poker and so on) are working is to attack a file called wp-comments-post.php which does the grunt-work of posting comments into the database… if this isn’t there, they can’t do it.

So first rename wp-comments-post.php to something else. Doesn’t really matter what, as long as it doesn’t clask with anything else. eg xyz.php. (It’s not ever seen by users so it really could be called anything without confusing people, though you might want to avoid confusing yourself if you later can’t remember what it is.)

Then you need to edit the files that call xyz.php, which are:

  • wp-comments.php
  • wp-comments-popup.php
  • wp-comments-reply.php

Save all those files to your server, and make sure the original wp-comments-post.php file is deleted, and then you should be done. Post a comment yourself to make sure it works.

For now it seems to stop the spammers… no doubt in future they’ll figure out something more advanced (like scanning the <form> code to figure out the name of the post file), but it should stop them for a little while at least.

RSS

XML feeds are the fashionable thing these days. Something like it almost showed up with Active Channels in IE4, but it’s taken RSS (and to a lesser extent, Atom) to grab a foothold for it to really take off. Anything half-decent has it, and the number of hits that most blogs get from RSS readers is ever-increasing.

One of the questions to ponder when setting up a feed for people is this: Do you provide your full content (at least of recent items), kit and kaboodle in the RSS feed, or just summaries? Pushing everything out uses more traffic (not a problem unless your site is very well-read) but gives people the convenience of reading everything in their RSS reader. Conversely, if you’re trying to get people onto your site (for whatever reason; to get people to see your adverts is important for commercial sites) you’d probably lean towards summaries.

My blog provides everything, because it was set-up this way when I was playing with it, and when I inadvertantly switched it to summaries during a WordPress upgrade, people used to reading it all quite rightly complained, so I switched it back.

This site uses summaries. (WordPress provides the first X words of an entry, or a specific Summary field if it’s filled in.) While we’re not commercial exactly, it would be nice to get enough Google ad revenue to at least cover the hosting fees. For this, you need people visiting.

We’ve had some comments about this, expressing the view that this is a Bad Thing as it discourages readers who like to read everything from their RSS readers. That’s probably true for some people — unless the summary (human or computer-provided) is compelling enough, they won’t visit. But do they bother to visit if they can read everything from the RSS reader? Maybe if there’s pictures or they feel compelled to leave a comment. A visit is only a click away, after all.

For now, we’ve decided, like an aging 80s rocker clearing out his CD collection, to keep the Status Quo, but do a little tweaking of the feed to provide more text in the auto-summaries. Hopefully there’s enough interesting content appearing here to keep people coming back.

Okay, we’re running

Obviously in a geek blog, you should blog about how the blog got setup.

Domain name. Geekrant.com and .net were already taken, but .org was free. I registered it with Gandi. They’re a French company, have been around for a while. I think I first encountered them some years ago in a list of domain registrars. At the time they were up near the top of the recommended registrars not only for being reasonably cheap and reliable, but also for having a domain registration policy that precluded all sorts of the kind of legal mumbo jumbo that some other registrars had at the time, which theoretically gave you rather less than complete control over your domain. Whatever the reason I originally went with them, they’ve been good over the years, and provide useful stuff like free domain and e-mail forwarding. At 12 Euros a year, perhaps not the cheapest around, but reliable and quick. Quicker than I thought, actually. I assume Those In Charge have improved the speed of new domain propagation over the last few years, because everything seemed to be done after a couple of hours.

Hosting. The hosting is at Aussie Hosts, a mob in Brisbane who specialise in shared hosting on Linux, and using the Plesk7 web site control software, which is frikkin’ marvellous. I’ve never come across a web control panel quite so useful and user-friendly. It does everything, and is light-years ahead of most of the other very clunky web control panels I’ve seen.

Software. Installing WordPress is dead easy. Upload the files into the http directory, create the MySql directory and its user in Plesk, then run WordPress’s install script. That’s it. It creates all the tables, creates the initial user, and away you go. Then I logged-on to WordPress and created the users, set the various options like comment spam parameters, and structure of permalinks. For the latter it tells you what your .htaccess needs to look like. You just paste it into the file and you’re done. (Admittedly it shat itself the first time I tried it. I wiped it out, and tried it again a bit later. Not sure what was different the second time, but it worked.)

Template. For WordPress’s templates, you basically need to edit: index.php (the main page), wp-layout.css (the stylesheet), and wp-comments.php (the comments section, which for some reason WP’s default installation has quirks like the caption for the comment fields appearing after the fields themselves. Wacky). I’m not entirely a master of CSS yet, so I just fiddled with the fonts and colours, and fiddled a bit with the links and so on. I’ve messed the template up slightly — right now the XHTML validation gets a thumbs-down. Will fix that when I get the chance to look at it.

We started creating a (perhaps over-ambitious) hierarchy of categories for articles to fall into. Hmm. Probably should have just copied out of DMOZ or Yahoo or something. (Just the hierarchy that is. If you look around, it’s incredible the number of directory sites that have swiped content completely from Yahoo.)

Also created a basic logo in my trusty old copy of Corel Photopaint, added in a Google advert to try and recoup some of the hosting and domain name costs, and that’s about it for now. Further fiddling can (and no doubt will) come later.

Excuse the dust

Welcome to Geekrant.org. Still getting things setup. The idea came yesterday when mucking about with MamboServer. Mambo is a fine product, with a lot of cool features, and was in contention for a web site of mine. But yesterday it finally dawned on me that Mambo doesn’t allow a post to sit in multiple categories. That just plain sucks. Along with the URLs it spits out, some of which are what they call “SEF” — Search Engine Friendly — but are in no way human-friendly, that was the nail in the coffin. That site’s going WordPress instead.

Like this one. And several sites I’ve setup, in fact.

So I e-mailed a couple of mates to ask if anybody wanted to join in. Josh reads his mail every few days when he’s not at work… no doubt he’ll get back to me sooner or later. But Tony’s in. That was good enough. A few hours later, the domain is registered, WP’s setup, and it’s all systems go. Idea to web site in less than 24 hours. Not bad.

Well, apart from little things like the site design/CSS/template. Yeah. Well. All in good time.

So what is this? A place for people to rant or talk about geeky stuff. Issues they’ve come across, clever things they’ve done, wondrous things they’ve discovered.

More later.