Skip to content

Commit 13e1f94

Browse files
feat(metrics): Add usage metrics table in UI (#166)
* ci(test): Add test for 6.8 * feat(metrics): Add metrics report table in UI * test(e2e): Add test for metrics report UI * ci(multisite): Update test for multisite * feat(baas): Handle baas uri: show reset metrics button, unallow push metrics and appsec * feat(BLaaS): Display warning for BLaaS url and disallow some unsupported setting when using BLaaS * test(blaas): Add e2e blaas test * test(multisite): Skip test as the decativation callback on checkbox is not working * feat(*): Bump to release 2.10.0 * ci(timeout): Add 100ms to delay to avoid failing tests
1 parent 5ef298b commit 13e1f94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1167
-291
lines changed

.github/workflows/doc-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
gem install awesome_bot
3838
cd extension
3939
awesome_bot --files README.md --allow-dupe --allow 401,429 --skip-save-results --white-list ddev.site --base-url http://localhost:8080/
40-
awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401,429 --white-list ddev.site,your-wordpress-url,crowdsec:8080,localhost:7422 --base-url http://localhost:8080/docs/
40+
awesome_bot docs/*.md --skip-save-results --allow-dupe --allow 401,429 --white-list ddev.site,your-wordpress-url,crowdsec:8080,localhost:7422,admin.api.crowdsec.net --base-url http://localhost:8080/docs/

.github/workflows/end-to-end-auto-prepend-test-suite.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
end-to-end-auto-prepend-file-mode-test-suite:
1919
strategy:
2020
fail-fast: false
21-
# First and last minor versions of each major version
22-
# Highest compatible PHP version
21+
# First and latest minor versions of each major version
22+
# Highest and lowest compatible PHP version
2323
matrix:
2424
include:
2525
- wp-version: '4.9'
@@ -34,14 +34,13 @@ jobs:
3434
php-version: '7.2'
3535
- wp-version: '6.0'
3636
php-version: '8.0'
37-
- wp-version: '6.7'
37+
- wp-version: '6.8'
3838
php-version: '7.2'
39-
- wp-version: '6.7'
39+
- wp-version: '6.8'
4040
php-version: '8.3'
4141

4242
name: End-to-end auto-prepend-file mode test suite
4343
runs-on: ubuntu-latest
44-
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
4544

4645
env:
4746
EXTENSION_NAME: "CrowdSec_Bouncer"
@@ -221,7 +220,7 @@ jobs:
221220
file_path: 11-appsec.js
222221

223222
- name: Prepare CrowdSec for AppSec timeout tests
224-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 500ms
223+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
225224

226225
- name: Run AppSec timeout tests
227226
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
@@ -244,6 +243,12 @@ jobs:
244243
file_path:
245244
13-redis-acl.js
246245

246+
- name: Run BLaaS tests
247+
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
248+
with:
249+
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
250+
file_path: 14-blaas.js
251+
247252
- name: Check tested version
248253
run: |
249254
CURRENT_VERSION=$(ddev wp core version)

.github/workflows/end-to-end-multisite.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ jobs:
2323
end-to-end-multisite:
2424
strategy:
2525
fail-fast: false
26-
# Last minor version of each major version
26+
# Latest minor version of each major version
2727
# Minimum PHP version compatible with all WordPress versions
2828
matrix:
29-
wp-version: [ "4.9", "5.9", "6.7" ]
29+
wp-version: [ "4.9", "5.9", "6.8" ]
3030
php-version: [ "7.2" ]
3131
subsite: ["site1", "site2"]
3232

3333
name: End-to-end Multisite
3434
runs-on: ubuntu-latest
35-
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
3635

3736
env:
3837
EXTENSION_NAME: "CrowdSec_Bouncer"
@@ -213,7 +212,7 @@ jobs:
213212
subsite: ${{ matrix.subsite }}
214213

215214
- name: Prepare CrowdSec for AppSec timeout tests
216-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 500ms
215+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
217216

218217
- name: Run AppSec timeout tests
219218
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
@@ -236,6 +235,12 @@ jobs:
236235
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
237236
file_path: 13-redis-acl.js
238237

238+
- name: Run BLaaS tests
239+
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
240+
with:
241+
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
242+
file_path: 14-blaas.js
243+
239244
- name: Check tested version
240245
run: |
241246
CURRENT_VERSION=$(ddev wp core version)

.github/workflows/end-to-end-test-suite.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
# First and last minor versions of each major version
29-
# Highest compatible PHP version
29+
# Highest and lowest compatible PHP version
3030
matrix:
3131
include:
3232
- wp-version: '4.9'
@@ -41,14 +41,13 @@ jobs:
4141
php-version: '7.2'
4242
- wp-version: '6.0'
4343
php-version: '8.0'
44-
- wp-version: '6.7'
44+
- wp-version: '6.8'
4545
php-version: '7.2'
46-
- wp-version: '6.7'
46+
- wp-version: '6.8'
4747
php-version: '8.3'
4848

4949
name: End-to-end test suite
5050
runs-on: ubuntu-latest
51-
if: ${{ !contains(github.event.head_commit.message, 'chore(') }}
5251

5352
env:
5453
EXTENSION_NAME: "CrowdSec_Bouncer"
@@ -206,7 +205,7 @@ jobs:
206205
file_path: 11-appsec.js
207206

208207
- name: Prepare CrowdSec for AppSec timeout tests
209-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 500ms
208+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
210209

211210
- name: Run AppSec timeout tests
212211
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
@@ -228,6 +227,12 @@ jobs:
228227
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
229228
file_path: 13-redis-acl.js
230229

230+
- name: Run BLaaS tests
231+
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
232+
with:
233+
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
234+
file_path: 14-blaas.js
235+
231236
- name: Check tested version
232237
run: |
233238
CURRENT_VERSION=$(ddev wp core version)

.github/workflows/keepalive.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/release-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
end-to-end-release-zip-test:
2424
strategy:
2525
fail-fast: false
26-
# First and last minor versions of each major version
26+
# First and latest minor versions of each major version
2727
# Highest compatible PHP version
2828
matrix:
2929
include:
@@ -39,9 +39,9 @@ jobs:
3939
php-version: '7.2'
4040
- wp-version: '6.0'
4141
php-version: '8.0'
42-
- wp-version: '6.7'
42+
- wp-version: '6.8'
4343
php-version: '7.2'
44-
- wp-version: '6.7'
44+
- wp-version: '6.8'
4545
php-version: '8.3'
4646

4747
name: End-to-end release test suite
@@ -236,7 +236,7 @@ jobs:
236236
file_path: 11-appsec.js
237237

238238
- name: Prepare CrowdSec for AppSec timeout tests
239-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 500ms
239+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
240240

241241
- name: Run AppSec timeout tests
242242
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
@@ -258,6 +258,12 @@ jobs:
258258
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
259259
file_path: 13-redis-acl.js
260260

261+
- name: Run BLaaS tests
262+
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test
263+
with:
264+
test_path: ${{ github.workspace }}/${{ env.EXTENSION_PATH }}/tests/e2e-ddev
265+
file_path: 14-blaas.js
266+
261267
- name: Check tested version
262268
run: |
263269
CURRENT_VERSION=$(ddev wp core version)

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
---
88

9+
## [2.10.0](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v2.10.0) - 2025-05-09
10+
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v2.9.0...v2.10.0)
11+
12+
13+
### Changed
14+
15+
- Handle BLaaS (Blocklist as a Service) LAPI specific behavior:
16+
- Block some settings if BLaaS URL is detected: Live Mode, TLS authentication, AppSec component, Usage Metrics Push.
17+
- Show a new `Reset usage metrics now` button.
18+
19+
### Added
20+
21+
- Add Usage Metrics table in UI
22+
- Add compatibility with WordPress 6.8
23+
24+
25+
---
26+
27+
928
## [2.9.0](https://github.com/crowdsecurity/cs-wordpress-bouncer/releases/tag/v2.9.0) - 2025-02-21
1029
[_Compare with previous release_](https://github.com/crowdsecurity/cs-wordpress-bouncer/compare/v2.8.1...v2.9.0)
1130

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
},
2424
"require": {
25-
"crowdsec/bouncer": "^4.2.0",
25+
"crowdsec/bouncer": "^4.3.0",
2626
"symfony/cache": "5.4.40",
2727
"symfony/polyfill-mbstring": "^1.31.0",
2828
"symfony/service-contracts": "^2.5.3",

composer.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crowdsec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* Plugin URI: https://github.com/crowdsecurity/cs-wordpress-bouncer
55
* Description: Safer Together. Protect your WordPress application with CrowdSec.
66
* Tags: security, captcha, ip-blocker, crowdsec, hacker-protection, appsec
7-
* Version: 2.9.0
7+
* Version: 2.10.0
88
* Author: CrowdSec
99
* Author URI: https://www.crowdsec.net/
1010
* Github: https://github.com/crowdsecurity/cs-wordpress-bouncer
1111
* License: MIT
1212
* License URI: https://opensource.org/licenses/MIT
1313
* Requires PHP: 7.2
1414
* Requires at least: 4.9
15-
* Tested up to: 6.7
16-
* Stable tag: 2.9.0
15+
* Tested up to: 6.8
16+
* Stable tag: 2.10.0
1717
* Text Domain: crowdsec-wp
1818
* First release: 2021.
1919
*/

0 commit comments

Comments
 (0)