- Make a new directory and move into it.
mkdir your-plugin-name; cd $_;
- Download the WordPress Plugin Boilerplate.
curl -LOk https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/archive/master.zip
- Unzip the file..
unzip master.zip
- Move the files into your plugin directory and delete the zip file and unzip folder.
rm master.zip mv WordPress-Plugin-Boilerplate-master/plugin-name/* . rm -rf WordPress-Plugin-Boilerplate-master/
- Find and replace ‘plugin-name’ in the filenames.
find . -type f -name '*' -exec sh -c 'mv "$0" "${0/plugin-name/your-plugin-name}"' '{}' \;
- Find and replace strings within the files.
find . -type f -exec sed -i '' s/plugin-name/your-plugin-name/ {} + find . -type f -exec sed -i '' s/plugin_name/your_plugin_name/ {} + find . -type f -exec sed -i '' s/Plugin_Name/Your_Plugin_Name/ {} + find . -type f -exec sed -i '' s/Your\ Name/First\ Last/ {} + find . -type f -exec sed -i '' s/email@example.com/your@email.com/ {} + find . -type f -exec sed -i '' s#http://example.com#http://yoururl.com# {} +
- Start developing your new plugin!
Month: February 2015
Basic GIT Feature Development Workflow
This is just a summary of how to create a branch when starting development on a new feature.
- Make sure you are in the root of your GIT project.
cd ~/path/to/project/
- Create a new branch.
git branch <branch>
- Checkout the new branch.
git checkout <branch>
- Work on the new feature making new commits as needed.
git add <file> git commit -m "Started work on a new feature" #repeat
- Merge the new feature back into the main codebase.
git checkout master git merge <branch>
- Delete the branch.
git branch -d <branch>
- Update version numbers.
- View branches
#all: local and remote git branch -a #just remote git branch -r
Update Your WordPress GIT Plugin in the .Org Repo
Using your terminal/command line on linux or mac.
- FIRST: Update the version number in your readme.txt, and make sure the version is correct in the main plugin file.
- Change to your plugin directory (`cd`).
- Create a tag of the of the new version (change “1.0.4” to your current stable version number).
svn cp trunk tags/1.0.4
ls -a tags/1.0.4 rm -rf tags/1.0.4/.git* rm tags/1.0.4/README.md
- Update GIT staging.
git add -A .
- Review GIT changes.
git status
- Commit the changes to the GIT repo if all looks right.
git commit -m "Updating as it gets added to WP repo"
- Change directory back to plugin root.
cd ../
- Add items to SVN repo.
svn add * --force
- Review SVN changes.
svn status
- Commit SVN changes to the repo.
svn --username [username] --password [password] commit -m 'Short description of changes made'