Getting Started with the WordPress Plugin Boilerplate

  1. Make a new directory and move into it.
    mkdir your-plugin-name; cd $_;
  2. Download the WordPress Plugin Boilerplate.
    curl -LOk https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/archive/master.zip
  3. Unzip the file..
    unzip master.zip
  4. 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/
  5. Find and replace ‘plugin-name’ in the filenames.
    find . -type f -name '*' -exec sh -c 'mv "$0" "${0/plugin-name/your-plugin-name}"' '{}' \;
  6. 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# {} +
  7. Start developing your new plugin!

Basic GIT Feature Development Workflow

This is just a summary of how to create a branch when starting development on a new feature.

  1. Make sure you are in the root of your GIT project.
    cd ~/path/to/project/
  2. Create a new branch.
    git branch <branch>
  3. Checkout the new branch.
    git checkout <branch>
  4. Work on the new feature making new commits as needed.
    git add <file>
    git commit -m "Started work on a new feature"
    #repeat
  5. Merge the new feature back into the main codebase.
    git checkout master
    git merge <branch>
  6. Delete the branch.
    git branch -d <branch>
  7. Update version numbers.
  8. 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.

  1. FIRST: Update the version number in your readme.txt, and make sure the version is correct in the main plugin file.
  2. Change to your plugin directory (`cd`).
  3. 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
  4. Update GIT staging.
    git add -A .
  5. Review GIT changes.
    git status
  6. Commit the changes to the GIT repo if all looks right.
    git commit -m "Updating as it gets added to WP repo"
  7. Change directory back to plugin root.
    cd ../
  8. Add items to SVN repo.
    svn add * --force
  9. Review SVN changes.
    svn status
  10. Commit SVN changes to the repo.
    svn --username [username] --password [password] commit -m 'Short description of changes made'