Step 1: Install and Set Up SVN
Make sure SVN (Subversion) is installed and properly configured on your computer. You can check if it’s installed by running the following command:
If SVN isn’t installed, download and install it from the SVN official site.
Step 2: Navigate to Your Plugin Directory
Once SVN is installed, open Command Prompt (Windows) or Terminal (macOS/Linux) and navigate to the folder where your plugin resides. For example, your plugin is located at:
Ensure you’re in the plugin directory where your trunk folder and other plugin files are stored.
Step 3: Check the Status of the SVN Working Copy
Before committing any changes, you can check the status of your working copy (which files are modified, added, or deleted) by running:
This will list all the files and folders in your working copy and indicate whether they have been modified (M), added (A), or deleted (D).
Example Output:
A trunk/assets/new-file.css
-
M means the style.css file has been modified.
-
A means new-file.css has been added and is pending commit.
Step 4: Modify an Existing File (e.g., style.css)
If you’re modifying an existing file (e.g., style.css), here’s how you do it:
-
Open the file in your text editor (e.g., Visual Studio Code, Sublime Text).
-
Make the necessary changes to the file.
-
Save the file.
Once saved, you don’t need to add the file again since it’s already tracked by SVN.
Step 5: Add New Files (e.g., new-file.css)
If you add a new file (like new-file.css), you need to tell SVN to track this file using svn add.
-
Create or place the new file in the correct directory (e.g., trunk/assets/new-file.css).
-
Add the file to SVN:
-
Check the status again to make sure the new file is added:
Now, you should see A next to the new file (new-file.css), indicating that it’s ready to be committed.
Step 6: Commit Your Changes (For Existing and New Files)
After modifying existing files or adding new files, you need to commit them to the SVN repository.
-
Commit all changes (including modifications and new files) by running:
-
The -m flag is for the commit message, where you should describe what changes were made (e.g., “Updated CSS for video modal”).
-
SVN will prompt you to enter your credentials (if you haven’t configured them already).
-
Wait for the confirmation: After running the commit command, SVN will process the files and upload your changes to the repository. You should see a confirmation like this:
Sending trunk/assets/style.css
Adding trunk/assets/new-file.css
Transmitting file data .done
Committed revision 1234.This means your changes have been successfully committed.
Step 7: Create a Tag for a New Version (Optional)
Once your changes are committed, you might want to create a version tag for the plugin, especially if you’re preparing a new release. Tags represent stable versions of your plugin.
Tagging the New Version:
If you’ve made significant changes (like adding a new feature or updating styles), and you want to release a new version (e.g., version 1.3.0), you can create a tag for that version.
-
Create a tag for the new version:
-
This command creates a copy of the trunk folder and saves it as a new version under tags/1.3.0.
-
The -m flag is for the commit message, which should describe the version being tagged (e.g., “Tagging version 1.3.0”).
-
Verify the tag by browsing to the WordPress plugin repository. You should now see a folder for the new version (1.3.0).
Step 8: Verify and Check the Commit
After committing and tagging, it’s a good idea to verify that your changes were applied correctly.
-
Check the commit history with:
This will display a list of commits, showing the most recent ones along with commit messages and revision numbers.
-
Check the updated version in WordPress:
-
Go to the WordPress Plugin Repository.
-
Search for your plugin (smartupworld-video-modal).
-
Ensure that the latest version is updated and includes your changes.
-
Step 9: Update the Plugin in WordPress
If your plugin is already installed on a WordPress site, you can go to Dashboard > Updates and click Check Again. If a new version is available (e.g., 1.3.0), you can update it to reflect your changes.
Step 10: Troubleshoot Common Issues
-
Changes Not Showing Up:
-
Clear cache: If you have caching plugins in WordPress (like W3 Total Cache or WP Super Cache), make sure to clear the cache.
-
Browser Cache: Clear your browser cache or do a hard refresh (Ctrl + F5).
-
-
Error Committing:
-
Permissions issue: Make sure you have commit access to the repository.
-
Uncommitted Changes: If SVN says you have uncommitted changes, make sure all modified files are committed before tagging or pushing new changes.
-
Final Recap of Steps:
-
Navigate to the plugin directory (cd command).
-
Check status (svn status).
-
Modify existing files (e.g., style.css) or add new files (e.g., new-file.css).
-
Commit changes (svn commit).
-
Tag a new version (optional) for releases (svn copy).
-
Verify the commit and ensure everything is reflected in WordPress.
Conclusion
This guide covers the entire process of:
-
Adding new files (e.g., new CSS files).
-
Updating existing files (e.g., modifying style.css).
-
Committing your changes to SVN.
-
Tagging a version to mark a stable release.
-
Verifying that the changes are reflected on WordPress.