Windows live writer and WordPress 2.6 compatibility issues

If you recently installed WordPress 2.6 and is unable to use Windows Live Writer, don’t worry. The problem is that that by default WordPress disables xml-rpc and atom api. Windows Live Writer requires xml-rpc to be turned on.

You can turn on XML-RPC using WordPress dashboard from Settings -> Writing -> XML-RPC option. Refer to the following screen shot,

enabling xml-rpc

If you recently upgraded from 2.5.1, you would be wondering what the fuss is all about! Interestingly the above two options are enabled by default when you upgrade from 2.5.1 to 2.6.

You may be wondering why XML-RPC is disabled by default. XML-RPC is used by a lot of hacking tools built around WordPress trying to exploit security vulnerabilities such as weak passwords. So by disabling XML-RPC, a lot of current hacking attempts can be prevented.

But for external tools such as Windows Live Writer, XML-RPC is a must. So in the end it becomes a trade off between flexibility and security. But as long as you keep your WordPress installation updated and use strong passwords, chances of getting hacked is minimal.

Another interesting thing I noticed while configuring Windows Live Writer for a WordPress 2.6 is that WLW is unable to detect WordPress 2.6 installation and RPC configuration. I had to manually select the WordPress and location of the RPC php file as shown below,

windows live writer and wordpress 2.6

July 18, 2008 | Posted in Tech Tips, WordPress | No Comments »

Disabling post revisions in WordPress 2.6 without using a plugin

Starting from WordPress 2.6 (code named  Tyner), a new feature called post revisions is added in WordPress. This is a versioning system for WordPress posts and allows you to revert to an old version of a post if needed. You can also compare between versions to see the difference.

 post revisions in wp2.6

This is a good feature if you are using WordPress UI for writing your posts. But if you are using an external tool, you might not need this feature.

One of the problems with post revisions is that if you do a lot of editing, a lot of different versions are generated and are stored in the MySQL db. Over a period of time your database becomes bloated and performance of your blog can get affected. Unfortunately on the WordPress dashboard there is no option to disable post revisions.

So it is no wonder there are couple of plugins being released to add the post revision disabling option. But I am not a fan of plugins because many of the plugins come with security holes and many of them affects performance of the blog. So my mantra is to keep the number of plugins to a bare minimum.

Fortunately there is another way to disable post revisions in WordPress 2.6. You can edit wp-config.php and add the following line it,

define(’WP_POST_REVISIONS’, false);

This command sets a flag which instructs WordPress to avoid creating versioned copied of a post.  If you replace ‘false’ with a number, WordPress will ensure that the number of version generated for a post is limited by that number.

Another feature recently added to WordPress is the auto save feature. This saves your post every 60 seconds automatically when you are using the WordPress editor. If you don’t want this feature or you want a different interval, you can add the following entry in wp-config.php,

define( ‘AUTOSAVE_INTERVAL’, 60 );

The second parameter indicates the number of seconds after which the post is auto saved. You can set this to a large value to avoid frequent auto saves.

Where does WordPress store post revisions in DB?

You may be wondering where WordPress 2.6 stores post revisions in DB. If you are looking for a new table you are mistaken. All the post revisions are stored in the wp-posts table itself.  For the old revisions the post status is stored as ‘inherit’ and post_type as ‘revision’. The post_parent in this case is set as the id of the currently published post.

How do I delete old revisions of WordPress posts from MySQL DB?

You can use the following SQL script to delete all old revisions from MySQL DB. For large WordPress databases, this will improve performance of the blog.

delete from wp-posts where post_type=’revision’;
July 17, 2008 | Posted in WordPress | No Comments »

WordPress 2.5 upgrade issues with Windows live writer?

Normally I wait for sometime before upgrading WordPress installations. But this time I jumped to WordPress 2.5 when I came across serious security issues in 2.2.x series. Some of my blogs which ran under 2.2.x versions were badly hacked and I had to spend a lot of time recovering them! The hacker modified most of my posts and cleverly inserted hidden links. Also he installed a backdoor php file in the current template folder! This ensured that even after upgrade he can control my WordPress blog.

I detected the problem only when I realized that my blog is no longer in the Google search index!

The WordPress hacking became so widespread that Technorati has special process in place to quarantine infected/hacked WordPress blogs! There are reports of WordPress 2.5 vulnerability, but it is better to upgrade to 2.5 than stick with 2.3.3. The important thing is to upgrade as soon as a release is out rather than cling to a version for which hacking scripts may be sold in warez forums! So I am keeping my thumb on the WordPress upgrade button waiting for 2.5.1  :-)

After the upgrade I came across an interesting  issue when I tried to post through Windows Live Writer. It responded with an error message - Invalid response document returned from XmlRpc server. I initially thought that it is a bug with Windows Live writer and compatibility issue with WordPress 2.5. Then I tried posting the same from the WordPress admin. When I tried to upload an image I got the following error,

- Fatal error: Call to undefined function wp_constrain_dimensions.

Then I realized there is some problem with the WordPress 2.5 upgrade. Here is how I resolved the problem. First I deleted all the php files in the WordPress root folder (except wp-config.php) and then deleted wp-admin and wp-includes folder. After ensuring that all old files are deleted, I uploaded WordPress 2.5 files again. That resolved the issue with Windows Live Writer!

April 22, 2008 | Posted in Security, Tech Tips, WordPress | No Comments »

Geeky Green - 2 column fixed width theme for WordPress

Geeky green is a 2 column fixed width theme for WordPress with complete widget support. The post area width is 550 pixels and the side bar is 220 pixels.  This theme is released under GPL license.

Geeky green is optimized for fast page load and uses minimum graphics. You can easily customize it by modifying the compact style sheet in this theme. Following is the sample screen of Geeky Green theme in action.

 geeky green theme preview

Download & Installation

The latest version of Geeky Green theme can be downloaded from here. Extract the compressed file under WordPress themes folder and then from administration screen select Geeky Green. If you want you can customize sidebar using widgets tab under the theme presentation tab.

All the links in the theme (except footer and header) can be customized by changing the global anchor tag style.

Live Demo

Geeky Green 2 column live demo.

I have tested this theme only on WordPress 2.3.3. But it should work on WordPress 2.0+. Do you have any suggestions for improvement? Let me know.

Version History

21 March, 2008 - released version 1.0

March 21, 2008 | Posted in My Work, WordPress | No Comments »

WordPress 2.5 release candidate is now available for download

The next generation WordPress (2.5) is going to be released soon and a release candidate is now available for download. I did a test drive of this version and the first thing I noticed is that it looks a lot more "whiter" than the previous version. Some may call it the modern design, but In my option, the earlier look and feel was easier to navigate! For example check out the homepage,

wordpress 2.5 homepage

As you can see, WordPress 2.5 uses google blog search instead of technorati for incoming links! The good thing is that you can now edit this. Another advantage of this feature is that now you can disable all the latest WordPress news and WordPress blog feeds. You don’t a need a plugin to do that!

Following are the major cool new features in WordPress 2.5,

add media wp2.5 Improved Write Post screen

Now it is easier to add various types of media to your post. Images, videos and audio files can be easily inserted. There is also a media library and a gallery feature available. But for majority of WordPress users who use tools like Windows Live Writer, this may not be important!  The write toolbar can be used in "simple" or "advanced" mode.

add tag 2.5 Tag Management

WordPress 2.5 now offers full tag management similar to category management. But surprisingly you cannot select a tag the way you select a category. You need to explicitly type in the tags in create post screen. The tag screen allows you to quickly see the posts under a specific tag. Also Blogroll is now moved under Manage section as links and link categories.

Faster Dashboard

One major improvement I noticed is that the dashboard now loads faster compared to the earlier dashboard. It can be made faster by removing all the unnecessary feeds on the dashboard such as incoming links and WordPress news. This alone probably is worth the upgrade to WordPress 2.5!

Don’t port your live blog to WordPress 2.5 yet! There could be serious security issues or bugs which needs to be ironed out. Wait till the production quality WordPress 2.5 is out. I would wait till WordPress 2.5.1 is out!

March 19, 2008 | Posted in Tech News, WordPress | No Comments »