Archive for December, 2005

What’s Not Gonna Work in WordPress 2.0

Monday, December 19th, 2005

The most often asked question regarding WordPress 2.0 is, “When is it coming out?” Well, that’s going to be this week.

The second most often asked question regarding WordPress 2.0 is, “What is changed?” I think I wrote about that before.

The third most often asked question regarding WordPress 2.0 is, “Will my plugins and/or themes work?” Uh…. Possibly?

This is also known as the dreaded question, “In what way is WordPress 2.0 going to break my site and cause me hours of upgrade pain without someone to whom I can whimper, ‘Please, make it go again.’?”

This post isn’t going to make that question much easier, but I may provide a toll-free support number for handling these issues before the week is out.

There is a user-supplied list of plugins that will/will not work with WordPress 2.0 over on photomatt’s Codex user page. I hope that this page gets rolled into the main site soon because it’s a little off the beaten path.

Here’s the good news: Themes are probably OK. Unless your theme was doing something crazy before, it’s probably going to work after the upgrade. There have been a lot of new plugin hooks added to the 2.0 version, but it doesn’t seem like anything made it into the theme system that would cause it to break.

The theme system does allow for a custom plugin-like set of functions to be loaded. WordPress will automatically load a file named functions.php for any theme that includes one. This is done in the same way that plugins are loaded, and allows themes to supply their own custom features, including both output functions and configuration pages.

Also, themes should now come with “thumbnail” images (I say “thumbnail” in quotes because they’re actually more the size of your palm, but…) that will be displayed in the admin. If your theme doesn’t have one, it’ll simply show a blank box.

A theme that doesn’t have either one of these should load just as it did in WordPress 1.5.2, but won’t have those additional features.

Plugins are another question, though. There are some specific sections of WordPress that have been heavily revised. If you use a plugin that integrates into one of these sections, it will probably not work. Specifically, the permissions and capability sections will be a bear for plugins that are affected by user levels.

If you are running a “view level” plugin - something that restricts a reader’s permissions to access certain posts - I’ll say straight out right now that unless you’ve got a brand new version (and I know of no author who has written one of these plugins that is offering an updated version) it’s not going to work. If you have an update, comment here - I’m looking for it myself.

One often overlooked aspect of this is that any plugin that uses an admin page will need review. The function call that adds custom admin pages used to require a user level number. It now requires a capability name. Now there are some backwards-compatibility checks for user levels in there, but they may obviously not work as well as something specifically designed to work with the new capabilities system.

Also in the administration area, if you are using a plugin that hooks into the editor, you may have issues with it. This is particularly so if that plugin adds buttons to the Quicktag toolbar, since the new default is to use the WYSIWYG editor, which does not use the same toolbar.

I have written the buttonsnap class, which lets plugin authors add buttons to both editors very easily. It’s not a plugin itself, but a library that makes it very simple for plugin authors to create buttons in either editor with a simple, single function call. Still, the plugin will have to be rewritten to use my library or some other solution if it’s going to be effectual.

If your plugins use DOM to insert new elements into the user interface (pretty much any plugin that adds elements is using DOM to do it) then it may need to be updated to account for changes there.

The Upload page in the admin is gone. If your plugin altered or attached to that page, it won’t be any more.

Generally speaking, you’re going to need to procure write access for your server to the /wp-content directory of WordPress. That means you have to allow your server to write files into that directory from scripts. This will allow things like caching, image uploading, and the bundled backup plugin to work as they should, although your host may not like it or allow it (most hosts will, but you should check), and you might not consider it secure to leave all of the subdirectories there in that state.

You should verify with someone you trust concerning the permissions you intend to use to provide the access to your server that you want to provide.

What should you do if your plugin doesn’t work?

Panic.

Nah, just kidding. Actually, before you upgrade, compare the list of working plugins against the ones you’re using. If your doesn’t appear in the “known working” section of list, you need to talk to someone.

Your best bet, if you can find contact info, is to badger the plugin author. Barring that, you can try any of the standard support channels, but be aware that in the fallout that is bound to occur when everyone upgrades, your 3rd-party code (code written by someone outside of the WordPress core) isn’t going to be a priority.

I suggest trying WordPress IRC (#wordpress @ irc.freenode.net) and see if anyone there knows how to solve your problem. There is usually someone there that can at least record the issue or forward it on to someone who can start fixing.

I haven’t been keeping up with documentation on 2.0 as well as I should, but I imagine that with the frequency of changes over the past month or two that nothing is verifiably up to date. If you find instructions in the Codex for performing some necessary intrinsic system change, first be sure that the instructions apply to the version you are installing.

Probably the most sound advice I can give you is this: If you have any doubt about performing an upgrade - don’t upgrade! There’s no reason to submit yourself as a guinea pig to test this software, especially if you’re fairly satisfied with what you have already. Granted, WordPress 2.0 is a nice piece of work, but it’s going to be a while before 1.5.2 loses the support of the community at large.

Take your time. Learn from the mistakes of the 500,000 other downloaders. After that, take the plunge.

Remember to backup everything.

Shameless plug: There are also people who can do your upgrade for you.

If any of you developers think of any other “gotchas” in the new system, please leave them in the comments. Thanks!

Otherwise, I’ll see you in WP 2.0 later this week. I’ve got at least two plugins for 2.0 that I hope to have baked for the release. I’m also looking forward to the sleek new WordPress.org site redesign/rebranding we were promised with the new version release.

WordPress and Philly Blogger Meetup Accosted by Santas!

Monday, December 19th, 2005

Ah, the depressing dearth of WordPress meetup attendees this month was quite offset by the Philly Blogger meetup that happened afterward.

First, let’s give props to the gang that showed up, and then I’ll tell you all about the crazy Irish dancing and Santa invasion that you missed when you left early.

This list is mostly copied from the list at Philly Future, kindly collected and posted by Scott, and modified only slightly to point at posts talking about the meetup:

And now, photos, movies, and “Run for your lives! It’s the Santas!”

Well, I showed up way early for the meetup, which was quite shocking. Traffic was not bad on the expressway, since they must all have been gathering around the shopping malls.

Lunch at Fregie’s is always tasty, which surprises me for Bar/Pub fair. The bartender even recognized me - not bad for less than a year of once-a-month meetups!

Two guys showed for the WordPress portion of the evening - Mike, a local blogger, and masquerade, from WordPress IRC and all the way from Dover, both came and exchanged some WordPress discussion. Thanks to everyone who RSVP’ed, even if it was a “No”, since we know you’re still out there. Hopefully being after the holidays you’ll be able to hit our next meetup.

After 3pm, we moved to the back table to sit with the Philly Blogger folks, and the group grew considerably. Perhaps next time I will take the opportunity to mingle more, to avoid being labeled as some kind of techie person. ;p

As usual, the conversation was engaging. It’s nice to be around folks with considered thought that is out of the regular stream of things that I usually think about.

As I said in my previous post, I’ve never seen Fergie’s so busy, but I guess bars in the city on the weekend tend to draw a crowd, especially on the holidays. The evening rolled on and a couple of folks started to leave for other destinations, but that’s when things started to get really weird.

At 4pm they had started the Irish music. The fiddle players kept multiplying through the evening, and I think there were a total of 9 musicians by the end of the night. It was strange because every time I would look behind me, there would be another guy with a fiddle or a drum sitting at that table.

The music was so good that it inspired three folks to spontaneously start Irish step dancing. (Cameraphone Video!) It was unexpected, yet very cool, and we all clapped along to the music and dancing. I’m not a judge as to how good they were, but they were better than I would have done, I assure you, and fun to watch.

Not too long afterwards, the pub was overrun by Santas from the Santacon. Here is the Philly evite, and check out the photos from other cities, since the Philly Santas are obviously still too hung-over to have posted their own photos.

Scott mentioned on Philly Future that there were 30 Santas. The capacity in this bar is 48. Yes, the place was actually freakin’ packed with Santas and their helpers, elves, and Miss Clauses alike.

Need photographic evidence? Thank goodness for my Treo, or there might be only our word of this strange occurrance.

Fortunately, the Santas left before we did, and we didn’t have to worry about the reindeer or sleighs causing any traffic issues when we were leaving.

Ahem.

I didn’t leave until around 9pm to pick Pat up from the airport. That’s a hella long meetup, and a roaring good time. Hopefully next month’s is as grand. Thanks everyone for coming out, see you next month!

Interview with me and Matt: Blogging, WordPress, Business.

Friday, December 16th, 2005

Tom Raftery has published his interview with me and Matt Mullenweg. He talked to us last Monday on various subjects related to WordPress, commercialisation, plus blogging in Ireland, business blogging and others. You can download and listen to the interview on the above site.

Philly WordPress Meetup - THIS SATURDAY, Dec. 17

Tuesday, December 13th, 2005

“What’s this?” you ask. “This meetup is a week early!”

That’s right! The dates have changed to avoid these blasted holidays. It seems like every week we have a meetup there is some holiday like Christmas or Memorial Day or something. So the monthly Philadelphia WordPress meetups are now the third Saturday of the month.

Meetup time is 2pm. Immediately following the WordPress meetup at 3pm (at least, last I looked) is the Philadelphia Weblogger Meetup. It’s mostly Blogspot users, but they’re a fun group of prolific Philly bloggers. It’s nice to see how the others live.

I want to see about moving the meetup to a cleaner venue. I like Fergie’s but it seems that some of the group isn’t down with the dark and smoky Irish bar scene. That’s fine, but I’ll need to find someplace new.

Jim suggested World Cafe Live, and I’m going to drop by over there after the meetup to check out their space. I wonder how much that’s going to cost me. Hmm.

In the future, assuming the group continues to show up, I would like to get some special guests. Maybe I could get them to Skype into the Meetup and answer some questions or tell us about what they’re working on. If you are interested in participating as a speaker, please let me know.

If that pans out, I would like to produce a monthly podcast from the meetup. It would be a summary of topics covered, and everyone could get some mic time, including the special guest. I’m not sure how the format would work, but I think this would be of interest not only for luring more folks into our own den of geekines, but also for getting more people involved worldwide.

Our group caters to a low-techie audience. I’ve answered a bunch of new user questions, and I’m happy to do it. Getting down with the people who actually use WordPress and make it popular gives me insight into how things can be made better for its audience. And sometimes I just like to help.

Many of our unscripted topics are of interest to computer users in general. We don’t talk about WordPress and blogs through the whole meetup. So don’t let that scare you away. If you’re thinking of coming down for a walkthrough of the software, that’s not what this is really about. We can tell you what we like about it, how we’ve accomplished things with it, what we use it for, and what we write about. We can show you some new things, talk about new features, and give you a glimpse at the future. But really, we just like to get together and hang out.

Please join us this weekend for our December meetup at 2pm. Meetups usually last for about 2 hours, sometimes longer. Fergie’s often has live Irish music at 4pm, which isn’t half bad. Come and enjoy!

Matt in Blarney

Tuesday, December 13th, 2005

Matt has been in Cork for the past few days and we’re catching up on WordPress stuff. After mentioning a local beverage, the discussion on his blog has centered around which is better, Guinness or Murphys! I don’t drink either so I’ll let that up to others!
He’s going home soon, but expect a podcast interview by Tom Raftery before the end of the week, and I’ll post a picture later today!
Here it is! A great photo taken by Jacinta outside Blarney Woollen Mills.
Later .. Matt is on his travels again and he’ll reach the US later today. He was a pleasure to have visit as he’s so easy going! The local B&B he stayed in, River Walk, is run by husband and wife, Eddie and Grace and they put on an early morning breakfast to prepare him for the day!
Apart from the B&B, Eddie runs a Bikecraft.ie where he runs motorcycle training courses!

How to Patch WordPress

Saturday, December 3rd, 2005

With the looming release of WordPress 2.0, there are a bunch of folks that are submitting bug fixes that say things like, “I would submit this to Trac, but I don’t know how.”

I think even more people are suggesting that writing to the mailing list with their bugs to “confirm” them is better than submitting them directly to Trac. I suppose if you’re not sure something is a bug, it might be worthwhile to ask someone else (I would ask on IRC at #wordpress on irc.freenode.net) but it really is better to have a formal record of an issue, even if it turns out that what you’re experiencing is expected behavior. If you really fear that it’s something to do specifically with your installation, check on IRC or maybe try a fresh install.

Nevertheless, it might be useful to folks to learn how I do it. I’m not saying my method is correct, just that it seems to get the job done with few complaints from the devs who commit my patches. It’s also a good method to use on Windows. (Sorry, someone else can document command-line Subversion use - not that I don’t know it, I’m just lazy.) Here we go…

Here’s what you need to do to get an environment that is ripe for making source modifications:

  1. Get a WordPress.org Support Forum Login - You need a support forum login to gain access to Trac. Trac is the software WordPress uses for bug tracking, and it shares its login database with the support forum.
  2. Download and Install Tortoise SVN - Tortoise is the best Subversion client for Windows. It will let you get the latest source from the code repository without messing with funky nightly versions.
  3. Install XAMPP - If you’re not already running Apache locally, you’re going to need it. You can test under Microsoft’s IIS (and this is probably not a bad idea considering there are fewer people testing that environment) but if you’re not running Windows XP Pro (not Home), you may find this difficult. XAMPP is Apache, MySQL, PHP and some other thing you don’t need for WordPress all rolled into one bundle.
  4. Checkout a Copy of WordPress - Find the directory that XAMPP is using for its DocumentRoot and right-click on it (or create a “wordpress” directory there and right-click on that). Select SVN Checkout…. In the dialog, use http://svn.automattic.com/wordpress/trunk as the repository URL. Click OK to download the latest WordPress source.
  5. Make a Database - Use phpMyAdmin to create a new database for WordPress. Navigate to http://localhost/phpmyadmin to see the interface.
  6. Run the WordPress Install - I trust you already know how to do this. If not, then perhaps patching is a bit advanced, no?

Ok, now WordPress is running. You should be able to do anything that you normally do with WordPress.

At this point, you can modify code freely. If you make a change you don’t like, you can always switch back to the original code. Right-click on the file, choose Tortoise SVN > Revert and the file will be restored to the last checkout version.

You should be able to see where you’ve made changes to the source by looking at the icon for the folder/file. The ones that are changed will likely be red.

Here’s what you need to do to make a patch:

  1. Update your source - This step is pretty important, otherwise you might end up patching bugs back into source that’s already fixed. Subversion has integrated merge features. All you need to do is right-click on the wordpress root folder and select SVN Update. If any of the files you edited come up as conflicted (in red in the list), you will need to merge them by hand in the tool provided when you double-click on the list item.
  2. Create a patch - This is easy. Right-click on the wordpress root folder and select Tortoise SVN - Create Patch. A dialog appears to allow you to select the files you want to include in the patch. Check the files you want to include, then save the patch file. If I’m patching one file, I’ll usually use the full name of the file followed by “.diff”, for example, “admin-functions.php.diff”.
  3. Find a Trac Ticket - To submit a patch, you need a ticket. Be sure to search for an existing ticket for your issue before creating a new ticket. If one doesn’t exist, create one and explain the problem as clearly as possible. When you have a ticket, click Attach File and attach your patch file.

That’s pretty much it, even though I’m sure I’ve left some trivial things out.

The essential bit to recognize is that there really isn’t a good excuse for a developer to know enough to make code changes but not enough to use source control. If you don’t know source control, consider that learning this simple task is a great way to pad your resume. One way to scientifically demonstate that you can work well with teams is to show a proficiency with source code conrol tools. Hopefully this short description will help you on your way.