In this guide, you will learn how to submit a new approved plugin or update an existing WordPress plugin on SVN (Subversion) repository on macOS
1. Adding a New Plugin to WordPress:
a. Visit the following link to upload your plugin: https://wordpress.org/plugins/developers/add/
b. Screenshots:
Place your screenshots in the /assets folder. Name them screenshot-1.png, screenshot-2.png, and so on, corresponding to the description number in your readme.txt file.
== Screenshots ==
1-Description for screenshot-1.png
2-Description for screenshot-2.png
c. Creating Banners:
Create a banner with the size banner-772x250.png and place it in the /assets folder.
d. Creating Icons:
Create two icons with the sizes icon-128x128.png and icon-256x256.png. Put them in the /assets folder.
2. Uploading to SVN Repository:
SVN, which stands for Subversion, is a Version Control System similar to Git.
On Mac, you can install SVN using the command brew install svn
.
a. Navigate to your local plugin directory:
cd ~/plugin-dir
b. Create a new directory inside your plugin directory:
mkdir my-local-dir
cd my-local-dir
c. Load SVN repository directories into your local directory:
svn co https://plugins.svn.wordpress.org/yourpluginname
cd ..
d. Copy your plugin files into the local SVN directory:
cp yourplugin.php my-local-dir/trunk/
cp style.css my-local-dir/trunk/
cp custom-functions.php my-local-dir/trunk/
cp readme.txt 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
e. Add all files to SVN trunk and assets repositories:
svn add trunk/*
svn add assets/*
f. Commit the changes to the SVN repository:
svn ci -m 'Adding the first version of my plugin'
# You'll be prompted to enter your WordPress.org password
3. Adding New Files to SVN During Plugin Update:
a. Copy your new file to either the trunk or assets directory:
cp yournewfile.php my-local-dir/yourplugin-dirname/trunk/
# Or
cp yournewfile.php my-local-dir/yourplugin-dirname/assets/
b. Update your local SVN directory:
cd my-local-dir/yourplugin-dirname
svn up
svn stat
svn add trunk/* --force
svn stat
c. Commit the changes to the SVN repository:
svn ci -m 'Add new file'
4. Updating Existing Files to SVN During Plugin Update:
a. Make changes to your plugin files in your local directory.
b. Update your local SVN directory:
cd my-local-dir
svn up
svn stat
svn add trunk/* --force
svn stat
c. Commit the changes to the SVN repository:
svn ci -m 'Update existing files'
5. Deleting a File from SVN:
a. Go to the directory where the file or folder exists and delete it using SVN delete:
cd my-local-dir/yourplugin-dir-name
svn delete filename
cd my-local-dir
svn up
svn stat
svn add trunk/* --force
svn stat
b. Commit the changes to the SVN repository:
svn ci -m 'Delete file'
6. Updating Your Plugin After Downloading from SVN:
a. Download your existing plugin from WordPress once you've made all the necessary changes.
svn co https://plugins.svn.wordpress.org/yourpluginname
b. Create a new local directory for the updated version:
mkdir my-local-dir
cd my-local-dir
svn co https://plugins.svn.wordpress.org/your-plugin-slug
c. Make the necessary updates in your local directory.
d. Update your local SVN directory:
cd my-local-dir/yourplugin-dirname
svn up
svn stat
svn add trunk/* --force
svn stat
e. Commit the changes to the SVN repository:
svn ci -m 'Update plugin'