48 blogs & 60 users

Posts Tagged ‘plugin’

A major problem fixed

October 11th, 2008

Over the past few days, as I have been increasingly active in “fixing” PersonalLog, I noticed something that’s always been perplexing to me. Our database had been increasing significantly in size, and it was rather odd.

I decided to use phpMyAdmin to take a look. What I found was disturbing. (No screenshots.)

The database had over 4000 records in the options table for many blogs. Looking through some of the records, I quickly ascertained that most of the records were duplicate entries: “kb_robotstxt” and the robots.txt file as the value.

I immediately proceeded to wipe the 4000+ records from the tables, which ended up halving the size of the database after optimization. I then went over to the File Manager for a bit more investigation.

The problem was clearly the “KB Robots.txt” plugin. After checking the plugin’s PHP file, I was shocked to see an ugly piece of code that inserted a database record for the plugin’s options every time it was loaded. Since WordPress plugins are loaded on every page load, this meant that the plugin was inserting a new record into the table for every page load, unnecessarily.

I know I could have changed the plugin so that it only did so upon activation. But I was so disturbed by this piece of bad coding that I proceeded to delete it immediately.

As a result, all blogs depending on the “KB Robots.txt” plugin will no longer have access to it. Instead, I did something that was better; I made a default, search engine optimized robots.txt file identical to what the plugin produced, so all blogs will now benefit from the robots.txt optimization, without the need for an inefficient plugin. :)

Addendum: the database has been further optimized by purging the caches of the various RSS feeds in the dashboard. This means that the first time you log in to your dashboard after these changes, there will be a slight delay (both before and after you load the page) while WordPress fetches the RSS feeds. However, the database is now a fifth of its unoptimized size and will perform significantly more efficiently. :)

Enjoy your blogs on a cleaner, faster database.

Updates and Features

August 9th, 2008

Having upgraded to WordPress µ 2.6 a very short while ago, there have been some changes to PersonalLog.

First, the “Theme Test Drive” function has been removed in favour of the new theme preview functionality built into the WordPress core. Previously, PersonalLog bloggers could go to Design » Theme Test Drive to show a specific theme for themselves. However, with the new built-in feature, all you have to do is click on the theme image, and you’ll be taken to your blog, shown with a particular theme. (Also, the themes are no longer cluttered on one page, and are separated into multiple pages.)

Second, the custom styling of the admin interface was removed because it was not fully compatible with recent versions of WordPress. Instead, the backend was reverted to the default style with several modifications: the navigation was moved to the very top, and drop-down menus were added. This design is more futureproof.

The Counterize plugin was removed because it did not integrate with WordPress 2.5, let alone 2.6. Thankfully, very few users were using it, and removing it decreased the size of the database tables as well. In the future, I’ll notify users using a particular plugin if I’m disabling it.

The WordPress Admin Bar was updated to a more recent version which has configurable options (see Settings » Admin Bar). It should streamline your blog administration tasks and look good as well.

Fifth, the Flash-based media uploader has caused a lot of grief for myself and others. Fortunately, in the new release of WordPress 2.6, all you have to do is click on “Try the Browser uploader instead” which will make the simple uploader the default method for your account.

Sixth, gravatar support was enhanced in 2.6, which means some themes (particularly newly added and future themes) will show little graphics beside the names of authors in comments.

Seventh, a number of themes were removed as a result of incompatibility and bad design. I’m also about to add a few more themes.

Eighth, some plugins were updated for 2.6, including HidePost.

Finally, you’ll also see some new functionality thanks to the WordPress update — every post is now saved with revisions, so if you save a post multiple times, each version will be retained. You can even compare revisions side-by-side with differences highlighted. There’s also word count in the Write Post screen, showing you the word count below the “Save” and “Publish” buttons. There is now also a Press This link (see the Shortcuts section on the Write Post page) that lets you write a blog post about any Web page, video, or image on the Internet; all you do is go to the page that you want to blog (be it a video or blog post), click on the Press This bookmark that you’ve added to your favourites, and a pop-up will appear from which you can write your post without leaving the page. Cool feature!