Register | Login

How to add your plugin to the WordPress repository with SVN (Subversion)

So you have made an awesome plugin and you want to put it onto the WordPress repository with Subversion…

When first reading up on how to add my plugin to the WordPress repository I felt extremely overwhelmed and out of my depth. Despite that, I stuck with it, and once I got my head around it, I realised that it wasn’t that bad. I am going to walk you through the entire process of how to add a plugin to the WordPress Repository in simple steps with no fancy jargon.

 

In this tutorial you will learn:

  1. How to get your plugin ready for reviewal by WordPress
  2. How to add your plugin to the WordPress repository with SVN (Subversion)

 

I am going to assume you have an understanding of plugin development and file structure. I am also going to assume your plugin complies with the WordPress Coding Standards. If not read the documentation.

 

 

How to get your plugin ready for reviewal by WordPress

 

Step 1: Quickly make yourself an account on wordpress.org

You will need to do this in order to upload your plugin.

 


 

Step 2: Read this short documentation page

It takes less than 5 minutes but is very helpful and a good place to start…
https://wordpress.org/plugins/about/

 

After reading that you may be thinking…

  • GPLv2 License?
  • readme.txt?
  • Subversion?

 

Don’t worry they sound worse than they are and we will cover these in this tutorial.

 


 

Step 3: Adding the plugin header information and GPLv2 License

At the top of your main plugin file you should have already added in your plugin header information but there’s an example below if you haven’t. To make your plugin compatible with the GNU General Public License v2 simply use the template below as that’s all you need to do in order for your plugin to be licensed under GPL2.

 

/*
* Plugin Name: Responsive Cookie Consent
* Plugin URI: http://www.jameskoussertari.co.uk
* Description: A really simple, lightweight, responsive cookie consent plugin for WordPress.
* Version: 1.0
* Author: James Koussertari
* Author URI: http://www.jameskoussertari.co.uk
* Text Domain: responsive-cookie-consent
* Domain Path: /languages/
* License: GPL2
*/
/* Copyright 2015 James Koussertari (email : hello@jameskoussertari.co.uk)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

 


 

Step 4: Adding a readme.txt file

Here is what WordPress says about the readme.txt file:

To make your entry in the plugin browser most useful, each plugin should have a readme file named readme.txt that adheres to the WordPress plugin readme file standard. You can put your readme file through the readme validator to check it.

Below is a working example of a readme file that you can use to base your plugin around.

 

=== Responsive Cookie Consent ===
Contributors: James Koussertari
Tags: responsive cookie consent, responsive cookie banner, cookie consent, cookie banner, cookie law, cookie notice, EU cookie law
Requires at least: 3.1
Tested up to: 4.4
Stable tag: 1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.htmlSimple, lightweight, fully customisable and responsive.== Description ==
<h1>Key Features</h1>
<ul>
<li>Responsive</li>
<li>Fully customisable</li>
<li>Simple and lightweight</li>
<li>Modern and clean design</li>
<li>Multi-language compatibility</li>
<li>Compatible with Explorer 8</li>
<li>Includes the option to hide or show the cookie bar</li>
<li>Includes the option to show on all pages or front page only</li>
<li>All text and links can be changed in the RCC settings menu</li>
</ul>== Installation ==
<ol>
<li>Upload the responsive-cookie-consent folder to the ‘/wp-content/plugins/’ directory.</li>
<li>Activate the plugin through the ‘Plugins’ menu in WordPress.</li>
<li>Change the settings in settings > RCC</li>
</ol>

== Frequently Asked Questions ==
There are no FAQ’s.

== Screenshots ==
1. Desktop
2. Mobile
3. Settings== Changelog ==

= 1.0 =
* This was the first version

== Upgrade Notice ==

= 1.0 =
This was the first version

 


 

Step 5: Submit your plugin for review

Once you have signed in to your worpress.org account go to wordpress.org/plugins/add/

You will be taken to a form with three fields that you must fill out carefully.

 

wordpress-submit-plugin-form-wordpress-repository

 

Plugin Name

The plugin name you submit here will become the URL of the plugin in the directory. The name is not changeable later, so check your spelling and be sure that you get this form correct!

For example: “Demo Plugin Name” will become http://wordpress.org/plugins/demo-plugin-name

 

Plugin Description

Enter a description so the reviewer can understand what your plugin does. This will not be used as the actual description of your plugin so don’t spend hours trying to perfect it.

 

Plugin URL

You must zip up your plugin and host it somewhere online. I create a folder in my WordPress theme directory and give them the link to that file. The links I provide look something like http://www.yourdomain.com/wp-content/themes/theme-name/zips/plugin-name.zip

 


 

Step 6: Await email from WordPress

You may have to wait a couple of days for WordPress to get back to you. If your plugin is accepted you will be sent an email like this…

JamesKoussertari,

Your plugin hosting request has been approved.

Within one hour, you will have access to your SVN repository at http://plugins.svn.wordpress.org/responsive-cookie-consent/ with your WordPress.org username and password (the same one you use on the forums).

 


 

How to add your plugin to the WordPress repository with SVN (Subversion)

 

Step 1: Understanding what Subversion is and what it does

Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders. If you are familiar with GIT then it’s very similar to that.

Basically WordPress stores all of the plugins on the repository and you have to use Subversion to be able to add, edit or delete files on the server.

Subversion is a command line tool so you need to have a basic understanding of Terminal on Mac and Command prompt on Windows. If you don’t then follow this great tutorial by Viking Code School http://www.vikingcodeschool.com/web-development-basics/a-command-line-crash-course

 

Alternatively you can use a SVN Client, however that is not taught in this tutorial.

Mac OS SVN Clients

Windows SVN Clients

 

If you are using Mac OS X then the SVN command line tool comes preinstalled on your machine. If you are on a PC then you can download it from http://sourceforge.net/projects/win32svn/

 

Now you know what SVN is and what it does you can move onto step 2.

 


 

Step 2: Create a local directory(folder) to sync to the WordPress repository.

Create an empty folder on your desktop called svn.

Your online plugin repository ‘http://plugins.svn.wordpress.org/responsive-cookie-consent/‘ will already contain three folders by default.

/trunk
/branches
/tags

 

Trunk is where we will put your plugin files and this is the only directory you need to worry about for now. It should always contain the latest version of your plugin.

Branches is where you put major version changes of your plugin. For example version 1.0 to 2.0.

Tags is for smaller changes of your plugin. For example 1.0 to 1.1.

 

We need to get these folders from the server and put them into our local folder.

To do this we have to open up Terminal/Command Prompt and navigate to our newly created svn folder which I will show you how to do in step 3.

 


 

Step 3: Use Subversion to connect to the repository and copy its content to our local directory

Firstly this resource from WordPress is very useful for learning the basic svn commands, however we will cover the ones we need in this tutorial.

Type the following into the command line…

cd desktop
cd svn
svn co https://plugins.svn.wordpress.org/your-plugin-name
In English that means:
Go to my desktop
Got to my local svn folder
Copy the files/folders in the online repository to my local folder.

 

The command line should then return something like this:

> A your-plugin-name/trunk
> A your-plugin-name/branches
> A your-plugin-name/tags
> Checked out revision 11325.

 

Now inside your svn folder there should be a new folder (your-plugin-name) and three folders inside that; trunk, branches and tags. That means we have successfully retrieved the folders from the online repository and can move onto step 4.

 


 

Step 4: Using subversion to add your plugin files to the WordPress repository.

OK so now you need to copy your plugin files from where they are stored on your computer and paste them into the trunk folder.

Once you have done that close your command line fully and then re open it.

Then navigate to your local plugin repository with the following commands…

cd desktop
cd svn
cd your-plugin-name
svn https://plugins.svn.wordpress.org/your-plugin-name
In English that means:
Go to my desktop
Go to my local svn folder
Go to my local plugin repository folder
Connect to the online repository with svn

 

Then we need to tell Subversion we want to add those new files we put in the local trunk folder to the online repository.

To do that we type:

svn add trunk/*
In English that means:
Tell Subversion we want to add everything inside the trunk folder to the online repository.

 

The command line should then return something like this:

> A trunk/my-plugin.php
> A trunk/readme.txt

 

 

Then we have to commit the changes which will upload the files to the repository.

svn ci -m ‘Adding first version of my plugin’
In English that means:
Commit the changes and add the files to the online repository, tagging it with a familiar description.

 

The command line should then return something like this:

> Adding trunk/my-plugin.php
> Adding trunk/readme.txt
> Transmitting file data.
> Committed revision 11326.

 

All done!

Your files should now be live in the repository and your plugin should be available to download shortly.

James koussertari

RECENT TUTORIALS

Leave a reply

We use cookies to ensure that we give you the best experience on our website.