Skip to content

How to setup the plugin development environment

Tim Nolte edited this page Mar 19, 2022 · 6 revisions

This page will guide you through the process of setting up the plugin development environment on your local machine. It should work on Linux, macOS, or Windows 10 with the Linux Subsystem.

Pre-requisites

Before starting, make sure you have the following software installed and working on your machine:

  1. Git to clone the plugin repository (or your fork of the plugin repository).
  2. NPM to install Node packages used to build assets and other tasks. (v12.18.3 at the time of last update.)
    • NOTE: A Node version manager, such as NVM, can be used to easily switch between versions as needed by different projects.
  3. Composer to install PHP packages required by the plugin & WordPress. It's also necessary to use the PHP CodeSniffer that ensures your code follows code standards.
  4. Docker & Docker Compose(separate download on Linux)

Clone the repository

In your terminal, replacing USER_NAME with your GitHub username::

$ git clone [email protected]:USER_NAME/openid-connect-generic.git

Setup Plugin Development Environment

  1. Change to plugin clone directory:
$ cd ~/<your clone path>/openid-connect-generic
  1. Install development dependencies & configure environment:
$ npm ci
$ npm run setup:composer

Managing the Local Docker Environment

  1. Startup Local Development instance:
$ npm start
  1. Shutdown Local Development instance:
$ npm stop
  1. Restart Local Development instance:
$ npm restart

Local Development Environment Advanced Topics

This plugin uses the NPM WordPress scripts package & env package for local development and builds.