Submit and Update a WordPress Plug-in

WordPress is currently the most popular blogging platform (as of 2009). It is released as open source and can be used by anyone for free. Because of this immense popularity, it is widely supported by web developers who aim to improve the user experience through the use of WordPress plug-ins. If you want to submit or update a plug-in yourself, keep reading.

In my personal experience, it is not a straightforward procedure to submit a plug-in, or even to update your plug-in. This article provides a basic overview of the process of submitting and updating your WordPress plug-in. So if you are planning to develop a plug-in or share the plug-in you wrote, but are not sure of how to submit or update it, then keep reading.

The Essential Steps to Submit a Plug-in

The first thing you need to do is visit http://wordpress.org/extend/plugins/register.php, and register yourself there. Fill in the information accurately, and then click the “Register” button. WordPress will send the complete login information to your email address.

When you receive the email containing your login details, the next thing you will do is log in here: http://wordpress.org/extend/plugins/add/, using the username and password sent by WordPress. After successfully logging in, you will see the “Add Your Plug-in” form. You cannot see this form if you are not logged in.

Again, you need to fill out the form accurately so that it will exactly reflect the name and function of your plug-in. For example, say I wrote a plug-in that will automatically sorts the WordPress search results by post title. I can name the plug-in ”Sort Search Result by Title,” and put that on the form.

The same holds true with your description. You need to elaborate further on the functionality of your plug-in, and explain why it is useful and unique. Remember that your information will be moderated and approved by WordPress, so make sure you state the required information very clearly.

The WordPress Plug-in URL on the “Add Your Plug-in” form is optional, but it will be useful for WordPress plug-in moderators to see the exact code of your plug-in and assess the plug-in’s importance/uniqueness. The idea is to avoid obvious duplication of developed plug-ins. Remember that once WordPress approves your plug-in, you are allowed to host the plug-in at http://wordpress.org, so it can be shared with the rest of the WordPress community.

One day after you submit your request, WordPress will provide a reply as to whether or not they have approved your plug-in. For example, the screen shot below is a confirmation of an approved plug-in request:

When you receive a confirmation of plug-in approval from WordPress, it is time to start uploading your plug-in to their SVN repository.

WordPress uses Subversion software as a method to organize uploaded plug-ins. It is used to track changes in the code. It is also used to provide a systematic/automatic way to display plug-in related content to the public in HTML, while letting plug-in developers use a CMS to display useful information such as plug-in descriptions, installation methods, FAQ, Change logs, etc.

This means that all a developer needs to do is upload those plug-in files correctly to their intended repository path, and WordPress will take care of the rest of displaying/converting those uploaded content to HTML. For example: http://wordpress.org/extend/plugins/sort-searchresult-by-title/  

Uploading files to the repository is a “completely different approach” from what is commonly done (such as using FTP, Cpanel or CMS) and can be very confusing to a new WordPress plug-in developer without experience in Subversion. The repository is analogous to a directory hosting space, which you can used to store your plug-in files (such as the PHP script and Readme.txt).

To upload your plug-in files, you need a subversion client. If you are using Windows, the recommended client is TortoiseSVN. Select the appropriate version of your operating system. For example, if you are using the 32 bit Windows, select the 32 bit installer.

After installation, it will ask you to restart; once you do, you are ready to use TortoiseSVN.

There are basically two important files that you need to prepare to submit a plug-in to the WordPress repository. These are the readme.txt and your PHP plug-in script. A detailed discussion of how to make a readme.txt as well as your script is beyond the scope of this article. It is highly recommended that you read this tutorial from WordPress: http://codex.wordpress.org/Writing_a_Plugin  

TIP: You are going to make your readme.txt and your PHP script. It is important to double check that it works not only for the current WordPress version, but for the older version as well. Then note the results of your test, because you are going to append that to your readme.txt. Below is an excerpt from a readme.txt that shows you where you will put this information:

Contributors: Codex-m

Tags: search result, post title, wordpress search, sort search result by title

Requires at least: 2.5.1

Tested up to: 2.8.2

Stable tag: 2.0

The above information means that in order for the plug-in to work, it needs WordPress 2.5.1 and it is tested to work until version 2.8.2.

The phrase “Stable tag” is used to indicate the latest version of your plug-in; in the above example, it is version 2.0. “Tags” are used to indicate which keywords you would like plug-in users to use to locate your plug-in.

If you have completed the preparation stage of your plug-in, it is time to upload it to your own plug-in repository assigned by WordPress. Follow the simple steps below:

Step 1: Make a folder where you would like to place your plug-in. For example, say you would like to place this folder in the root of drive E. In naming the folder, use dashes; this is not a requirement, but I find this is safe. For example, if the name of the plug-in is: “Sort SearchResult By Title,” you assign a folder name of “sort-searchresult-by-title.”

Step 2: Place all of the important files inside that folder, particularly the README.TXT and the PHP script.

Step 3: Right click on the folder, and then go to TortoiseSVN -> Click Import. See the screen shot below:

Enter the repository URL (provided by WordPress during the confirmation; refer to previous section) + “trunk” directory appended in the URL (see above screen shot in the “URL of repository”).

Note: The “trunk” folder is where you should upload your plug-in files (PHP script and readme.txt) if you want your plug-in to be displayed on the WordPress site. This is required by WordPress.

After that, press OK. WordPress might ask for authentication (especially for a first time log-in). Use the username and password provided by WordPress in the email.

Step 4: Double check to make sure it is correctly uploaded to the right path (trunk folder).

One of the easiest ways to determine that you have correctly uploaded your files is to use the TortoiseSVN “repo-browser” feature. To use the repo-browser, right click your plug-in folder in your local computer and then go to TortoiseSVN -> Repo-browser.

Repo-browser enables you to see all of the folders and files in your WordPress plug-in hosting/subversion server. For example, if you enter the root URL of your repository like so: http://svn.wp-plugins.org/sort-searchresult-by-title , you can see all the folders in it. You should upload all plug-in files to be shown on the WordPress site to the “trunk” folders. All revision history files (e.g. version 1.0, version 2.0, etc) should be stored in the “tag” folders. You can then use the IMPORT feature to upload files.

Note that when using the “import feature,” you cannot upload files if they exist physically on the repository (they cannot be overwritten). You need to manually delete those files using a “repo-browser” (navigate to the file and then right click), and replace them with the correct ones.

Eventually, the time will come that you need to update your plug-in. You need to make a folder named “tags” on your local computer. Inside that folder should be versions of your plug-in. You can label those folders ”VERSION 1.0″ and “VERSION 2.0,” where version 1.0 is the original plug-in and version 2.0 contains the updated files (updated readme.txt and PHP script, for example).

What you do next is right click on ”tags” and then select “import” using TortoiseSVN. You will then need to upload the updated files in two spots:

1. First to the tags folder in the WordPress repository. For example, with my plug-in, I upload it to http://svn.wp-plugins.org/sort-searchresult-by-title/tags/ (I will use this as the import path)

2. Once the tag folder has been updated, you need to update the files in the TRUNK folder for your readme.txt and PHP files as well. You’ll also need to upload an updated version to the TRUNK folder.

If you successfully uploaded your files in the “tags” folder, it will be reflected under the ”other versions” link in your WordPress plug-in page, and “version 2.0″ is reflected if “stable tag” is set to “2.0.” The download link in the plug-in page comes from the trunk folder that you have updated.

Google+ Comments

Google+ Comments