Author Archive

8/27/2008 ↓

Tackle Plugin Compatibility Issues While Using Popular Libraries 14comments

If you like this post, please subscribe to our RSS feed to read our new posts every day.

I recently got a email from a plugin developer, with regards to him having compatibility issues with one of the plugins I had developed. It turned out that both our plugins used a popular library called PclZip for adding archiving features. Due to the compatibility issue, accessing his plugin would cause a fatal PHP error saying that the PclZip class cannot be re-declared, when both our plugins were activated.

The compatibility issue arose because of two things;

  1. A mistake on his part while checking for existence of class objects in the code.
  2. A mistake on my part of using custom libraries, instead of using those provided by WordPress core.

Here is a code snippet used to check for class existence.

if(! function_exists(’class_name’)) {
   require_once(’myclass.php’);
}
$object = new class_name();

The above code is wrong, since:

  1. Class names cannot be accessed as functions.
  2. The internal methods of a class are not available for checks, unless one decides to instantiate the class and use the method_exists instead.

The correct way to check if a class exists or not can be seen in the following code.

if(! class_exists(’class_name’)) {
   require_once(’myclass.php’);
}
$object = new class_name();

This change in code actually solved the compatibility issue, but I would like to discuss a bit further on why one should rely on libraries provided by WordPress core instead of using their own custom libraries. The fatal error could have been avoided, if my plugin made use of the the library files from core WordPress, instead of using custom libraries included with my plugin.

If both our plugins had relied on the library files provided by WordPress, the require_once directive would not have re-evaluated the “same file” again, thus avoiding the duplicate class issue. Earlier versions of WordPress did not include many popular libraries, and many plugins include those libraries to provide backward compatibility. If you have to provide backward compatibility for your plugins, be sure to add in a WordPress version check so that you can rely on your own libraries, only when a version of WordPress does not provide it, doing this will certainly do away with having to tackle the compatibility issues caused by plugins using different files for the same libraries.

Update: Including files for backward compatibility can be accomplished by using the following code.

if(!class_exists(’PclZip’)) {
  if(file_exists(ABSPATH.’wp-admin/includes/class-pclzip.php’)) {
    require_once(ABSPATH.’wp-admin/includes/class-pclzip.php’);
  }
  else {
    require_once(’/path/to/your/lib/class-pclzip.php’);
  }
}

It is also a good practice to include the classes only when you require them, and later destroy the object by using the unset() method. This is a non-exhaustive resource for tackling compatibility issues between plugins, and I will try and research more on other things that can help avoid these issues and keep informing you about them.

If you have your own advice about avoiding such issues, please do share them with us.

Further reading from PHP documentation:

Tags:

8/20/2008 ↓

Safest Way to Include Plugin Code in Themes 27comments

Several plugins provide users with template tags like functions to include plugin output into themes, the most common way of including plugin code into themes looks like this:

<h2>Section Header</h2>

<?php plugin_template_tag_function(); ?>

Though the above code is absolutely right, PHP errors will occur if you disable the plugin and do not remove the template tag from the theme. There is a much better way of including template tags in your themes, which ensures that PHP errors do not occur when you disable plugins and do not remove them from your themes:

<?php if ( function_exists(’plugin_template_tag_function’) ) : ?>

<h2>Section Header</h2>

<?php plugin_template_tag_function(); ?>

<?php endif; ?>

The if condition in the above code ensures that the function you want to use is registered, before the code is executed. This extra check will ensure that your theme will load without PHP errors, even if the plugin has been disabled.

If you are new to conditional statements, you can read one of our earlier post about if, then and else conditions.

Tags:

8/16/2008 ↓

What Does the Blurb on Top of Plugins Link Mean? 29comments

If  you are using WordPress 2.6 and above you may have noticed a blurb above the plugins link with a number, many users are confused about this and have asked me about it, here is a simple explanation to all WordPress users who are confused about the blurb.

The blurb on top of the plugins link indicates the number of plugins for which updates are available, making it easier for users to track updates without having to frequently visit the plugins page. You may not notice the blurb if the plugins you use are up-to-date.

Hope this answers your question about the Blurb you have always been wondering about.

Tags:

8/15/2008 ↓

Maintenance Update: WordPress 2.6.1 Released 21comments

The WordPress team has released a maintenance update to the WordPress 2.6 branch. This release includes several improvements for international users, it also fixes permalink problems faced by blogs hosted on IIS servers.

This release does not require a mandatory update, so you can continue using WordPress 2.6 if you are happy with it, although you may want to upgrade to this release if you have been facing any of the bugs that were fixed in this version.

Tags:

8/11/2008 ↓

Charity Event: WordPress Scavenger Hunt 2008 0comments

WordCamp SF 2008 is getting closer, many users may have already signed up for the event, for those who have yet to do so, you can purchase your ticket by visiting the sales page.

If you are visiting the WordCamp there is another exciting event planned for charity, the WordPress Scavenger Hunt 2008 will be held the day after WordCamp SF on August 17th.

The WordPress Charity Scavenger Hunt will have teams of four running amok in San Francisco for two hours, unravelling clues, finding weird stuff and completing tasks for points. The winning team with the most points will get the grand prize: lots of WordPress schwag, plus special surprises!

Team registration fee is $40 for a team of 4 people, all proceeds will be donated to 826 Valencia, a local non-profit that helps kids refine their reading and writing skills. If you are looking to have a bit of fun before heading home from the WordCamp, do signup for the WordPress Scavenger Hunt 2008.

You can follow the event organizers on Twitter and also view the photos from the events at Flickr.

Tags:

8/3/2008 ↓

WordPress.com announces 24/7 support 12comments

WordPress.com has announced 24/7 support where people from across the world can ask their support questions without having to worry about time differences. The WordPress.com engineers will cater to all the questions sent using the contact form and reply within 24 hours or lesser.

Not long ago, our team was online 9 a.m to 4 p.m. PDT to answer your questions and keep your blog running smoothly. Soon after, we brought it up to 24-hour support, five days and week, so those across the country and across the globe wouldn’t have to wait for their answers.

The time has come for help without delay. We hereby announce 24-7 support on WordPress.com.

Remember to use the contact form to send your questions to the WordPress.com team, to get a quicker reply.

Tags:

8/2/2008 ↓

  • WordPress Facebook Community / Group

    If you are a Facebook user, you may want to add this group to your favorites to get good inputs from Facebook users about WordPress.

    (6)

7/31/2008 ↓

Features Planned for WordPress 2.7 119comments

It has been only a couple of weeks since WordPress 2.6 has released and there is already talk about a much more feature rich version in the making. WordPress 2.7 has several exciting features planned/proposed as discussed in informal meetings on IRC and the feature votes being posted on the Codex. Though there are very few hints hint of a release date, I expect it to be released by the end of 2008.

[EDIT] Clarification: Mark Jaquith brings up a very good point that I believe requires re-iteration. The list of proposed features mentioned on weblogtoolscollection.com were just that, proposed features. All or none of them might actually show up in WordPress 2.7 Some things that have already started being worked on are the comments API and automated plugin installation. In hindsight, I realize that though they were represented as proposed, some of the other language in this post might have sounded a lot more definite. We apologize for any confusion that might have caused.

Here is a list of features that will be introduced into WordPress 2.7:

  • Comments API – This according to me is the most exciting feature, it will allow developers to create offline integration of comments management, where users could use desktop clients to manage comments (moderate, edit, reply, delete, spam, unspam).
  • Keyboard shortcuts for comment moderation – This feature will help users to quickly moderate comments using keyboard shortucts, so you can expect key combinations like Ctrl + S to spam a comment, Ctrl + A to approve and so on.
  • Theme Update API – WordPress 2.5 and above have really made plugin management quite easy, you automatically receive notices when a new update to a plugin is available and can upgrade it without having to manually upload it to your FTP server. With this addition WordPress aims to bridge the gap between theme developers and the users for publishing updates to themes.
  • One Click Plugin Installs – Installing a plugin will be much easier with One click plugin installs. A plugin with similar features called One Click Plugin was the winner of the Plugin Competition last year.
  • WordPress core updates – This is a feature many users have been waiting for, with core updates you can easily upgrade your WordPress versions. The WordPress Automatic Upgrade plugin performs the same task.
  • Default Sitemaps – WordPress 2.7 will include a default sitemap creator, which will create Google XML sitemaps for your blog. Google Sitemaps Generator plugin is the best option available right now for creating XML sitemaps.
  • Admin Panel Comment Replies - This plugin will help administrators to reply to comments using the admin panel. There are several plugins which allow you to do so right now, including WP AJax Edit Comments, Better Comments Manager and Absolute Comments.
  • Comment Threading – This feature will allow users to reply to other commentators in a threaded manner, where replied comments will display below the actual comment, WordPress already has the ability to scale to accomodate threaded comments, without requiring database changes. Brian’s Threaded Comments is a does the job of allowing users to reply to comments.
  • Subscribe to Comments – The WordPress team is also planning to include a option to allow commentators to subscribe to follow up comments, but this is marked as a question, so it may not actully make it into WordPress 2.7. The Subscribe to Comments plugin does the job to notify commentators on follow up comments.
  • Widgets for Dashboard and Write Box – This feature will allow users to re-arrange the widgets on the dashboard and write page to suit their preferences.
  • Batch Editing of Posts – This feature will allow users to batch edit their posts. Though there is not much information available about this right now, and I could not really find more from my research on the topic.

With WordPress 2.7, we may see many popular plugins retire because of direct integration into WordPress core but we should have better functionality and easier management of daily blogging tasks from within the vanilla WordPress install.

There are several other interesting features, you can take a look at them by visiting WordPress codex. Thanks to QuickOnlineTips for drawing my attention to the new features.

What features are you looking the WordPress team to integrate? Do let me know. It would be great to hear what your expectations are.

Dislaimer: WordPress Automatic Upgrade Plugin and Better Comments Manager plugin has been written by me.

Tags:

7/27/2008 ↓

WordCamp San Francisco 2008 Signup Open 3comments

Matt has opened up the signup for the WordCamp San Francisco event which will be held on August 16th 2008.

The WordCamp SF ticket prizes has been reduced by $5, each ticket will only cost $20 for this event. The event is being hosted at a bigger venue this time around, so you can expect better and comfortable seating arrangements, one of things Matt has ensured us about.

Going by the success of past WordCamp’s, we believe this one will be even bigger and better. You can book your tickets for the WordCamp SF event by visiting this page. Don’t forget to read more about what is WordCamp, if you are new to it.

Tags:

7/15/2008 ↓

WordPress 2.6 Released Officially 73comments

WordPress 2.6 has been officially released today. Matt surprised many of us by releasing WordPress 2.6 almost a month ahead of schedule.

There are several new features in WordPress 2.6, few of which we had covered earlier. The WordPress team have also created a video that demonstrates the new features bundled with WordPress 2.6.

Download WordPress 2.6

Tags:

7/14/2008 ↓

Evolution of WordPress: B2/Cafelog to WordPress 1.0 23comments

A few days ago we had told you what you should know about WordPress 2.6. The post described new features that will be introduced shortly in WordPress 2.6. Though there are several new features that you may like in this new version, there might be many that have gone unnoticed that were introduced in the earlier versions of WordPress. To quell the anticipation that users might have for the latest version, we wanted to write a series of posts that will cover WordPress from its infancy to WordPress 2.5 (the latest major version) that many of you use.

The WordPress team has been naming their major releases after popular Jazz legends and we will take a look at code names for the past releases.

B2 / Cafelog

WordPress is the official successor of B2/Cafelog which is a blogging platform created in early 2001 by Michel Valdrighi using PHP and MySQL. Matt Mullenweg and Mike Little took over the development to come up with (fork?) the WordPress platform as we officially know it now in early 2003, giving birth to one of the best blogging platforms ever developed.

WordPress 0.7 – 0.71

The first version to come out under the new name was WordPress 0.7 which was released in May 2003, marking several changes over the B2/Cafelog software. WordPress 0.7 introduced several new features such as allowing users to add links to their blogrolls, new administration interfaces, manual excerpts, default templates and more.

WordPress 0.71 was just a minor revision but it brought incorporated many changes that form an integral part of WordPress as we know it today. WordPress 0.71 “Gold” introduced cool new features such as post status where users could mark the post state as draft, publish or private. A blog owner would also have greater flexibility over the comments by disabling them on a per-post basis. 0.71 also combined trackbacks, pingbacks and user written comments into a single category. There were several other changes including better administration, security fixes and more.

WordPress 0.72 added password protected posts, new xmlrpc APIs, a Blogger import and many other improvements. This version also included a new theme from Dave Shea.

WordPress 1.0

There were several minor versions in between WordPress 0.71 and WordPress 1.2 beside WordPress 1.0, which included WordPress 1.0.1 code named “Miles”. This was followed by WordPress 1.0.2 code named “Blakey” which was a smaller release based on bug fixes.

The much anticipated WordPress 1.0 was finally released on January 3rd, 2004. This version included several new exciting features (as usual). The most noticeable feature was the introduction of better search engine friendly permalinks which allowed users to structure their URLs to get better search engine visibility using mod_rewrite. The version also lifted the limitation of allowing only one category per post. This meant that users could assign several categories to a single post.

For all those who were worried about comment spam, this version included comment moderation where blog authors could moderate comments, before they would be viewable on the blog. Users could also edit pages or comments with the newly provided links. WordPress 1.0 also included support for ATOM based feeds. 1.0 was a very popular release.

There were several other new releases which we will take a look in other parts of this series. In the mean time, we would love to hear from users who had used these versions. How did the earlier versions of WordPress change your outlook towards blogging? Did those earlier versions make you a fan?

[EDIT] Fixed minor error in versions and added 0.72. Thanks Carson and Geof

Tags:

6/30/2008 ↓

What You Need To Know About WordPress 2.6 69comments

WordPress 2.5 was just released a few months ago and WordPress 2.6 has been in development for some time to be released very soon. Not only does WordPress 2.6 add more zing to a platform that has already won hearts and made blogging a wonderful experience, there are few features in WordPress 2.6 that many have requested and some that caused a little controversy.

Let’s get to know a few things about WordPress 2.6 that will definitely raise few eyebrows albeit a few of them in the wrong way.

Post Revisioning

I have been a Software developer for quite long now and know how important CVS or SVN is to maintaining different versions of a file. WordPress 2.6 brings the same functionality to posts where you can have different revisions for posts.

In lay terms this means that no matter how many times you make changes to the post, you will never have the “Oops, I did something wrong to the post” effect since you can always go back to a older revision of the post, and, let me add you have a cool feature where you can actually differentiate between your revisions to see what changes you made. (think wiki-like post revisions)

Tumble Your Posts

The one thing I have loved about Tumblr is the simplicity and ease of access. I simply select a link or a image and tumble it to my micro blog at Tumblr without having to go through a series of steps to actually post my content.

WordPress 2.6 is taking a new approach and adds in bookmarklets that will allow you to quickly post links and image ala Tumblr. (think “Press This”)

Speed Up of Admin Interface

There has never been a reason not to use the admin interface but that said with the versatility and flexibility of WordPress many people have taken advantage and built softwares that resist you from doing so.

To be quite frank, I hardly use the Admin interface except for approving and replying to comments and managing plugins and themes, but in doing that, I am definitely missing so many of the features that WordPress posting interface provides me with.

WordPress 2.6 makes use of Google Gears when available to speedup and cache static files that are loaded every time you visit your WordPress admin panel.

XML-RPC access now requires Admin Permission

XML-RPC for WordPress can be used by many software applications that allow you to post content to your blog without having to visit the admin panel. The most notable one I can point out to you is Windows Live Writer.

With WordPress 2.6, in new installations, the access to XML-RPC will be unavailable by default. This in short means that every user will have to go and manually enable XML-RPC to allow external applications to post to your blog. Dougal wrote a post about this recently. From his post on the APIs:

  • The APIs will not be automatically disabled for sites upgrading from older versions. Since the APIs have previously been ‘on’ by default, they will continue to function.
  • For new installs of WordPress 2.6 and later, there will be an option presented at install-time to enable the APIs. Or not. They seem to have removed that between Beta 1 and Beta 2.
  • There will be options in the Write settings to enable or disable XML-RPC posting and Atom API posting individually.

Though this might appear to be a problem to som, personally I do not think that it is a inconvenience. Since users who want to use external applications will be able to do so with just a minor change in the settings and for the millions others who do not require it would never even bother with it. I definitely see this as a move to allow users the flexibility to do what they want to with their blogs without forcing them.

Activate Multiple Plugins at Once and Delete Plugins in Bulk

The one thing that went over my head with the earlier revisions of WordPress was that they allowed you to deactivate all the plugins but never allowed you to activate them at once.

Also deleting plugins was never a piece of cake as users had to manually login to their FTP to delete them. I did get around to writing a plugin that would allowed users to delete plugins they no longer used from the admin panel but never released it. With WordPress 2.6 both of the concerns are answered as it will not only allow you to activate bulk plugins but also provide you with the ability to delete plugins you no longer use.

I would love to see a feature where they allow users to deactivate plugins and keep a history of it and then allow users to reactivate the same plugins once again. I did end up writing a plugin for myself that kept a history of the the plugins it deactivated and then activated them while skipping those that caused a problem due to a newer version of WordPress version.

Move Your Config File to a Different Directory

Your WordPress config file contains information about things that are critical to your blog including access to your WordPress database. Though there are no known security issues with having your wp-config file in your root directory, WordPress 2.6 does allow you to move it to another directory.

Other Features

There are several other features to grab your attention and the few I talked about does not end the features you will get in the next major revision, here are some of the other things you should know about too;

  • You can move your content directory from wp-content to any other place you want it to be. (This definitely will mean there are shorter links to your downloadable content or images)
  • Better Theme Previewing.
  • External JavaScript upgrades to TinyMCE, jQuery and jQuery UI.
  • Customizable default avatars.

Well hopefully this should be the best ever version yet of WordPress, though I still look forward to getting more. Let me know your views and opinions about the latest and probably greatest version of WordPress.

Afterthought: Aaron Brazell over at Technosailor goes into greater details on some of items on the WordPress 2.6 list of changes and updates, including

  • Shift Click selection of multiple checkboxes in the wp-admin
  • More avatar options
  • Page Templates of XML-RPC
  • More “Press This” features
  • Integrated Theme Preview
  • Many other illustrated examples

6/26/2008 ↓

WordPress Theme Releases For 6/26 13comments

One Column Theme

Grunge Superstar

grunge-superstar-thumbnail

Grunge Superstar is a simple one column theme. The theme uses dark colors and you can add in additional information in the footer area.

Linquist

linquist-thumbnail

Linquist is a simple one column theme which can be used to display portfolios. The theme comes in light and dark styles and has built-in lightbox and gravatar support.

Two Column Themes

Brightness

brightness-thumbnail

Brightness is a magazine style 2 column widget-ready theme. You can control the layout of the theme using settings in the Admin Panel.

WP Pixels

wp-pixels-thumbnail

WP Pixels is a two column widget-ready theme. The home page has no sidebars and uses loops for three different categories.

Three Column Themes

Voodoo Empire

rev-vodoo-thumbnail

Voodoo Empire is a three column widget ready theme. The theme makes use of dark colors. Both the sidebars are to the right of the content.

Elements of SEO

elements-of-seo-thumbnail

Elements of SEO is a 3 column widget-ready theme. The theme has two sidebars to the right of the content.

Tags:

6/24/2008 ↓

WordPress Plugin releases for 6/22 12comments

Increase Sociability

Increase Sociability shows customized messages to users who visit your site through StumbleUpon, Digg. The messages enhances your chances to gain better traffic from social networking sites.

Hoard Hunter

Hoard Hunter is an online treasure map game designed and developed for people who would like an easy (and fun) method of fund raising online.

Nofollow Links in Posts

Nofollow Links in Posts plugin enables you to add the nofollow attribute into links in a post within a specified category.

Newspaper Style Posts

Newspaper Style Posts is a simple plugin that splits your post into two columns, as you find in newspaper articles.

SEO Smart Links

SEO Smart Links can automatically link keywords and phrases in your posts and comments with corresponding posts, pages, categories and tags.

Platinum SEO

Platinum SEO offers all the features of All in One SEO plugin plus more. You can import your settings from All in One SEO to Platinum SEO.

Category Search

Category Search allows you to add category names to your search results.

Tags:

6/20/2008 ↓

WordPress Theme Releases for 6/20 9comments

Two Column Themes

Natural Power

natural-power-thumbnail

Natural Power is a two column theme, widget ready, that comes with four different colored header graphics that can easily be changed in the options panel included with the theme.

Blue Block

blue-block-thumbnail

Blue Block is a two column widget-ready theme. The theme comes build in with banner ad integration. The content are is quite smaller compared to other two column themes.

CheckMate

checkmate-thumbnail

CheckMate is a two column theme with 10 widgetized areas. The themes comes with 7 color options.

Out of the Box

out-of-the-box

Out of the Box is a two column widget ready theme. The theme has a widgetized sidebar and footer area along with Gravatar support for WordPress 2.5 and above.

TechJunkie

techie-junkie-thumbnail

TechJunkie is a two column widget-ready theme with 4 widgetized areas including 3 in the footer. The theme comes built in with Gravatar support.

Whisky Air

whisky-air

Whisky Air is a two column widget-ready theme which does not make use of any images. The them uses simple dotted grey lines, justified paragraphs, easy-for-the-eye headings and titles.

Three Column Themes

Wolf

wolf-thumbnail

Wolf is a 3 column black and gray theme featuring wolf photos in header and footer. The theme is widget-ready and supports Gravatars.

Tags:

Friends

Translate

Translate to German Translate to Spanish Translate to French Translate to Italian Translate to Portuguese Translate to Japanese Translate to Korean Translate to Russian Translate to Chinese

Latest Videos

S2