Top 10 Tips for WordPress Plugin Developers

Top 10 Tips for WordPress Plugin Developers

Posted by
Nispaara Blog

WordPress has become one of the most widely spread blogging and publishing platforms on the Internet today. With the huge number of existing WordPress powered sites, from personal blog to corporate solutions, the demand for WordPress plugin developers has increased largely over the past year and is still strong despite the economic crisis.

So for all WordPress plugin developers out there, from newbies to professionals, here are the top 10 tips to make your job easier.

1. Speed up development using the Ubiquity Firefox add-on

Ubiquity is a cutting edge add-on for Firefox, developed by Mozilla Labs. Ubiquity allows you to search WordPress and PHP documentation in an instant using these two plugins: PHP Search and WP Codex Search.

Ubiquity is also a mashup of a growing number of creative ideas, and some of them could be interesting to transform into a new WordPress plugin.

2. Need a plugin idea? Use the official Ideas forum

It is important for a plugin developer to keep creating plugins, just as it is important for theme developers to produce new themes. Sometimes you will have trouble thinking of new ideas for plugins and this is where WordPress plugin ideas forum comes in. With thousands of plugin ideas posted at this moment, you will have no problem finding a few for your new plugin.

3. Use the WordPress Plugin Directory

WordPress provides a free home for any plugin at the WordPress Plugin Directory.

Hosting a plugin at the plugin directory has several advantages:

– You do not pay for hosting and bandwidth
– You get SVN repository to manage your plugin versions
– You get free download statistics
– You get free promotion for your plugins

The best thing is that setting it up does not take more than half an hour. You can find detailed instructions in the Developer Center.

4. Invest time in making a proper readme.txt file

A readme.txt file should be a part of every plugin distribution. Time invested in creating one will be well worth it in the long run.

The most obvious advantage of a good readme.txt is that the plugin will have more downloads, as users are inclined to download plugins with good descriptions, installation instructions and screenshots. The second advantage is not so obvious. If your plugin becomes popular you will start getting a lot of support questions which with time you won’t be able to handle – having a good readme file will to a certain extent help you avoid this situation.

The WordPress Developer Center offers a standard readme.txt file which is a good base to build your own on.

5. Promote Your Plugin

Once you are done with your plugin you want to ensure maximum exposure and downloads. Here are the steps to follow:

1. Head to the WordPress Plugins and Hacks forums.

2. Create a new topic, for example: [New plugin: Insights]

3. Use a simple but informative template to describe your plugin release: Plugin Name: Insights
Plugin URL: http://www.prelovac.com/vladimir/wordpress-plugins/insights
Description: Insights brings a powerful new way to write your blog posts. It increases productivity and at the same time the appeal of your posts.

4. Visit the Weblog Tools Collection forum and create a topic there as well, using the same template. After the Weblog Tools Collection team reviews the topic, it should be added to their regular plugin news post, which appears on the dashboard of every WordPress user.

5. Add your plugin to wp-plugins.net. This is another place where users will look for a plugin.

6. Add your plugin to the WordPress Plugin Compatibility list. You need to register before you can add changes to the list.

7. Announce the plugin on your blog.

6. Enhance plugin security by using nonces

Nonce stands for number used once and is a very effective way of securing your plugin against a cross-site request forgery (CSRF) hacking attack.

Luckily, implementing nonces in your plugins is a matter of a few minutes of work. To get started, check WordPress documentation, which has examples of implementation.

7. Mind your database queries
Make sure you use functions provided by WordPress to create database queries and insert/update information. These functions are $wpdb->prepare(), $wpdb->insert() and $wpdb->update(). This will ensure your queries are properly escaped.

Also check out a nifty slideshow presentation on WordPress security by Mark Jaquith presented at WordCamp SF 2008.

8. Don’t forget the optimization

WordPress plugins can sometimes be a real resource hog. To make sure your plugin isn’t, you need to localize the usage of resources, by loading them only when you need them.

You can use the following example to execute certain code (like declare additional actions and filters) only when WordPress is loading plugins.php page (list of installed plugins in the backend):

$local_pages=array(‘plugins.php’); // define pages we want the plugin to be activated on

if (in_array($pagenow, $local_pages))
{
// do stuff here
}

Similar to this, you should pay attention to load JavaScript files only when you need them.

9. Properly load JavaScript with wp_enqueue_script

If you are using external JavaScript files, these should be invoked using wp_enqueue_script() function. If you want to pass variables to your JavaScript from your plugin, you should use wp_localize_script() function. It not only makes it easier to handle and change but also ensures maximum compatibility for your plugin in the future.

10. How to handle freelance work

The best way to start getting work is to create a couple of free plugins, publish them in the WordPress directory and promote them.

After some time, you may be approached by parties interested in custom development. When that happens and a deal is made, do not be afraid to ask for part of the payment upfront. In fact that will signal to the client you mean business, and if they agree it will signal to you that they mean business too. Make sure to pick your hourly rate, considering the market and your ambitions, and stick to it. Be consistent and honest about it and the clients will appreciate it.

Courtesy: http://mashable.com/2009/03/25/wordpress-plugin-developer-tips/

Leave a Reply

Your email address will not be published.