Tips and tricks

How to add a plugin to the WordPress repository
Posted on November 15 2023 / in WordPress
Install the svn via homebrew or from their website
brew install svn
Update the plugin
cd /Users/raduh/Dropbox/hosts/devsite/wpenabledebug/svn2 svn co https://plugins.svn.wordpress.org/your-plugin/ cd your-plugin svn add trunk/* svn ci -m 'Adding first version of my plugin' svn cp trunk tags/2.0 svn ci -m "tagging version 2.0"
push a version:
you can use to resolve conflicts
svn status
svn commit -m "Fixes after initial release"
confirm tags:
svn list https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/tags
create a tag:
svn copy \
https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/trunk \
https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/tags/1.0.10 \
-m "Hotfix release 1.0.10"
check what is live:
svn cat https://plugins.svn.wordpress.org/dzs-video-block-for-youtube/trunk/README.md | grep "Stable tag"
useful tips:
you can use to resolve conflicts
svn update svn resolve
deploy from git to svn:
you can use this script
#!/usr/bin/env bash
set -e
PLUGIN_SLUG="dzs-video-block-for-youtube"
VERSION="$1"
if [ -z "$VERSION" ]; then
echo "โ Usage: ./deploy-wporg.sh <version>"
exit 1
fi
GIT_DIR="$PWD"
SVN_DIR="$HOME/dev/${PLUGIN_SLUG}-svn"
echo "๐ง Building assets..."
npm install
npm run build
echo "๐งน Cleaning SVN trunk..."
rm -rf "$SVN_DIR/trunk/*"
echo "๐ฆ Syncing files to SVN trunk..."
rsync -av --delete \
--exclude=".git" \
--exclude="node_modules" \
--exclude="deploy-wporg.sh" \
--exclude="*.map" \
"$GIT_DIR/" "$SVN_DIR/trunk/"
cd "$SVN_DIR"
echo "โ SVN add/remove..."
svn add trunk/* --force
svn status | grep '^!' | awk '{print $2}' | xargs -r svn delete
echo "๐ค Committing trunk..."
svn commit -m "Release $VERSION"
echo "๐ท Creating SVN tag $VERSION..."
svn copy \
https://plugins.svn.wordpress.org/$PLUGIN_SLUG/trunk \
https://plugins.svn.wordpress.org/$PLUGIN_SLUG/tags/$VERSION \
-m "Tagging $VERSION"
echo "โ Deployment complete: $VERSION"
Recent Comments
- admin on Vimeo Thumbnail Generator
- Robert Moeck on Vimeo Thumbnail Generator
- Rainer on Vimeo Thumbnail Generator
- Video Gallery WordPress Plugin /w YouTube, Vimeo, Facebook pages | Berita Online on Vimeo Thumbnail Generator
- Use Browserify Globally as Watcher in PhpStorm [ add Babelify ] – Digital Zoom Studio on Setup a .babelrc in your user directory