WooCommerce Plugin
==================

About
-----

This project defines a WooCommerce plugin for redirect-based actions such as
payment pages.

Usage
-----

The plugin requires WordPress and WooCommerce to be installed. To install
WordPress, Apache server with php 7.4 needs to be installed, as well as a
MySQL/MariaDB database. The easiest way to run these is to install one of the
popular PHP environments like
[XAMPP](https://www.apachefriends.org/download.html),
[WAMP](https://www.wampserver.com/en/), or
[LAMP](https://bitnami.com/stack/lamp/installer) which already include Apache
server, PHP, and MySQL/MariaDB database.

If using XAMPP, WordPress can be installed by following [these
instructions](https://www.webcodzing.com/install-wordpress-on-localhost/).

Styling
-------

PHP CodeSniffer can be installed using composer by running the following:

```shell
composer global require "squizlabs/php_codesniffer=3.7.1"
```

The style rules are defined in `.phpcs.xml`. After installing CodeSniffer, it
can be run in "error checking mode" by running `phpcs src`, or in "fix mode" by
running `phpcbf src`. Documentation can be found at the following link:
<https://github.com/squizlabs/PHP_CodeSniffer>.

CodeSniffer can also be run with Docker using the convenience script:

```shell
bash scripts/with_build_env.sh phpcs src
```
