WordPress MU 2.7.1

WordPress MU is a multi user or multi blog version of WordPress that can be used to run sites like WordPress.com.

This release of WordPress MU has been much delayed but I think it’s been worth the wait. Included in this release are a number of new features and many bugfixes. Get it from the MU download page.

Update! In the final rush to get this post written I neglected to add that this release fixes a vulnerability in the importer system that would allow an untrusted user to run PHP code. Thanks to Alexander Concha for discovering the vulnerability and to Barry Abrahamson who recognised that some servers treat unknown file types as PHP scripts.
One more reason to upgrade.

New features and changes include:

  • A revamped plugin system thanks to Andy Peatling. Plugins installed in the plugins directory rather than mu-plugins can be activated and deactivated on all blogs with one click.
  • The admin bar was removed. It’ll be stuffed into a plugin instead. Must talk to Viper007Bond about that.
  • A new “My Blogs” page where a user’s blogs are listed and personal “per blog” settings can be configured. It’s empty right now but it’s easy to add settings to it via plugins. Imagine having a different “Display Name” on each blog you write on! See SetupMenu and HandleFormPOST in the just removed admin bar for example code. That code uses actions rather than filters but it’ll get you started.
  • The site admin can now set a Global Dashboard blog for users who don’t have blogs. Those users will be added to this blog rather than the main blog. The default role of users on that blog can also be set but if they’re not “Subscribers” they won’t be moved if you change the Global Dashboard.

They’re the major changes. Smaller changes include notification of failed blog upgrades [1728], MU will now ignore free space checks when importing posts [1725] and lots more. Check out the timeline for further details.

If you’re running WordPress MU 2.7 you can upgrade from inside the Dashboard. The system will notice that a new version is out and will lead you through the upgrade process, just like in regular WordPress. Plugins can be updated as well through the familiar plugin upgrade process as long as your plugins are hosted on the WordPress.org Plugins Database.

As always this release would not have been possible without the help and encouragement of many people along the way. I know I’ll leave out someone if I try to list everyone but I appreciate all the help people give working through tickets, and helping on the forums.

PS. WP Super Cache was updated today too. New features include an option to stop caching for logged in users, it doesn’t cache previewed posts, and it displays cache size summary information on the admin page now.
PPS. Happy birthday Adam! 2 today and Dad’s finally getting away from the computer now! 🙂

WordPress MU 2.7.1 beta 2

WordPress MU is a multi user or multi blog version of WordPress that can be used to run sites like WordPress.com.

The 2.7.1 release is very close now. I have just uploaded wordpress-mu-2.7.1-beta2.zip for your enjoyment.

2.7.1 has taken longer than usual to come out, mainly because of the large number of bug fixes and new features in this release. Highlights include:

  • A revamped plugin system thanks to Andy Peatling. Plugins installed in the plugins directory rather than mu-plugins can be activated and deactivated on all blogs with one click.
  • The admin bar settings can be customized by any user for each blog via the “My Blogs” page. The code here is still rough, and may not make it into the final release. Please help clean it up!
  • The site admin can now set a Global Dashboard blog for users who don’t have blogs. Those users will be added to this blog rather than the first one.
  • And many more bugfixes you can read about on the MU Timeline

I think this release is just about good enough to put on a production server, but test it first on a development server and backup your old install if you’re really paranoid. All I’ll guarantee is that this software will take up space on your server. I need your help to test it.

If you’re a jQuery fiend or CSS styling guru, your help with the “My Blogs” page would be very much appreciated. My ugly code hides settings that aren’t relevant, but the page isn’t pretty. Use Trac or contact me through this site if you have ideas or code to contribute.

I’m glad to say that once MU 2.7.1 does come out. Upgrading from 2.7 should be as easy as clicking the Upgrade button in the dashboard. I tried upgrading from 2.7 yesterday and my test server upgraded itself after 1 or 2 false starts.
‘Course, if you’ve modified core files (naughty!), those changes will be overwritten and you’ll have to manually upgrade.

Thanks to everyone who helped me with patches, code snippets, ideas and with ticket updates on Trac.

Wireless Nunchuck Adapter Review

My latest gaming purchase last week was MadWorld for the Nintendo Wii Console. It’s a horribly violent and bloody beat-em-up and saw-em-up and gauge-em-up and .. you get the idea.
Everyone’s raving about it but after playing it for an hour or two I feared I’d snap my Nunchuck and Wiimote cable because one of the actions in the game calls for the player to err, snap the controls apart and something indescribable happens on screen. Someone loses their head, and they’re not angry! It certainly deserves the 18 cert,

Gameware Wireless Nunchuck Adapter Last weekend I popped into Game for a look around and spotted the Gameware Wireless Nunchuck Adapter for a reasonable €12.99. Not bad. I also bought a Wiimote charger but I’ll blog about that at a later stage. Can’t have too much excitement in one post now can we?

The box contained simple instructions, the adapter itself, and a small square transmitter/receiver you place on the end of the Wiimote (requiring a good tug to remove again!) It doesn’t include the Nunchuck. The adapter takes 2 AAA batteries. The Nunchuck fits snugly into the top, plugs in at the bottom, and the the cable is wound up at the back neatly. Press the little transmit button to connect it to the Wiimote and a little red light flashes on both.

Gameware Wireless Nunchucck Adapter

The first game I tried with it was Call of Duty, World at War (Get it! It’s a great game!) For the most part it’s fine and it’s neat not having the cable knocking against you as you play. If I can fault the adapter, I found that sometimes when pulling back on the Nunchuck joystick, the Nunchuck slid back slightly. It’s a snug fit, but could have done with some restraining plastic to hold things in place better.
Also, it you have overly large or small hands it might cause problems too but that’s a minor niggle.

MadWorld was more fun with the Wireless Adapter fitted to the Nunchuck. No worries about breaking cables any more! I still can’t recommend buying the game though. It got repetitive quickly, I spent my time bashing buttons desperately and wondering how I killed the end-of-level bosses.

MadWorld gets a thumbs down from me, but the Wireless Nunchuck Adapter from Game gets a thumbs up! 🙂

The new Commodore 64 laptop

sx-64_build This isn’t the first time a Commodore 64 laptop has been made but it’s probably the coolest one. Commodore’s original SX 64 was built in 1984 and featured a tiny 5 inch CRT screen with a hardly portable body weighing in at 10kg!
I actually saw an SX 64 years ago in Cork Micro, the small computer shop run by the late Sean Bossang in Cork.
A couple of years ago there was the Picodore, a tiny little laptop built from the innards of a C64 DTV joystick. The keyboard’s a little small for my tastes though!
c64_hero And finally, Benjamin has created a real, “normal sized” laptop from the motherboard of a C64C, the final version of the C64 built by Commodore.
It uses the original keyboard too, and “1541-III DTV” to emulate the original 1541 disk drive. This device takes FAT32 formatted SD cards so you can copy D64 images from your PC on to it, insert the card in the laptop and load them immediately. Judging by the movie below, he needs an Action Replay cartridge or something to speed up loading. The emulated drive emulates the slow loading of the original drive too well methinks.

Nice to see Thunderblade make an appearance. I’m sure I have the original C64 tape of that game around here somewhere..

More info on Ben’s post.

Three links for WordPress developers

  • WordPress Coding Standards. I used to be a big fan of the “curly bracket on it’s own line” but many years ago that was beaten out of me. Coding standards can be a subjective preference, but they’re very useful when reading code created by others.
  • Data Validation. It’s vitally important that the data your web application accepts is checked for any malicious code. The new $wpdb->prepare() function is something every WordPress plugin author should be using if they have to use the database directly.
  • WordPress Nonces. A nonce makes sure that a request you’re sending your blog was one you meant to send. Without a nonce, another site could have your browser load an image on it’s site pointing at your blog’s admin page to do an administrative task. You don’t want another site fooling your browser into doing something malicious do you? See Cross-site request forgery on Wikipedia for more.

If you write plugins for WordPress, please take the time to read through those pages above and learn how to use the security tools on offer. I know of at least one very popular WordPress MU plugin that doesn’t use nonces and I’ve only looked at the code of a couple of them. Most plugins don’t use $wpdb->prepare() yet as it was only introduced in recent versions of WordPress.

As a user of Free Software, you already know that “Free” doesn’t mean “Free as in beer”, it’s “Free as in speech”. If you know anything about software development help plugin authors by looking over their shoulders and checking their code. There is a cost to everything. In Free Software that cost is helping to test or fix bugs in the software you value and enjoy.

PS. WordPress MU 2.7.1 beta 1 is out, as is WP Super Cache 0.9.3 which has even more fixes for those running the latest PHP5 builds. Bloody register_shutdown() and it’s object destruction caused me no end of grief debugging that.

PHP is_numeric() vs is_int()

Some lessons you don’t forget, but this one I did because it doesn’t come up very often.

Don’t use is_int() because, as Jeremy says, it’ll lie to you. Use is_numeric() instead.

Copy the following chunk of code into a php file and run it. You’ll be surprised at the outcome:

$t = "12345";
if( is_int($t ) ) {
    echo $t . " is an int!";
} else {
    echo $t . " is not an int!";
}

The problem is that is_int() thinks a string of numbers is a string, not an integer. The is_int() man page has an example illustrating that but it’s easy to miss. That function should carry a public health warning!

There’s also the ctype_digit() function too but it has it’s own gotcha:

Note: This function require a string to be useful, so for example passing in an integer will always return FALSE. However, also note that HTML Forms will result in numeric strings and not integers. See also the types section of the manual.

Kylie Minogue does Monkey Man

Well, this was a nice start to the day. Yesterday morning I heard a catchy tune coming from the living room so I popped my head in to see Kylie singing with “The Wiggles” on NickJr. They covered Monkey Man by The Specials and I have to take my hat off to Miss Minogue. Wow.

The song is full of energy, it’s happy, it’s got that “get up and go” feel. My foot was tapping as I listened. Who knew Kylie Minogue could do Ska? Dare I say it, but she does a better job of it than The Specials?

The naked Brian Cowen

Earlier this month someone walked into the National Gallery in Dublin, Ireland and hung a nude painting of our illustrious leader, Brian Cowen, in the “National Portrait Collection” section of the gallery.
Another painting was hung in a nearby gallery. More details can be found on this Tribune article.

Brian Cowen

Brian Cowen

All a bit of fun right? Sure, nobody wants to see a satirical nude photo of themselves hung up in public but the pictures were only on display for a short time. One or two newspapers reported on it and the national broadcaster, RTE, carried the following report on Monday night:

I never saw the original news clip. I was barely aware it had happened until this morning when the blogs and twitter were all alight with talk of the apology RTE broadcast last night. They also removed the news clip and article from their site.

RTE has to apologise and be censored for reporting the news? What sort of country are we living in? If Fianna Fail had let things lie all this would have blown over and be forgotten by now.

Ray D’Arcy speaking on TodayFM (a private national radio station) revealed the painter is Conor Casbey yesterday, but he wasn’t the one who hung the paintings. After the show yesterday a Garda called to the TodayFM offices looking for the email of the artist to caution him. The request was refused. Ray admitted that if the Garda hadn’t called he wouldn’t be talking about the paintings today.

More coverage by Irish bloggers:

Grandad has a different viewpoint. Brave of you 🙂

Control of the media is essential at this time, lest they say something negative about His Holiness. In fact, the Director General of RTE should immediately be reassigned to a menial task in the Ringsend Sewage Station as a lesson to the rest of those who would speak ill of our Great Government.

We must all revere and adore His Godliness for his inspired leadership in this time of crisis. Nothing negative must pass our lips.

The North Koreans have the right idea.
cowanposter

(Great caricature by Alan Cavanagh)

So, next time you see something funny about Gordon Brown or Barack Obama be glad you don’t live in Ireland. Spread the news. Check out #picturegate on Twitter.

PS. Many many more blogs are covering picturegate now but take a look at this thread on Creative Ireland. Great photoshopping going on there! (Alastair)

cowen-1

Crash Different

An oldie, but as they say, “a goody”. For all the Mac fans who are sick and tired of their computers crashing. (Hey Mark!)
Found this on a CD while sorting through my CDRs and music collection. Most are now ripped to MP3 and the physical media is heading into the attic for safe storage.

Why is it that most of my compilation CDs are from about 10 years ago? Does music become less relevant the older you get? I’ve never bought music online but if I do, Blue Lights on the Runway by Bell X1 will probably be the first album I buy. Love “The Great Defector”, their current single.