11# Contribute to this plugin
22
33## Install the stack for development purpose
4- ## Select the PHP version you want to use (7.2, 7.3, 7.4, 8.0)
54
6- ``` bash
7- export CS_WORDPRESS_BOUNCER_PHP_VERSION=7.2
8- ```
9- ## Run tests
5+ Select the PHP version you want to use (7.2, 7.3, 7.4, 8.0) :
106
117``` bash
12- ./tests-local.sh # headless mode for speed up
13-
14- DEBUG ./tests-local.sh
8+ export CS_WORDPRESS_BOUNCER_PHP_VERSION=7.2
159```
1610
17- > Note: you can add ` await jestPlaywright.debug(); ` at the moment you want to pause the process.
18-
1911Run containers:
2012
2113``` bash
2214docker-compose up -d wordpress crowdsec mysql redis memcached
2315```
2416
25- Visit the wordpress instance here: http://localhost
26-
27- Admin account: admin / ThisSecretIsKnown!
17+ Visit the wordpress instance here: http://localhost and install the wordpress instance.
2818
2919# Init deps for dev environment
3020
31- In ` composer.json ` , replace ` "crowdsec/bouncer": "^..." ` with ` "crowdsec/bouncer": "dev-<a-dev-branch>" ` .
32-
33- > Important: Don't forget to replace this value by the new lib release tag when finishing the feature).
34-
3521``` bash
3622docker-compose exec wordpress composer install --working-dir /var/www/html/wp-content/plugins/cs-wordpress-bouncer --prefer-source
3723```
@@ -50,9 +36,7 @@ The LAPI URL is:
5036
5137http://crowdsec:8080
5238
53- docker-compose run crowdsec
54-
55- # Play with crowdsec container
39+ # Play with crowdsec state
5640
5741``` bash
5842# Get the Docker host IP from inside the crowdsec container
@@ -72,13 +56,23 @@ docker-compose exec crowdsec cscli decisions delete --all
7256docker-compose logs crowdsec
7357```
7458
59+ ## Run functionnal tests
60+
61+ ``` bash
62+ ./tests-local.sh # headless mode for speed up
63+
64+ DEBUG ./tests-local.sh
65+ ```
66+
67+ > Note: you can add ` await jestPlaywright.debug(); ` at the moment you want to pause the process.
68+
7569# WP Scan pass
7670
7771``` bash
7872docker-compose run --rm wpscan --url http://wordpress/
7973```
8074
81- ### Docker -compose cheets sheet
75+ ### Quick ` docker -compose` cheet sheet
8276
8377``` bash
8478docker-compose run wordpress sh # run sh on wordpress container
@@ -87,7 +81,7 @@ docker-compose stop # stop
8781docker-compose rm # destroy
8882```
8983
90- ### Use another PHP version
84+ ### Try the plugin with another PHP version
9185
9286``` bash
9387docker-compose down
@@ -100,16 +94,7 @@ CS_WORDPRESS_BOUNCER_PHP_VERSION=7.2 docker-compose up -d --build --force-recrea
10094
10195In end 2020, [ more than 90% of the wordpress websites] ( https://wordpress.org/about/stats/ ) was using Wordpress versions:
10296
103- - 5.6
104- - 5.5
105- - 5.4
106- - 5.3
107- - 5.2
108- - 5.1
109- - 5.0
110- - 4.9
111-
112- The plugin is tested under each of these versions.
97+ The plugin is tested under each of these versions: ` 5.6 ` , ` 5.5 ` , ` 5.4 ` , ` 5.3 ` , ` 5.2 ` , ` 5.1 ` , ` 5.0 ` , ` 4.9 ` .
11398
11499#### Add support for a new WordPress version
115100
@@ -139,7 +124,7 @@ docker-compose run wordpress<X.X> bash
139124tail -f logs/*
140125```
141126
142- #### New feature
127+ #### New feature workflow
143128
144129``` bash
145130git checkout -b < branch-name>
@@ -155,7 +140,7 @@ gh pr create --fill
155140
156141> Note: after the merge, don't forget to delete to branch.
157142
158- #### New release
143+ #### New release workflow
159144
160145``` bash
161146git checkout main && git pull && git co -
0 commit comments