How to upload a plugin to WordPress Plugin directory

In this post I will share a simple tutorial on how to upload your plugin to WordPress plugin directory.

This article will not cover WordPress plugin development, I might write content on that in the future, instead this article will assume that you have your plugin ready for upload. If that’s not the case feel free to contact me about the questions you have and I will answer them in my future blog posts for you.

1. Create a readme file

Your plugin needs this file in order for WordPress and your users to have all the information about your plugin.

Use Readme Validator tool to check whether your readme is correct.

If you want a user-friendly way to generate readme file, use Readme WordPress Generator.

In the end it should look something like this, example taken from a plugin I’ve developed recently.

=== WordSteem === Contributors: cipiko3, thomasschachte Tags: steem, steemit, blockchain, wordsteem Author URI: https://patsch.studio Requires at least: 4.6 Tested up to: 4.7 Stable tag: 4.3 Requires PHP: 5.2.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html == Description == Start monetizing your WordPress posts through the Steemit social economy, a community where users are rewarded for garnering attention by sharing their content. Using the Wordsteem plugin, you can publish posts from your WordPress blog directly to your Steemit account, allowing people to engage and curate your content, and earning you cryptocurrency. Expand your audience beyond your current following, keep your content secure on a blockchain, and start earning money for your contributions, using Wordsteem and Steemit. To learn more about Steemit, check out their FAQ [here](https://steemit.com/faq.html). If you have any questions, feel free to contact us at admin@patsch.studio == Installation == 1. Upload the plugin files to the `/wp-content/plugins/wordsteem` directory, or install the plugin through the WordPress plugins screen directly. 2. Activate the plugin through the 'Plugins' screen in WordPress 3. Use the WordSteem section in your admin panel in the right to navigate to the WordSteem Settings page. 4. In the Settings page enter your "Private posting key" that you can find in your Steemit account page. Please make sure that it is private posting key, not public. If you don't have a steemit account yet, you can create one following those instructions [here](https://steemit.com/faq.html#How_do_I_create_an_account). == Screenshots == 1. WordSteem Settings Page 2. WordSteem post settings when creating new post 3. Published status in post page when it's published to Steemit == Changelog == = 1.0.0 = Initial release. Note: It might be that the readme will interfere with your main plugin file where you’ve defined some fields. If that’s the case just move this information to readme.

2. Pack your plugin files in a zip

Just compress all your plugin files in a zip folder so you could use it in the next step.

3. Submit the plugin for review

Head down to WordPress plugin adding page, click on add plugin and add the zip file you’ve uploaded in the previous step. Note that you have to be logged in to do this.

This will check the validity of your readme file, so you will know if there are any errors.

After that the form will pop up where you have to fill in extra information about the plugin. Fill out all the information requested.

Once you get the notification that it was submitted successfully, you can start waiting for WordPress code review. They will check if your plugin does good in code. You will receive an email from them saying if there are any issues with the code.

If they do say that there are issues — fix them and repeat the steps up until you reach this point.

It might take 2–10 days for your plugin to be reviewed. If that takes longer, get in contact with their support team.

4. You get the validation email

Once your plugin is reviewed by the WordPress team, you will receive an email that should look something like this:

Yay! After this you can start with uploading your plugin.

5. Upload the plugin through SVN

WordPress plugin repository uses SVN instead of Git. Don’t be afraid if you’ve never used it before, it’s similar to Git.

So make sure that your machine has SVN installed on it. To verify if it’s installed, type:

svn help

in your command line, it should come up with something like this:

Now we have to have a local folder where our plugin files reside. Create a folder and move the plugin files to this folder. I’ve decided for myself that I want my local plugin to be /Documents/Projects/wordsteem_wp, so I’ve created it and cd’d into it with following commands:

mkdir ~/Documents/Projects/wordsteem_wp cd ~/Documents/Projects/wordsteem_wp

Now you have to map this folder to the remote path that WordPress has given you in the email. This will pull all your plugin files in WordPress plugin repository. Enter this while in your local plugin directory that you’ve just created. Replace the url with your svn plugin url provided in the confirmation email.

svn co https://plugins.svn.wordpress.org/wordsteem

You should see this output:

> A {yourPluginName}/branches > A {yourPluginName}/tags > A {yourPluginName}/trunk > Checked out revision {revNumber}.

Now you should see new files appear in your local folder. Let’s go through them quickly:

/assets — plugin images. Don’t confuse it with the assets folder you had in your plugin files (if you had one). Those are assets for your overall plugin, not the images you use in your actual plugin code.

Here are the images, their names and their formats. It’s very important to follow them, otherwise it will not work.

Banner:

  • Normal Banner:

     

    banner-772×250.(jpg|png)

  • Normal Banner (RTL):

     

    banner-772×250-rtl.(jpg|png)

  • High-DPI (Retina):

     

    banner-1544×500.(jpg|png)

  • High-DPI (Retina RTL):

     

    banner-1544×500-rtl.(jpg|png)

Icon:

  • Normal:

     

    icon-128×128.(png|jpg)

  • High-DPI (Retina):

     

    icon-256×256.(png|jpg)

  • SVG:

     

    icon.svg

Screenshots:

  • Screenshot 1:

     

    screenshot-1.(jpg|png)

  • Screenshot 2:

     

    screenshot-2.(jpg|png)

  • Screenshot 3:

     

    screenshot-3.(jpg|png)

Note on screenshots: in readme you saw that you can put description for each screenshot, so they are just mapped using this simple numbering. So each description will go to the file with the same number.

/trunk – Your plugin files, those are the files that will be downloaded by the user when he clicks download button.

/tags – Different versions for your plugin. This folder will have folders like 1.0.0, 1.0.1 and so on. It is like a collection of trunks. So when you have a new release, you have to update your change log in readme file and then add a new folder with a proper folder name (tag) and the content of it has to be plugin files for a specific version.

/branches – Different branches of code of your plugin that are divergent

Now, to add you plugin files you need to pack them to the trunk and send them to your remote WordPress plugin directory. Let’s do that.

Add the plugin files to the trunk folder:

Now run the SVN command to add them to your commit.

svn add trunk/*

Note that this will add only the files inside the trunk folder, if you have some in assets or some other files outside trunk (of course you will in the future), you have to add them analogically:

svn add assets/*

You might be asked to authenticate yourself if you haven’t done this already in the terminal. So if you need to, type in the credentials of your WordPress account. Keep in mind that it is the username that has to be used, not email.

Now you can push them to the directory:

svn ci -m 'Plugin files upload'

You should see this output:

> Adding trunk/readme.txt // All the files of your plugin line by line > Transmitting file data .... > Committed revision {revNumber}.

6. Smile, you did it 😉

Now if you go to your plugin url provided in the WordPress success notification email, you should see your plugin and the files you’ve uploaded.

Congratulations, you did it! Now you can try to download your plugin in your plugin url and make sure it works.

Conclusion

So it was not so hard, was it? The hard part was actually creating a plugin, so props for building one, I’m very proud of you! Now it’s the time to start maintaining it, don’t be afraid that there will be issues, there always will be, nothing can be perfect really.

When you see the issue, just fix it, bump the tag version up, add the folder to your tags folder with the new plugin files and remember to update the trunk folder with the new plugin files.