WP Error: The data could not be converted to UTF-8

If you’ve just upgraded to WordPress 2.9 and you are now getting UTF 8 conversion errors on your dashboard, you’ll need to take a look at WordPress Trac Ticket #11219.

RSS Error: The data could not be converted to UTF-8

The bottom line is that you’ll need to enable either iconv or mbstring in your PHP configuration. I’m using CoolStack on Solaris 10, so it was a simple matter of uncommenting the following lines from /opt/coolstack/php5/lib/php.ini and restarting apache. While you’re at it, may as well uncomment ctype as well since the new image uploader needs it.

Uncommnet the following lines in /opt/coolstack/php5/lib/php.ini.

extension=iconv.so
extension=mbstring.so
extension=ctype.so

Finally, restart apache:

svcadm restart apache22-csk

Managing WordPress and Gallery2 With Subversion

Keeping WordPress up to date using the standard method of deleting old files, extracting the new ones and then running the database upgrade script is a bit cumbersome, but really not that difficult. Gallery2 uses more or less the same methodology, but it does not require you to delete your files prior to the upgrade because it generates a script to remove deprecated files after the install is complete. This is very kind of them, but the Gallery package is large, and upgrades can get a bit unwieldy. While there are certainly more difficult software packages to maintain, there are things I would much rather be doing than software updates, so I decided to make my life easier by using subversion to manage both applications.

Subversion is a code revision management tool that is everything CVS should have been. It is not only amazingly useful for software developers, but it can be readily used by end users as a convenient method of keeping their software up to date. It is for this reason that the Automattic and and Gallery folks have started recommending it for those who have command line access to subversion enabled servers.

There is no way to force the software to make an existing install into a subversion checkout, so to convert my site, I pretty much just followed the instructions at wordpress.org site.

Create a directory for the new install and “cd” into it:
$ mkdir wordpress-svn

Checkout the current WordPress version:
$ svn co http://svn.automattic.com/wordpress/tags/2.3.1 .

Copy the things I cared about into from the old directory into the new one:
$ cp ../wordpress/wp-config.php .
And the same for:
favicon.ico
.htaccess

The only thing I didn’t really like was their method for copying the files from the old wp-content directory to the new one.

They suggested using “cp -rpf”:
$ cd wordpress
$ cp -rpf wp-content/* ../wordpress-svn/wp-content

But I prefer to use a “tar | tar” operation as root from my original wp-content directory.
$ cd wordpress/wp-content
$ tar cpEf - * | (cd ../../wordpress-svn/wp-content; tar xf -)

I don’t really have a reason for this other than it’s the way I have always moved large directories full of files with varying permissions. I just have more confidence in “tar” to maintain permissions than I do “cp”. I seem to remember being bitten by “cp” while moving some Oracle databases at some point.

That pretty much did it for WordPress… Next I moved onto Gallery2. The process was very similar.

Create the new gallery2 directory within your wordpress-svn folder and “cd” into it:
$ mkdir gallery2

Checkout the latest version of the Gallery2 code:
svn co https://gallery.svn.sourceforge.net/
svnroot/gallery/branches/BRANCH_2_2/gallery2 .

Copy over the config file:
cp ../../wordpress/gallery2/config.php .

Finally, copy the g2data directory over using “tar | tar”:
$ cd ../../wordpress/gallery2/g2data
$ tar cpEf - * | (cd ../../wordpress-svn/gallery2/g2data; tar xf -)

That was it… Now all that was left was to rename wordpress to wordpress-presvn and wordpress-svn to wordpress:
$ mv wordpress wordpress-presvn; mv wordpress-svn wordpress

Everything worked fine, so I was golden. If it had not been, I could have simply renamed the directories back to their original names.

What did all this get me? Much much easier upgrades. Upgrading WordPress is now just a matter of switching to the latest tag and running “svn up”:
$ svn sw http://svn.automattic.com/wordpress/tags/2.3.2
$ svn up

With Gallery, however, there is no need to do a switch for dot releases, so until it goes from 2.2.x to 2.3.x there is no need to run the “svn switch”… I can just “svn up”.

Remember that this is a 10,000 foot view of the process. Please read the links to the Automattic and Gallery documentation if you are going to make the move yourself.

Automattic Has Purchased Gravatar

I was just reading photomatt.net and realized that Automattic has acquired Gravatar. I stopped using the Gravatar service when Bork wrote “MyBlogLog” support into his Sexy Comments plugin because it was unreliable and only served up avatars about half the time.

I immediatly switched back to Gravatar upon realizing that Automattic had acquired it, and found that it not only works reliably not, but all the features that were previously paid are now free. Once again, the folks at Automattic have really come through for us! There is just something wonderful about using software that you can really feel good about, and I honestly feel that way about WordPress, Gravatar, Akismet, and all Automattic products. One gets the feeling that that these people are really trying to make the world a better place through their software.

Sexy Comments WordPress Plugin

I’m proud to be the first to test out Matt’s new Sexy Comments plugin. Since the comments on a few of my stories have taken on feel similar to that of a discussion group, I was glad to see Matt working on a layout that allowed the user to personalize their comment by adding an avatar. Last evening we discussed it and I convinced him to turn the jazzed-up comments layout into a WordPress plugin so that the whole world could benefit from it. Apparently the poor guy stayed up all night working on it, although I don’t feel bad for him since he kept me up until 10:30 with constant billiards challenges and I had to be at work by 5:00 AM! Not to mention I’m mad because he never told me he was such a pool shark.

It gets the picture from Gravatar, so if you have not uploaded an avatar to the service, do so, and your picture will show up next to your comments. Thanks Matty for the great plugin!

Geo Dive Blogging 101

My recent posts and dive log entries about my trip to the Socorro Islands have gotten a lot of people asking about how I create the map with post excerpts on this website. I’ve been slow about writing it up because quite frankly the process has been changing over the past week or so. I started doing this as a way of logging my dives, which I have not done since I was a teenager. When people ask how many dives I have, I honestly have to answer that I don’t know because I stopped logging just after dive number 200. Since dive log book had no real value to me, I found no reason to continue using them. Lately, however, I began asking myself how I might log my dives in a way that could be valuable to both me, and others as well.

I had a few requirements.

  • First, I wanted to use this blog as my dive log book.
  • Secondly, I wanted to record and display the GPS coordinates of the dive site. I also wanted to leverage the Google Maps API to display these sites on a map.
  • Finally, I wanted to record and display the information that I believe is important about the dive. For instance, I don’t care to record the water temperature and whether or not I wore a hood, but I did want to record and display information about gas choice, max depth and bottom time. I also wanted to record and present information about deco schedule.

The first phase, and the only one that I have completed thus far is to record and present GPS information about the dive site. When I first implemented this, a total of three WordPress plugins were required. “Geo Mashup” was used to create the map page with the post excerpts, “Geo” was used to enter the GPS coordinates into the “wp_postmeta” table, and “bsuite-geocode” was used to search the post text for links to Google Maps, strip out the GPS coordinates and enter them into “wp_postmets” if they exist. It also created a “Location” link to the post excerpt on the map page.

This was all before the final release of Geo Mashup 1.0, however. This is now the ONLY plugin that is required to create the map with post excerpts. In fact, running either “Geo” or “bsuite-geocode” will prevent “Geo Mashup” from working correctly after version 1.0.

Version 1.0.1 of the Geo Mashup plugin creates a nice little Google Map in your “Edit Post” or “Write Post” window that can easily be used to enter GPS data about the post. The only downside is that there is no way to display a link to the map from your post without adding the following code to the loop in your theme:

< ?php GeoMashup::show_on_map_link('link_text') ?>

Sadly, the “bsuite” plugin I use to create the “Tags” and “Related” stories section at the end of my posts takes over the bottom of the post entirely, meaning that map link would need to go below that. Since I think the “Related” section ends the post nicely, I have not incorporated this code into my theme yet. I have brought this up with Casey, who says he will allow the user to control where the bsuite functions display in the next version, which is soon to come out.

Clearly I still have some work to do with respect to displaying dive information and deco graphs, but that should be coming soon. Hopefully I will be able to release a DiveLog WordPress plugin once I get it all hammered out. Stay tuned.

Flickr Has Always Sucked… Now it Sucks More!

A lot of the people I know and work with just can’t help doing a little dance whenever they think of Flickr. They’re constantly raving about how wonderful it is to join this silly little community of photo sharing web pedestrians. I, for my part have always been skeptical. Everyone who blogs needs a way to incorporate photos into their posts, and to be fair, Flickr does make this easy. I, however, have always liked the idea of controlling my own content, so decided to use Gallery2 and its WPG2 integration with WordPress.

This solution worked well for a long time, but suddenly the iPhoto uploader to Gallery2 broke, and I was faced with a decision. I reluctantly decided to try Flickr. After struggling for what seemed like hours, I finally managed to find a crappy Yahoo username that I could only half tolerate. I tried it, but quickly gave up because I could never remember the cryptic username I had selected.

Casey reminded me that he had invited me to Flickr before they had merged with Yahoo, and that I had created an oldskool, non-Yahoo Flickr account with my normal human readable username. I decided to give it another shot. I hated the restrictive terms of service, and the dozens of clicks it took to get a different sized image, but I tolerated it because images were easy to upload. I even went so far as to create a Pro account.

Well, that all came crashing down around me, and thousands of other Flickr users today when I received notification that Flickr was forcing all their users to merge with a Yahoo account! I was furious! I do not have a lot of images in Flickr, but many of them are linked and presented in this site, and I really don’t want to take the time to go back and change all those links. I would have to create a Yahoo account and merge it thanks to Flickr’s Nazish new policy.

I’m not the only one who is cheesed off either. ThomasHawk.com has been following the forums and has compiled a collection of peoples complaints.

One user had this to say:

What really pisses me off is Yahoo’s God-awful ID setup. It took me over an hour this morning to set up an ID, mostly because every name I tried was taken – including random letters I got by hitting the keyboard in frustration. So now I’m stuck with a username I didn’t want, can’t change, don’t like, and won’t remember.

Another user writs:

Is yahoo offering any sort of counselling for people who go into fits of rage after the 387th attempt to find an available user ID that doesn’t suck?

I could not agree more. It took me forever to find a username, and as before, it’s cryptic, and I will never remember it. Somehow I very much doubt that my Flickr Pro account will stand the test of this betrayal. I have never really liked Flickr, but tolerated it. This will most likely be the last straw for me. I’m just glad I left my Gallery2 integration up and running!

Ecto is Busted in WordPress 2.1

Last week I took this site to WordPress 2.1 and much to my dismay realized that Ecto, my favorite XMLRPC blogging client no longer worked. It would let me post, but it was never able to update the category information for posts… It just hung with no error. I looked into it, and found out that Ecto expects the category information to be returned as a string, not an int.

Adriaan, the developer of Ecto is blaming WordPress, while I’m sure the folks at Automattic would call it an Ecto problem… That’s just how these things tend to work. Anyhow, it’s pretty easy to fix if you make this quick change to xmlrpc.php.

Simply change this on line 180:

'categoryId' => $catid,

To this:

'categoryId' => (string) $catid,

Hopefully someone will go back to their code tree and make a permanent fix so we don’t have to constantly edit this file every time we upgrade.