Skip to content

Commit c67b5f0

Browse files
committed
Merge audit/wpcs-modernization: security fix + WPCS/PHP 8.3 modernization
2 parents 5eb98a4 + 02f6271 commit c67b5f0

30 files changed

Lines changed: 1231 additions & 233 deletions

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
name: PHPCS (WPCS + PHP compat)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '8.3'
17+
coverage: none
18+
tools: composer
19+
- name: Install dependencies
20+
run: composer install --no-interaction --no-progress
21+
- name: Lint
22+
run: composer lint
23+
24+
test:
25+
name: PHPUnit (PHP ${{ matrix.php }})
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
php: [ '8.1', '8.2', '8.3' ]
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php }}
36+
coverage: none
37+
extensions: pdo, sqlite3, pdo_sqlite
38+
tools: composer
39+
- name: Install dependencies
40+
run: composer install --no-interaction --no-progress
41+
- name: Test
42+
run: composer test

admin/build/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '06ce75edc13b6a24cc84');
1+
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'd51e160d34e478fb3cd6');

admin/build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

admin/src/components/ConnectWizard.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,14 @@ function buildConfig( app, password ) {
9494
const header = `Authorization: Basic ${ auth }`;
9595

9696
switch ( app ) {
97-
// One CLI command, native HTTP transport.
97+
// One CLI command, native HTTP transport. User scope, not the default
98+
// local scope: local binds the server to the exact directory string the
99+
// command runs in, so it silently fails to load from any other folder
100+
// (or even the same folder reached via different path casing). A site
101+
// credential belongs to the user, not to whatever cwd they happened to
102+
// be in — user scope makes "run claude in any folder" actually true.
98103
case 'claude-code':
99-
return `claude mcp add ${ SLUG } --transport http ${ MCP_URL } \\\n --header "${ header }"`;
104+
return `claude mcp add ${ SLUG } --scope user --transport http ${ MCP_URL } \\\n --header "${ header }"`;
100105

101106
// ChatGPT connects by URL from its Connectors screen — hand over the
102107
// address and the sign-in details as plain fields to fill in.

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
"require-dev": {
1010
"phpunit/phpunit": "^9.6",
1111
"wp-phpunit/wp-phpunit": "^6.9",
12-
"yoast/phpunit-polyfills": "^2.0"
12+
"yoast/phpunit-polyfills": "^2.0",
13+
"wp-coding-standards/wpcs": "^3.1",
14+
"phpcompatibility/phpcompatibility-wp": "^2.1",
15+
"dealerdirect/phpcodesniffer-composer-installer": "*"
1316
},
1417
"config": {
1518
"allow-plugins": {
16-
"composer/installers": true
19+
"composer/installers": true,
20+
"dealerdirect/phpcodesniffer-composer-installer": true
1721
}
1822
},
1923
"scripts": {
20-
"test": "phpunit"
24+
"test": "phpunit",
25+
"lint": "phpcs",
26+
"lint:fix": "phpcbf"
2127
}
2228
}

0 commit comments

Comments
 (0)