If you want to publish your plugins on the the WordPress Plugin Directory, you will need to use SVN (Apache Subversion) version control system to upload your code. Unlike Git, WordPress SVN is a release system; therefore, WordPress wants the developers to only upload ready-to-be-used versions of your plugin. You should keep your code in development separate from WordPress SVN.
This article will cover:
- The plugin submission process
- Installing TortoiseSVN
- Uploading your plugin to WordPress SVN for the first time
- Editing your plugin web page on WordPress.org
- Releasing updates for your plugin
Plugin Submission Process
First, you need to make sure your plugin follows these guidelines; the important most one is to have a readme.txt file in the correct format since that populates the content of your plugin page. Online readme generator for WordPress plugins or the readme.txt validator are useful for creating your readme.txt. Then, upload your plugin here as a zip package. After it is reviewed and approved, you will receive two emails with the links to your SVN URL and the plugin URL, as the ones below.
Once approved, you can upload your plugin using an SVN client. In this case, we will use TortoiseSVN.
You can download and install TortoiseSVN from TortoiseSVN website. Make sure the option Command Line Tools is checked during installation as shown below.
After installation is completed, you will see that the Explorer context menu has SVN Checkout and TortoiseSVN items added. Once we are done, you can remove this clutter from your context menu in the TortoiseSVN settings, which can be launched by typing the following in the command line. We need to keep it for now, though.
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:settings
Uploading Your Plugin to WordPress SVN for the First Time
Create a new folder, open it, right-click inside, and select SVN Checkout.
Enter your SVN URL from the email and click OK.
Now, you should be seeing three directories in the folder where you performed SVN checkout. Copy the contents of your plugin folder into the trunk folder. Please note that you need to place main plugin file (e.g. my-plugin,php) and everything else in that directory in the trunk/ folder, not in trunk/my-plugin/ folder. Then, right-click on the trunk folder, select SVN Commit. On the Commit window, type a message that describes this commit, select the files you want to upload, and click OK.
Enter your wordpress.org credentials when prompted for authentication. Once you see the Commit Finished window, click OK. Congratulations, you plugin is now available for download from the WordPress Plugin Directory and on the Add New Plugin page of every WordPress installation in the world.
Editing Your Plugin Web Page on WordPress.org
Your plugin page on WordPress.org is determined by the readme.txt file of your plugin. If the stable tag of your readme.txt in your /trunk directory is missing or set to “trunk”, then that readme file populates the plugin page. If stable tag is set to a version, then the readme file of that version in the /tags directory will populate the plugin page. Details about population each field can be found on the Plugin Readmes article on wordpress.org.
Icon, Banner, and Screenshots
All images for icon, banner, and screenshots should be places in the /assets on your SVN directory. Correctly named jpg and png files will be added to the plugin page automatically after commit confirmation email is received.
Plugin icon and its retina version should be named icon-128×128 and icon-256×256, banner picture and its retina version should be named banner-772×250 and banner-1544×500, respectively. Their size should be at the dimensions in the filenames.
Screenshots named as screenshot-1, screenshot-2, and so on. Their dimensions are not restricted. Captions of the screenshots are populated from the readme.txt file:
== Screenshots == 1. Caption for screenshot-1 2. Caption for screenshot-2
How the plugin assets work article on wordpress.org describes further details such as using svg files and rtl considerations.
Releasing Updates for Your Plugin
If you did not specify a stable tag, the default is trunk. This means all you need to update your plugin is to replace the new files and commit to SVN.
If you do use stable tags, additionally, you need to make sure you add a directory with the name of the current version number, paste the files in that directory (confirm the additional commit prompt, if needed), and ensure that the stable tag in the readme file in the trunk directory is set to the correct version.
Please note that WordPress SVN is intended for development versions of your code. Only production code is supposed to be kept on the SVN.