WordPress 2.2

WordPress 2.2 has just been released about 14 hours ago. There are a lot of new goodies with this release, among the big ones are Integrated Widgets, Full Atom support, New Blogger importer, Infinite comment stream, protection against plugins or edits that will break your blog, and also a hook for a future WYSIWYG support in Safari.

There are a bunch of new features for developers too. Looks like I will have to check my simple random posts widget plugin whether it still works in 2.2.

WordPress 2.2 also marks the total obsoleteness of my blogger rss import plugin 😉

Now I have to find time to upgrade all blogs I maintain. I own only one blog, though.

WordPress Plugin: Random Posts Widget

My better half was complaining that she can’t find a suitable plugin for displaying random posts on her sidebar. I tried to look myself, and there were some references to the plugin but nowhere to be found. One good plugin I found is Random categories with random posts by Mike Stickel but it uses categories which is not what we are looking for. Also, it requires tinkering with PHP codes which is not suitable for less technical bloggers.

So I went to analyze his code for a little while. What the heck, I’ll just create a simple widget version with no categories involved. So I took about 30 minutes to write this simple code with not so many options. It is a widget and configurable in the Sidebar Widgets page:

Random Posts Widget configuration

  • Widget title: the title of the widget
  • List types: ul for bulleted list, p for paragraph, br for paragraph with line breaks
  • Before title and After title: you have to find out what your theme uses before and after the widget headers. A simple way to do this is to identify a currently existing widget in your site and viewing the source. Find the title and see what is printed before and after. For example it might show as <h2>Widget Title</h2> which is used by most themes.
  • Post count: Number of random posts you would like to be displayed

Basically that’s it. It’s really a simple widget.

I don’t like to reinvent the wheel but since I can’t find any I just have to create one myself. Most probably I will have not so much time to maintain this plugin, but it is suitable if you are looking for a (very) simple plugin to display random posts.

You can download it from WordPress Plugins Directory: Random Posts Widget, or view online here: randomposts.php

Current Version: 1.5.0

Installation

Copy the file to the wp-content/plugins/widgets directory and activate it in the Plugins page. Then drag and configure it in the Sidebar Widgets page.

Warning: Will only work on widgets enabled blogs.

Change Log

  • 07-May-2007: Fixed a bug of displaying widget before and after tag
  • 14-Jun-2007: Fixed a bug where pages are also selected. Now it only displays posts.
  • 26-Jun-2007: Removed before and after configuration options, now taken from theme settings. Was broken for some themes with embedded class in the header tags. Reported by Guohua. Thanks.
  • 03-Aug-2007: Overhauled entire engine to optimize queries. This has been tested on a test blog with 50,000 posts on an old machine (Pentium III 600MHz) in maximum 3 seconds. Also removed duplicated results and added category to choose.
  • 04-Aug-2007: Fixed a bug where wrong permalink was displayed.
  • 10-Aug-2007: Fixed a bug where if 1 post count is selected an error occurred.
  • 27-Sep-2007: Added ability to detect database version (WordPress 2.3 has database changed) while maintaining backward-compatibility with 2.2.x

Automated WordPress Backup

Since I am maintaining several WordPress installation now, I feel that it is quite a tiring chore to backup the databases every now and then. I used to do it once a week, and it is even a recurring event in my pocket PC. It was WordPress Database backup 0.8 and every time I clicked on the link on the plugin page, the site is no longer there. I thought Skippy was doing maintenance and because of other commitments I let the thought go.

A few days ago, I was thinking of writing an automated plugin, and I searched for it first not to reinvent the wheel. I found it at a different site: http://www.ilfilosofo.com/blog/wp-db-backup, and learned that the plugin has changed hands from Skippy (Scott Merrill) to Austin Matzko.

I was excited to learn that the new plugin support the cron hook provided by WordPress 2.1. Yay! And the plugin worked flawlessly:

WP DB Backup

One thing you might want to take note is that the cron event is not a real, system cron event but it is triggered when your site is accessed. I noticed that when I installed and configured the email function on a newly set up installation (hence no traffic) it didn’t work until I access the site.

The plugin can also be configured to save the backup files to the server, but of course this is not recommended because of security reasons.

Have a try, I believe you’ll love it. However do remember to also backup your image files separately!

FeedBurner Feed Replacement

If any one of you just updated to the newer version of WordPress, make sure that you also update to the latest version of the plugin.

A fellow blogger encountered this error on WordPress 2.1.x yesterday, as he still had the version 2.1 of the plugin.

This is caused by the removal of generate_page_rewrite_rules function in WordPress 2.1

I checked the 2.1 version of the plugin and indeed it is calling to the function at line 43. Version 2.2 of the plugin had this removed.

Damn Crackers!

To anyone who have downloaded and used WordPress 2.1.1, you must immediately download 2.1.2. Now!

An evil cracker managed to get into one of WordPress’ server and edited some file, resulting in the ability to remotely execute PHP codes. This is a very serious issue.

News at WordPress.org

Even the F-Secure Weblog posted on this information here.

WordPress 2.1.1 and 2.0.9

Hey, did anyone realize that there’s an upgrade available? Or February is the busiest time for everyone?

WordPress 2.1 is upgraded to 2.1.1 while WordPress 2.0.7 is upgraded to 2.0.9.

Files changed in 2.1.1 from 2.1:

  • wp-includes/post-template.php
  • wp-includes/cache.php
  • wp-includes/formatting.php
  • wp-includes/category.php
  • wp-includes/post.php
  • wp-includes/version.php
  • wp-includes/js/scriptaculous/wp-scriptaculous.js
  • wp-includes/js/tinymce/tiny_mce_config.php
  • wp-includes/js/tinymce/wp-mce-help.php
  • wp-includes/js/tinymce/tiny_mce_gzip.php
  • wp-includes/capabilities.php
  • wp-includes/cron.php
  • wp-includes/functions.php
  • wp-includes/bookmark-template.php
  • xmlrpc.php
  • wp-admin/admin-ajax.php
  • wp-admin/admin-functions.php
  • wp-admin/custom-header.php
  • wp-admin/options-general.php
  • wp-admin/edit.php
  • wp-admin/index-extra.php
  • wp-admin/options-reading.php

Files changed from 2.0.7 to 2.0.9 (version 2.0.8 was tagged for Debian, but never announced):

  • wp-includes/cache.php
  • wp-includes/wp-db.php
  • wp-includes/version.php
  • wp-includes/js/tinymce/wp-mce-help.php
  • wp-includes/js/tinymce/tiny_mce_gzip.php
  • wp-includes/classes.php
  • wp-includes/functions.php
  • wp-includes/rss-functions.php
  • readme.html
  • wp-admin/edit-form-advanced.php
  • wp-admin/link-import.php
  • wp-admin/link-categories.php
  • wp-admin/user-edit.php
  • wp-admin/options-permalink.php

This time I not going to upgrade yet, as if something is broken I can’t fix it right away 😀

Plugin: Import New Blogger To WordPress

Update #3 (26 April 2007): This plugin has been broken by changes made to feeds on Blogger, and is pretty much unusable anymore. The download links are still there so if you want to try it anyway you can do so. Try to see the method described in TechCounter (the last one) for a good method. Theoretically this would work but I have not tried it. Good luck!.

Update #2: Only 500 posts can be imported via RSS (Blogger limited the RSS feed to only contain 500 max posts). Check out comment 181 and 191 below for suggestions.

Update: This plugin is now known as Blogger RSS Import instead of New Blogger Import.

Back in December, I created a stand alone script to import Blogger Beta to WordPress. I didn’t really expect that many will benefit from it until I received so many comments and bug reports. So here is the improved version, as a plugin. Many improvements were done especially at the database side where WordPress functions are utilized, and there’s no security issue anymore.
Continue reading Plugin: Import New Blogger To WordPress

WordPress 2.1

Wow! That was fast. WordPress 2.1 has been released. Users of my Blogger Beta importer, please be aware that the script might not work with WordPress 2.1

I shall have to look into it later.

Update: A kind soul tested the script to a fresh install of WordPress 2.1 and it still works.

Update: This blog has also been updated to WordPress 2.1 without many complications. Only 2 of my plugins failed.

A Sneak Peek at WordPress 2.1

I do keep track of the subversion repository and the latest I just updated from the server is 2.1 beta4. I can see lots of improvements for the management interface although I don’t have the time to take a look at the internals yet. The interface runs smoother and faster – or is it just psychology? 😉

Anyway one of the most obvious upgrade is the image uploading form – feel likes AJAX. I say feel because like I said I didn’t look at the codes. Navigation of images are insanely fast, better than the current inline uploading used by 2.0.x series. Here’s a snapshot:

WP2.1 Upload

I love it!

I think version 2.1 beta4, like its counterpart 2.0.7 also fixes the FeedBurner problem as I no longer receive feed medic alerts. Thumbs up to WordPress.

WordPress 2.0.7 Security Update

There’s a new update for WordPress: version 2.0.7

Most of you who are currently using WordPress would be able to see it on your dashboard. This is a very minor upgrade, involving these files:

  • wp-admin/inline-uploading.php
  • wp-admin/post.php
  • wp-includes/classes.php
  • wp-includes/functions.php
  • wp-settings.php
  • wp-includes/version.php

Download it now.

Useful WordPress Plugin: WordPress Suicide

WordPress Suicide is a useful plugin, particularly if you are running tests on your freshly installed WordPress.

Also, if you are trying to import your posts and comments from the New Blogger this could prove useful – if you are unlucky to have problems during your import. Some people succeed the first time, but some do have problems.

As for the importer, I am trying to find time to update it to include features that were requested by users. Currently I can only fix important bugs, if found. It’s currently in version 0.5.

If I had found this plugin earlier I would have recommended it too.

Move Complete

This site has been moved to another hosting server. Some of you might have received an error message from the old server, if your DNS has not been made aware of the server change and still have the old IP address. Sorry for any inconveniences. This is normal for any DNS change.

Additionally, WordPress have been upgraded to 2.0.6

Update: Since my previous hosting uses MySQL 4.0 and the new server uses MySQL 4.1 there seems to be some kind of confusion. Many UTF-8 characters such as the ” character were displayed as ? instead. I spotted this problem when receiving errors from FeedBurner.

A dirty quick fix is to open up /wp-includes/wp-db.php and look for these:

function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
if (!$this->dbh) {

And add an additional line:

function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
$this->query("SET NAMES 'utf8'");
if (!$this->dbh) {

I am sure WordPress guys will not agree with this quick hack 😉

This is due to how MySQL 5.0 handles collations.

I found the fix here: http://blog.jtam.org/…

Google Analytics Plugin Not Showing

Well, this is not a complaint to the great plugin, but for some themes.

Themes like Intense, and AquaGreen does not have any wp_footer call so the tracking code will not show. How to fix it?

Open up themes/[themename]/footer.php and add <?php wp_footer(); ?> before </body> resulting in:


<?php wp_footer(); ?>
</body>
</html>

Hope this helps. I discover this after 5 minutes of head scratching. 😉

Blogger Moves Out Of Beta

blogger.jpg

Blogger is now out of Beta: www.blogger.com. However I tried my Blogger Beta Importer and it still works 🙂

I think this is because the importer depends on the RSS provided by the New Blogger. Perhaps I should change my importer’s name to New Blogger import?

My true wish is that to have that importer being able to integrate with WordPress importer control panel officially or unofficially but I just don’t have the time to look into WordPress code yet eventhough I periodically checks out the code from the subversion repository. One of my blogs run 2.1-alpha3 and there are many improvements I do like a lot such as the image push to editor and the visual and code editor on the same screen!

IMHO importing from RSS is much efficient than the legacy method of logging into Blogger, publishing the template and extracting from there. But of course, a simple change on the RSS output and the importer will not work 😉

Why WordPress

For those who are still thinking whether or not to migrate from Blogger to WordPress, here’s a good insight by Anita Campbell. Although it was written more than a year ago, it’s still relevant.

Blogger (non-beta) users will be able to use the built-in import function and while you’re at that you might want to take a look at this best practices when moving from Blogger to WordPress, by Tom Sherman.

For Blogger Beta, you can use the script I wrote and still use the same technique described by Tom so that permalinks to your blogger pages will be redirected to your new WordPress site. I have not tried it yet, and since I am sleepy coming back from night shift I think I’ll let you try it and let me know 😉

See ya around.