Skip to content

Commit d5c9018

Browse files
authored
Merge branch 'trunk' into mime/introduce-mime-class
2 parents 6096a58 + f27699d commit d5c9018

2,288 files changed

Lines changed: 204453 additions & 73400 deletions

File tree

Some content is hidden

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

‎.env.example‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ LOCAL_PORT=8889
1414
# Where to run WordPress from. Valid options are 'src' and 'build'.
1515
LOCAL_DIR=src
1616

17+
# Whether or not to enable text compression (gzip) in the web server.
18+
# Valid options are 'on' and 'off'.
19+
LOCAL_NGINX_COMPRESSION=off
20+
1721
# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
1822
LOCAL_PHP=latest
1923

@@ -46,12 +50,12 @@ LOCAL_DB_TYPE=mysql
4650
##
4751
# The database version to use.
4852
#
49-
# Defaults to 8.0 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
53+
# Defaults to 9.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
5054
#
5155
# When using `mysql`, see https://hub.docker.com/_/mysql for valid versions.
5256
# When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
5357
##
54-
LOCAL_DB_VERSION=8.4
58+
LOCAL_DB_VERSION=9.7
5559

5660
# Whether or not to enable multisite.
5761
LOCAL_MULTISITE=false

‎.eslintignore‎

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

‎.eslintrc-jsdoc.js‎

Lines changed: 78 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,80 @@
1-
module.exports = {
2-
rules: {
3-
'require-jsdoc': 'off',
4-
'valid-jsdoc': [ 'error', {
5-
prefer: {
6-
arg: 'param',
7-
argument: 'param',
8-
extends: 'augments',
9-
returns: 'return',
1+
/**
2+
* ESLint v10 flat config file for JSDoc linting.
3+
* This config is based on the original valid-jsdoc rules.
4+
*/
5+
6+
const jsdocPlugin = require( 'eslint-plugin-jsdoc' );
7+
8+
module.exports = [
9+
{
10+
plugins: {
11+
jsdoc: jsdocPlugin,
12+
},
13+
settings: {
14+
jsdoc: {
15+
tagNamePreference: {
16+
'arg': 'param',
17+
'argument': 'param',
18+
'extends': 'augments',
19+
'returns': 'return',
20+
},
21+
preferredTypes: {
22+
'array': 'Array',
23+
'bool': 'boolean',
24+
'Boolean': 'boolean',
25+
'float': 'number',
26+
'Float': 'number',
27+
'function': 'Function',
28+
'int': 'number',
29+
'integer': 'number',
30+
'Integer': 'number',
31+
'Number': 'number',
32+
'object': 'Object',
33+
'String': 'string',
34+
'Void': 'void',
35+
},
1036
},
11-
preferType: {
12-
array: 'Array',
13-
bool: 'boolean',
14-
Boolean: 'boolean',
15-
float: 'number',
16-
Float: 'number',
17-
int: 'number',
18-
integer: 'number',
19-
Integer: 'number',
20-
Number: 'number',
21-
object: 'Object',
22-
String: 'string',
23-
Void: 'void',
24-
},
25-
requireParamDescription: false,
26-
requireReturn: false,
27-
} ],
37+
},
38+
rules: {
39+
'jsdoc/check-alignment': 'error',
40+
'jsdoc/check-indentation': [ 'error', {
41+
excludeTags: [
42+
'deprecated',
43+
'example',
44+
'param',
45+
'property',
46+
'return',
47+
'since',
48+
'todo',
49+
],
50+
} ],
51+
'jsdoc/check-line-alignment': [ 'error', 'always', {
52+
tags: [ 'param', 'property' ],
53+
} ],
54+
'jsdoc/check-param-names': 'error',
55+
'jsdoc/check-syntax': 'error',
56+
'jsdoc/check-tag-names': [ 'error', {
57+
definedTags: [
58+
'memberOf',
59+
'output',
60+
'ticket',
61+
'link',
62+
],
63+
} ],
64+
'jsdoc/check-types': 'error',
65+
'jsdoc/require-description': 'error',
66+
'jsdoc/require-hyphen-before-param-description': [ 'error', 'never' ],
67+
'jsdoc/require-jsdoc': 'error',
68+
'jsdoc/require-param': [ 'error', {
69+
enableFixer: false,
70+
} ],
71+
'jsdoc/require-param-description': 'error',
72+
'jsdoc/require-param-name': 'error',
73+
'jsdoc/require-param-type': 'error',
74+
'jsdoc/require-returns': 'error',
75+
'jsdoc/require-returns-check': 'error',
76+
'jsdoc/require-returns-description': 'error',
77+
'jsdoc/require-returns-type': 'error',
78+
},
2879
},
29-
};
80+
];
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Smoke check a WordPress installation'
2+
description: 'Serves an installed single site with PHP built-in web server and checks that its front end, REST API, and admin respond.'
3+
4+
inputs:
5+
admin-user:
6+
description: 'The username of an administrator account on the site.'
7+
required: true
8+
admin-password:
9+
description: 'The password of the administrator account.'
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Serve the site and check it
16+
shell: bash
17+
run: bash "${GITHUB_ACTION_PATH}/smoke-check.sh"
18+
env:
19+
WP_ADMIN_USER: ${{ inputs.admin-user }}
20+
WP_ADMIN_PASSWORD: ${{ inputs.admin-password }}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
#
3+
# Smoke checks an installed WordPress single site over HTTP.
4+
#
5+
# Runs from the root of the installation, with WP-CLI available. Multisite is not supported because
6+
# a network's domain lives in wp-config.php and the database, not just an option.
7+
8+
set -euo pipefail
9+
10+
: "${RUNNER_TEMP:?}" "${WP_ADMIN_USER:?}" "${WP_ADMIN_PASSWORD:?}"
11+
12+
site_port=8889
13+
site_url="http://127.0.0.1:${site_port}"
14+
server_log="${RUNNER_TEMP}/server.log"
15+
jar="${RUNNER_TEMP}/cookies.txt"
16+
: > "${jar}"
17+
response="${RUNNER_TEMP}/response.txt"
18+
code="${RUNNER_TEMP}/http-code.txt"
19+
http_code=''
20+
21+
version="$(wp core version)"
22+
23+
# Nothing undoes these, so the site is only good for this check afterwards.
24+
wp option update home "${site_url}"
25+
wp option update siteurl "${site_url}"
26+
# A fresh install shows posts here already, but the front page check below needs it.
27+
wp option update show_on_front posts
28+
# Both make requests no check asked for, and the update checks call api.wordpress.org.
29+
wp config set DISABLE_WP_CRON true --raw
30+
wp config set WP_HTTP_BLOCK_EXTERNAL true --raw
31+
32+
# opcache counts php -S as a web SAPI, so the runner's JIT runs here and segfaults.
33+
php -d opcache.jit=disable -S "127.0.0.1:${site_port}" -t . > "${server_log}" 2>&1 &
34+
server_pid=$!
35+
36+
stop_server() {
37+
local status=$?
38+
kill "${server_pid}" 2> /dev/null || true
39+
wait "${server_pid}" 2> /dev/null || true
40+
[ "${status}" -eq 0 ] || cat "${server_log}" || true
41+
exit "${status}"
42+
}
43+
trap stop_server EXIT
44+
45+
# No connection prints 000 and exits 7, which set -e would take as fatal.
46+
deadline=$(( SECONDS + 30 ))
47+
while :; do
48+
ready_code="$(curl --silent --max-time 5 --output /dev/null --write-out '%{http_code}' "${site_url}/" || true)"
49+
[ "${ready_code}" = '000' ] || break
50+
[ "${SECONDS}" -lt "${deadline}" ] || { echo '::error::the server never answered'; exit 1; }
51+
sleep 1
52+
done
53+
54+
fail() {
55+
echo "::error::${1}"
56+
tail -n 20 "${response}"
57+
exit 1
58+
}
59+
60+
# An HTTP error returns to the caller. No reply at all is fatal.
61+
fetch() {
62+
local path="${1}" status=0
63+
shift
64+
: > "${response}"
65+
curl --silent --show-error --max-time 30 --output "${response}" \
66+
--write-out '%{http_code}' --cookie "${jar}" --cookie-jar "${jar}" \
67+
"$@" "${site_url}${path}" > "${code}" || status=$?
68+
http_code="$(cat "${code}")"
69+
[ "${status}" -eq 0 ] || [ "${status}" -eq 22 ] \
70+
|| fail "${path} got no reply and curl exited ${status}"
71+
return "${status}"
72+
}
73+
74+
check() {
75+
local path="${1}" marker status=0
76+
shift
77+
fetch "${path}" --fail-with-body || status=$?
78+
[ "${status}" -eq 0 ] || fail "${path} returned HTTP ${http_code}"
79+
for marker in "$@"; do
80+
grep -qF -e "${marker}" "${response}" || fail "${path} did not contain: ${marker}"
81+
done
82+
echo "ok ${path}"
83+
}
84+
85+
# A fatal mid-page still returns 200, so every check also asks for the closing tag.
86+
check '/' "content=\"WordPress ${version}\"" 'Hello world!' '</html>'
87+
88+
fetch '/?rest_route=/' --fail-with-body || fail "/?rest_route=/ returned HTTP ${http_code}"
89+
jq -e --arg url "${site_url}" '.url == $url and ( .namespaces | index( "wp/v2" ) )' "${response}" > /dev/null \
90+
|| fail 'the REST index was not the expected JSON'
91+
echo 'ok /?rest_route=/'
92+
93+
# It prints this for an empty database too, which the checks above rule out.
94+
check '/wp-admin/upgrade.php' 'No Update Required' '</html>'
95+
96+
fetch '/?p=99999999' || true
97+
[ "${http_code}" = '404' ] || fail "a missing post returned ${http_code}, expected 404"
98+
grep -qF '</html>' "${response}" || fail 'the 404 page was cut short'
99+
echo 'ok 404 handling'
100+
101+
login_status=0
102+
fetch '/wp-login.php' --fail-with-body \
103+
--data-urlencode "log=${WP_ADMIN_USER}" --data-urlencode "pwd=${WP_ADMIN_PASSWORD}" || login_status=$?
104+
[ "${login_status}" -eq 0 ] || fail "logging in returned HTTP ${http_code}"
105+
grep -qF 'wordpress_logged_in_' "${jar}" || fail 'logging in did not set an authentication cookie'
106+
echo 'ok login'
107+
108+
# The admin bar renders only for a logged-in user.
109+
check '/wp-admin/' 'id="wpadminbar"' '</html>'
110+
111+
# Catches a fatal during shutdown. An empty log would let the grep pass silently.
112+
[ -s "${server_log}" ] || { echo '::error::the server wrote no log'; exit 1; }
113+
if grep -qE 'Fatal error|Uncaught|Segmentation fault' "${server_log}"; then
114+
echo '::error::the server logged a fatal error'
115+
exit 1
116+
fi
117+
echo 'ok server log'

‎.github/pull_request_template.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,25 @@ If this is your first time contributing, you may also find reviewing these guide
1212
- Inline Documentation Standards: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/
1313
- Browser Support Policies: https://make.wordpress.org/core/handbook/best-practices/browser-support/
1414
- Proper spelling and grammar related best practices: https://make.wordpress.org/core/handbook/best-practices/spelling/
15+
- ✨ If you are using AI tools, you must adhere to the AI Guidelines: https://make.wordpress.org/ai/handbook/ai-guidelines/
1516
-->
1617

1718
<!-- Insert a description of your changes here -->
1819

1920
Trac ticket: <!-- insert a link to the WordPress Trac ticket here -->
2021

22+
## Use of AI Tools
23+
24+
<!--
25+
You are free to use artificial intelligence (AI) tooling to contribute, but you must disclose what tooling you are using and to what extent a pull request has been authored by AI. It is your responsibility to review and take responsibility for what AI generates. See the WordPress AI Guidelines: <https://make.wordpress.org/ai/handbook/ai-guidelines/>.
26+
27+
Example disclosure:
28+
29+
AI assistance: Yes
30+
Tool(s): GitHub Copilot, ChatGPT
31+
Model(s): GPT-5.1
32+
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.
33+
-->
34+
2135
---
2236
**This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See [GitHub Pull Requests for Code Review](https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/) in the Core Handbook for more details.**

‎.github/workflows/check-built-files.yml‎

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

0 commit comments

Comments
 (0)