Submitting A New WordPress Plugin And Uploading It On SVN

In this blog you will learn about uploading a new approved plugin or updating an existing WordPress plugin on svn.

1. Adding New Plugin to WordPress  

Go to below link and upload your plugin :
https://wordpress.org/plugins/developers/add/

Add read me file

Screenshots

Screenshots go in the /assets folderthe filename for screenshot should be screenshot-1.png, screenshot-2.png and the number corresponds to the description no. of screenshot in readme.txt file

== Screenshots ==

1-This is the description of screenshot-1.png
2-This is the description of screenshot-2.png

Creating Banners

Banner go in the /assets folder 
You should make banner of below size and put that in assets folder

banner-772x250.png

Creating Icons

Icons go in the /assets folder 
You should make two icons of below sizes and put them in assets folder

icon-128x128.png
icon-256x256.png

2. Uploading in SVN repository:

SVN stands for Sub Version . Its is a Version Control System ( similar to git )
If you are on Mac you can install svn using command

brew install svn

Link to know how to use svn: https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/

Go to your plugins directory on terminal:
# here co stands for checkout

cd ~/plugin-dir                                         # Go to your plugin directory in your local computer
mkdir my-local-dir                                      # Make a new dir my-local-dir inside your plugin directory  
cd my-local-dir
svn co https://plugins.svn.wordpress.org/yourpluginname # load svn repo directories to your my-local-dir
cd ..                                                   # Go back to your plugin directory
cp yourplugin.php my-local-dir/trunk/                   # Copy your main plugin file from your plugin dir into my-local-dir/trunk
cp style.css my-local-dir/trunk/                        # Copy all other files and dir from your plugin dir into my-local-dir/trunk
cp custom-functions.php my-local-dir/trunk/             # Copy your custom-functions file from your plugin dir into my-local-dir/trunk
cp readme.txt my-local-dir/trunk/                       # Copy your readme.txt file into my-local-dir/trunk
cp screenshot-1.png my-local-dir/assets/
cp icon-128x128.png my-local-dir/assets/
cp icon-256x256.png my-local-dir/assets/
cd my-local-dir/yourplugin-dir-name                     # Go to plugin dir
svn add trunk/*                                         # Add all files to svn trunk repo
svn add assets/*                                        # Add all files to svn assets repo
svn ci -m 'Adding first version of my plugin'           # push the files you have uploaded into /truck dir of local svn repo to online svn repo
# now put your wordpress.org password

3. Adding New files to SVN during Plugin update.

cd ~/plugin-dir
cp yournewfile.php my-local-dir/yourplugin-dirname/trunk/  ( or my-local-dir/yourplugin-dirname/assets/ whichever dir you want to add to )
cd my-local-dir/yourplugin-dirname
svn up
svn stat
svn add trunk/* --force
svn stat
svn ci -m 'Add new file'               # push the changes to online svn repo

4. Updating existing files to SVN during Plugin update.

cd my-local-dir //make changes to your files 
svn up
svn stat
svn add trunk/* --force
svn stat
svn ci -m 'Add new file'               # push the changes to online svn repo

5. Deleting a File from SVN

cd my-local-dir/yourplugin-dir-name //GO to that file or folder and delete using svn delete filename
svn delete filename
cd my-local-dir
svn up
svn stat
svn add trunk/* --force
svn stat
svn ci -m 'Add new file'               # push the changes to online svn repo

6. Updating your plugin after downloading it from the SVN.

# Download Plugin your existing plugin from wordpress once you have made all the changes to your file go to your updated dir locally
mkdir my-local-dir                                      # Make a new dir my-local-dir
cd my-local-dir
svn co https://plugins.svn.wordpress.org/your-plugin-slug # load svn repo directories to your my-local-dir

# Now make the necessary updates

cd my-local-dir/yourplugin-dirnme
svn up
svn stat
svn add trunk/* --force
svn stat
svn ci -m 'Add new file'               # push the changes to online svn repo

Leave a Reply