You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SETUP.md
+80-13Lines changed: 80 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,18 @@ This document describes how to setup your development environment, so that it is
5
5
Suggestions are provided for the LAMP/LEMP stack and Git client are for those who prefer the UI over a command line and/or are less familiar with
6
6
WordPress, PHP, MySQL and Git - but you're free to use your preferred software.
7
7
8
-
## Setup
9
-
10
-
### LAMP/LEMP stack
8
+
## LAMP/LEMP stack
11
9
12
10
Any Apache/nginx, PHP 7.x+ and MySQL 5.8+ stack running WordPress. For example, but not limited to:
13
11
- Local by Flywheel (recommended)
14
-
- Docker
15
12
- MAMP
16
13
- WAMP
17
14
- VVV
15
+
- Docker
16
+
17
+
## Local, MAMP, WAMP, VVV
18
+
19
+
If using a non-Docker environment, follow the below steps:
18
20
19
21
### Composer
20
22
@@ -56,9 +58,9 @@ Create a blank `test` database in MySQL, with a MySQL user who can read and writ
56
58
57
59
### Configure Testing Environment
58
60
59
-
Copy the `.env.example` file to `.env.testing` in the root of this repository, changing the `WORDPRESS_*`and `CHROMEDRIVER_*` variables as necessary to match your environment.
61
+
Copy the `.env.example` file to `.env.testing` in the root of this repository, changing folder and database credentials as necessary.
60
62
61
-
####Codeception
63
+
### Codeception
62
64
63
65
Create a `codeception.yml` file in the root of the repository, with the following contents:
64
66
```yaml
@@ -68,10 +70,6 @@ params:
68
70
69
71
This tells Codeception to read the above `.env.testing` file when testing on the local development enviornment.
70
72
71
-
#### PHPStan
72
-
73
-
Copy the `phpstan.neon.example` file to `phpstan.neon` in the root of this repository, changing the `scanDirectories` to point to your local WordPress installation.
74
-
75
73
### Install Packages
76
74
77
75
In the Plugin's directory, at the command line, run `composer install`.
Again, don't worry if you don't understand these commands; if your output looks similar to the above screenshot, with no errors, your environment
179
177
is setup successfully.
180
178
181
-
### Add your API Key to the Plugin
179
+
### Connect Plugin to Kit
180
+
181
+
Refer to the [Kit Help Article](https://help.kit.com/en/articles/2502591-getting-started-the-wordpress-plugin) to get started with using the WordPress Plugin.
182
+
183
+
## Docker
184
+
185
+
Using the Development Container, and either GitHub Codespaces or VS Code, it's quick and easy to get started:
186
+
187
+
### Clone Repository
188
+
189
+
Using your preferred Git client or command line, clone this repository to your local machine.
190
+
191
+
If you're new to this, use [GitHub Desktop](https://desktop.github.com/) or [Tower](https://www.git-tower.com/mac)
192
+
193
+
### Install Docker and Visual Studio Code
194
+
195
+
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop/), or [Docker Engine](https://docs.docker.com/engine/) if you're developing on Linux
196
+
- Install [Visual Studio Code]()
197
+
198
+
### Install and Run Dev Containers
199
+
200
+
- Open Visual Studio Code, and install the [Dev Containers]() extension
201
+
- Open the Visual Studio Code Command Palette (`Ctrl + Shift + P`)
202
+
- Type `>Dev Container: Rebuild and Reopen in Container`, pressing Enter
203
+
204
+
Visual Studio Code will switch to the Dev Container, loading the preconfigured Docker image for WordPress development, with the Terminal in Visual Studio Code showing the progress:
To access the WordPress Administration interface, append `/wp-admin` to the URL, using the following credentials:
217
+
- Username: `vipgo`
218
+
- Password: `password`
219
+
220
+
Once logged in, navigating to the Plugins screen will show the repository Plugin installed and active, along with some other common third party Plugins:
In Visual Studio Code's Terminal, navigate to `/workspaces/convertkit-wordpress`, and run the following command to run PHP_CodeSniffer, which will check the code meets WordPress' Coding Standards:
227
+
228
+
```bash
229
+
vendor/bin/phpcs ./ -v -s
230
+
```
231
+
232
+
If no Terminal instance is open, you can create a new one by clicking the `+` icon.
In Visual Studio Code's Terminal, navigate to `/workspaces/convertkit-wordpress`, and run the following command to run PHPStan, which will perform static analysis on the code, checking it meets required
239
+
standards, that PHP DocBlocks are valid, WordPress action/filter DocBlocks are valid etc:
0 commit comments