# Flipdish WordPress Plugin
The Flipdish WordPress plugin allows clients who use the WordPress platform to add the Flipdish ordering system to their website using a nice and easy to use interface.

<a href="https://github.com/flipdishbytes/wordpress-plugin/actions">
  <img alt="Tests Passing" src="https://github.com/flipdishbytes/wordpress-plugin/workflows/CI/badge.svg" />
</a>

## The Flipdish Plugin Files & Folders

**flipdish-ordering.php** - This file contains the main php code to make the plugin work. This file also contains the plugin version number which must be updated on each release.

- **admin/** - Contains all code used in the admin section
  - **admin-menu.php** - Admin menu configuration
  - **settings-page.php** - Code displayed to user
  - **settings-register.php** - Register settings saved in database
  - **settings-callbacks.php** - Display custom settings code
  - **settings-validate.php** - Validates settings saved into database
  - **settings-on-update.php** - Runs functions on specific setting value change
  - **images/** - Contains all images used in the admin section
  - **css/** - CSS used in the admin section
  - **js/** - JS used in the admin section
  - **assets/** - Asset files such as Apple Pay verification file

- **includes/** - Contains all code used by admin and public
  - **core-functions.php** - Core function configuration
  - **flipdish-ordering-transparent-styles.php** - CSS styles used to enable transparent background

- **languages/** - Contains files used to translate plugin
- **public/** - Contains all code used in the public section

- **database** - Settings are stored in the options table under `flipdish_ordering_options`.
- **index.php** - Blank files like this are used for security purposes.
- **readme.txt** - This file contains the information for the wordpress plugin directory, ie: the description, the FAQ etc. On a new stable release the stable tag number must be changed to match the new stable version

### Install Dependecies
Project Dependecies
`composer update`

Global Dependecies (PHPCS - VS Code - WordPress-Core)
`composer g require --dev automattic/vipwpcs dealerdirect/phpcodesniffer-composer-installer`

### Code Quality Checks
Automated code quality checks can be run to ensure code quality standards. The following command can be run from within the plugin directory to check code quality.

`vendor/bin/grumphp run --testsuite=code_quality`
