In this article you will learn how to upload a new approved plugin or update an existing WordPress plugin to svn repository.
1. Adding a new plugin to WordPress
This is how you can add a new plugin to WordPress
Go to the following link to upload your plugin: https://wordpress.org/plugins/developers/add/
The screenshots go in the /assets folder the filename for the screenshot should be screenshot-1.png, screenshot-2.png and the number corresponds to the screenshot description number in the readme.txt file.
== Screenshots == 1-This is the description of screenshot-1.png 2-This is the description of screenshot-2.png
We will put the banner in the /assets folder
You need to create a banner with the size below and put it in the assets folder.
We will put the icon images in the /assets folder You
should create two icons with the dimensions below and put them in the assets folder
2. Upload to SVN repository:
This is how you can upload to svn repository
SVN stands for Sub Version. It is a version control system (similar to git).
If you have a Mac, you can install svn using the command:
brew install svn
Link to learn how to use svn: https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/
Go to the directory with the plugin on the terminal:
# here co means checkout
cd ~/plugin-dir # Access the folder that contains your plugin mkdir my-local-dir # Create a new folder named my-local-dir cd my-local-dir svn co https://plugins.svn.wordpress.org/yourpluginname # Load directories from the repository in the new folder cd .. # Go back to your plugin's folder cp yourplugin.php my-local-dir/trunk/ # Copy the main plugin file from the plugin directory to my-local-dir/trunk cp style.css my-local-dir/trunk/ # Copy all other files and directories from your plugin directory to my-local-dir/trunk cp custom-functions.php my-local-dir/trunk/ # Copy the custom-functions file from your plugin directory to my-local-dir/trunk cp readme.txt my-local-dir/trunk/ # Copy readme.txt file to 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 your plugin folder svn add trunk/* # Add all files to svn trunk repo svn add assets/* # Add all files to svn assets repo svn ci -m 'Loading the first version of the plugin' # Publish the files you uploaded to the /truck directory from the local svn repo to the online svn repo. # now enter your wordpress.org password
3. Adding new files to SVN.
This is how you can add new files
cd ~/plugin-dir cp yournewfile.php my-local-dir/yourplugin-dirname/trunk/ ( or my-local-dir/yourplugin-dirname/assets/ any directory you want to add ) cd my-local-dir/yourplugin-dirname svn up svn stat svn add trunk/* --force svn stat svn ci -m 'Add new file' # Publish changes to the svn repository
4. Updating existing files on SVN.
This is how you can update existing files
cd my-local-dir # access and edit files svn up svn stat svn add trunk/* --force svn stat svn ci -m 'Actualizare fisiere' # Publish changes to the svn repository
5. Deleting a file from SVN
This is how you can delete a file from SVN
cd my-local-dir/yourplugin-dir-name # Go to the desired file or folder and delete it 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' # Publish changes to the svn repository
6. Updating the plugin after downloading it from SVN.
This is how you can update the plugin after you have downloaded it from SVN
# Download your existing plugin plugin from wordpress after you have made all the changes to your file go to your local updated dir mkdir my-local-dir # Create a new directory my-local-dir cd my-local-dir svn co https://plugins.svn.wordpress.org/your-plugin-slug # upload 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' # Publish changes to the svn repository For more tutorials, follow our blog posts here.