Skip to content

4 Contributing

James Mehorter edited this page Jun 6, 2015 · 7 revisions

After cloning this repository into your wp-content/plugins/ directory you can immediately activate it and begin using the plugin. However, if you wish to contribute to the development of this plugin you'll also need to do the following.

Running Grunt - We use Grunt tasks to compile Sass and JavaScript, generate the i18n *.pot file, and if present; create *.mo files for each *.po translation file.

  1. Navigate to the plugin directory within your shell
  2. Download node modules for Grunt: npm install
  3. Run grunt to process each task, or grunt watch to compile when changes are noticed

Running Unit Tests - We use phpunit tests to verify our code is quality assured. You can build and/or run the tests locally by doing the following.

  1. Install temporary WP for testing - Follow step 3 here https://github.com/wp-cli/wp-cli/wiki/Plugin-Unit-Tests (we've already done steps 1 and 2 for you :))
// VVV Example 
$ cd /srv/www/wordpress-default/wp-content/plugins/device-theme-switcher
$ bash bin/install-wp-tests.sh wordpress_test root root localhost latest
  1. Install phpunit
  2. Then you can run phpunit to run the tests
Clone this wiki locally