-
Notifications
You must be signed in to change notification settings - Fork 368
Setting Up Development Environment
This page will guide you through the process of setting up WP Job Manager development environment on your local machine. It should work on Linux, macOS, or Windows 10 with the Linux Subsystem.
- Pre-requisites
- Configure a local WordPress instance
- Clone WP Job Manager repository
- Install dependencies and generate assets
- IDE integrations
- Additional resources
Before starting, make sure you have the following software installed and working on your machine:
- Git to clone the WP Job Manager repository (or your fork of the WP Job Manager repository).
- NPM to install Node packages used to build assets and other tasks.
-
Composer to install PHP packages required by WP Job Manager such as the
wp-job-manager-rest-api
and thejetpack-autoloader
. It's also necessary to use the PHP CodeSniffer that ensures your code follows code standards.
For this guide we will use VVV, which is a local WordPress development environment built using Vagrant and VirtualBox, to run a local WordPress instance and install WP Job Manager on top of it. But it is worth noting that it is possible to set up a WP Job Manager development environment using several other stacks (docker, LAMP, etc). If you opt to use a solution other than VVV, you can skip to the next section. Keep in mind that you might need to make some small adjustments to the steps in the rest of this guide.
To configure our local WordPress instance, you will need to:
- Install VirtualBox
- Install vagrant
- Install and provision VVV
- If everything worked as expected, you should have a WordPress installation running on the following URL: https://one.wordpress.test. This is the WP site that we will use to install WP Job Manager.
To install WP Job Manager on your WordPress installation, you need to decide whether you will clone the WP Job Manager repository directly or your WP Job Manager fork. If you plan to contribute to WP Job Manager code base, it is recommended that you clone your fork. If needed, see this GitHub document on how to create a fork.
In your terminal:
- Go to the WordPress plugins directory:
$ cd ~/vagrant-local/www/wordpress-one/public_html/wp-content/plugins/
- Clone the repository:
- If cloning WP Job Manager repository:
$ git clone [email protected]:Automattic/WP-Job-Manager.git
- If cloning your own fork replace
USER_NAME
with your GitHub username:
$ git clone [email protected]:USER_NAME/WP-Job-Manager.git
To install WP Job Manager dependencies (this includes some functionality that installs git pre-commit hooks for code style checks and Grunt that is used to generated minified versions of the SCSS and JS files):
$ cd ~/vagrant-local/www/wordpress-one/public_html/wp-content/plugins/wp-job-manager
$ npm install
$ composer install
To generate JS and CSS assets run the following command from the WP Job Manager root directory:
npm run build
To automatically rebuild the assets whenever a JS or SCSS file is modified run:
npm run build-watch
WP Job Manager core has linting rules in place via pre-commit hooks to ensure code standards are used. Ensure you have installed NPM and Composer packages, so these are set up!
While developing, we recommend adding support to your editor for the following (most IDEs have plugins for this):
- phpcs
- eslint
- editorconfig
WP Job Manager is an open source job board plugin built for WordPress and lovingly crafted by Automattic and the WP Job Manager community ❤