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!