diff --git a/.env.example b/.env.example index bdd47dedb82d5..957c9edd7691f 100644 --- a/.env.example +++ b/.env.example @@ -84,6 +84,19 @@ LOCAL_WP_ENVIRONMENT_TYPE=local LOCAL_WP_DEVELOPMENT_MODE=core LOCAL_WP_TESTS_DOMAIN=example.org +## +# API keys and models for the live AI provider tests, which send real requests. +# See `tests/phpunit/manual/wpAiClientLiveProviders.php`. +## +# WP_TESTS_AI_ANTHROPIC_API_KEY= +# WP_TESTS_AI_GOOGLE_API_KEY= +# WP_TESTS_AI_OPENAI_API_KEY= +# +# Model IDs to use instead of the default models, such as `gemini-3.5-flash-lite`. +# WP_TESTS_AI_ANTHROPIC_MODEL= +# WP_TESTS_AI_GOOGLE_MODEL= +# WP_TESTS_AI_OPENAI_MODEL= + ## # This silences the tips output by the dotenv package. ## diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 9825166f0fb38..15d3c76f7da89 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -10,3 +10,4 @@ paths: .github/workflows/**/*.yml: ignore: - 'specifying action "\$/[^"]+" in invalid format because ref is missing' + - 'reusable workflow call "\$/[^"]+" at "uses" is not following the format' diff --git a/.github/actions/smoke-check/action.yml b/.github/actions/smoke-check/action.yml index 4a115e0f6d754..73da5b84bf54b 100644 --- a/.github/actions/smoke-check/action.yml +++ b/.github/actions/smoke-check/action.yml @@ -1,5 +1,5 @@ name: 'Smoke check a WordPress installation' -description: 'Serves an installed single site with PHP built-in web server and checks that its front end, REST API, and admin respond.' +description: 'Serves an installed single site or network with PHP built-in web server and checks that its front end, REST API, and admin respond.' inputs: admin-user: diff --git a/.github/actions/smoke-check/smoke-check.sh b/.github/actions/smoke-check/smoke-check.sh index d3ab33e068f9e..cd265333c0e9c 100755 --- a/.github/actions/smoke-check/smoke-check.sh +++ b/.github/actions/smoke-check/smoke-check.sh @@ -1,16 +1,18 @@ #!/bin/bash # -# Smoke checks an installed WordPress single site over HTTP. +# Smoke checks an installed WordPress single site or the main site of a network over HTTP. # -# Runs from the root of the installation, with WP-CLI available. Multisite is not supported because -# a network's domain lives in wp-config.php and the database, not just an option. +# Runs from the root of the installation, with WP-CLI available. The site must be installed at +# http://localhost/. curl connects to the local server but sends Host: localhost, so a network finds its +# main site and no URL in the database changes. php -S does no rewrites, so subsites are not checked. set -euo pipefail : "${RUNNER_TEMP:?}" "${WP_ADMIN_USER:?}" "${WP_ADMIN_PASSWORD:?}" site_port=8889 -site_url="http://127.0.0.1:${site_port}" +site_url='http://localhost' +connect_to="localhost:80:127.0.0.1:${site_port}" server_log="${RUNNER_TEMP}/server.log" jar="${RUNNER_TEMP}/cookies.txt" : > "${jar}" @@ -20,9 +22,12 @@ http_code='' version="$(wp core version)" -# Nothing undoes these, so the site is only good for this check afterwards. -wp option update home "${site_url}" -wp option update siteurl "${site_url}" +# Every request sends Host: localhost, so another install URL would fail later with a vague error. +installed_url="$(wp option get siteurl)" +[ "${installed_url%/}" = "${site_url}" ] \ + || { echo "::error::the site must be installed at ${site_url}/, not ${installed_url}"; exit 1; } + +# Nothing undoes these, so cron stays off and external requests stay blocked afterwards. # A fresh install shows posts here already, but the front page check below needs it. wp option update show_on_front posts # Both make requests no check asked for, and the update checks call api.wordpress.org. @@ -45,7 +50,8 @@ trap stop_server EXIT # No connection prints 000 and exits 7, which set -e would take as fatal. deadline=$(( SECONDS + 30 )) while :; do - ready_code="$(curl --silent --max-time 5 --output /dev/null --write-out '%{http_code}' "${site_url}/" || true)" + ready_code="$(curl --silent --max-time 5 --output /dev/null --write-out '%{http_code}' \ + --connect-to "${connect_to}" "${site_url}/" || true)" [ "${ready_code}" = '000' ] || break [ "${SECONDS}" -lt "${deadline}" ] || { echo '::error::the server never answered'; exit 1; } sleep 1 @@ -63,7 +69,7 @@ fetch() { shift : > "${response}" curl --silent --show-error --max-time 30 --output "${response}" \ - --write-out '%{http_code}' --cookie "${jar}" --cookie-jar "${jar}" \ + --write-out '%{http_code}' --cookie "${jar}" --cookie-jar "${jar}" --connect-to "${connect_to}" \ "$@" "${site_url}${path}" > "${code}" || status=$? http_code="$(cat "${code}")" [ "${status}" -eq 0 ] || [ "${status}" -eq 22 ] \ @@ -108,6 +114,12 @@ echo 'ok login' # The admin bar renders only for a logged-in user. check '/wp-admin/' 'id="wpadminbar"' '' +if wp core is-installed --network; then + check '/wp-admin/network/' 'id="wpadminbar"' ' network-admin' '' +else + echo 'skip /wp-admin/network/ (not a network)' +fi + # Catches a fatal during shutdown. An empty log would let the grep pass silently. [ -s "${server_log}" ] || { echo '::error::the server wrote no log'; exit 1; } if grep -qE 'Fatal error|Uncaught|Segmentation fault' "${server_log}"; then diff --git a/.github/workflows/file-type-check.yml b/.github/workflows/file-type-check.yml new file mode 100644 index 0000000000000..e2773384a8009 --- /dev/null +++ b/.github/workflows/file-type-check.yml @@ -0,0 +1,182 @@ +name: File Type Check + +on: + push: + branches: + - trunk + - '6.[8-9]' + - '[7-9].[0-9]' + paths: + # Inward check: files added to CSS/JS directories. + - 'src/wp-includes/css/**' + - 'src/wp-includes/js/**' + - 'src/wp-admin/css/**' + - 'src/wp-admin/js/**' + # Outward check: CSS/JS files placed outside designated directories. + - 'src/wp-includes/**.css' + - 'src/wp-includes/**.js' + - 'src/wp-admin/**.css' + - 'src/wp-admin/**.js' + # Confirm any changes to the workflow file itself. + - '.github/workflows/file-type-check.yml' + pull_request: + branches: + - trunk + - '6.[8-9]' + - '[7-9].[0-9]' + paths: + - 'src/wp-includes/css/**' + - 'src/wp-includes/js/**' + - 'src/wp-admin/css/**' + - 'src/wp-admin/js/**' + - 'src/wp-includes/**.css' + - 'src/wp-includes/**.js' + - 'src/wp-admin/**.css' + - 'src/wp-admin/**.js' + - '.github/workflows/file-type-check.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + # Verifies that CSS and JS files live in the directories intended for them. + # + # The JS sources in src/js/ are out of scope. The build system decides where + # those are placed, so only its output is checked. + check-file-types: + name: Verify file types in CSS/JS directories + runs-on: ubuntu-26.04 + permissions: + contents: read + if: | + github.repository == 'WordPress/wordpress-develop' || ( + github.event_name == 'pull_request' && ( + ! github.event.repository.private || + ! github.event.pull_request.draft || + contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' ) + ) + ) + timeout-minutes: 5 + + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + persist-credentials: false + + - name: Check for misplaced CSS and JS files + run: | + # Git does the filtering, so no path is ever matched as text. Shell + # patterns break on names holding a tab, a newline or a quote: Git + # C-quotes those, and core.quotePath=false does not stop it. + # + # Each check is a bare assignment, so `set -e` sees a failure from Git. + # + # Every exclude starts with src/, the directory the positive pathspecs share. + # git ls-files strips that shared directory from every pathspec, excludes + # included, without checking that it is there. An exclude such as *.js is + # then cut down to a pattern that can match every file. + # + # Only tracked files are checked. The PHP that Gutenberg generates + # into css/dist and js/dist is untracked, so it never appears here. + # Whether it should be tracked, moved, or not copied at all is still + # open in #65278. If it becomes tracked, this check will flag it. + + # Git exits 0 when a pathspec matches nothing. + if [ -z "$( git ls-files -- src/wp-includes src/wp-admin )" ]; then + echo "::error::No tracked files found under src/wp-includes or src/wp-admin." + exit 1 + fi + + # The SCSS sources for the admin color schemes are the only tracked + # non-CSS files in these directories. + inward_css=$( git ls-files -- src/wp-includes/css src/wp-admin/css \ + ':(exclude,glob)src/wp-includes/css/**/*.css' \ + ':(exclude,glob)src/wp-admin/css/**/*.css' \ + ':(exclude,glob)src/wp-admin/css/colors/**/*.scss' ) + + # Both directories are gitignored in full, so this only catches a file + # committed with `git add -f`. + inward_js=$( git ls-files -- src/wp-includes/js src/wp-admin/js \ + ':(exclude,glob)src/wp-includes/js/**/*.js' \ + ':(exclude,glob)src/wp-admin/js/**/*.js' ) + + # src/wp-includes/build/ is tracked, not gitignored: it holds the + # generated routes and pages. + outward=$( git ls-files -- \ + ':(glob)src/wp-includes/**/*.css' ':(glob)src/wp-includes/**/*.js' \ + ':(glob)src/wp-admin/**/*.css' ':(glob)src/wp-admin/**/*.js' \ + ':(exclude,glob)src/wp-includes/css/**' \ + ':(exclude,glob)src/wp-includes/js/**' \ + ':(exclude,glob)src/wp-admin/css/**' \ + ':(exclude,glob)src/wp-admin/js/**' \ + ':(exclude,glob)src/wp-includes/build/**' ) + + violations=$( printf '%s\n%s\n%s' "$inward_css" "$inward_js" "$outward" | grep -v '^$' || true ) + + if [ -n "$violations" ]; then + echo "::error::Misplaced files found." + echo + echo "$violations" + echo + echo "CSS directories should contain only .css files and JS directories only .js files." + echo ".css and .js files belong in those directories, not elsewhere in wp-includes/ or wp-admin/." + echo "If a file is a legitimate exception, update .github/workflows/file-type-check.yml." + exit 1 + fi + + echo "All tracked CSS and JS files are correctly placed." + + slack-notifications: + name: Slack Notifications + uses: ./.github/workflows/slack-notifications.yml + permissions: + actions: read + contents: read + needs: [ check-file-types ] + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} + with: + calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} + secrets: + SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} + SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} + SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} + SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} + + failed-workflow: + name: Failed workflow tasks + runs-on: ubuntu-26.04 + permissions: + actions: write + needs: [ check-file-types, slack-notifications ] + if: | + always() && + github.repository == 'WordPress/wordpress-develop' && + github.event_name != 'pull_request' && + github.run_attempt < 2 && + ( + contains( needs.*.result, 'cancelled' ) || + contains( needs.*.result, 'failure' ) + ) + + steps: + - name: Dispatch workflow run + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + retries: 2 + retry-exempt-status-codes: 418 + script: | + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'failed-workflow.yml', + ref: 'trunk', + inputs: { + run_id: `${context.runId}`, + } + }); diff --git a/.github/workflows/generate-changed-files.yml b/.github/workflows/generate-changed-files.yml new file mode 100644 index 0000000000000..e49c027914c82 --- /dev/null +++ b/.github/workflows/generate-changed-files.yml @@ -0,0 +1,149 @@ +## +# A GitHub Action that generates a list of files changed between the newly +# tagged WordPress release and the previous release tag. +# +# This list is useful for updating documentation such as the HelpHub +# "Files Changed" section for each release. It replaces the need to manually +# run SVN or Git commands to produce the same output. +# +# The comparison is made against the built WordPress repository +# (WordPress/WordPress, a mirror of core.svn.wordpress.org) so that the list +# reflects the files that ship in a release, rather than the development +# sources in this repository. +# +# Contributors can also run this workflow manually via the "workflow_dispatch" +# event, providing custom tag inputs to compare any two releases. +## +name: Generate Changed Files List + +on: + push: + tags: + - '[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: + inputs: + compare_tag: + description: 'The newer tag to compare (e.g. 6.6.2)' + required: true + type: string + base_tag: + description: 'The older base tag to compare against (e.g. 6.6.1)' + required: true + type: string + +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + +jobs: + # Generates a list of files changed between two version tags. + # + # Performs the following steps: + # - Clones the built WordPress repository without file contents. + # - Determines the current and previous version tags. + # - Generates a sorted list of changed files using git diff. + # - Displays the list in the workflow run summary. + # - Uploads the list as a downloadable workflow artifact. + generate: + name: Generate changed files list + runs-on: ubuntu-24.04 + permissions: + contents: read + timeout-minutes: 20 + if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'workflow_dispatch' }} + + steps: + # Only the commit and tree objects are needed to list changed file names, + # so file contents are left out to keep the clone small. + - name: Clone the built WordPress repository + shell: bash + run: git clone --quiet --filter=blob:none --no-checkout https://github.com/WordPress/WordPress.git wordpress + + - name: Determine the tags to compare + id: tags + shell: bash + working-directory: wordpress + env: + EVENT_NAME: ${{ github.event_name }} + INPUT_COMPARE_TAG: ${{ inputs.compare_tag }} + INPUT_BASE_TAG: ${{ inputs.base_tag }} + run: | + VERSION_PATTERN='^[0-9]+\.[0-9]+(\.[0-9]+)?$' + + if [[ "${EVENT_NAME}" == "workflow_dispatch" ]]; then + CURRENT_TAG="${INPUT_COMPARE_TAG}" + PREVIOUS_TAG="${INPUT_BASE_TAG}" + + for TAG in "${CURRENT_TAG}" "${PREVIOUS_TAG}"; do + if [[ ! "${TAG}" =~ ${VERSION_PATTERN} ]]; then + echo "::error::'${TAG}' is not a valid version tag (expected e.g. 6.6 or 6.6.2)." + exit 1 + fi + done + else + CURRENT_TAG="${GITHUB_REF_NAME}" + + # The built repository is tagged separately from this one and can lag + # behind it, so wait for the new tag to appear there. + for ATTEMPT in {1..10}; do + if git rev-parse --verify --quiet "refs/tags/${CURRENT_TAG}" > /dev/null; then + break + fi + echo "Tag ${CURRENT_TAG} is not in the built repository yet (attempt ${ATTEMPT} of 10). Retrying in 60 seconds." + sleep 60 + git fetch --quiet --tags origin + done + + # The previous release is the tag sorted directly below the current one. + # This keeps maintenance releases within their own branch (7.0.8 is + # compared to 7.0.7, even when 7.1.3 exists), and compares a major + # release to the latest release of the previous branch (7.0 to 6.9.4). + PREVIOUS_TAG=$( git tag --list --sort=-version:refname | grep -E "${VERSION_PATTERN}" | grep -x -F -A1 "${CURRENT_TAG}" | sed -n '2p' || true ) + fi + + for TAG in "${CURRENT_TAG}" "${PREVIOUS_TAG}"; do + if [[ -z "${TAG}" ]] || ! git rev-parse --verify --quiet "refs/tags/${TAG}" > /dev/null; then + echo "::error::Could not find the tag '${TAG}' in the built WordPress repository." + exit 1 + fi + done + + echo "Comparing ${PREVIOUS_TAG} to ${CURRENT_TAG}." + echo "current_tag=${CURRENT_TAG}" >> "$GITHUB_OUTPUT" + echo "previous_tag=${PREVIOUS_TAG}" >> "$GITHUB_OUTPUT" + + # Rename detection is turned off because it needs file contents, which the + # clone leaves out. A renamed file is listed as a deletion and an addition. + - name: Generate list of changed files + id: diff + shell: bash + working-directory: wordpress + env: + CURRENT_TAG: ${{ steps.tags.outputs.current_tag }} + PREVIOUS_TAG: ${{ steps.tags.outputs.previous_tag }} + run: | + git diff --name-status --no-renames "refs/tags/${PREVIOUS_TAG}" "refs/tags/${CURRENT_TAG}" | sort > ../changed-files.txt + + FILE_COUNT=$( wc -l < ../changed-files.txt | tr -d ' ' ) + + { + echo "## Files Changed: \`${PREVIOUS_TAG}\` → \`${CURRENT_TAG}\`" + echo "" + echo "**${FILE_COUNT} file(s) changed** between \`${PREVIOUS_TAG}\` and \`${CURRENT_TAG}\`." + echo "" + echo "Status codes: \`A\` = Added, \`D\` = Deleted, \`M\` = Modified." + echo "" + echo '```' + cat ../changed-files.txt + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + + echo "file_count=${FILE_COUNT}" >> "$GITHUB_OUTPUT" + + - name: Upload changed files list as artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: changed-files-${{ steps.tags.outputs.current_tag }} + path: changed-files.txt + if-no-files-found: error diff --git a/.github/workflows/install-testing.yml b/.github/workflows/install-testing.yml index 4e1af59a308fd..fd47856680616 100644 --- a/.github/workflows/install-testing.yml +++ b/.github/workflows/install-testing.yml @@ -18,6 +18,7 @@ on: - '.github/workflows/install-testing.yml' - '.version-support-*.json' - '.github/workflows/reusable-support-json-reader-v1.yml' + - '.github/workflows/reusable-download-wordpress-release.yml' pull_request: # Always test the workflow when changes are suggested. paths: @@ -27,6 +28,7 @@ on: - '.version-support-*.json' - '.github/workflows/install-testing.yml' - '.github/workflows/reusable-support-json-reader-v1.yml' + - '.github/workflows/reusable-download-wordpress-release.yml' schedule: - cron: '0 0 * * 1' @@ -59,6 +61,16 @@ jobs: with: wp-version: ${{ inputs.wp-version }} + # Downloads a release zip once for every matrix job, waiting until WordPress.org serves it. + download-wordpress: + name: Download WordPress + uses: $/.github/workflows/reusable-download-wordpress-release.yml + permissions: + contents: read + if: ${{ github.repository == 'WordPress/wordpress-develop' }} + with: + version: ${{ inputs.wp-version || 'nightly' }} + # Test the WordPress installation process through WP-CLI. # # Performs the following steps: @@ -74,7 +86,7 @@ jobs: runs-on: ${{ matrix.os }} if: ${{ github.repository == 'WordPress/wordpress-develop' }} timeout-minutes: 15 - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] env: WP_ADMIN_USER: admin @@ -147,9 +159,24 @@ jobs: with: version: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && '2.4.0' || contains( fromJSON('["5.6", "7.0", "7.1"]'), matrix.php ) && '2.12.0' || 'latest' }} + - name: Download the WordPress release artifact + if: ${{ needs.download-wordpress.outputs.artifact != '' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ needs.download-wordpress.outputs.artifact }} + path: ${{ runner.temp }} + + # WP-CLI 2.4.0 cannot install from a local zip, so unzip it. + - name: Extract WordPress + if: ${{ needs.download-wordpress.outputs.artifact != '' }} + run: | + unzip -q "${RUNNER_TEMP}/wordpress.zip" -d "${RUNNER_TEMP}" + mv "${RUNNER_TEMP}"/wordpress/* . + # WP-CLI 2.x extracts tarballs with PharData, which truncates paths longer than 100 characters. # Zip archives are not affected, so download the zip for every version. - name: Download WordPress + if: ${{ needs.download-wordpress.outputs.artifact == '' }} # WP-CLI requests WordPress from WordPress.org once, so a network error fails the job. # It extracts only after a complete download, so a retry starts from an empty directory. uses: $/.github/actions/run-with-retry @@ -174,9 +201,7 @@ jobs: --admin_password="${WP_ADMIN_PASSWORD}" --admin_email=me@example.org --skip-email - name: Post-install smoke check - # A network's domain lives in wp-config.php and the database, not just an option. - if: ${{ ! matrix.multisite }} - uses: WordPress/wordpress-develop/.github/actions/smoke-check@trunk # zizmor: ignore[unpinned-uses] + uses: $/.github/actions/smoke-check with: admin-user: ${{ env.WP_ADMIN_USER }} admin-password: ${{ env.WP_ADMIN_PASSWORD }} @@ -187,7 +212,7 @@ jobs: permissions: actions: read contents: read - needs: [ install-tests-mysql ] + needs: [ download-wordpress, install-tests-mysql ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} diff --git a/.github/workflows/phpstan-pull-request-comments.yml b/.github/workflows/phpstan-pull-request-comments.yml index d1c38cc83fd10..170d770cd880b 100644 --- a/.github/workflows/phpstan-pull-request-comments.yml +++ b/.github/workflows/phpstan-pull-request-comments.yml @@ -57,6 +57,20 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ github.token }} + # The results of the analysis holding selected paths to a stricter rule level. A pull request whose branch does + # not have that analysis yet uploads none, which is fine. Whether they were expected is decided from the results + # above. + - name: Download the results of the strict analysis + id: download-strict + if: ${{ steps.download.outcome == 'success' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + continue-on-error: true + with: + name: phpstan-results-strict + path: ${{ runner.temp }}/phpstan-results-strict + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + - name: Create, update, or resolve the PHPStan comment if: ${{ steps.download.outcome == 'success' }} uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -74,7 +88,7 @@ jobs: // anything at all. They are therefore checked for shape, and only accepted for the pull request whose // current head is the commit that the run analyzed. That also discards the results of a run that was // overtaken by a newer push. - const results = JSON.parse( fs.readFileSync( `${ process.env.RUNNER_TEMP }/phpstan-results/results.json`, 'utf8' ) ); + const results = JSON.parse( fs.readFileSync( `${ process.env.RUNNER_TEMP }/phpstan-results/results.json`, { encoding: 'utf8' } ) ); const issue_number = results.pull_request; if ( ! Number.isSafeInteger( issue_number ) || issue_number <= 0 || ! Array.isArray( results.errors ) ) { core.setFailed( 'The analysis results are malformed.' ); @@ -93,12 +107,62 @@ jobs: const asString = ( value ) => ( typeof value === 'string' ? value : null ); const asSha = ( value ) => ( typeof value === 'string' && /^[0-9a-f]{40}$/.test( value ) ? value : null ); + // A rule level is a number, or `max`. Results from a branch that does not report the level have none. + const asLevel = ( value ) => ( ( Number.isSafeInteger( value ) && value >= 0 ) || value === 'max' ? value : null ); const normalize = ( error ) => ( { file: asString( error.file ), line: Number.isSafeInteger( error.line ) && error.line > 0 ? error.line : null, message: ( asString( error.message ) ?? '' ).slice( 0, 1000 ), identifier: /^[A-Za-z0-9.]+$/.test( error.identifier ) ? error.identifier : null, ignorable: error.ignorable === true, + // The analysis that reported the error, and the rule level it analyzed at. Neither is reported per error: + // they are those of the results the error was read from, and are kept in the history from there. + analysis: error.analysis === 'strict' ? 'strict' : 'default', + level: asLevel( error.level ), + } ); + + // The paths held to a stricter rule level are analyzed a second time, and that analysis uploads its results + // separately. The results above list the analyses the run made, and when the strict one is among them but + // its results are missing, the comment is left as it is: every error that only analysis reported would + // otherwise be shown as resolved. A run from a branch that does not have that analysis yet lists none, and + // has only these results. + const expectsStrict = Array.isArray( results.analyses ) && results.analyses.includes( 'strict' ); + let strictErrors = []; + let strictLevel = null; + let strictChangedInBase = []; + if ( expectsStrict ) { + let strictResults = null; + try { + strictResults = JSON.parse( fs.readFileSync( `${ process.env.RUNNER_TEMP }/phpstan-results-strict/results.json`, { encoding: 'utf8' } ) ); + } catch ( error ) { + core.info( `The results of the strict analysis are missing, so the comment is left as it is: ${ error.message }` ); + return; + } + if ( strictResults?.pull_request !== issue_number || ! Array.isArray( strictResults.errors ) ) { + core.setFailed( 'The results of the strict analysis are malformed.' ); + return; + } + strictLevel = asLevel( strictResults.level ); + strictErrors = strictResults.errors.map( ( error ) => normalize( { ...error, analysis: 'strict', level: strictLevel } ) ); + strictChangedInBase = Array.isArray( strictResults.changed_in_base ) ? strictResults.changed_in_base : []; + } + + // The strict analysis includes everything the default one does, so an error it reports at a lower level is + // reported by both. Such an error is listed once, as found by the analysis of the whole codebase, and the + // strict one only adds what is left over. Errors are matched as they are below, apart from their line. + const errorKey = ( error ) => JSON.stringify( [ error.file, error.identifier, error.message ] ); + const defaultCounts = new Map(); + const defaultErrors = results.errors.map( ( error ) => normalize( { ...error, analysis: 'default', level: results.level } ) ); + for ( const error of defaultErrors ) { + defaultCounts.set( errorKey( error ), ( defaultCounts.get( errorKey( error ) ) ?? 0 ) + 1 ); + } + const strictOnly = strictErrors.filter( ( error ) => { + const count = defaultCounts.get( errorKey( error ) ) ?? 0; + if ( count > 0 ) { + defaultCounts.set( errorKey( error ), count - 1 ); + return false; + } + return true; } ); // An error is recognized from one run to the next by its file, identifier and message, but not its line, @@ -107,10 +171,10 @@ jobs: // is fixed or added, those after it shift to the history of the one before or after, so their first reports // can be off, and the one shown as resolved or new is the last rather than the one that was. That is rarer // than lines being added or removed above them, which would throw off matching them by line. - const errors = results.errors.map( normalize ); + const errors = [ ...defaultErrors, ...strictOnly ]; const occurrences = new Map(); for ( const error of [ ...errors ].sort( ( a, b ) => ( a.line ?? 0 ) - ( b.line ?? 0 ) ) ) { - const key = JSON.stringify( [ error.file, error.identifier, error.message ] ); + const key = errorKey( error ); const occurrence = occurrences.get( key ) ?? 0; occurrences.set( key, occurrence + 1 ); error.key = `${ key }#${ occurrence }`; @@ -164,7 +228,11 @@ jobs: // Files the base branch has changed since the pull request branched from it, in which the line numbers // reported can be off in the head commit, since the analysis ran on the head commit merged into the base. - const changedInBase = new Set( Array.isArray( results.changed_in_base ) ? results.changed_in_base.filter( ( file ) => typeof file === 'string' ) : [] ); + // Each analysis only lists those among the files it reported errors in, so the lists of both are combined. + const changedInBase = new Set( + [ ...( Array.isArray( results.changed_in_base ) ? results.changed_in_base : [] ), ...strictChangedInBase ] + .filter( ( file ) => typeof file === 'string' ) + ); const lineMayBeOff = ( error ) => ! error.fixed && Boolean( error.line ) && changedInBase.has( error.file ); const filesWithLinesOff = new Set( active.filter( lineMayBeOff ).map( ( error ) => error.file ) ); @@ -206,7 +274,10 @@ jobs: // GitHub shows only the first few annotations of each kind from a step on the page of the workflow run, so // errors left out of a table are pointed to in the log of the step that reported them, which has them all. - const where = `the log of the [workflow run](${ run.html_url }), in the “Report the analysis results” step`; + // Each analysis runs in a job of its own, and an error found only by the strict one is only in that job's log. + const where = strictOnly.length > 0 + ? `the log of the [workflow run](${ run.html_url }), in the “Report the analysis results” step of each of its jobs (errors in strict paths are only in the “strict paths” job)` + : `the log of the [workflow run](${ run.html_url }), in the “Report the analysis results” step`; const table = ( rows, rowLimit, { withResolution = false } = {} ) => { const shown = rows.slice( 0, rowLimit ); if ( shown.length === 0 ) { @@ -215,10 +286,14 @@ jobs: : `The ${ rows.length } errors are not listed here, to keep this comment short. They are listed in ${ where }.`; } const more = `…and ${ rows.length - shown.length } more, which are listed in ${ where }.`; + // The rule level is only shown in a table listing an error from the strict analysis, so that one listing + // only errors from the analysis of the whole codebase looks as it did before there were two. A level + // that was not reported, as by a branch from before it was, is left blank. + const withLevel = shown.some( ( error ) => error.analysis === 'strict' ); const lines = [ - `| Location | Error | Identifier | First reported |${ withResolution ? ' Resolved |' : '' }`, - `| --- | --- | --- | --- |${ withResolution ? ' --- |' : '' }`, - ...shown.map( ( error ) => `| ${ location( error ) } | ${ code( error.message ) } | ${ identifier( error ) } | ${ commit( error.introduced ) } |${ withResolution ? ` ${ commit( error.fixed ) } |` : '' }` ), + `| Location | Error | Identifier |${ withLevel ? ' Level |' : '' } First reported |${ withResolution ? ' Resolved |' : '' }`, + `| --- | --- | --- |${ withLevel ? ' --- |' : '' } --- |${ withResolution ? ' --- |' : '' }`, + ...shown.map( ( error ) => `| ${ location( error ) } | ${ code( error.message ) } | ${ identifier( error ) } |${ withLevel ? ` ${ error.level ?? '' } |` : '' } ${ commit( error.introduced ) } |${ withResolution ? ` ${ commit( error.fixed ) } |` : '' }` ), ]; if ( shown.length < rows.length ) { lines.push( '', more ); @@ -248,6 +323,11 @@ jobs: `> ${ filesWithLinesOff.size === 1 ? 'A file with errors has' : `${ filesWithLinesOff.size } files with errors have` } changed in ${ code( pr.base.ref ) } since this branch was last updated, so the line numbers reported in ${ filesWithLinesOff.size === 1 ? 'it' : 'them' } may be off and are not linked. Merge the latest ${ code( pr.base.ref ) } into this branch for accurate links.`, ].join( '\n' ) ); } + if ( active.some( ( error ) => error.analysis === 'strict' ) ) { + const strictError = strictLevel === null ? 'An error found by the strict analysis' : `An error at level ${ strictLevel }`; + const stricterLevel = strictLevel === null ? 'a stricter rule level' : `rule level ${ strictLevel }`; + sections.push( `${ strictError } is in a path that ${ code( 'phpstan-strict.neon.dist' ) } holds to ${ stricterLevel }, which the rest of the codebase is not yet held to. See [Stricter analysis of selected paths](${ readmeUrl }#stricter-analysis-of-selected-paths).` ); + } } else { // Resolved by the last commit that resolved anything, so that later commits do not change the comment. const resolvedBy = resolved.at( -1 )?.fixed ?? run.head_sha; @@ -316,8 +396,8 @@ jobs: // The errors tracked are taken in the order they are listed, so that each one listed keeps its history. const tracked = [ ...unignorable, ...ignorable ].slice( 0, trackedLimit ).concat( resolved ).map( ( error ) => { - const { key, file, line, message, identifier, ignorable, introduced, seen, fixed } = error; - return { key, file, line: lineMayBeOff( error ) ? null : line, message, identifier, ignorable, introduced, seen, fixed }; + const { key, file, line, message, identifier, ignorable, analysis, level, introduced, seen, fixed } = error; + return { key, file, line: lineMayBeOff( error ) ? null : line, message, identifier, ignorable, analysis, level, introduced, seen, fixed }; } ); sections.push( `` ); diff --git a/.github/workflows/phpstan-static-analysis.yml b/.github/workflows/phpstan-static-analysis.yml index f0eaad6d015f3..75f61e02a2f32 100644 --- a/.github/workflows/phpstan-static-analysis.yml +++ b/.github/workflows/phpstan-static-analysis.yml @@ -17,11 +17,16 @@ on: - 'composer.*' # These files configure PHPStan. Changes could affect the outcome. - 'phpstan.neon.dist' + - 'phpstan-strict.neon.dist' - 'tests/phpstan/base.neon' - 'tests/phpstan/baselines/**' + - 'tests/phpstan/baselines-strict/**' + # These files configure the tests of the PHPStan extensions, and hold their fixtures. + - 'tests/phpstan/phpunit.xml.dist' + - 'tests/phpstan/Tests/**' # Confirm any changes to relevant workflow files. - '.github/workflows/phpstan-static-analysis.yml' - - '.github/workflows/reusable-phpstan-static-analysis-v1.yml' + - '.github/workflows/reusable-phpstan-static-analysis-v2.yml' workflow_dispatch: # Cancels all previous workflow runs for pull requests that have not completed. @@ -39,7 +44,7 @@ jobs: # Runs PHPStan Static Analysis. phpstan: name: PHP static analysis - uses: ./.github/workflows/reusable-phpstan-static-analysis-v1.yml + uses: ./.github/workflows/reusable-phpstan-static-analysis-v2.yml permissions: contents: read if: | diff --git a/.github/workflows/reusable-download-wordpress-release.yml b/.github/workflows/reusable-download-wordpress-release.yml new file mode 100644 index 0000000000000..ec953abbfd58f --- /dev/null +++ b/.github/workflows/reusable-download-wordpress-release.yml @@ -0,0 +1,101 @@ +## +# A reusable workflow that downloads a WordPress release zip once and shares it as an artifact. +# +# For a while after a release is uploaded, some WordPress.org download servers do not have the new zip yet. +# This workflow waits until the zip downloads and passes its md5 check, so the jobs that use it do not each fail. +## +name: Download a WordPress release + +on: + workflow_call: + inputs: + version: + description: 'The WordPress version to download. "latest", "nightly", "trunk" and "develop" are not downloaded.' + type: string + required: true + outputs: + artifact: + description: 'The name of the artifact that holds wordpress.zip, or an empty string when nothing was downloaded.' + value: ${{ jobs.download.outputs.artifact }} + +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + +jobs: + # Downloads the release zip and uploads it as an artifact. + # + # Performs the following steps: + # - Sets up PHP and WP-CLI. + # - Downloads the release zip, retrying until it is available. + # - Uploads the zip as an artifact. + download: + name: Download WordPress ${{ inputs.version }} + permissions: + contents: read + runs-on: ubuntu-26.04 + timeout-minutes: 50 + outputs: + artifact: ${{ steps.upload.outcome == 'success' && 'wordpress-release' || '' }} + + steps: + - name: Check whether the version is a release + id: check + run: | + case "${WP_VERSION}" in + latest|nightly|trunk|develop) echo "release=false" >> "$GITHUB_OUTPUT" ;; + *) echo "release=true" >> "$GITHUB_OUTPUT" ;; + esac + env: + WP_VERSION: ${{ inputs.version }} + + - name: Set up PHP + if: ${{ steps.check.outputs.release == 'true' }} + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: '8.4' + coverage: none + + # This job does not check out the repository: `$/` fetches the action from this workflow's commit. + - name: Set up WP-CLI + if: ${{ steps.check.outputs.release == 'true' }} + uses: $/.github/actions/setup-wp-cli + + # A missing md5 checksum is only a warning in WP-CLI, so a try passes only when the hash was verified. + # The URL form always saves a zip; `--version` can save a tar.gz. + - name: Download WordPress ${{ inputs.version }} + if: ${{ steps.check.outputs.release == 'true' }} + run: | + until output=$(wp core download "https://wordpress.org/wordpress-${WP_VERSION}.zip" --no-extract --path="$DOWNLOAD_DIR" 2>&1) \ + && grep -q 'md5 hash verified' <<< "$output"; do + echo "$output" + + if (( SECONDS + RETRY_DELAY_SECONDS > MAX_WAIT_SECONDS )); then + echo "::error::WordPress ${WP_VERSION} could not be downloaded after ${SECONDS} seconds." + exit 1 + fi + + echo "Trying again in ${RETRY_DELAY_SECONDS} seconds." + sleep "$RETRY_DELAY_SECONDS" + rm -rf "$DOWNLOAD_DIR" + done + + echo "$output" + echo "Downloaded WordPress ${WP_VERSION} after waiting ${SECONDS} seconds." + mv "$DOWNLOAD_DIR"/wp_*.zip "$DOWNLOAD_DIR/wordpress.zip" + env: + WP_VERSION: ${{ inputs.version }} + DOWNLOAD_DIR: ${{ runner.temp }}/wordpress-release + MAX_WAIT_SECONDS: 2700 # 45 minutes. + RETRY_DELAY_SECONDS: 60 + + - name: Upload the release zip + id: upload + if: ${{ steps.check.outputs.release == 'true' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: wordpress-release + path: ${{ runner.temp }}/wordpress-release/wordpress.zip + if-no-files-found: error + overwrite: true + retention-days: 30 diff --git a/.github/workflows/reusable-phpstan-static-analysis-v1.yml b/.github/workflows/reusable-phpstan-static-analysis-v1.yml index 9a80af539ae13..cda319835e645 100644 --- a/.github/workflows/reusable-phpstan-static-analysis-v1.yml +++ b/.github/workflows/reusable-phpstan-static-analysis-v1.yml @@ -1,7 +1,7 @@ ## # A reusable workflow that runs PHP Static Analysis tests. # -# This workflow is used by `trunk` and branches >= 7.0. +# This workflow is used by branches 7.0 and 7.1. ## name: PHP Static Analysis @@ -283,9 +283,9 @@ jobs: composer phpstan:fix ``` - That runs PHPStan with `--fix`, which lowers the counts in the files under [`tests/phpstan/baselines`][baselines], removes the entries that no longer match, and removes any `@phpstan-ignore` annotation in the code that no longer ignores anything. It then deletes any baseline left with no entries, and updates the list of them in `phpstan.neon.dist`. + That runs PHPStan with `--fix`, which lowers the counts in the files under [`tests/phpstan/baselines`][baselines], removes the entries that no longer match, and removes any `@phpstan-ignore` annotation in the code that no longer ignores anything. It then deletes any baseline left with no entries. - Alternatively, regenerate the baselines with `npm run typecheck:php:baselines` or `composer phpstan:baselines`. That also deletes any baseline whose errors are now all fixed, and updates the list of them in `phpstan.neon.dist`, but it does not clear an `@phpstan-ignore` annotation. + Alternatively, regenerate the baselines with `npm run typecheck:php:baselines` or `composer phpstan:baselines`. That also deletes any baseline whose errors are now all fixed, but it does not clear an `@phpstan-ignore` annotation. See [`tests/phpstan/README.md`][readme] for details. diff --git a/.github/workflows/reusable-phpstan-static-analysis-v2.yml b/.github/workflows/reusable-phpstan-static-analysis-v2.yml new file mode 100644 index 0000000000000..73c21bc21d23d --- /dev/null +++ b/.github/workflows/reusable-phpstan-static-analysis-v2.yml @@ -0,0 +1,399 @@ +## +# A reusable workflow that runs PHP Static Analysis tests. +# +# This workflow is used by `trunk` and branches >= 7.2. +## +name: PHP Static Analysis + +on: + workflow_call: + inputs: + php-version: + description: 'The PHP version to use.' + required: false + type: 'string' + default: 'latest' + +# Disable permissions for all available scopes by default. +# Any needed permissions should be configured at the job level. +permissions: {} + +jobs: + # Runs PHP static analysis tests. + # + # Core is analyzed twice, in parallel: the whole codebase with phpstan.neon.dist, and the paths held to a stricter rule + # level with phpstan-strict.neon.dist. See tests/phpstan/README.md. + # + # Violations are reported inline with annotations. For pull requests, the results of each analysis are also uploaded + # as an artifact, and the PHPStan Pull Request Comments workflow combines them in a comment. + # + # Performs the following steps: + # - Checks out the repository. + # - Sets up PHP. + # - Logs debug information. + # - Installs Composer dependencies. + # - Make Composer packages available globally. + # - Builds WordPress. + # - Configures caching for PHPStan static analysis scans. + # - Runs PHPStan static analysis. + # - Reports the results as annotations. + # - Uploads the results as an artifact (pull requests only). + # - Runs the tests of the WordPress-specific PHPStan extensions (default analysis only). + # - Checks for errors that cannot be reported as warnings, such as out-of-date baselines. + # - Saves the PHPStan result cache. + # - Ensures version-controlled files are not modified or deleted. + phpstan: + name: Run PHP static analysis (${{ matrix.label }}) + runs-on: ubuntu-26.04 + permissions: + contents: read + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + # The artifact of the analysis of the whole codebase keeps the name it had before there were two, which is + # the name the PHPStan Pull Request Comments workflow on trunk requires. That way the comment is kept up to + # date for a pull request whose branch does not have the second analysis yet. + # + # The analyses are named for their role rather than their rule level, which is read from the configuration + # when the results are reported, so that raising either level is an edit of its configuration alone. + - analysis: default + label: all paths + config: phpstan.neon.dist + baselines: tests/phpstan/baselines + script: phpstan:default + artifact: phpstan-results + - analysis: strict + label: strict paths + config: phpstan-strict.neon.dist + baselines: tests/phpstan/baselines-strict + script: phpstan:strict + artifact: phpstan-results-strict + + steps: + # For a pull request, the parents of the merge commit are fetched too, to find the files that the base branch + # has changed since the pull request branched from it. + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + persist-credentials: false + fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 1 }} + + - name: Set up PHP + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 + with: + php-version: ${{ inputs.php-version }} + coverage: none + + - name: General debug information + run: | + composer --version + + # Since Composer dependencies are installed using `composer update` and no lock file is in version control, + # passing a custom cache suffix ensures that the cache is flushed at least once per week. + - name: Install Composer dependencies + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") + + - name: Make Composer packages available globally + run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" + + # The directory holds more than the analysis results. PHPStan also stores what it read out of + # each source file there, the docblocks and signatures it found, keyed by that file's contents + # and nothing else. The extensions in `tests/phpstan` change what reading a file yields without + # changing the file: a parser node visitor rewrites a docblock in the syntax tree, and the bytes + # on disk stay as they were. A cache written before one of them changed therefore answers with + # what the old code saw, and the analysis silently runs against types no longer derived. + # + # Keying on the configuration and the extensions keeps a run from restoring a cache that + # predates either. The baselines are left out of the key: they only decide which reported errors + # are ignored, PHPStan invalidates the results cache on a configuration change by itself, and + # including them would discard the whole cache every time one is regenerated. + # + # The cache is renamed rather than only prefixed, because the key this replaces restored on + # `phpstan-result-cache-`, which every key below still begins with. A branch that has not + # merged this commit yet runs the workflow it has, and that workflow would prefix-match the + # caches written here: it would analyse without the extensions against reflection derived with + # them. A name of its own leaves those runs restoring only their own caches. + # + # Each analysis caches separately. Its result cache records the rule level, and is discarded + # by a run at another level, so restoring the other analysis's cache would gain nothing. + - name: Cache PHP Static Analysis scan cache + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: .cache # This is defined in the base.neon file. + key: "phpstan-analysis-cache-${{ matrix.analysis }}-${{ hashFiles('phpstan.neon.dist', 'phpstan-strict.neon.dist', 'tests/phpstan/*.neon', 'tests/phpstan/*.php') }}-${{ github.run_id }}" + restore-keys: | + phpstan-analysis-cache-${{ matrix.analysis }}-${{ hashFiles('phpstan.neon.dist', 'phpstan-strict.neon.dist', 'tests/phpstan/*.neon', 'tests/phpstan/*.php') }}- + + - name: Run PHP static analysis tests + id: phpstan + env: + SCRIPT: ${{ matrix.script }} + run: | + # The report is written to a file for the steps below, which turn it into annotations, + # the pull request comment, and a check for errors that cannot be reported as warnings. + # Only the report goes to standard output; the debug output goes to standard error, so + # it stays in the log without corrupting the JSON. + # + # The step shell exits on the first failing command, which would also end the step on + # the status of 1 that PHPStan uses for reporting errors. Capture the status instead. + status=0 + composer run "${SCRIPT}" -- -vvv --error-format=json > "${RUNNER_TEMP}/phpstan-report.json" || status=$? + + # PHPStan exits 1 when it has errors to report, which is the expected case here and + # is what the annotations are for. Anything higher means it did not finish at all. + if [ "${status}" -gt 1 ]; then + echo "::error title=PHPStan did not complete::The analysis exited with status ${status}, so the code was not fully checked. This is a failure of the run itself rather than a problem found in the code." + exit "${status}" + fi + + # Errors are annotated as warnings, so that they are visible on the pull request without + # failing the run. The exception is an error that PHPStan does not allow to be ignored, + # such as an out-of-date baseline entry, or one that is not specific to a file. These are + # annotated as errors instead, and the run fails on them in the check further below. + # + # The results are also written out for the PHPStan Pull Request Comments workflow, which + # runs with the permissions needed to comment on the pull request. Only the facts are + # passed along: the comment is composed there, since a pull request can change anything + # that runs here. + - name: Report the analysis results + id: report + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + ANALYSIS: ${{ matrix.analysis }} + CONFIG: ${{ matrix.config }} + with: + script: | + const fs = require( 'fs' ); + + // The rule level the configuration analyzes at, as a number, or `max`. Only the line of the parameter is + // matched, rather than decoding the whole dump, because the JSON PHPStan prints can be invalid: it writes + // the `\<` in a message pattern as is, which is not a valid JSON escape. + let level = null; + try { + const parameters = require( 'child_process' ).execFileSync( + `${ process.env.GITHUB_WORKSPACE }/vendor/bin/phpstan`, + [ 'dump-parameters', `--configuration=${ process.env.CONFIG }`, '--json' ], + { encoding: 'utf8' } + ); + const match = parameters.match( /^\s*"level":\s*"?(max|\d+)"?,?$/m ); + if ( match ) { + level = match[ 1 ] === 'max' ? 'max' : Number( match[ 1 ] ); + } + } catch ( error ) { + core.warning( `The rule level of ${ process.env.CONFIG } could not be read: ${ error.message }` ); + } + + // Annotations from the stricter analysis say so, since the same code can pass the other one. + const analysis = process.env.ANALYSIS; + const titlePrefix = analysis === 'strict' ? `PHPStan (strict${ level === null ? '' : `, level ${ level }` })` : 'PHPStan'; + + const report = JSON.parse( fs.readFileSync( `${ process.env.RUNNER_TEMP }/phpstan-report.json`, { encoding: 'utf8' } ) ); + const workspace = `${ process.env.GITHUB_WORKSPACE }/`; + + const errors = []; + for ( const [ absolutePath, file ] of Object.entries( report.files ) ) { + const relativePath = absolutePath.startsWith( workspace ) ? absolutePath.slice( workspace.length ) : absolutePath; + for ( const message of file.messages ) { + errors.push( { + file: relativePath, + line: message.line ?? null, + message: message.message, + identifier: message.identifier ?? null, + tip: message.tip ?? null, + ignorable: message.ignorable, + fixable: message.fixable ?? false, + } ); + } + } + + // Errors that are not specific to a file, such as an `ignoreErrors` entry from a config + // file PHPStan cannot locate it in. These cannot be ignored either. + for ( const message of report.errors ) { + errors.push( { file: null, line: null, message, identifier: null, tip: null, ignorable: false, fixable: false } ); + } + + // PHPStan marks an error it can fix itself, such as a stale baseline entry, as fixable. + const fixHint = 'This can be fixed automatically by running `composer phpstan:fix` (or `npm run typecheck:php:fix`).'; + + for ( const error of errors ) { + const properties = { title: error.identifier ? `${ titlePrefix }: ${ error.identifier }` : titlePrefix }; + if ( error.file ) { + properties.file = error.file; + } + if ( error.line ) { + properties.startLine = error.line; + } + const message = [ error.message, error.tip, error.fixable ? fixHint : null ].filter( Boolean ).join( '\n' ); + if ( error.ignorable ) { + core.warning( message, properties ); + } else { + core.error( message, properties ); + } + } + + // Tips and whether an error is fixable are left out of the results, since they are only shown in the + // annotations, next to the code. + // + // The commit analyzed is the pull request merged into its base branch, whose second parent is the head + // commit. The files with errors that differ between the two are those the base branch has changed, in + // which the line numbers reported can be off in the head commit. + // + // Each analysis writes its own results. Those of the analysis of the whole codebase also list every + // analysis the run makes, so that the comment is not updated from only some of them: an error missing + // because its analysis did not upload results would otherwise be shown as resolved. + if ( context.eventName === 'pull_request' ) { + let changedInBase = []; + try { + const filesWithErrors = new Set( errors.map( ( error ) => error.file ) ); + changedInBase = require( 'child_process' ) + .execFileSync( 'git', [ 'diff', '--name-only', '--no-renames', 'HEAD^2', 'HEAD' ], { encoding: 'utf8' } ) + .split( '\n' ) + .filter( ( file ) => filesWithErrors.has( file ) ); + } catch ( error ) { + core.warning( `The files changed in the base branch could not be found: ${ error.message }` ); + } + fs.mkdirSync( `${ process.env.RUNNER_TEMP }/phpstan-results`, { recursive: true } ); + fs.writeFileSync( `${ process.env.RUNNER_TEMP }/phpstan-results/results.json`, JSON.stringify( { + pull_request: context.payload.pull_request.number, + analysis, + level, + // Keep this list in step with the `analysis` values of the job's matrix. + ...( analysis === 'default' ? { analyses: [ 'default', 'strict' ] } : {} ), + changed_in_base: changedInBase, + errors: errors.map( ( { tip, fixable, ...error } ) => error ), + } ) ); + } + + # Uploads the results for the PHPStan Pull Request Comments workflow, which keeps a comment on the + # pull request up to date with them. + - name: Upload the analysis results as an artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + if: ${{ github.event_name == 'pull_request' && steps.report.outcome == 'success' }} + with: + name: ${{ matrix.artifact }} + path: ${{ runner.temp }}/phpstan-results/ + + # The extensions in `tests/phpstan` are tested against fixtures rather than against + # core, so a defect in one is reported here as a failing test rather than as a + # change in what the analysis above reports. + # + # This runs after the results are reported and uploaded, so that a failing test + # does not also keep the pull request from being annotated and commented on. It + # runs even when the analysis failed, since the two are independent, but not when + # the analysis was skipped: that means a step setting up the job, such as installing + # the Composer dependencies, failed, and the tests could only fail along with it. + # Both analyses load the same extensions, so the tests run in only one of them. + - name: Run the tests of the PHPStan extensions + if: ${{ !cancelled() && steps.phpstan.outcome != 'skipped' && matrix.analysis == 'default' && hashFiles('tests/phpstan/phpunit.xml.dist') != '' }} + run: composer run phpstan:test + + # Some errors cannot be ignored, so they cannot be reported as warnings either. Most often + # this is an ignored error that no longer occurs, or occurs a different number of times, + # which is reported under an `ignore.*` identifier. That is not something to fix in the + # code: the usual cause is that the error *was* fixed, leaving a baseline describing a state + # that no longer exists. + # + # Such an error is reported without a line number, so its annotation is not shown alongside + # the changes in the pull request, and one that is not specific to a file has nowhere to be + # shown at all. A passing run would let it go unnoticed, so fail the run on it instead, and + # say what to do about it. + # + # Detection is on PHPStan's own `ignorable` flag rather than on the identifier or message. + - name: Check for errors that cannot be reported as warnings + if: ${{ !cancelled() }} + env: + BASELINES_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}/${{ matrix.baselines }} + LABEL: ${{ matrix.label }} + README_URL: ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/tests/phpstan/README.md + run: | + # This step runs even when the analysis above it failed, in which case the report may + # never have been written. That failure is reported there, so there is nothing to add + # here beyond staying quiet about a file that was never going to exist. + report="${RUNNER_TEMP}/phpstan-report.json" + if [ ! -f "${report}" ]; then + exit 0 + fi + + # Errors that are not specific to a file are listed separately from the rest, and are + # never ignorable. + unignorable=$( jq '[ .files[].messages[] | select( .ignorable | not ) ] + .errors | length' "${report}" ) + if [ "${unignorable}" -eq 0 ]; then + exit 0 + fi + + # Whether the errors include ignore errors decides what to say about them, but not whether to + # fail: every error that reaches this point fails the run. Ignore errors concern an ignore + # configuration that no longer describes the code. They are `ignore.unmatched`, where a + # pattern matched nothing at all, and `ignore.count`, where it matched a different number of + # times than the entry records. The `ignore.` prefix is matched rather than those two names + # so that any later addition to the group is caught as well. Any other error that cannot be + # ignored is something regenerating the baselines would not help with, so it is reported + # plainly instead. + ignore_errors=$( jq '[ .files[].messages[] | select( .identifier // "" | startswith( "ignore." ) ) ] | length' "${report}" ) + + # The summary is Markdown, and its code spans and fences are written literally, so the + # heredoc is quoted to keep the backticks out of the shell's hands. The links are + # written in reference style for the same reason: the URLs are the only part needing + # a variable, so defining them afterwards keeps the whole of the prose in here. + # + # A newline renders as a line break rather than a space, so each paragraph is one + # line however long that makes it, and the rendered summary wraps to its own width. + # + # The heading names the analysis whose baselines are out of date, which is filled in for + # the LABEL placeholder when the summary is written, since the heredoc expands nothing. + baselines_summary=$( cat <<'SUMMARY' + ## PHPStan baselines are out of date (LABEL) + + An ignored error no longer occurs, or occurs a different number of times, so PHPStan reported it under an `ignore.unmatched` or `ignore.count` identifier. + + **If you fixed the error, this is expected.** Each baseline entry records an exact count for a specific file, so that a new occurrence of an already baselined error is reported rather than absorbed. That same exactness means fixing one leaves the baseline describing a state that no longer exists. There is nothing to fix in the code; the baselines just need to catch up. + + Remove the stale entries, and commit the result: + + ```bash + npm run typecheck:php:fix + ``` + + or, outside the Docker environment: + + ```bash + composer phpstan:fix + ``` + + That runs PHPStan with `--fix`, which lowers the counts in [the baselines][baselines], removes the entries that no longer match, and removes any `@phpstan-ignore` annotation in the code that no longer ignores anything. It then deletes any baseline left with no entries. + + Alternatively, regenerate the baselines with `npm run typecheck:php:baselines` or `composer phpstan:baselines`. That also deletes any baseline whose errors are now all fixed, but it does not clear an `@phpstan-ignore` annotation. + + See [`tests/phpstan/README.md`][readme] for details. + + SUMMARY + ) + + if [ "${ignore_errors}" -gt 0 ]; then + { + printf '%s\n\n' "${baselines_summary/LABEL/${LABEL}}" + echo "[baselines]: ${BASELINES_URL}" + echo "[readme]: ${README_URL}" + } >> "${GITHUB_STEP_SUMMARY}" + + echo "::error title=PHPStan baselines are out of date (${LABEL})::An ignored error no longer occurs, or occurs a different number of times. If you fixed it, that is expected: run \`npm run typecheck:php:fix\` or \`composer phpstan:fix\` and commit the updated baselines. See ${README_URL}" + else + echo "::error title=PHPStan reported errors that cannot be ignored (${LABEL})::PHPStan reported ${unignorable} error(s) that cannot be ignored or reported as warnings. See the error annotations for details, and ${README_URL} for how to run the analysis locally." + fi + + exit 1 + + - name: "Save result cache" + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + if: ${{ !cancelled() }} + with: + path: .cache + key: "phpstan-analysis-cache-${{ matrix.analysis }}-${{ hashFiles('phpstan.neon.dist', 'phpstan-strict.neon.dist', 'tests/phpstan/*.neon', 'tests/phpstan/*.php') }}-${{ github.run_id }}" + + - name: Ensure version-controlled files are not modified or deleted + run: git diff --exit-code diff --git a/.github/workflows/reusable-upgrade-testing.yml b/.github/workflows/reusable-upgrade-testing.yml index cc36c1a80587a..ef0ea40fae82c 100644 --- a/.github/workflows/reusable-upgrade-testing.yml +++ b/.github/workflows/reusable-upgrade-testing.yml @@ -17,6 +17,11 @@ on: description: 'The version of WordPress to update to. Use "latest" to update to the latest version, "develop" to update to the current branch, or provide a specific version number to update to.' type: 'string' default: 'latest' + new-version-artifact: + description: 'Optional. The name of an artifact that holds the wordpress.zip of new-version. When set, the upgrade installs from it instead of downloading.' + required: false + type: 'string' + default: '' php: description: 'The version of PHP to use. Expected format: X.Y.' required: true @@ -137,8 +142,29 @@ jobs: run: | wp core update develop.zip + - name: Download the WordPress ${{ inputs.new-version }} artifact + if: ${{ inputs.new-version != 'develop' && inputs.new-version-artifact != '' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ inputs.new-version-artifact }} + + # With a zip, WP-CLI does not stop a downgrade, and the minor update can already be past the target. + # `sort -V` orders 7.2 before 7.2-RC2, so compare the way WordPress does. + - name: Upgrade to WordPress ${{ inputs.new-version }} from the artifact + if: ${{ inputs.new-version != 'develop' && inputs.new-version-artifact != '' }} + run: | + current=$(wp core version) + if ! CURRENT="$current" php -r 'exit( version_compare( getenv( "CURRENT" ), getenv( "WP_VERSION" ), "<" ) ? 0 : 1 );'; then + echo "WordPress ${current} is not older than ${WP_VERSION}, so there is nothing to upgrade." + exit 0 + fi + + wp core update wordpress.zip --version="$WP_VERSION" + env: + WP_VERSION: ${{ inputs.new-version }} + - name: Upgrade to WordPress ${{ inputs.new-version }} - if: ${{ inputs.new-version != 'develop' }} + if: ${{ inputs.new-version != 'develop' && inputs.new-version-artifact == '' }} run: | wp core update ${{ 'latest' != inputs.new-version && '--version="${WP_VERSION}"' || '' }} env: @@ -151,9 +177,7 @@ jobs: run: wp core version - name: Post-upgrade smoke check - # A network's domain lives in wp-config.php and the database, not just an option. - if: ${{ ! inputs.multisite }} - uses: WordPress/wordpress-develop/.github/actions/smoke-check@trunk # zizmor: ignore[unpinned-uses] + uses: $/.github/actions/smoke-check with: admin-user: ${{ env.WP_ADMIN_USER }} admin-password: ${{ env.WP_ADMIN_PASSWORD }} diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml index a7d2ddcb01836..c858088879b95 100644 --- a/.github/workflows/test-old-branches.yml +++ b/.github/workflows/test-old-branches.yml @@ -25,7 +25,7 @@ on: permissions: {} env: - CURRENTLY_SUPPORTED_BRANCH: '7.1' + CURRENTLY_SUPPORTED_BRANCH: '7.2' jobs: dispatch-workflows-for-old-branches: @@ -45,13 +45,15 @@ jobs: 'test-build-processes.yml' ] branch: [ - '7.1', '7.0', + '7.2', '7.1', '7.0', '6.9', '6.8', '6.7', '6.6', '6.5', '6.4', '6.3', '6.2', '6.1','6.0', '5.9', '5.8', '5.7', '5.6', '5.5', '5.4', '5.3', '5.2', '5.1', '5.0', '4.9', '4.8', '4.7' ] include: # PHP Compatibility testing was introduced in 5.5. + - branch: '7.2' + workflow: 'php-compatibility.yml' - branch: '7.1' workflow: 'php-compatibility.yml' - branch: '7.0' @@ -90,6 +92,8 @@ jobs: # End-to-end testing was introduced in 5.3 but was later removed as there were no meaningful assertions. # Starting in 5.8 with #52905, some additional tests with real assertions were introduced. # Branches 5.8 and newer should be tested to confirm no regressions are introduced. + - branch: '7.2' + workflow: 'end-to-end-tests.yml' - branch: '7.1' workflow: 'end-to-end-tests.yml' - branch: '7.0' @@ -122,9 +126,9 @@ jobs: # Performance testing was introduced in 6.2 using Puppeteer but was overhauled to use Playwright instead in 6.4. # Since the workflow frequently failed for 6.2 and 6.3 due to the flaky nature of the Puppeteer tests, # the workflow was removed from those two branches. - - branch: '7.1' + - branch: '7.2' workflow: 'performance.yml' - - branch: '7.0' + - branch: '7.1' workflow: 'performance.yml' # Run all branches monthly, but only the currently supported one twice per month. diff --git a/.github/workflows/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index dcd921c2e6c7e..97744c960054f 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -33,6 +33,7 @@ on: - '.github/actions/setup-npm/**' - '.github/actions/setup-wp-cli/**' - '.github/actions/run-with-retry/**' + - '.github/actions/smoke-check/**' - '.github/workflows/upgrade-develop-testing.yml' - '.github/workflows/reusable-upgrade-testing.yml' schedule: @@ -92,7 +93,7 @@ jobs: db-type: [ 'mysql' ] db-version: [ '5.7', '8.4' ] # WordPress 5.3 is the oldest version that supports PHP 7.4. - wp: [ '5.3', '7.0', '7.1' ] + wp: [ '5.3', '7.0', '7.1', '7.2-RC3' ] multisite: [ false, true ] with: os: ${{ matrix.os }} @@ -126,7 +127,7 @@ jobs: php: [ '7.4', '8.4' ] db-type: [ 'mysql' ] db-version: [ '8.4' ] - wp: [ '7.0', '7.1' ] + wp: [ '7.0', '7.1', '7.2-RC3' ] multisite: [ false, true ] with: os: ${{ matrix.os }} diff --git a/.github/workflows/upgrade-testing.yml b/.github/workflows/upgrade-testing.yml index d4817522585d9..62d5438372584 100644 --- a/.github/workflows/upgrade-testing.yml +++ b/.github/workflows/upgrade-testing.yml @@ -14,6 +14,7 @@ on: - '.github/actions/smoke-check/**' - '.github/workflows/upgrade-testing.yml' - '.github/workflows/reusable-upgrade-testing.yml' + - '.github/workflows/reusable-download-wordpress-release.yml' pull_request: # This workflow is only meant to run from trunk. Pull requests changing this file with different BASE branches should be ignored. branches: @@ -22,8 +23,10 @@ on: paths: - '.github/actions/setup-wp-cli/**' - '.github/actions/run-with-retry/**' + - '.github/actions/smoke-check/**' - '.github/workflows/upgrade-testing.yml' - '.github/workflows/reusable-upgrade-testing.yml' + - '.github/workflows/reusable-download-wordpress-release.yml' workflow_dispatch: inputs: new-version: @@ -92,7 +95,7 @@ jobs: env: NEW_VERSION: ${{ inputs.new-version && inputs.new-version || 'latest' }} # The versions each job below starts from. See the comment on the job for why those versions are tested. - RECENT_RELEASES: '7.0 7.1' # upgrade-tests-recent-releases + RECENT_RELEASES: '7.0 7.1 7.2-RC3' # upgrade-tests-recent-releases WP_6X: '6.0 6.3 6.4 6.5' # upgrade-tests-wp-6x-mysql WP_5X_PHP_7X: '5.0 5.1 5.3 5.4 5.5 5.6 5.9' # upgrade-tests-wp-5x-php-7x-mysql WP_5X_PHP_8X: '5.3 5.4 5.5 5.6 5.9' # upgrade-tests-wp-5x-php-8x-mysql @@ -152,12 +155,22 @@ jobs: filter wp-5x-php-8x "$WP_5X_PHP_8X" filter oldest-wp "$OLDEST_WP" + # Downloads a release zip once for every matrix job, waiting until WordPress.org serves it. + download-wordpress: + name: Download WordPress + uses: $/.github/workflows/reusable-download-wordpress-release.yml + permissions: + contents: read + if: ${{ github.repository == 'WordPress/wordpress-develop' }} + with: + version: ${{ inputs.new-version && inputs.new-version || 'latest' }} + # Tests the full list of PHP/MySQL combinations for the two most recent versions of WordPress. upgrade-tests-recent-releases: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' && needs.build-test-matrix.outputs.recent-releases != '[]' }} - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] permissions: contents: read strategy: @@ -177,13 +190,14 @@ jobs: wp: ${{ matrix.wp }} new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }} multisite: ${{ matrix.multisite }} + new-version-artifact: ${{ needs.download-wordpress.outputs.artifact }} # Tests 6.x releases where the WordPress database version changed on the oldest and newest supported versions of PHP 7 & 8. upgrade-tests-wp-6x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' && needs.build-test-matrix.outputs.wp-6x != '[]' }} - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] permissions: contents: read strategy: @@ -203,13 +217,14 @@ jobs: wp: ${{ matrix.wp }} new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }} multisite: ${{ matrix.multisite }} + new-version-artifact: ${{ needs.download-wordpress.outputs.artifact }} # Tests 5.x releases where the WordPress database version changed on the only supported version of PHP 7. upgrade-tests-wp-5x-php-7x-mysql: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' && needs.build-test-matrix.outputs.wp-5x-php-7x != '[]' }} - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] permissions: contents: read strategy: @@ -229,6 +244,7 @@ jobs: wp: ${{ matrix.wp }} new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }} multisite: ${{ matrix.multisite }} + new-version-artifact: ${{ needs.download-wordpress.outputs.artifact }} # Tests 5.x releases where the WordPress database version changed on the oldest and newest supported versions of PHP 8. # @@ -239,7 +255,7 @@ jobs: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' && needs.build-test-matrix.outputs.wp-5x-php-8x != '[]' }} - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] permissions: contents: read strategy: @@ -259,6 +275,7 @@ jobs: wp: ${{ matrix.wp }} new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }} multisite: ${{ matrix.multisite }} + new-version-artifact: ${{ needs.download-wordpress.outputs.artifact }} # The oldest version of WordPress receiving security updates should always be tested against # the widest possible list of PHP/MySQL combinations. @@ -270,7 +287,7 @@ jobs: name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }} uses: ./.github/workflows/reusable-upgrade-testing.yml if: ${{ github.repository == 'WordPress/wordpress-develop' && needs.build-test-matrix.outputs.oldest-wp != '[]' }} - needs: [ build-test-matrix ] + needs: [ build-test-matrix, download-wordpress ] permissions: contents: read strategy: @@ -290,6 +307,7 @@ jobs: wp: ${{ matrix.wp }} new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }} multisite: ${{ matrix.multisite }} + new-version-artifact: ${{ needs.download-wordpress.outputs.artifact }} slack-notifications: name: Slack Notifications @@ -297,7 +315,7 @@ jobs: permissions: actions: read contents: read - needs: [ build-test-matrix, upgrade-tests-recent-releases, upgrade-tests-wp-6x-mysql, upgrade-tests-wp-5x-php-7x-mysql, upgrade-tests-wp-5x-php-8x-mysql, upgrade-tests-oldest-wp-mysql ] + needs: [ build-test-matrix, download-wordpress, upgrade-tests-recent-releases, upgrade-tests-wp-6x-mysql, upgrade-tests-wp-5x-php-7x-mysql, upgrade-tests-wp-5x-php-8x-mysql, upgrade-tests-oldest-wp-mysql ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} diff --git a/.gitignore b/.gitignore index 2d0178f495120..211cf660ac8ee 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ wp-tests-config.php /tests/phpunit/data/plugins/wordpress-importer /tests/phpunit/data/.trac-ticket-cache* /tests/qunit/compiled.html +/tests/qunit/common-compiled.html /tests/performance/**/*.test.results.json /src/.wp-tests-version /node_modules @@ -24,6 +25,7 @@ wp-tests-config.php /tests/phpunit/build /wp-cli.local.yml /phpstan.neon +/phpstan-strict.neon /*.tsbuildinfo /jsdoc /composer.lock diff --git a/.version-support-mysql.json b/.version-support-mysql.json index 68c6d2ac77407..bcd6946aa9eb7 100644 --- a/.version-support-mysql.json +++ b/.version-support-mysql.json @@ -1,4 +1,14 @@ { + "7-3": [ + "26.10", + "26.7", + "9.7", + "8.4", + "8.0", + "5.7", + "5.6", + "5.5" + ], "7-2": [ "26.10", "26.7", diff --git a/.version-support-php.json b/.version-support-php.json index 31d8169338822..057204cd67f65 100644 --- a/.version-support-php.json +++ b/.version-support-php.json @@ -1,4 +1,14 @@ { + "7-3": [ + "7.4", + "8.0", + "8.1", + "8.2", + "8.3", + "8.4", + "8.5", + "8.6" + ], "7-2": [ "7.4", "8.0", diff --git a/Gruntfile.js b/Gruntfile.js index 0a9270f436847..9bbd543193a6a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -324,7 +324,7 @@ module.exports = function(grunt) { cwd: WORKING_DIR, src: [] }, - qunit: ['tests/qunit/compiled.html'], + qunit: [ 'tests/qunit/compiled.html', 'tests/qunit/common-compiled.html' ], // This is only meant to run within a numbered branch after branching has occurred. workflows: { @@ -396,7 +396,7 @@ module.exports = function(grunt) { [ WORKING_DIR + 'wp-includes/js/jquery/jquery.min.js' ]: [ './node_modules/jquery/dist/jquery.min.js' ], [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.js' ], [ WORKING_DIR + 'wp-includes/js/jquery/jquery-migrate.min.js' ]: [ './node_modules/jquery-migrate/dist/jquery-migrate.min.js' ], - [ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js' ]: [ './node_modules/jquery-form/src/jquery.form.js' ], + [ WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js' ]: [ './node_modules/jquery-form/dist/jquery.form.js' ], [ WORKING_DIR + 'wp-includes/js/jquery/jquery.color.min.js' ]: [ './node_modules/jquery-color/dist/jquery.color.min.js' ], [ WORKING_DIR + 'wp-includes/js/masonry.min.js' ]: [ './node_modules/masonry-layout/dist/masonry.pkgd.min.js' ], [ WORKING_DIR + 'wp-includes/js/underscore.js' ]: [ './node_modules/underscore/underscore.js' ], @@ -687,8 +687,10 @@ module.exports = function(grunt) { files: {} }, qunit: { - src: 'tests/qunit/index.html', - dest: 'tests/qunit/compiled.html', + files: { + 'tests/qunit/compiled.html': 'tests/qunit/index.html', + 'tests/qunit/common-compiled.html': 'tests/qunit/common.html', + }, options: { processContent: function( src ) { return src.replace( /(\".+?\/)build(\/.+?)(?:.min)?(.js\")/g , function( match, $1, $2, $3 ) { diff --git a/README.md b/README.md index a0fd93673885f..9dc46b4a2a3cd 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ For development on Windows, [Windows Subsystem for Linux (WSL)](https://learn.mi After installing Docker Desktop, enable Docker's WSL integration under **Settings > Resources > WSL integration**. This only needs to be configured once. +For much better performance, keep the project files within the Linux filesystem (e.g., `\\wsl.localhost\Ubuntu\home\user\wordpress-develop`) rather than on a mounted Windows drive (e.g., `C:\`). + If you use Docker Desktop directly from Windows without WSL, make sure it is using Linux containers. Right-click the Docker icon in the system tray and select **Switch to Linux containers...**. If that option is not available, or the menu shows **Switch to Windows containers...**, Docker is already using Linux containers. You can switch between container types later if another project requires Windows containers. ### Development Environment Commands diff --git a/SECURITY.md b/SECURITY.md index 13e8007009af8..b73d6ab5c0b6d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,6 +10,7 @@ Full details of the WordPress Security Policy and the list of covered projects a | Version | Supported | |---------| --------- | +| 7.2.x | Yes | | 7.1.x | Yes | | 7.0.x | Yes | | 6.9.x | Yes | diff --git a/composer.json b/composer.json index dd7f57d5b6313..c897fba0fa720 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wordpress/wordpress", - "version": "7.2.0", + "version": "7.3.0", "license": "GPL-2.0-or-later", "description": "WordPress is open source software you can use to create a beautiful website, blog, or app.", "homepage": "https://wordpress.org", @@ -52,10 +52,13 @@ "squizlabs/php_codesniffer": "3.13.5", "wp-coding-standards/wpcs": "~3.4.1", "phpcompatibility/phpcompatibility-wp": "~2.1.3", - "phpstan/phpstan": "2.3.6", + "phpstan/phpstan": "2.3.7", "phpstan/phpstan-phpunit": "2.1.2", - "phpstan/phpstan-strict-rules": "2.1.1", - "yoast/phpunit-polyfills": "^1.1.0" + "phpstan/phpstan-strict-rules": "2.1.2", + "yoast/phpunit-polyfills": "^1.1.0", + "wordpress/ai-provider-for-anthropic": "1.0.5", + "wordpress/ai-provider-for-google": "1.3.0", + "wordpress/ai-provider-for-openai": "1.3.0" }, "config": { "audit": { "ignore": [ "GHSA-hmqg-cxww-wqhq", "PKSA-rdkp-vv9z-mjkg" ] }, @@ -75,9 +78,12 @@ } }, "scripts": { - "phpstan": "@php ./vendor/bin/phpstan analyse --memory-limit=2G", + "phpstan": [ "Composer\\Config::disableProcessTimeout", "@php ./tests/phpstan/analyse.php --memory-limit=2G" ], + "phpstan:default": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/bin/phpstan analyse --configuration=phpstan.neon.dist --memory-limit=2G" ], + "phpstan:strict": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/bin/phpstan analyse --configuration=phpstan-strict.neon.dist --memory-limit=2G" ], "phpstan:baselines": [ "Composer\\Config::disableProcessTimeout", "@php ./tests/phpstan/generate-baselines.php" ], - "phpstan:fix": [ "Composer\\Config::disableProcessTimeout", "@phpstan --configuration=phpstan.neon.dist --fix", "@phpstan:baselines --prune", "@phpstan --configuration=phpstan.neon.dist" ], + "phpstan:fix": [ "Composer\\Config::disableProcessTimeout", "@php ./tests/phpstan/analyse.php --memory-limit=2G --fix" ], + "phpstan:test": "@php ./vendor/phpunit/phpunit/phpunit -c tests/phpstan/phpunit.xml.dist", "compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source", "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source", "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --report=summary,source", diff --git a/docker-compose.yml b/docker-compose.yml index 62bce43174293..ecbd1adbdb970 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,13 @@ services: GITHUB_REF: ${GITHUB_REF-false} GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME-false} HOST_PATH: ${PWD-}/${LOCAL_DIR-src} + # Passed through for the live AI provider tests, and only when they are set. + WP_TESTS_AI_ANTHROPIC_API_KEY: + WP_TESTS_AI_GOOGLE_API_KEY: + WP_TESTS_AI_OPENAI_API_KEY: + WP_TESTS_AI_ANTHROPIC_MODEL: + WP_TESTS_AI_GOOGLE_MODEL: + WP_TESTS_AI_OPENAI_MODEL: volumes: - ./tools/local-env/php-config.ini:/usr/local/etc/php/conf.d/php-config.ini diff --git a/package-lock.json b/package-lock.json index 89c91e4f79522..77cb8b4e307b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "WordPress", - "version": "7.2.0", + "version": "7.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "WordPress", - "version": "7.2.0", + "version": "7.3.0", "license": "GPL-2.0-or-later", "dependencies": { "backbone": "1.6.1", @@ -43,24 +43,24 @@ "devDependencies": { "@343dev/gifsicle": "1.2.0", "@lodder/grunt-postcss": "^3.1.1", - "@napi-rs/image": "1.14.0", - "@playwright/test": "1.64.1", - "@pmmmwh/react-refresh-webpack-plugin": "0.6.2", + "@napi-rs/image": "1.16.0", + "@playwright/test": "1.65.1", + "@pmmmwh/react-refresh-webpack-plugin": "0.6.3", "@types/backbone": "1.4.23", - "@types/codemirror": "5.60.17", + "@types/codemirror": "5.60.18", "@types/espree": "10.1.0", "@types/htmlhint": "1.1.5", "@types/jquery": "3.5.34", - "@types/node": "20.19.43", + "@types/node": "24.19.2", "@types/underscore": "1.13.0", "@wordpress/e2e-test-utils-playwright": "1.51.0", "@wordpress/prettier-config": "4.51.0", "@wordpress/scripts": "33.0.0", - "autoprefixer": "10.5.3", + "autoprefixer": "10.6.2", "chokidar": "4.0.3", "dotenv": "17.4.2", "dotenv-expand": "13.0.0", - "grunt": "1.6.2", + "grunt": "1.6.3", "grunt-banner": "^0.6.0", "grunt-contrib-clean": "~2.0.1", "grunt-contrib-concat": "2.1.0", @@ -75,23 +75,23 @@ "grunt-replace-lts": "~1.1.0", "grunt-rtlcss": "~2.0.2", "grunt-sass": "~4.1.0", - "grunt-webpack": "7.0.1", + "grunt-webpack": "8.0.0", "install-changed": "1.1.0", "json2php": "0.0.12", - "minimizer-webpack-plugin": "5.6.1", + "minimizer-webpack-plugin": "5.14.0", "php-array-reader": "2.1.4", - "postcss": "8.5.19", + "postcss": "8.5.33", "prettier": "npm:wp-prettier@3.0.3", - "qunit": "~2.26.0", + "qunit": "3.0.0", "react-refresh": "0.14.0", - "sass": "1.101.0", + "sass": "1.108.2", "sinon": "16.1.3", "sinon-test": "~3.1.6", "source-map-loader": "5.0.0", "typescript": "6.0.3", - "update-browserslist-db": "1.3.1", - "wait-on": "9.0.10", - "webpack": "5.108.4" + "update-browserslist-db": "1.4.0", + "wait-on": "9.5.1", + "webpack": "5.109.2" }, "engines": { "node": ">=24.18.0", @@ -2708,9 +2708,9 @@ "license": "BSD-3-Clause" }, "node_modules/@hapi/tlds": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.4.tgz", - "integrity": "sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.7.tgz", + "integrity": "sha512-MgNjRwy9Ti92yVAixLmDc8dd1bJIKwO9qlWCfFQRwRmUEDPQHYn4G6hwPFvFGUTzAa0FsS+inMjLin7GnyBRhA==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -4028,9 +4028,9 @@ } }, "node_modules/@napi-rs/image": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image/-/image-1.14.0.tgz", - "integrity": "sha512-pmwJPWY6R063luNBEP9msq9lFu+kYVMiQTJRSpyGnzYnnerYpT3U4vCgFhhVR3jypCgCVWi9viDLoEJoZoIA1w==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image/-/image-1.16.0.tgz", + "integrity": "sha512-kciiEskvG7m6t0+VwJ/dUT5Zn79mKr1/RAAmjvG8TfK6aG9dI1lZqohtt8QGSQjdhRkyYJ85YKW686gQGFgzWw==", "dev": true, "license": "MIT", "engines": { @@ -4041,25 +4041,24 @@ "url": "https://github.com/sponsors/Brooooooklyn" }, "optionalDependencies": { - "@napi-rs/image-android-arm64": "1.14.0", - "@napi-rs/image-darwin-arm64": "1.14.0", - "@napi-rs/image-darwin-x64": "1.14.0", - "@napi-rs/image-freebsd-x64": "1.14.0", - "@napi-rs/image-linux-arm-gnueabihf": "1.14.0", - "@napi-rs/image-linux-arm64-gnu": "1.14.0", - "@napi-rs/image-linux-arm64-musl": "1.14.0", - "@napi-rs/image-linux-x64-gnu": "1.14.0", - "@napi-rs/image-linux-x64-musl": "1.14.0", - "@napi-rs/image-wasm32-wasi": "1.14.0", - "@napi-rs/image-win32-arm64-msvc": "1.14.0", - "@napi-rs/image-win32-ia32-msvc": "1.14.0", - "@napi-rs/image-win32-x64-msvc": "1.14.0" + "@napi-rs/image-android-arm64": "1.16.0", + "@napi-rs/image-darwin-arm64": "1.16.0", + "@napi-rs/image-darwin-x64": "1.16.0", + "@napi-rs/image-freebsd-x64": "1.16.0", + "@napi-rs/image-linux-arm-gnueabihf": "1.16.0", + "@napi-rs/image-linux-arm64-gnu": "1.16.0", + "@napi-rs/image-linux-arm64-musl": "1.16.0", + "@napi-rs/image-linux-x64-gnu": "1.16.0", + "@napi-rs/image-linux-x64-musl": "1.16.0", + "@napi-rs/image-win32-arm64-msvc": "1.16.0", + "@napi-rs/image-win32-ia32-msvc": "1.16.0", + "@napi-rs/image-win32-x64-msvc": "1.16.0" } }, "node_modules/@napi-rs/image-android-arm64": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-android-arm64/-/image-android-arm64-1.14.0.tgz", - "integrity": "sha512-LBWu1fNR7uC6kNQy+axDqXKU7Kj1x3UdD3xGKw/bks6YAUG15m92qwSwINDEB4Jqgl29vCeSNFItJZRm3byfJQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-android-arm64/-/image-android-arm64-1.16.0.tgz", + "integrity": "sha512-pwn/41RoGaE0gHlJBvEIikYXASeiHhs1lyo5+fWZZSXsS9hpJt0zQqWiSr7cCdCwLdg84pQwPbqd32Kp+scLSw==", "cpu": [ "arm64" ], @@ -4074,9 +4073,9 @@ } }, "node_modules/@napi-rs/image-darwin-arm64": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-darwin-arm64/-/image-darwin-arm64-1.14.0.tgz", - "integrity": "sha512-0f7SqjtXHelxbwkqdpUb/5yhVK7ciVoe902hqCeffhAFsJA7HQbEbzfM8W1MDawI6Ghenr5zHYQimWf1W1vaow==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-darwin-arm64/-/image-darwin-arm64-1.16.0.tgz", + "integrity": "sha512-JJesjwlmWA9m0iN4y0GvHpfZkgAviU4Yhk+qvV+D44obYPisqAhJdMCQMY1/u8Yj/PblijimCMY05fMRvCmrdQ==", "cpu": [ "arm64" ], @@ -4091,9 +4090,9 @@ } }, "node_modules/@napi-rs/image-darwin-x64": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-darwin-x64/-/image-darwin-x64-1.14.0.tgz", - "integrity": "sha512-wi6w06N516QzSd/QMre/Ye92mA4b5E2yQfr1+Hhml3tWrIM2Po2QvxBO9ns0AaG8u6y8b545bDzQCGLTfBykyQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-darwin-x64/-/image-darwin-x64-1.16.0.tgz", + "integrity": "sha512-EV/SHAnsIoadlJdyeSVtHo2RE+N6BAWTK6S3y52vvCF8/s3z38fe9o1tbk40xxPpcSXdu+gh6ASBeFHic2/NOQ==", "cpu": [ "x64" ], @@ -4108,9 +4107,9 @@ } }, "node_modules/@napi-rs/image-freebsd-x64": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-freebsd-x64/-/image-freebsd-x64-1.14.0.tgz", - "integrity": "sha512-Sz1XSGF6/Xmjb33CbWLOb7h6+ekmoJRGsN0bdnzn8W86OHPTSsIbTOMtqp9ZXTLQNJgeXQhprQhhmRFNRqq0Gg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-freebsd-x64/-/image-freebsd-x64-1.16.0.tgz", + "integrity": "sha512-2Q2XcPqeFfr5U8oL9zwZgbnfJLvFrA85+XPaOgjaUiIhEFfRKDgp5l7R0jDFZvymCw0ljMKtVzUD+Id2LUQasg==", "cpu": [ "x64" ], @@ -4125,9 +4124,9 @@ } }, "node_modules/@napi-rs/image-linux-arm-gnueabihf": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm-gnueabihf/-/image-linux-arm-gnueabihf-1.14.0.tgz", - "integrity": "sha512-ZsJ+0Rl3Ke1DN+W4lQMSzsfrwskjP4CkUsqOT7Y/HpziwirQn9R2fl2QU2Kb2eDSQvwSvGbRCkMLqH+4V4rzHg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm-gnueabihf/-/image-linux-arm-gnueabihf-1.16.0.tgz", + "integrity": "sha512-qOXhoEXK66U396sBtL1wDvho4yooW6EPse0Ue23kRHlRHbR6SiDKz6mKcEoB1MrQzZGeKOYRh2F9rk0iHlsPiw==", "cpu": [ "arm" ], @@ -4142,9 +4141,9 @@ } }, "node_modules/@napi-rs/image-linux-arm64-gnu": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm64-gnu/-/image-linux-arm64-gnu-1.14.0.tgz", - "integrity": "sha512-J06fGFXt76fAGEaCb3uyPQgZrwvGbpYZycA4Xz6F5dauVgcLPw75syXmggode5G+a0cSg40fjddXMvSWhPwHGQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm64-gnu/-/image-linux-arm64-gnu-1.16.0.tgz", + "integrity": "sha512-S0j/r3ciH+WW/NnsOaLwhol0wly0x0YtljZnfQ4o1YCfkVrcAPMQGgGmPyjKIG/TLQ8tqPd6liuUL4Nms017lA==", "cpu": [ "arm64" ], @@ -4162,9 +4161,9 @@ } }, "node_modules/@napi-rs/image-linux-arm64-musl": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm64-musl/-/image-linux-arm64-musl-1.14.0.tgz", - "integrity": "sha512-AH8WvQb58ix9/RHB+9XNF2rOB8aAnFHzj0hDCCZCplRGHmv9BzOtA+IWdf5l4f7KmEJUohY+MxVWJ1jfpgn+JQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-arm64-musl/-/image-linux-arm64-musl-1.16.0.tgz", + "integrity": "sha512-ILcos5cDYUQw6h2aty8BBlm5B4l4I5y52i0tSSU44HBM8tmGE6sUU1DREPfMx1NLhB2HX4xu1Y9DNQq7tIXhpQ==", "cpu": [ "arm64" ], @@ -4182,9 +4181,9 @@ } }, "node_modules/@napi-rs/image-linux-x64-gnu": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-x64-gnu/-/image-linux-x64-gnu-1.14.0.tgz", - "integrity": "sha512-oU3wnQcDeZf+t8vyKMP4A6okY7JNjRbiiC7j8UsJ2lDf0no3GDQEJCCFDrQ7gCKQZAI7cr0rFbI75l2KlTM0PQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-x64-gnu/-/image-linux-x64-gnu-1.16.0.tgz", + "integrity": "sha512-R2LnMJzHxztTYyySZnyWIiZmDxgK7pq8DWYT1jAuryCXcGmhUhM14BgEnQKj5h3zvDVbtf1czm6DSD9f8PDl4g==", "cpu": [ "x64" ], @@ -4202,9 +4201,9 @@ } }, "node_modules/@napi-rs/image-linux-x64-musl": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-x64-musl/-/image-linux-x64-musl-1.14.0.tgz", - "integrity": "sha512-iuDTfVmFm9W6S4gzLNdSFt+Wr86LtciJJ+u2i0KBixpFYoHzeIkUr6LHBIkYg3eNdi7xHBb9qFBvxxhFQg4tUQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-linux-x64-musl/-/image-linux-x64-musl-1.16.0.tgz", + "integrity": "sha512-UXcwFSIEEHia8/JhJO6H3uehQmTrsG8UK8tpD1qpzi8WHxUVgLJyuoVS3zKm8cmqlYq0No1cyqU6h2OnArShOw==", "cpu": [ "x64" ], @@ -4221,63 +4220,10 @@ "node": ">= 10" } }, - "node_modules/@napi-rs/image-wasm32-wasi": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-wasm32-wasi/-/image-wasm32-wasi-1.14.0.tgz", - "integrity": "sha512-XRAbAQVWSm4wQzYwnTtOHD+ev6dRHUxLxmFQe5Nbev12dspqkB40zsDJ/yr4VwnV80gIfEfg7BvRLw9FFvLRlg==", - "cpu": [ - "wasm32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/core": "1.11.1", - "@emnapi/runtime": "1.11.1", - "@napi-rs/wasm-runtime": "^1.1.6" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@napi-rs/image-wasm32-wasi/node_modules/@emnapi/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.2", - "tslib": "^2.4.0" - } - }, - "node_modules/@napi-rs/image-wasm32-wasi/node_modules/@emnapi/runtime": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@napi-rs/image-wasm32-wasi/node_modules/@emnapi/wasi-threads": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@napi-rs/image-win32-arm64-msvc": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-arm64-msvc/-/image-win32-arm64-msvc-1.14.0.tgz", - "integrity": "sha512-Wuq0AfN5rjrv2SkJTubIIYW//B5aBloPxND9GxRHKgGkLhyiSxBD6iOCQA1M/n12rvF9BWeadDDO8JLoO3iRHA==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-arm64-msvc/-/image-win32-arm64-msvc-1.16.0.tgz", + "integrity": "sha512-C1lmWAajIqkiYyVb0aBz0svCWIbzFAT6YpNoQ/QC/QsyNaQ602WSLSoq4ixnNhBPQrlro/Va3n/KANv4iqp4GA==", "cpu": [ "arm64" ], @@ -4292,9 +4238,9 @@ } }, "node_modules/@napi-rs/image-win32-ia32-msvc": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-ia32-msvc/-/image-win32-ia32-msvc-1.14.0.tgz", - "integrity": "sha512-Idb+OyISq24YRdO8iU+BC6QaN4pU6HpC+SRrxFOftWJg0xXPzfPfpwpwdviduJK/SjJcHe02nhUq3HKHtUEnWQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-ia32-msvc/-/image-win32-ia32-msvc-1.16.0.tgz", + "integrity": "sha512-j6OMycTmw47pY4m3yw4FnurkikzA8r36xgtbHqxsXWg1TGdY2uQq37Or56USNjLIeA6Oyv4az5YXc7L1oVv03w==", "cpu": [ "ia32" ], @@ -4309,9 +4255,9 @@ } }, "node_modules/@napi-rs/image-win32-x64-msvc": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-x64-msvc/-/image-win32-x64-msvc-1.14.0.tgz", - "integrity": "sha512-Hq5BY3+FeNehRe1VPhVQ28dGTSWlxnGAHeoF7/GpgeWBfltLT5+DpkV+FPyq6ju49kG1aFofE+IlSGi5sMJ0Kw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@napi-rs/image-win32-x64-msvc/-/image-win32-x64-msvc-1.16.0.tgz", + "integrity": "sha512-jdmbjZhvR1T++hTZpi5CYASA+2Js9tuUQGtQ0fVtrtbGt82sGkYrrax8gAVNsgyvEu9/B2yxbB/4mlJcXkwt0Q==", "cpu": [ "x64" ], @@ -4737,13 +4683,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.1.tgz", - "integrity": "sha512-IaYGml/nSOiZWROfPtuIL7neuu9qDOZ3TNvNljUIrhDMxiGTgPjzj/g9p9RxpS2tSepPDRY+UwAaEeiKtUvIAg==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.1.tgz", + "integrity": "sha512-y+NCIRm2LvY4slUVWvGh1nujJ8RF/hEisIsq2mtUPgdQC4L701bq5hZGMhrpeXjACvwvO9tj5dJqhvM6TP9lbw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.64.1" + "playwright": "1.65.1" }, "bin": { "playwright": "cli.js" @@ -4753,9 +4699,9 @@ } }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.6.2.tgz", - "integrity": "sha512-IhIAD5n4XvGHuL9nAgWfsBR0TdxtjrUWETYKCBHxauYXEv+b+ctEbs9neEgPC7Ecgzv4bpZTBwesAoGDeFymzA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.6.3.tgz", + "integrity": "sha512-k1EEmFS9K7685tqJM55DCA3sYlTNZb7aFj1M3HNFwMqH+fGgMEvemIQ5kurIzKc9wYRSmfKpSZN3WUyY/GHlvg==", "dev": true, "license": "MIT", "dependencies": { @@ -4775,7 +4721,7 @@ "sockjs-client": "^1.4.0", "type-fest": ">=0.17.0 <6.0.0", "webpack": "^5.0.0", - "webpack-dev-server": "^4.8.0 || 5.x", + "webpack-dev-server": "^4.8.0 || 5.x || 6.x", "webpack-hot-middleware": "2.x", "webpack-plugin-serve": "1.x" }, @@ -5754,9 +5700,9 @@ } }, "node_modules/@types/codemirror": { - "version": "5.60.17", - "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.17.tgz", - "integrity": "sha512-AZq2FIsUHVMlp7VSe2hTfl5w4pcUkoFkM3zVsRKsn1ca8CXRDYvnin04+HP2REkwsxemuHqvDofdlhUWNpbwfw==", + "version": "5.60.18", + "resolved": "https://registry.npmjs.org/@types/codemirror/-/codemirror-5.60.18.tgz", + "integrity": "sha512-aSBOPXH2PXRYixxUpVP1sJ5+S0vEfKDvR+lABZ7Kju/9Qb0SSbZk72NihWaKoQbANyibs92q4DBfYasywxnNkA==", "dev": true, "license": "MIT", "dependencies": { @@ -5979,13 +5925,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.19.43", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", - "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "version": "24.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", + "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": ">=7.24.0 <7.24.7" } }, "node_modules/@types/node-forge": { @@ -8671,19 +8617,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-phases": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", - "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.13.0" - }, - "peerDependencies": { - "acorn": "^8.14.0" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -9189,9 +9122,9 @@ "dev": true }, "node_modules/autoprefixer": { - "version": "10.5.3", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.3.tgz", - "integrity": "sha512-bJRzflk8GgE4JX+iZNEwz9f9p460NCHnU7bd+CZ9vIjIlZuTkt6F3WSl2oNO8StZBFx17nLEsiQ6H2wcZiY7nA==", + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.2.tgz", + "integrity": "sha512-VOw9/yGTGwPPgzFcODtcv6zhEPIeIWkRSe10L2ri2f5vZ7ID7lCt6jZzRF5/ubgOZ+szYydmEF5AYsA5jxX1tA==", "dev": true, "funding": [ { @@ -9209,8 +9142,8 @@ ], "license": "MIT", "dependencies": { - "browserslist": "^4.28.6", - "caniuse-lite": "^1.0.30001805", + "browserslist": "^4.28.9", + "caniuse-lite": "^1.0.30001810", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" @@ -9265,14 +9198,14 @@ } }, "node_modules/axios": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", - "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.21.1.tgz", + "integrity": "sha512-6eI5Q/Y4u/Um9dDlsRoq5pY2rxnUTv+L4PpLitnbk/i4jb3MxLZ5CsN5Ih3IysbeRYK4pR+P7qfMsOQl9fwwFQ==", "dev": true, "license": "MIT", "dependencies": { - "follow-redirects": "^1.16.0", - "form-data": "^4.0.5", + "follow-redirects": "^1.16.2", + "form-data": "^4.0.6", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } @@ -9759,9 +9692,9 @@ ] }, "node_modules/baseline-browser-mapping": { - "version": "2.10.43", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", - "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", + "version": "2.11.37", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.37.tgz", + "integrity": "sha512-QYph+vfurmaxhNwi9FprfmtkT5cx2Keg8FzZ0vnjO8ukscIybVyZGMFwdllKGlTI6qyU8ck43OM9UXh+IFJihQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -9951,9 +9884,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", - "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", + "version": "4.29.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.6.tgz", + "integrity": "sha512-CmVVIQ3RVc5HxYEc9X84GvxK/C8C1wH8TlKAiO7uTxF8PDwt7r8t9Qk3J9NkMOVzX5O/HbLv3yzxZg9HPrnI9w==", "dev": true, "funding": [ { @@ -9971,11 +9904,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001803", - "electron-to-chromium": "^1.5.389", - "node-releases": "^2.0.51", - "update-browserslist-db": "^1.2.3" + "baseline-browser-mapping": "^2.11.37", + "caniuse-lite": "^1.0.30001826", + "electron-to-chromium": "^1.5.486", + "node-releases": "^2.0.64", + "update-browserslist-db": "^1.4.0" }, "bin": { "browserslist": "cli.js" @@ -10166,9 +10099,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001805", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", - "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", + "version": "1.0.30001826", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz", + "integrity": "sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==", "dev": true, "funding": [ { @@ -11914,9 +11847,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", + "version": "1.5.486", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.486.tgz", + "integrity": "sha512-rpybw4Ac4ak/An6G1Me2+61xzwobowDGyuJe71QHHOVpkZv4fPVobsLl7WH6zHSKusAMpaHxGKTpOvpy7+r3dQ==", "dev": true, "license": "ISC" }, @@ -11986,9 +11919,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.24.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.24.2.tgz", - "integrity": "sha512-rpsZEGT1jFuve6QlpyRp9ckQ+kN61hvF9BzCPyMdaKTm8UJce96KBn3sorXOFXlzjPrs3Vc4T1NsSroZ3PxlFw==", + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.0.tgz", + "integrity": "sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13964,9 +13897,9 @@ "license": "ISC" }, "node_modules/follow-redirects": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", - "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.3.tgz", + "integrity": "sha512-toOSoqN6d51Wjf1aOFJYcoVv1aND9rj/CwjLU0Vz40oDuSpWDayCeKe4JpL5NL0WdFvoOOCI3BRo69HahjbR1A==", "dev": true, "funding": [ { @@ -14512,9 +14445,9 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/grunt": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.2.tgz", - "integrity": "sha512-bUzh5nA/P5L66ihXTDP6J5BGnMB/8lXJXejYWSbH4Y4TvWM9t2S39sggQDYYQlx06cYcCsmu63HMYHGCIzUVfg==", + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.3.tgz", + "integrity": "sha512-ng0CbpyNp/ox5e5CBY9TkZgVdAL4wK+nBHO6rNE8cXGa5kM++Lxlp0MpFBVZbpgOR2oCp/91V+T3CZVSWWLqMA==", "dev": true, "license": "MIT", "dependencies": { @@ -14528,7 +14461,7 @@ "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", "iconv-lite": "~0.6.3", - "js-yaml": "~3.14.0", + "js-yaml": "^3.15.0", "minimatch": "^3.1.5", "nopt": "^5.0.0" }, @@ -15443,9 +15376,9 @@ } }, "node_modules/grunt-webpack": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/grunt-webpack/-/grunt-webpack-7.0.1.tgz", - "integrity": "sha512-3Mo0UfZE7v5CnSCIkN6tGMlKDOCr0okvk8SQrL9X/6JhrE2sQlGwFEI5Q6j89rZ9DTl9jEjkIev/hfR0x85wKg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/grunt-webpack/-/grunt-webpack-8.0.0.tgz", + "integrity": "sha512-pcDVu1DPcDaEik29MDwMPuYwYCYW2Xhoze9UjWGGVJLK7XR/dpQ6kCwT3IDqByrVhDwobtKqFtk3b7l75OiJcw==", "dev": true, "license": "MIT", "dependencies": { @@ -15453,11 +15386,7 @@ "webpack-merge": "^6.0.1" }, "engines": { - "node": ">=18.19.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "node": "^22.13.0 || >=24" }, "peerDependencies": { "webpack": "^5.0.0" @@ -19377,9 +19306,9 @@ } }, "node_modules/joi": { - "version": "18.2.3", - "resolved": "https://registry.npmjs.org/joi/-/joi-18.2.3.tgz", - "integrity": "sha512-N5A3KTWQpPWT4ExxxPlUx7WmykGXRzhNidWhV41d6Abu9YfI2NyWCJuxdPnslJCPWtbRpSVOWSnSS6GakLM/Rg==", + "version": "18.3.2", + "resolved": "https://registry.npmjs.org/joi/-/joi-18.3.2.tgz", + "integrity": "sha512-iUivApKYw5GpZmq2Sy6El99j7noo8QSUFZlyQtr3HCkosC/b5wKF6/Y3teiHIlaM8WI38sAT3P+51rB0lhAhJA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -19458,9 +19387,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "dev": true, "license": "MIT", "dependencies": { @@ -20174,20 +20103,6 @@ "uc.micro": "^1.0.1" } }, - "node_modules/loader-runner": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz", - "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.11.5" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", @@ -21043,16 +20958,15 @@ } }, "node_modules/minimizer-webpack-plugin": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.6.1.tgz", - "integrity": "sha512-DoeAZz8Q1C1znwsUzej1fdoi4jCf7/+Em27ouLqfK/+3m8G+D7yDhUwrc3CNhjSzGUN1kn7Iv4sWmjflQHenpw==", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.0.tgz", + "integrity": "sha512-PnvQXCJxhgH2ZVVO7Lj0sM6q8L1XGxnUvd8wVQIRwi8khMCLq5wg0Ngxe44bcuZL2FSN81RdVE7YHEVzTKsQDQ==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", - "schema-utils": "^4.3.0", - "terser": "^5.31.1" + "schema-utils": "^4.6.0", + "terser": "^5.51.0" }, "engines": { "node": ">= 10.13.0" @@ -21068,6 +20982,9 @@ "@minify-html/node": { "optional": true }, + "@napi-rs/image": { + "optional": true + }, "@swc/core": { "optional": true }, @@ -21092,12 +21009,21 @@ "html-minifier-terser": { "optional": true }, + "imagemin": { + "optional": true + }, "lightningcss": { "optional": true }, "postcss": { "optional": true }, + "sharp": { + "optional": true + }, + "svgo": { + "optional": true + }, "uglify-js": { "optional": true } @@ -21120,6 +21046,24 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/minimizer-webpack-plugin/node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, "node_modules/minimizer-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", @@ -21141,23 +21085,34 @@ "license": "MIT" }, "node_modules/minimizer-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", - "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.3.tgz", + "integrity": "sha512-qIfo3f+lRNqnMPgpXSKvUhsT3pY5U+ppmgGr4j8LanFP3W/Ze+xj8DY/dPb5qVu3m6qFIMyMWKVRLNKxrNhxWg==", "dev": true, "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", + "@types/json-schema": "^7.0.15", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", "ajv-keywords": "^5.1.0" }, + "bin": { + "schema-utils": "bin/schema-utils.js" + }, "engines": { "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } } }, "node_modules/minipass": { @@ -21247,9 +21202,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.16", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -21430,9 +21385,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "version": "2.0.64", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.64.tgz", + "integrity": "sha512-zAPCKqMcnqs2nGy6nlkm7JduFseiBJy3EXHGLh+8pFR+TxGCBxxiEN21+UROU5CKwX/f4TlUcYjiM+vs/tsyxw==", "dev": true, "license": "MIT", "engines": { @@ -21488,10 +21443,11 @@ } }, "node_modules/node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.4.tgz", + "integrity": "sha512-RinNxoz4W1cep1b928fuFhvAQ5ag/+1UlMDV7rbyGthBIgsiEouS4kvRayvvboxii4m8eolKOIBo3OjDqbc+uQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -22831,13 +22787,13 @@ } }, "node_modules/playwright": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz", - "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz", + "integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.64.1" + "playwright-core": "1.65.1" }, "bin": { "playwright": "cli.js" @@ -22847,9 +22803,9 @@ } }, "node_modules/playwright-core": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz", - "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz", + "integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -22902,9 +22858,9 @@ } }, "node_modules/postcss": { - "version": "8.5.19", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.19.tgz", - "integrity": "sha512-Mz8SaolMd8nB+G13WkORcxQKHZ/NE4xXevtkJHVuG+guo9/wYKlIMTKAqGdEmYOXR2ijPjTYNHssizdaVSUNdQ==", + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, "funding": [ { @@ -22922,9 +22878,9 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.12", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -23472,30 +23428,31 @@ } }, "node_modules/qunit": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.26.0.tgz", - "integrity": "sha512-KSv16YomcYmiK90qTOJl3Bm5IvTf2upqQDdBQWCvSQWe94FWobnUgKOpvpvZdG7VkDt3TJSI8k8g9+GGGEd7Fw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/qunit/-/qunit-3.0.0.tgz", + "integrity": "sha512-g4Fgw3uhqwdjzhUDa0bYGQyGzs1xRcIY/32c5zUydnnrgzcA8updYF9nIeUis+PfwuqX6UB/4JpCNMnrVBY6iA==", "dev": true, "license": "MIT", "dependencies": { - "commander": "7.2.0", - "node-watch": "0.7.3", + "commander": "12.1.0", + "node-watch": "0.7.4", "tiny-glob": "0.2.9" }, "bin": { "qunit": "bin/qunit.js" }, "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/qunit/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, + "license": "MIT", "engines": { - "node": ">= 10" + "node": ">=18" } }, "node_modules/randombytes": { @@ -24318,9 +24275,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.101.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.101.0.tgz", - "integrity": "sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==", + "version": "1.108.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.108.2.tgz", + "integrity": "sha512-kugK8djotnG9HQRPTOf36asKYlxg8rWWsNLYHOgWDIVOiZQqlRfKBgF4XXM6kfw146kIDMvm57B4GIkvDSyTzA==", "dev": true, "license": "MIT", "dependencies": { @@ -25034,10 +24991,11 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -26211,14 +26169,14 @@ } }, "node_modules/terser": { - "version": "5.37.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", - "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", + "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -26876,9 +26834,9 @@ } }, "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", "dev": true, "license": "MIT" }, @@ -26993,9 +26951,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.1.tgz", - "integrity": "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.4.0.tgz", + "integrity": "sha512-WPJuOnjI9FWDct4fB+ej4Mz8opLaw5CDcZ2t44tFZ0vIQVYWzBhWR3mkixuUj/A7+vY4V9+ApOZ2YYLwdgq46w==", "dev": true, "funding": [ { @@ -27195,16 +27153,15 @@ } }, "node_modules/wait-on": { - "version": "9.0.10", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-9.0.10.tgz", - "integrity": "sha512-rCoJEhvMr0X6alHmwc9abbrA5ZrLZFKpFQVKPNFwl2h7DapXOGdmimIHDtLOWhT4PjhZhxFEtZoQgEXbkDWdZw==", + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-9.5.1.tgz", + "integrity": "sha512-bOtj1wRY6u+GPnNskZLcgZNHOaL5NC4+5hRCbEpVoVX6MbMrCLCqIBM2bjsAfrgst3ZC0siIo7vLb4LuYFfIow==", "dev": true, "license": "MIT", "dependencies": { - "axios": "^1.16.0", - "joi": "^18.2.1", + "axios": "^1.20.0", + "joi": "^18.2.9", "lodash": "^4.18.1", - "minimist": "^1.2.8", "rxjs": "^7.8.2" }, "bin": { @@ -27280,9 +27237,9 @@ } }, "node_modules/webpack": { - "version": "5.108.4", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.108.4.tgz", - "integrity": "sha512-yur8LyJoeiWh47dErD+Ok7vlbmDsJ3UbbRPAoxbGJ54WpE2y5yVo5G/inUzujnYgw3tPmBRdn+G7PoxXaYC33w==", + "version": "5.109.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.109.2.tgz", + "integrity": "sha512-U9/cvLzxObKNEZ9+TtdqrHM5/9z3lgl2c+c4BzbqGxFQvQvBAq87yql5A8pQ+rrMbS496MZJeF5enVBndIy2hw==", "dev": true, "license": "MIT", "dependencies": { @@ -27292,22 +27249,20 @@ "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", "acorn": "^8.16.0", - "acorn-import-phases": "^1.0.3", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.22.2", + "enhanced-resolve": "^5.24.4", "es-module-lexer": "^2.1.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "graceful-fs": "^4.2.11", - "loader-runner": "^4.3.2", "mime-db": "^1.54.0", "minimizer-webpack-plugin": "^5.6.1", "neo-async": "^2.6.2", "schema-utils": "^4.3.3", "tapable": "^2.3.0", "watchpack": "^2.5.2", - "webpack-sources": "^3.5.0" + "webpack-sources": "^3.5.1" }, "bin": { "webpack": "bin/webpack.js" diff --git a/package.json b/package.json index 5011ea5452e2d..0733952e27279 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "WordPress", - "version": "7.2.0", + "version": "7.3.0", "description": "WordPress is open source software you can use to create a beautiful website, blog, or app.", "repository": { "type": "svn", "url": "https://develop.svn.wordpress.org/trunk" }, "gutenberg": { - "sha": "61aba5422836aeed76a794f98d3fe0da3eb5f5d1", + "sha": "423bdf39aaa34a710acc338d3e89eac5b920fe6d", "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build" }, "engines": { @@ -41,24 +41,24 @@ "devDependencies": { "@343dev/gifsicle": "1.2.0", "@lodder/grunt-postcss": "^3.1.1", - "@napi-rs/image": "1.14.0", - "@playwright/test": "1.64.1", - "@pmmmwh/react-refresh-webpack-plugin": "0.6.2", + "@napi-rs/image": "1.16.0", + "@playwright/test": "1.65.1", + "@pmmmwh/react-refresh-webpack-plugin": "0.6.3", "@types/backbone": "1.4.23", - "@types/codemirror": "5.60.17", + "@types/codemirror": "5.60.18", "@types/espree": "10.1.0", "@types/htmlhint": "1.1.5", "@types/jquery": "3.5.34", - "@types/node": "20.19.43", + "@types/node": "24.19.2", "@types/underscore": "1.13.0", "@wordpress/e2e-test-utils-playwright": "1.51.0", "@wordpress/prettier-config": "4.51.0", "@wordpress/scripts": "33.0.0", - "autoprefixer": "10.5.3", + "autoprefixer": "10.6.2", "chokidar": "4.0.3", "dotenv": "17.4.2", "dotenv-expand": "13.0.0", - "grunt": "1.6.2", + "grunt": "1.6.3", "grunt-banner": "^0.6.0", "grunt-contrib-clean": "~2.0.1", "grunt-contrib-concat": "2.1.0", @@ -73,23 +73,23 @@ "grunt-replace-lts": "~1.1.0", "grunt-rtlcss": "~2.0.2", "grunt-sass": "~4.1.0", - "grunt-webpack": "7.0.1", + "grunt-webpack": "8.0.0", "install-changed": "1.1.0", "json2php": "0.0.12", - "minimizer-webpack-plugin": "5.6.1", + "minimizer-webpack-plugin": "5.14.0", "php-array-reader": "2.1.4", - "postcss": "8.5.19", + "postcss": "8.5.33", "prettier": "npm:wp-prettier@3.0.3", - "qunit": "~2.26.0", + "qunit": "3.0.0", "react-refresh": "0.14.0", - "sass": "1.101.0", + "sass": "1.108.2", "sinon": "16.1.3", "sinon-test": "~3.1.6", "source-map-loader": "5.0.0", "typescript": "6.0.3", - "update-browserslist-db": "1.3.1", - "wait-on": "9.0.10", - "webpack": "5.108.4" + "update-browserslist-db": "1.4.0", + "wait-on": "9.5.1", + "webpack": "5.109.2" }, "dependencies": { "backbone": "1.6.1", @@ -155,6 +155,7 @@ "typecheck:php": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan --", "typecheck:php:baselines": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan:baselines --", "typecheck:php:fix": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan:fix --", + "typecheck:php:test": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan:test --", "gutenberg:copy": "node tools/gutenberg/copy.js", "gutenberg:verify": "node tools/gutenberg/utils.js", "gutenberg:download": "node tools/gutenberg/download.js && npm run build:gutenberg" diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 9f15c0c3670d6..469f013a3a23a 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -194,6 +194,8 @@ + + diff --git a/phpstan-strict.neon.dist b/phpstan-strict.neon.dist new file mode 100644 index 0000000000000..ffa58a226d576 --- /dev/null +++ b/phpstan-strict.neon.dist @@ -0,0 +1,91 @@ +# PHPStan configuration holding selected parts of WordPress Core to a stricter rule level. +# +# phpstan.neon.dist analyzes the whole codebase at a lower rule level. This analyzes only the paths listed under +# `paths!` below, at the `level` set below, so that code which already meets that stricter level, mostly code added in +# recent releases, keeps meeting it. `composer phpstan` runs both analyses. +# +# The rest of core is scanned rather than analyzed, so that what the strict paths use is known. A scanned file is read +# with the same WordPress-specific parser node visitors as an analyzed one (see the redefinition of +# `currentPhpVersionSimpleParser` in tests/phpstan/base.neon), so a function outside the strict paths has the same +# types here, such as the array shapes from hash notation, as in the analysis of the whole codebase. +# +# To override this configuration, create a phpstan-strict.neon which includes this file, in the same way as +# phpstan.neon overrides phpstan.neon.dist. +# +# https://phpstan.org/config-reference + +includes: + # Everything phpstan.neon.dist enforces: the base configuration, the strict rules, the errors ignored as not + # actionable, and its baselines. An error that both analyses report is baselined once, by phpstan.neon.dist. The + # entries for files this does not analyze are not reported as unmatched, since PHPStan only reports an entry when + # what it ignores is within the analysis. + - phpstan.neon.dist + + # Preexisting errors at this level in the strict paths, beyond those baselined by phpstan.neon.dist. They are + # organized and regenerated the same way, by `composer phpstan:baselines`, and included the same way, through the + # loader in their directory. + - tests/phpstan/baselines-strict/loader.php + +parameters: + # The level is set explicitly rather than as `max`, so that a PHPStan update that adds a level does not raise it. + # https://phpstan.org/user-guide/rule-levels + level: 10 + + # The two analyses share the cache of what PHPStan reads from each file, since both read every file the same way, + # but each needs its own result cache. Its metadata includes the rule level and the paths analyzed, so a shared one + # would be discarded by every run of the other analysis. + resultCachePath: %tmpDir%/resultCache-strict.php + + # The paths held to this rule level, replacing those analyzed by phpstan.neon.dist. A directory covers every file + # below it. + # + # Before adding a path, fix the errors this analysis reports in it, or baseline those that cannot be fixed yet. + paths!: + - src/wp-admin/includes/class-wp-filesystem-base.php + - src/wp-admin/includes/class-wp-filesystem-direct.php + - src/wp-admin/includes/class-wp-filesystem-ssh2.php + - src/wp-includes/abilities-api + - src/wp-includes/abilities-api.php + - src/wp-includes/ai-client + - src/wp-includes/ai-client.php + - src/wp-includes/class-wp-block-styles-registry.php + - src/wp-includes/class-wp-block-template.php + - src/wp-includes/class-wp-comment.php + - src/wp-includes/class-wp-connector-registry.php + - src/wp-includes/class-wp-error.php + - src/wp-includes/class-wp-post.php + - src/wp-includes/class-wp-url-pattern-prefixer.php + - src/wp-includes/html-api/class-wp-html-attribute-token.php + - src/wp-includes/html-api/class-wp-html-decoder.php + - src/wp-includes/html-api/class-wp-html-doctype-info.php + - src/wp-includes/html-api/class-wp-html-processor-state.php + - src/wp-includes/html-api/class-wp-html-span.php + - src/wp-includes/html-api/class-wp-html-stack-event.php + - src/wp-includes/html-api/class-wp-html-text-replacement.php + - src/wp-includes/html-api/class-wp-html-token.php + - src/wp-includes/html-api/class-wp-html-unsupported-exception.php + - src/wp-includes/l10n/class-wp-translations.php + - src/wp-includes/sitemaps.php + - src/wp-includes/speculative-loading.php + - src/wp-includes/style-engine + - tests/phpstan + + # The code outside the strict paths that they can use. The bundled themes are left out, since nothing in core uses + # them. The files in the root are scanned for the constants they define, such as WPINC in wp-settings.php. + scanDirectories: + - src/wp-admin + - src/wp-includes + scanFiles: + - src/index.php + - src/wp-activate.php + - src/wp-blog-header.php + - src/wp-comments-post.php + - src/wp-cron.php + - src/wp-links-opml.php + - src/wp-load.php + - src/wp-login.php + - src/wp-mail.php + - src/wp-settings.php + - src/wp-signup.php + - src/wp-trackback.php + - src/xmlrpc.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cbaa19f3e8db1..796646255ada6 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,8 @@ # PHPStan configuration for WordPress Core. # +# This analyzes the whole codebase. phpstan-strict.neon.dist includes it, and holds selected +# paths to a stricter rule level. `composer phpstan` runs both. +# # To override this configuration, create a phpstan.neon which includes this file and adjusts # its parameters as needed, rather than copying it, so that the copy does not go stale. See # tests/phpstan/README.md for examples. @@ -18,44 +21,12 @@ includes: # Preexisting errors that should be ignored, one baseline per error identifier # so that the remaining work on each is visible as a single shrinking file. - # Each is meant to reach zero and be deleted, taking its line below with it. + # Each is meant to reach zero and be deleted. # https://phpstan.org/user-guide/baseline # - # Regenerate with `composer phpstan:baselines`, which rewrites both the files - # and the list between the markers. Do not edit that list by hand. - # phpstan:baselines start - - tests/phpstan/baselines/argument.type.neon - - tests/phpstan/baselines/argument.unresolvableType.neon - - tests/phpstan/baselines/assign.propertyType.neon - - tests/phpstan/baselines/binaryOp.invalid.neon - - tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon - - tests/phpstan/baselines/booleanNot.alwaysTrue.neon - - tests/phpstan/baselines/class.notFound.neon - - tests/phpstan/baselines/deadCode.unreachable.neon - - tests/phpstan/baselines/empty.property.neon - - tests/phpstan/baselines/empty.variable.neon - - tests/phpstan/baselines/function.alreadyNarrowedType.neon - - tests/phpstan/baselines/function.resultUnused.neon - - tests/phpstan/baselines/identical.alwaysFalse.neon - - tests/phpstan/baselines/if.alwaysFalse.neon - - tests/phpstan/baselines/if.alwaysTrue.neon - - tests/phpstan/baselines/isset.property.neon - - tests/phpstan/baselines/method.childParameterType.neon - - tests/phpstan/baselines/method.unused.neon - - tests/phpstan/baselines/notIdentical.alwaysTrue.neon - - tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon - - tests/phpstan/baselines/offsetAccess.notFound.neon - - tests/phpstan/baselines/offsetAssign.valueType.neon - - tests/phpstan/baselines/parameterByRef.type.neon - - tests/phpstan/baselines/parameterByRef.unusedType.neon - - tests/phpstan/baselines/property.defaultValue.neon - - tests/phpstan/baselines/property.nonObject.neon - - tests/phpstan/baselines/property.notFound.neon - - tests/phpstan/baselines/property.private.neon - - tests/phpstan/baselines/return.type.neon - - tests/phpstan/baselines/varTag.noVariable.neon - - tests/phpstan/baselines/variable.undefined.neon - # phpstan:baselines end + # The loader includes every baseline in its directory, so adding or deleting one + # needs no edit here. Regenerate them with `composer phpstan:baselines`. + - tests/phpstan/baselines/loader.php # Rules from phpstan-strict-rules which core already complies with, or which enforce the # WordPress Coding Standards. The others are not enabled until the code complies with them, diff --git a/src/js/_enqueues/admin/common.js b/src/js/_enqueues/admin/common.js index 13ae77892ffe8..1d8b30b080276 100644 --- a/src/js/_enqueues/admin/common.js +++ b/src/js/_enqueues/admin/common.js @@ -2256,6 +2256,123 @@ $( function( $ ) { }( jQuery, window )); +/** + * Manages overflow indicators and keyboard access for list tables. + * + * @since 7.3.0 + */ +( function initListTableOverflow() { + if ( document.readyState === 'loading' ) { + document.addEventListener( 'DOMContentLoaded', initListTableOverflow, { once: true } ); + return; + } + + const content = document.getElementById( 'wpbody-content' ); + if ( + ! content || + ! content.querySelector( '.wp-list-table-scroll' ) + ) { + return; + } + + /** @type {Map} */ + const tables = new Map(); + + /** + * Tracks a table's scroll position and dimensions. + * + * @since 7.3.0 + * + * @param {HTMLTableElement} table The table inside a scroll wrapper. + * + * @return {void} + */ + function observeTableOverflow( table ) { + const wrapper = table.parentElement; + const tabIndex = wrapper.getAttribute( 'tabindex' ); + + /** + * Updates the overflow indicators and the wrapper's place in the Tab order. + * + * @since 7.3.0 + * + * @return {void} + */ + function update() { + const style = window.getComputedStyle( wrapper ); + const isRTL = style.direction === 'rtl'; + const scrollLeft = isRTL ? -wrapper.scrollLeft : wrapper.scrollLeft; + const maxScroll = Math.max( 0, wrapper.scrollWidth - wrapper.clientWidth ); + const position = Math.min( maxScroll, Math.max( 0, scrollLeft ) ); + + // Skip non-scrolling wrappers without moving focus if the wrapper is already focused. + wrapper.tabIndex = maxScroll > 0 && + ( style.overflowX === 'auto' || style.overflowX === 'scroll' ) ? 0 : -1; + + // Allow for fractional scroll positions at either end of the table. + wrapper.classList.toggle( 'has-scroll-overflow-start', position > 1 ); + wrapper.classList.toggle( 'has-scroll-overflow-end', maxScroll - position > 1 ); + } + + const observer = new window.ResizeObserver( update ); + observer.observe( wrapper ); + observer.observe( table ); + wrapper.addEventListener( 'scroll', update, { passive: true } ); + update(); + + tables.set( table, { + wrapper, + + /** + * Releases overflow tracking and restores the wrapper's original Tab order. + * + * @since 7.3.0 + * + * @return {void} + */ + cleanup: () => { + observer.disconnect(); + wrapper.removeEventListener( 'scroll', update ); + wrapper.classList.remove( 'has-scroll-overflow-start', 'has-scroll-overflow-end' ); + if ( tabIndex === null ) { + wrapper.removeAttribute( 'tabindex' ); + } else { + wrapper.setAttribute( 'tabindex', tabIndex ); + } + }, + } ); + } + + /** + * Initializes added tables and releases observers for removed tables. + * + * @since 7.3.0 + * + * @return {void} + */ + function refreshTables() { + tables.forEach( ( state, table ) => { + if ( ! content.contains( table ) || table.parentElement !== state.wrapper ) { + state.cleanup(); + tables.delete( table ); + } + } ); + + content.querySelectorAll( '.wp-list-table-scroll > .wp-list-table' ) + .forEach( ( table ) => { + if ( ! tables.has( table ) ) { + observeTableOverflow( table ); + } + } ); + } + + refreshTables(); + + // Plugins live search replaces the table and its wrapper. + const observer = new window.MutationObserver( refreshTables ); + observer.observe( content, { childList: true, subtree: true } ); +}() ); + /** * Freeze animated plugin icons when reduced motion is enabled. * diff --git a/src/js/_enqueues/admin/media-upload-pipeline.js b/src/js/_enqueues/admin/media-upload-pipeline.js index bd25774d48491..4b0fd4f47bae0 100644 --- a/src/js/_enqueues/admin/media-upload-pipeline.js +++ b/src/js/_enqueues/admin/media-upload-pipeline.js @@ -46,7 +46,7 @@ window.wp = window.wp || {}; const IMAGE_SUBTYPES = [ 'jpeg', 'png', 'gif', 'webp', 'avif', 'heic', 'heif' ]; /** - * Recursively appends data to a FormData object, supporting nested objects. + * Recursively appends data to a FormData object, supporting nested objects and arrays. * * Mirrors flattenFormData() in the media-utils package. * @@ -56,9 +56,10 @@ window.wp = window.wp || {}; */ function flattenFormData( formData, key, data ) { if ( - data !== null && - typeof data === 'object' && - Object.getPrototypeOf( data ) === Object.prototype + Array.isArray( data ) || + ( data !== null && + typeof data === 'object' && + Object.getPrototypeOf( data ) === Object.prototype ) ) { Object.keys( data ).forEach( function ( name ) { flattenFormData( formData, key + '[' + name + ']', data[ name ] ); diff --git a/src/js/_enqueues/admin/password-toggle.js b/src/js/_enqueues/admin/password-toggle.js index bdd98f8bb7359..6fd4ffefc0942 100644 --- a/src/js/_enqueues/admin/password-toggle.js +++ b/src/js/_enqueues/admin/password-toggle.js @@ -12,29 +12,35 @@ toggleElements = document.querySelectorAll( '.pwd-toggle' ); - toggleElements.forEach( function (toggle) { + toggleElements.forEach( function ( toggle ) { toggle.classList.remove( 'hide-if-no-js' ); toggle.addEventListener( 'click', togglePassword ); } ); /** * Toggles the password input field visibility. + * + * @this {HTMLElement} */ function togglePassword() { status = this.getAttribute( 'data-toggle' ); - input = this.parentElement.children.namedItem( 'pwd' ); + input = this.parentElement ? this.parentElement.children.namedItem( 'pwd' ) : null; icon = this.getElementsByClassName( 'dashicons' )[ 0 ]; label = this.getElementsByClassName( 'text' )[ 0 ]; - if ( 0 === parseInt( status, 10 ) ) { - this.setAttribute( 'data-toggle', 1 ); + if ( ! input || ! icon || ! label ) { + return; + } + + if ( 0 === parseInt( status || '', 10 ) ) { + this.setAttribute( 'data-toggle', '1' ); this.setAttribute( 'aria-label', __( 'Hide password' ) ); input.setAttribute( 'type', 'text' ); label.innerHTML = __( 'Hide' ); icon.classList.remove( 'dashicons-visibility' ); icon.classList.add( 'dashicons-hidden' ); } else { - this.setAttribute( 'data-toggle', 0 ); + this.setAttribute( 'data-toggle', '0' ); this.setAttribute( 'aria-label', __( 'Show password' ) ); input.setAttribute( 'type', 'password' ); label.innerHTML = __( 'Show' ); diff --git a/src/js/_enqueues/admin/set-post-thumbnail.js b/src/js/_enqueues/admin/set-post-thumbnail.js index 5f5f565564cc8..72b4ee2610961 100644 --- a/src/js/_enqueues/admin/set-post-thumbnail.js +++ b/src/js/_enqueues/admin/set-post-thumbnail.js @@ -5,24 +5,50 @@ /* global ajaxurl, post_id, alert */ /* exported WPSetAsThumbnail */ +/** + * Sets the selected attachment as the post's featured image via AJAX. + * + * @param {string|number} id Attachment ID. + * @param {string} nonce Security nonce. + */ window.WPSetAsThumbnail = function( id, nonce ) { - var $link = jQuery('a#wp-post-thumbnail-' + id); + if ( typeof ajaxurl !== 'string' || typeof post_id === 'undefined' ) { + return; + } + + var $link = jQuery( 'a#wp-post-thumbnail-' + id ); $link.text( wp.i18n.__( 'Saving…' ) ); - jQuery.post(ajaxurl, { - action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie ) - }, function(str){ - var win = window.dialogArguments || opener || parent || top; - $link.text( wp.i18n.__( 'Use as featured image' ) ); - if ( str == '0' ) { - alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); - } else { - jQuery('a.wp-post-thumbnail').show(); - $link.text( wp.i18n.__( 'Done' ) ); - $link.fadeOut( 2000 ); - win.WPSetThumbnailID(id); - win.WPSetThumbnailHTML(str); + jQuery.post( + ajaxurl, + { + action: 'set-post-thumbnail', + post_id: post_id, + thumbnail_id: id, + _ajax_nonce: nonce, + cookie: encodeURIComponent( document.cookie ) + }, + /** + * Handles the AJAX response after setting the post thumbnail. + * + * @param {string} str Response HTML or `'0'` on failure. + */ + function( str ) { + var win = window.dialogArguments || opener || parent || top; + $link.text( wp.i18n.__( 'Use as featured image' ) ); + if ( str == '0' ) { + alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); + } else { + jQuery( 'a.wp-post-thumbnail' ).show(); + $link.text( wp.i18n.__( 'Done' ) ); + $link.fadeOut( 2000 ); + if ( win && typeof win.WPSetThumbnailID === 'function' ) { + win.WPSetThumbnailID( id ); + } + if ( win && typeof win.WPSetThumbnailHTML === 'function' ) { + win.WPSetThumbnailHTML( str ); + } + } } - } ); }; diff --git a/src/js/_enqueues/lib/zxcvbn-async.js b/src/js/_enqueues/lib/zxcvbn-async.js index 114cb5a0d698e..d974f775acc29 100644 --- a/src/js/_enqueues/lib/zxcvbn-async.js +++ b/src/js/_enqueues/lib/zxcvbn-async.js @@ -9,22 +9,26 @@ * script tag on the page. * * This makes sure zxcvbn isn't blocking loading the page as it is a big - * library. The source for zxcvbn is read from the _zxcvbnSettings global. + * library. The source for zxcvbn is read from the `_zxcvbnSettings` global. */ -(function() { - var async_load = function() { - var first, s; - s = document.createElement('script'); - s.src = _zxcvbnSettings.src; - s.type = 'text/javascript'; - s.async = true; - first = document.getElementsByTagName('script')[0]; - return first.parentNode.insertBefore(s, first); - }; +( () => { + const asyncLoad = () => { + if ( typeof _zxcvbnSettings === 'undefined' || ! _zxcvbnSettings.src ) { + return; + } - if (window.attachEvent != null) { - window.attachEvent('onload', async_load); - } else { - window.addEventListener('load', async_load, false); - } -}).call(this); + const script = document.createElement( 'script' ); + script.src = _zxcvbnSettings.src; + script.type = 'text/javascript'; + script.async = true; + + const first = document.getElementsByTagName( 'script' )[ 0 ]; + if ( ! first || ! first.parentNode ) { + return; + } + + first.parentNode.insertBefore( script, first ); + }; + + window.addEventListener( 'load', asyncLoad ); +} )(); diff --git a/src/js/_enqueues/wp/api-request.js b/src/js/_enqueues/wp/api-request.js index 4762a37f658e2..2ab0f3160aafc 100644 --- a/src/js/_enqueues/wp/api-request.js +++ b/src/js/_enqueues/wp/api-request.js @@ -19,41 +19,41 @@ * @param {JQueryStatic} $ The jQuery object. */ ( function( $ ) { - var wpApiSettings = window.wpApiSettings; - /** * Makes an API request. * - * @param {Object} options The options for the API request. - * @param {string} [options.url] The full URL for the request. - * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. - * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. - * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. - * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). - * @param {Object} [options.data] The request data to send. - * @param {string} [options.data._wpnonce] Nonce for security. - * @param {Object} [options.headers] Custom headers to include in the request. + * @param {Object} options The options for the API request. + * @param {string} [options.url] The full URL for the request. + * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. + * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. + * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. + * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). + * @param {Object} [options.data] The request data to send. + * @param {string} [options.data._wpnonce] Nonce for security. + * @param {JQuery.PlainObject} [options.headers] Custom headers to include in the request. * @return {JQueryXHR} The jQuery XHR object. */ function apiRequest( options ) { - options = apiRequest.buildAjaxOptions( options ); - return apiRequest.transport( options ); + return apiRequest.transport( apiRequest.buildAjaxOptions( options ) ); } /** * Builds the options for the jQuery.ajax request. * - * @param {Object} options The options for the API request. - * @param {string} [options.url] The full URL for the request. - * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. - * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. - * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. - * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). - * @param {Object} [options.data] The request data to send. - * @param {Object} [options.headers] Custom headers to include in the request. - * @return {Object} The options for the jQuery.ajax request. + * @param {Object} options The options for the API request. + * @param {string} [options.url] The full URL for the request. + * @param {string} [options.path] The API path (e.g., 'wp/v2/posts'). Used if url is not provided. + * @param {string} [options.namespace] The API namespace (e.g., 'wp/v2'). Used with endpoint to build path. + * @param {string} [options.endpoint] The API endpoint (e.g., 'posts'). Used with namespace to build path. + * @param {string} [options.method] The HTTP method (GET, POST, PUT, DELETE, etc.). + * @param {Object} [options.data] The request data to send. + * @param {string} [options.data._wpnonce] Nonce for security. + * @param {JQuery.PlainObject} [options.headers] Custom headers to include in the request. + * @return {JQuery.AjaxSettings} The options for the jQuery.ajax request. + * @throws {Error} If `wpApiSettings.root` is missing when `path` or `namespace`/`endpoint` is used. */ apiRequest.buildAjaxOptions = function( options ) { + var wpApiSettings = window.wpApiSettings; var url = options.url; var path = options.path; var method = options.method; @@ -73,12 +73,15 @@ } } if ( typeof path === 'string' ) { - apiRoot = wpApiSettings.root; + apiRoot = wpApiSettings && typeof wpApiSettings.root === 'string' ? wpApiSettings.root : ''; + if ( ! apiRoot ) { + throw new Error( 'wpApiSettings.root is required when using path or namespace/endpoint.' ); + } path = path.replace( /^\//, '' ); // API root may already include query parameter prefix // if site is configured to use plain permalinks. - if ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) { + if ( -1 !== apiRoot.indexOf( '?' ) ) { path = path.replace( '?', '&' ); } @@ -108,7 +111,7 @@ } } - if ( addNonceHeader ) { + if ( addNonceHeader && wpApiSettings ) { // Do not mutate the original headers object, if any. headers = $.extend( { 'X-WP-Nonce': wpApiSettings.nonce diff --git a/src/js/_enqueues/wp/utils/word-count.js b/src/js/_enqueues/wp/utils/word-count.js index 4c336582ecf63..82e48d52fe21a 100644 --- a/src/js/_enqueues/wp/utils/word-count.js +++ b/src/js/_enqueues/wp/utils/word-count.js @@ -82,7 +82,7 @@ '[', // Basic Latin (extract). - '\u0021-\u0040\u005B-\u0060\u007B-\u007E', + '\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E', // Latin-1 Supplement (extract). '\u0080-\u00BF\u00D7\u00F7', diff --git a/src/wp-admin/_index.php b/src/wp-admin/_index.php index 4af8d0d66485b..de5cc21b8ff4f 100644 --- a/src/wp-admin/_index.php +++ b/src/wp-admin/_index.php @@ -86,11 +86,7 @@ $help .= '

' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '

'; } -$help .= '

' . __( 'Activity — Shows upcoming scheduled posts, recently published posts, and posts published on this day in previous years.' ) . '

'; - -if ( _wp_dashboard_has_received_comments() ) { - $help .= '

' . __( 'Recent Comments — Shows the most recent comments on your posts and allows you to moderate them.' ) . '

'; -} +$help .= '

' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '

'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '

' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '

'; diff --git a/src/wp-admin/about.php b/src/wp-admin/about.php index 1bfc3018e0556..bf93181540048 100644 --- a/src/wp-admin/about.php +++ b/src/wp-admin/about.php @@ -14,7 +14,7 @@ $title = _x( 'About', 'page title' ); list( $display_version ) = explode( '-', wp_get_wp_version() ); -$display_major_version = '7.1'; +$display_major_version = '7.2'; $release_notes_url = sprintf( /* translators: %s: WordPress version number. */ @@ -69,21 +69,21 @@ ); ?> -

+

-

+

-
- +
+

- +
@@ -91,29 +91,29 @@
- +
-

+

-
- +
+

-

+

-
- +
+

- +
@@ -121,14 +121,14 @@
- +
-

+

-
- +
+

@@ -143,8 +143,8 @@ -

-

+

+

@@ -153,7 +153,7 @@

-

+

@@ -183,7 +183,7 @@
- <?php echo esc_attr( $version_text ); ?> + <?php echo esc_attr( $version_text ); ?>

@@ -294,7 +294,7 @@ // These are strings we may use to describe maintenance/security releases, where we aim for no new strings. return; -__( 'Maintenance Release' ); +__( 'Maintenance Release' ); // @phpstan-ignore deadCode.unreachable (Placed after the return so that the strings are added to the POT file without running.) __( 'Maintenance Releases' ); __( 'Security Release' ); diff --git a/src/wp-admin/credits.php b/src/wp-admin/credits.php index 75993cf6652a7..26f06b76a6010 100644 --- a/src/wp-admin/credits.php +++ b/src/wp-admin/credits.php @@ -122,7 +122,7 @@ return; // These are strings returned by the API that we want to be translatable. -__( 'Project Leaders' ); +__( 'Project Leaders' ); // @phpstan-ignore deadCode.unreachable (Placed after the return so that the strings are added to the POT file without running.) /* translators: %s: The current WordPress version number. */ __( 'Core Contributors to WordPress %s' ); __( 'Noteworthy Contributors' ); diff --git a/src/wp-admin/css/about.css b/src/wp-admin/css/about.css index f0c81acac8ec8..bc3c1353b1da8 100644 --- a/src/wp-admin/css/about.css +++ b/src/wp-admin/css/about.css @@ -20,9 +20,14 @@ */ .about__container { - /* Section backgrounds */ - --background: #3858e9; - --subtle-background: #f4f4f4; + /* + * Section backgrounds + * + * Section header backgrounds are set to the dominant color of the + * image to avoid display issues if the image fails to load. + */ + --background: #eeece5; + --subtle-background: #f3f2ee; /* Main text color */ --text: #1e1e1e; @@ -617,7 +622,7 @@ padding-right: 26rem; /* Space for the background image. */ min-height: clamp(10rem, 25vw, 18.75rem); border-radius: var(--border-radius); - background-image: url(../images/about-header-default.svg?ver=7.1); + background-image: url(../images/about-header-default.svg?ver=7.2); background-repeat: no-repeat; background-position: right center; background-size: cover; @@ -627,39 +632,42 @@ } .credits-php .about__header { - background-image: url(../images/about-header-credits.svg?ver=7.1); + background-image: url(../images/about-header-credits.svg?ver=7.2); + --background: #3858e9; } .freedoms-php .about__header { - background-image: url(../images/about-header-freedoms.svg?ver=7.1); + background-image: url(../images/about-header-freedoms.svg?ver=7.2); + --background: #757575; } .privacy-php .about__header { - background-image: url(../images/about-header-privacy.svg?ver=7.1); + background-image: url(../images/about-header-privacy.svg?ver=7.2); + --background: #323232; } .contribute-php .about__header { - background-image: url(../images/about-header-get-involved.svg?ver=7.1); + background-image: url(../images/about-header-get-involved.svg?ver=7.2); } [dir="rtl"] .about__header { - background-image: url(../images/about-header-default-rtl.svg?ver=7.1); + background-image: url(../images/about-header-default-rtl.svg?ver=7.2); } [dir="rtl"] .credits-php .about__header { - background-image: url(../images/about-header-credits-rtl.svg?ver=7.1); + background-image: url(../images/about-header-credits-rtl.svg?ver=7.2); } [dir="rtl"] .freedoms-php .about__header { - background-image: url(../images/about-header-freedoms-rtl.svg?ver=7.1); + background-image: url(../images/about-header-freedoms-rtl.svg?ver=7.2); } [dir="rtl"] .privacy-php .about__header { - background-image: url(../images/about-header-privacy-rtl.svg?ver=7.1); + background-image: url(../images/about-header-privacy-rtl.svg?ver=7.2); } [dir="rtl"] .contribute-php .about__header { - background-image: url(../images/about-header-get-involved-rtl.svg?ver=7.1); + background-image: url(../images/about-header-get-involved-rtl.svg?ver=7.2); } .about__header-image { @@ -691,6 +699,12 @@ font-size: clamp(2rem, 20vw - 9rem, 4rem); } +.about-php .about__header-title h1, +.contribute-php .about__header-title h1, +.contribute-php .about__header-text { + color: var(--text); +} + .about__header-text { box-sizing: border-box; max-width: 26em; diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index 100c4df0a9633..c75eca12ee7be 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -879,7 +879,7 @@ body #dashboard-widgets .postbox form .submit { /* Dashboard activity widget */ -#dashboard_recent_comments .comment-meta span.approve::before { +#dashboard_activity .comment-meta span.approve::before { content: "\f227"; content: "\f227" / ""; font: 20px/0.5 dashicons; @@ -890,8 +890,7 @@ body #dashboard-widgets .postbox form .submit { margin-right: 2px; } -#dashboard_activity .inside, -#dashboard_recent_comments .inside { +#dashboard_activity .inside { margin: 0; padding: 0 12px; } @@ -907,27 +906,25 @@ body #dashboard-widgets .postbox form .submit { font-size: 16px; } -#dashboard_recent_comments .subsubsub { +#dashboard_activity .subsubsub { float: none; border-top: 1px solid #f0f0f1; margin: 0 -12px; padding: 8px 12px 4px; } -#dashboard_recent_comments .subsubsub a .count, -#dashboard_recent_comments .subsubsub a.current .count { +#dashboard_activity .subsubsub a .count, +#dashboard_activity .subsubsub a.current .count { color: #646970; /* white background on the dashboard but #f0f0f1 on list tables */ } #future-posts ul, -#published-posts ul, -#on-this-day-posts ul { +#published-posts ul { margin: 8px -12px 0 -12px; } #future-posts li, -#published-posts li, -#on-this-day-posts li { +#published-posts li { display: grid; grid-template-columns: clamp(160px, calc(2vw + 140px), 200px) auto; column-gap: 10px; @@ -936,15 +933,10 @@ body #dashboard-widgets .postbox form .submit { } #future-posts li:nth-child(odd), -#published-posts li:nth-child(odd), -#on-this-day-posts li:nth-child(odd) { +#published-posts li:nth-child(odd) { background-color: #f6f7f7; } -#on-this-day-posts .wp-on-this-day-post-author { - color: #646970; -} - .activity-block { border-bottom: 1px solid #f0f0f1; margin: 0 -12px 6px -12px; @@ -963,45 +955,45 @@ body #dashboard-widgets .postbox form .submit { /* Dashboard activity widget - Comments */ /* @todo: needs serious de-duplication */ -#dashboard_recent_comments #the-comment-list tr.undo, -#dashboard_recent_comments #the-comment-list div.undo { +#activity-widget #the-comment-list tr.undo, +#activity-widget #the-comment-list div.undo { background: none; padding: 6px 0; margin-left: 12px; } -#dashboard_recent_comments #the-comment-list .comment-item { +#activity-widget #the-comment-list .comment-item { background: #f6f7f7; padding: 12px; position: relative; } -#dashboard_recent_comments #the-comment-list .avatar { +#activity-widget #the-comment-list .avatar { position: absolute; top: 12px; } -#dashboard_recent_comments #the-comment-list .dashboard-comment-wrap.has-avatar { +#activity-widget #the-comment-list .dashboard-comment-wrap.has-avatar { padding-left: 63px; } -#dashboard_recent_comments #the-comment-list .dashboard-comment-wrap blockquote { +#activity-widget #the-comment-list .dashboard-comment-wrap blockquote { margin: 1em 0; } -#dashboard_recent_comments #the-comment-list .comment-item p.row-actions { +#activity-widget #the-comment-list .comment-item p.row-actions { margin: 4px 0 0; } -#dashboard_recent_comments #the-comment-list .comment-item:first-child { +#activity-widget #the-comment-list .comment-item:first-child { border-top: 1px solid #f0f0f1; } -#dashboard_recent_comments #the-comment-list .unapproved { +#activity-widget #the-comment-list .unapproved { background-color: #fcf9e8; } -#dashboard_recent_comments #the-comment-list .unapproved::before { +#activity-widget #the-comment-list .unapproved::before { content: ""; display: block; position: absolute; @@ -1012,8 +1004,8 @@ body #dashboard-widgets .postbox form .submit { width: 4px; } -#dashboard_recent_comments #the-comment-list .spam-undo-inside .avatar, -#dashboard_recent_comments #the-comment-list .trash-undo-inside .avatar { +#activity-widget #the-comment-list .spam-undo-inside .avatar, +#activity-widget #the-comment-list .trash-undo-inside .avatar { position: relative; top: 0; } diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index f6105ad5a59fb..a0c4164fab925 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -1789,9 +1789,186 @@ div.action-links, width: 80px; } +.wp-list-table-scroll:focus-visible { + outline: 2px solid var(--wp-admin-theme-color); + outline-offset: 0; +} + /* =Media Queries -------------------------------------------------------------- */ +@media screen and (min-width: 783px) { + + /* Keep the table within a horizontally scrollable viewport. */ + .wp-list-table-scroll { + display: grid; + container-type: inline-size; + clear: both; + overflow-x: auto; + overflow-y: hidden; + overscroll-behavior-x: none; + border: 1px solid #c3c4c7; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + } + + /* Wrap preformatted text, including inline preformatting, while preserving whitespace. */ + .wp-list-table-scroll > .wp-list-table pre { + white-space: pre-wrap !important; + overflow-wrap: anywhere; + } + + /* Paint the entire editing row above the scroll fades. */ + .wp-list-table-scroll > .wp-list-table > tbody > :is(.inline-edit-row, .inline-editor) { + position: relative; + z-index: 2; + } + + /* Keep inline editing forms within the visible table container. */ + .wp-list-table-scroll .inline-edit-wrapper, + .wp-list-table-scroll #replyrow.inline-edit-row fieldset.comment-reply { + position: sticky; + inset-inline-start: 0; + box-sizing: border-box; + width: 100cqi; + } + + /* Account for the comment editing cell's 2px padding on each side. */ + .wp-list-table-scroll #replyrow.inline-edit-row fieldset.comment-reply { + inset-inline-start: 2px; + float: none; + width: calc(100cqi - 4px); + } + + /* Share the table's grid area so the fades can stick to the viewport edges. */ + .wp-list-table-scroll > .wp-list-table, + .wp-list-table-scroll::before, + .wp-list-table-scroll::after { + grid-area: 1 / 1; + } + + .wp-list-table-scroll > .widefat { + border: 0; + box-shadow: none; + } + + /* Keep sort indicators beside their labels when columns shrink. */ + .wp-list-table-scroll > .wp-list-table th.sortable a, + .wp-list-table-scroll > .wp-list-table th.sorted a { + display: flex; + align-items: center; + } + + /* Keep the sort icons' layout boxes from extending past the last column. */ + .wp-list-table-scroll .sorting-indicators { + overflow: clip; + } + + /* Keep sorting links' focus indicators inside the scrolling viewport. */ + .wp-list-table-scroll th.sortable a:focus, + .wp-list-table-scroll th.sorted a:focus { + box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9); + outline-offset: -2px; + } + + .wp-list-table-scroll > .fixed { + table-layout: auto; + } + + /* Preserve the checkbox column's spacing under automatic table layout. */ + .wp-list-table-scroll > .fixed .check-column { + min-width: 2.2em; + } + + :where(.wp-list-table-scroll) > .fixed .column-author, + :where(.wp-list-table-scroll) > .fixed .column-categories, + :where(.wp-list-table-scroll) > .fixed .column-tags, + :where(.wp-list-table-scroll) > .fixed .column-date, + :where(.wp-list-table-scroll) > .fixed .column-response, + :where(.wp-list-table-scroll) > .fixed .column-role, + :where(.wp-list-table-scroll) > .fixed .column-slug, + :where(.wp-list-table-scroll) > .fixed .column-locations { + width: auto; + } + + /* Long words, URLs, and filenames must not set the table's intrinsic width. */ + .wp-list-table-scroll > .fixed .column-primary, + .wp-list-table-scroll > .fixed .column-primary *, + .wp-list-table-scroll > .fixed .column-author, + .wp-list-table-scroll > .fixed .column-author *, + .wp-list-table-scroll > .fixed .column-categories, + .wp-list-table-scroll > .fixed .column-categories *, + .wp-list-table-scroll > .fixed .column-tags, + .wp-list-table-scroll > .fixed .column-tags *, + .wp-list-table-scroll > .fixed [class*=" column-taxonomy-"], + .wp-list-table-scroll > .fixed [class*=" column-taxonomy-"] *, + .wp-list-table-scroll > .fixed .column-description, + .wp-list-table-scroll > .fixed .column-description *, + .wp-list-table-scroll > .fixed .column-email, + .wp-list-table-scroll > .fixed .column-email *, + .wp-list-table-scroll > .fixed .column-parent, + .wp-list-table-scroll > .fixed .column-parent *, + .wp-list-table-scroll > .fixed .column-response, + .wp-list-table-scroll > .fixed .column-response *, + .wp-list-table-scroll > .fixed .column-role, + .wp-list-table-scroll > .fixed .column-role *, + .wp-list-table-scroll > .fixed .column-slug, + .wp-list-table-scroll > .fixed .column-slug *, + .wp-list-table-scroll > .fixed .column-locations, + .wp-list-table-scroll > .fixed .column-locations * { + overflow-wrap: anywhere; + } + + .wp-list-table-scroll > .fixed th.column-author, + .wp-list-table-scroll > .fixed th.column-categories, + .wp-list-table-scroll > .fixed th.column-tags, + .wp-list-table-scroll > .fixed th[class*=" column-taxonomy-"], + .wp-list-table-scroll > .fixed th.column-response, + .wp-list-table-scroll > .fixed th.column-role, + .wp-list-table-scroll > .fixed th.column-slug, + .wp-list-table-scroll > .fixed th.column-locations { + min-width: 10em; + } + + .wp-list-table-scroll > .fixed th.column-comments { + min-width: 5.5em; + } + + .wp-list-table-scroll > .fixed th.column-date { + min-width: 12em; + } + + .wp-list-table-scroll > .fixed th.column-primary { + min-width: 20em; + } + + .wp-list-table-scroll::before, + .wp-list-table-scroll::after { + content: ""; + position: sticky; + z-index: 1; + width: 24px; + pointer-events: none; + opacity: 0; + } + + .wp-list-table-scroll::before { + inset-inline-start: 0; + justify-self: start; + background-image: linear-gradient(to right, #fff, transparent); + } + + .wp-list-table-scroll::after { + inset-inline-end: 0; + justify-self: end; + background-image: linear-gradient(to left, #fff, transparent); + } + + .wp-list-table-scroll.has-scroll-overflow-start::before, + .wp-list-table-scroll.has-scroll-overflow-end::after { + opacity: 1; + } +} + @media screen and (max-width: 1100px) and (min-width: 782px), (max-width: 480px) { .plugin-card .action-links { position: static; diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 820424fb3c477..6585fbc2d63bc 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -121,15 +121,14 @@ static function ( $classes ) { '/wp/v2/templates/lookup?slug=front-page', '/wp/v2/taxonomies?context=edit', array( rest_get_route_for_post_type_items( $post_type ), 'OPTIONS' ), + /* + * The post summary of the inspector requests the form config of the post type + * through `useViewConfig` with `fields: [ 'form' ]`, so the path must match + * the resulting `_fields=form` request. + */ + '/wp/v2/view-config?kind=postType&name=' . $post_type . '&_fields=form', ); -if ( post_type_supports( $post_type, 'author' ) && $post->post_author > 0 ) { - $preload_paths[] = sprintf( - '/wp/v2/users/%d?context=view&_fields=id,name', - (int) $post->post_author - ); -} - block_editor_rest_api_preload( $preload_paths, $block_editor_context ); wp_add_inline_script( diff --git a/src/wp-admin/images/about-header-credits-rtl.svg b/src/wp-admin/images/about-header-credits-rtl.svg index 001e47d6949f8..741b4e1e01fea 100644 --- a/src/wp-admin/images/about-header-credits-rtl.svg +++ b/src/wp-admin/images/about-header-credits-rtl.svg @@ -1 +1,32 @@ - \ No newline at end of file + + + + + + import { + registerBlockType } + from '@wordpress/blocks'; + import { useBlockProps, RichT + ext, InspectorControls } from '@w + ordpress/block-editor'; import { Pa + nelBody, RangeControl } from '@word + press/components'; import { __ } fr + om '@wordpress/i18n'; registerBlock + Type( 'vamp/path', { edit( { attrib + utes, setAttributes } ) { const + blockProps = useBlockProps() + ; return ( <> <InspectorC + ontrols> <PanelBo + dy title={ __( 'Spacing', ' + vamp' ) }> <RangeControl label={ __( 'Tra + cking', 'vamp' ) } value={ attributes.tracking } on + Change={ ( tracking ) => setAttributes( { tracking } ) } + min={ 0 } max={ 20 } /> </PanelBody> </InspectorControls> <Ri + chIext { ...blockProps } tagName="p" value={ attributes.content + + diff --git a/src/wp-admin/images/about-header-credits.svg b/src/wp-admin/images/about-header-credits.svg index ac6dfef6883ea..72dbfbdfcfeef 100644 --- a/src/wp-admin/images/about-header-credits.svg +++ b/src/wp-admin/images/about-header-credits.svg @@ -1 +1,32 @@ - \ No newline at end of file + + + + + + import { + registerBlockType } + from '@wordpress/blocks'; + import { useBlockProps, RichT + ext, InspectorControls } from '@w + ordpress/block-editor'; import { Pa + nelBody, RangeControl } from '@word + press/components'; import { __ } fr + om '@wordpress/i18n'; registerBlock + Type( 'vamp/path', { edit( { attrib + utes, setAttributes } ) { const + blockProps = useBlockProps() + ; return ( <> <InspectorC + ontrols> <PanelBo + dy title={ __( 'Spacing', ' + vamp' ) }> <RangeControl label={ __( 'Tra + cking', 'vamp' ) } value={ attributes.tracking } on + Change={ ( tracking ) => setAttributes( { tracking } ) } + min={ 0 } max={ 20 } /> </PanelBody> </InspectorControls> <Ri + chIext { ...blockProps } tagName="p" value={ attributes.content + + diff --git a/src/wp-admin/images/about-header-default-rtl.svg b/src/wp-admin/images/about-header-default-rtl.svg index d8574fc4c3b75..bd0156b542b27 100644 --- a/src/wp-admin/images/about-header-default-rtl.svg +++ b/src/wp-admin/images/about-header-default-rtl.svg @@ -1 +1,50 @@ - \ No newline at end of file + + + + + + , { edit( { attribut▒ + es, setAttr▓ + utes } ) { const ▓ + blockProps ▓ + useBlockProps(▓ + ); return (▓ + > <Inspecto▓ + rControls> ▓ + PanelBod▓ + y title={ _▓ + ▒█_( █ + 'Spacing', ▓ + 'vamp' ) }>▓ + <RangeCont▓ + ▒▓rol la█░ + bel={ __( '▓ + ░▓Tracking', 'vamp▒ + ' ) } value▓ + ░▓█={ attributes.tracking░ + } onChange={ ( tracking ) => setAttribu▓ + tes( { tracking } ) } min={ 0 } max={ 20▓ + > </PanelBody> </InspectorControls> <Ric▓ + ▓h + ..blockProps } tagName="p" value={ attri▓ + ▒bute + ░ } onChange={ ( content ) =>▓ setAttribu▓ + ▒tes( { + ) } /> </> ); }, save(█▒ + { attribut▓ + ▒es } ) { r + ▓chText.Content█▓ + { ...useBl▓ + ▒ockProps.save + Name="p█▓░ + " value={ a▓ + █ttributes.conte + >; }. } ); ▓ + ▒█import { registerB + + diff --git a/src/wp-admin/images/about-header-default.svg b/src/wp-admin/images/about-header-default.svg index ca71da7d8a2be..bd0156b542b27 100644 --- a/src/wp-admin/images/about-header-default.svg +++ b/src/wp-admin/images/about-header-default.svg @@ -1 +1,50 @@ - \ No newline at end of file + + + + + + , { edit( { attribut▒ + es, setAttr▓ + utes } ) { const ▓ + blockProps ▓ + useBlockProps(▓ + ); return (▓ + > <Inspecto▓ + rControls> ▓ + PanelBod▓ + y title={ _▓ + ▒█_( █ + 'Spacing', ▓ + 'vamp' ) }>▓ + <RangeCont▓ + ▒▓rol la█░ + bel={ __( '▓ + ░▓Tracking', 'vamp▒ + ' ) } value▓ + ░▓█={ attributes.tracking░ + } onChange={ ( tracking ) => setAttribu▓ + tes( { tracking } ) } min={ 0 } max={ 20▓ + > </PanelBody> </InspectorControls> <Ric▓ + ▓h + ..blockProps } tagName="p" value={ attri▓ + ▒bute + ░ } onChange={ ( content ) =>▓ setAttribu▓ + ▒tes( { + ) } /> </> ); }, save(█▒ + { attribut▓ + ▒es } ) { r + ▓chText.Content█▓ + { ...useBl▓ + ▒ockProps.save + Name="p█▓░ + " value={ a▓ + █ttributes.conte + >; }. } ); ▓ + ▒█import { registerB + + diff --git a/src/wp-admin/images/about-header-freedoms-rtl.svg b/src/wp-admin/images/about-header-freedoms-rtl.svg index 5eb445f4b8a4a..58b30a01bdc10 100644 --- a/src/wp-admin/images/about-header-freedoms-rtl.svg +++ b/src/wp-admin/images/about-header-freedoms-rtl.svg @@ -1 +1,96 @@ - \ No newline at end of file + + + + + + import { r + import { r + import { r + import { r + egisterBlockType } from ' + egisterBlockType } from ' + egisterBlockType } from ' + egisterBlockType } from ' + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + s } from '@wordpress/block-editor'; import + s } from '@wordpress/block-editor'; impo + } from '@wordpress/block-editor'; import + s } from '@wordpress/block-editor'; import + { PanelBody, RangeControl } from '@wordpres + { PanelBody, RangeControl } from '@wordp + PanelBody, RangeControl } from '@wordpres + { PanelBody, RangeControl } from '@wordpres + s/components'; import { __ } from '@wordpress/i1 + s/components'; import { __ } from '@wordpre + ponents'; import { __ } from '@wordpress/i1 + s/components'; import { __ } from '@wordpress/i1 + 8n'; registerBlockType( 'vamp/path', { edit( { at + 8n'; registerBlockType( 'vamp/path', { edit + registerBlockType( 'vamp/path', { edit( { at + 8n'; registerBlockType( 'vamp/path', { edit( { at + tributes, setAttributes } ) { const blockProps = u + tributes, setAttributes } ) { const blockPro + es, setAttributes } ) { const blockProps = u + tributes, setAttributes } ) { const blockProps = u + seBlockProps(); return ( <> <InspectorControls> <Pan + seBlockProps(); return ( <> <InspectorControl + Props(); return ( <> <InspectorControls> <Pan + seBlockProps(); return ( <> <InspectorControls> <Pan + elBody title={ __( 'Spacing', 'vamp' ) }> <RangeCont + elBody title={ __( 'Spacing', 'vamp' ) }> <Ra + title={ __( 'Spacing', 'vamp' ) }> <RangeCont + elBody title={ __( 'Spacing', 'vamp' ) }> <RangeCont + rol label={ __( 'Tracking', 'vamp' ) } value={ attri + rol label={ __( 'Tracking', 'vamp' ) } value= + el={ __( 'Tracking', 'vamp' ) } value={ attri + rol label={ __( 'Tracking', 'vamp' ) } value={ attri + butes.tracking } onChange={ ( tracking ) => setAtt + butes.tracking } onChange={ ( tracking ) => + tracking } onChange={ ( tracking ) => setAtt + butes.tracking } onChange={ ( tracking ) => setAtt + ributes( { tracking } ) } min={ 0 } max={ 20 } /> + ributes( { tracking } ) } min={ 0 } max={ 2 + es( { tracking } ) } min={ 0 } max={ 20 } /> + ributes( { tracking } ) } min={ 0 } max={ 20 } /> + </PanelBody> </InspectorControls> <RichText { . + </PanelBody> </InspectorControls> <RichTex + nelBody> </InspectorControls> <RichText { . + </PanelBody> </InspectorControls> <RichText { . + ..blockProps } tagName="p" value={ attributes + ..blockProps } tagName="p" value={ attrib + lockProps } tagName="p" value={ attributes + ..blockProps } tagName="p" value={ attributes + .content } onChange={ ( content ) => setAt + .content } onChange={ ( content ) => set + ontent } onChange={ ( content ) => setAt + .content } onChange={ ( content ) => setAt + tributes( { content } ) } /> </> ); }, + tributes( { content } ) } /> </> ); } + tributes( { content } ) } /> </> ); }, + tributes( { content } ) } /> </> ); }, + save( { attributes } ) { return + save( { attributes } ) { return + save( { attributes } ) { return + save( { attributes } ) { return + <RichText.Content { ...us + <RichText.Content { ...us + <RichText.Content { ...us + <RichText.Content { ...us + eBlockProps. + eBlockProps. + eBlockProps. + eBlockProps. + + diff --git a/src/wp-admin/images/about-header-freedoms.svg b/src/wp-admin/images/about-header-freedoms.svg index e996bcc373802..58b30a01bdc10 100644 --- a/src/wp-admin/images/about-header-freedoms.svg +++ b/src/wp-admin/images/about-header-freedoms.svg @@ -1 +1,96 @@ - \ No newline at end of file + + + + + + import { r + import { r + import { r + import { r + egisterBlockType } from ' + egisterBlockType } from ' + egisterBlockType } from ' + egisterBlockType } from ' + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + @wordpress/blocks'; import { use + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + BlockProps, RichText, InspectorControl + s } from '@wordpress/block-editor'; import + s } from '@wordpress/block-editor'; impo + } from '@wordpress/block-editor'; import + s } from '@wordpress/block-editor'; import + { PanelBody, RangeControl } from '@wordpres + { PanelBody, RangeControl } from '@wordp + PanelBody, RangeControl } from '@wordpres + { PanelBody, RangeControl } from '@wordpres + s/components'; import { __ } from '@wordpress/i1 + s/components'; import { __ } from '@wordpre + ponents'; import { __ } from '@wordpress/i1 + s/components'; import { __ } from '@wordpress/i1 + 8n'; registerBlockType( 'vamp/path', { edit( { at + 8n'; registerBlockType( 'vamp/path', { edit + registerBlockType( 'vamp/path', { edit( { at + 8n'; registerBlockType( 'vamp/path', { edit( { at + tributes, setAttributes } ) { const blockProps = u + tributes, setAttributes } ) { const blockPro + es, setAttributes } ) { const blockProps = u + tributes, setAttributes } ) { const blockProps = u + seBlockProps(); return ( <> <InspectorControls> <Pan + seBlockProps(); return ( <> <InspectorControl + Props(); return ( <> <InspectorControls> <Pan + seBlockProps(); return ( <> <InspectorControls> <Pan + elBody title={ __( 'Spacing', 'vamp' ) }> <RangeCont + elBody title={ __( 'Spacing', 'vamp' ) }> <Ra + title={ __( 'Spacing', 'vamp' ) }> <RangeCont + elBody title={ __( 'Spacing', 'vamp' ) }> <RangeCont + rol label={ __( 'Tracking', 'vamp' ) } value={ attri + rol label={ __( 'Tracking', 'vamp' ) } value= + el={ __( 'Tracking', 'vamp' ) } value={ attri + rol label={ __( 'Tracking', 'vamp' ) } value={ attri + butes.tracking } onChange={ ( tracking ) => setAtt + butes.tracking } onChange={ ( tracking ) => + tracking } onChange={ ( tracking ) => setAtt + butes.tracking } onChange={ ( tracking ) => setAtt + ributes( { tracking } ) } min={ 0 } max={ 20 } /> + ributes( { tracking } ) } min={ 0 } max={ 2 + es( { tracking } ) } min={ 0 } max={ 20 } /> + ributes( { tracking } ) } min={ 0 } max={ 20 } /> + </PanelBody> </InspectorControls> <RichText { . + </PanelBody> </InspectorControls> <RichTex + nelBody> </InspectorControls> <RichText { . + </PanelBody> </InspectorControls> <RichText { . + ..blockProps } tagName="p" value={ attributes + ..blockProps } tagName="p" value={ attrib + lockProps } tagName="p" value={ attributes + ..blockProps } tagName="p" value={ attributes + .content } onChange={ ( content ) => setAt + .content } onChange={ ( content ) => set + ontent } onChange={ ( content ) => setAt + .content } onChange={ ( content ) => setAt + tributes( { content } ) } /> </> ); }, + tributes( { content } ) } /> </> ); } + tributes( { content } ) } /> </> ); }, + tributes( { content } ) } /> </> ); }, + save( { attributes } ) { return + save( { attributes } ) { return + save( { attributes } ) { return + save( { attributes } ) { return + <RichText.Content { ...us + <RichText.Content { ...us + <RichText.Content { ...us + <RichText.Content { ...us + eBlockProps. + eBlockProps. + eBlockProps. + eBlockProps. + + diff --git a/src/wp-admin/images/about-header-get-involved-rtl.svg b/src/wp-admin/images/about-header-get-involved-rtl.svg index 3db4448e465af..ee61071e66fd2 100644 --- a/src/wp-admin/images/about-header-get-involved-rtl.svg +++ b/src/wp-admin/images/about-header-get-involved-rtl.svg @@ -1 +1,26 @@ - \ No newline at end of file + + + + + + imp + ort { re + gisterBlockT + ype } from '@word + press/blocks'; import { useBlockProps, RichText, InspectorControls + } from '@wordpress/block-editor'; import { PanelBody, RangeControl } fro + m '@wordpress/components'; import { __ } from '@wordpress/i18n'; registerBloc + kType( 'vamp/path', { edit( { attributes, setAttributes } ) { const blockProp + s = useBlockProps(); return ( <> <InspectorControls> <PanelBody title={ + __( 'Spacing', 'vamp' ) }> <RangeControl label={ __( 'Tracking', 'v + amp' ) } value={ + attributes.t + racking + } o + + diff --git a/src/wp-admin/images/about-header-get-involved.svg b/src/wp-admin/images/about-header-get-involved.svg index 17b2717ddf63b..23a385bbf2cf7 100644 --- a/src/wp-admin/images/about-header-get-involved.svg +++ b/src/wp-admin/images/about-header-get-involved.svg @@ -1 +1,26 @@ - \ No newline at end of file + + + + + + imp + ort { re + gisterBlockTy + pe } from '@wordpr + ess/blocks'; import { useBlockProps, RichText, InspectorControls } + from '@wordpress/block-editor'; import { PanelBody, RangeControl } from + '@wordpress/components'; import { __ } from '@wordpress/i18n'; registerBloc + kType( 'vamp/path', { edit( { attributes, setAttributes } ) { const blockPro + ps = useBlockProps(); return ( <> <InspectorControls> <PanelBody title= + { __( 'Spacing', 'vamp' ) }> <RangeControl label={ __( 'Tracking', + 'vamp' ) } value= + { attributes. + tracking + } on + + diff --git a/src/wp-admin/images/about-header-privacy-rtl.svg b/src/wp-admin/images/about-header-privacy-rtl.svg index e2b3084e14b55..99a2e2385aec1 100644 --- a/src/wp-admin/images/about-header-privacy-rtl.svg +++ b/src/wp-admin/images/about-header-privacy-rtl.svg @@ -1 +1,52 @@ - \ No newline at end of file + + + + + + imp + ort { registerB + lockType } from '@wordpress/b + locks'; import { useBlockProps, RichText, I + nspectorControls } from '@wordpress/block-editor'; impo + rt { PanelBody, RangeControl } from '@wordpress/components' + ; import { __ } from '@wordpress/i18n'; registerBlockType( + 'vamp/path', { edit( { attributes, setAttributes } ) { cons + t blockProps = useBlockProps(); return ( <> <InspectorContr + ols> <PanelBody title={ __( + 'Spacing', 'vamp' ) }> <Rang + eControl label={ __( 'Tr + acking', 'vamp' ) } valu + e={ attributes.tracking + } onChange={ ( trackin + g ) => setAttributes( { + tracking } ) } min={ 0 + } max={ 20 } /> </Pane + lBody> </InspectorContro + ls> <RichText { ...blockPr + ops } tagName="p" value={ + attributes.content } onCh + ange={ ( content ) => set + Attributes( { content } + ) } /> </> ); }, save( { + attributes } ) { retur + n <RichText.Content { . + ..useBlockProps.save() + } tagName="p" value={ + attributes.content } />; }, } ); import { registerBl + ockType } from '@wordpress/blocks'; import { useBlo + ckProps, RichText, InspectorControls } from '@wor + dpress/block-editor'; import { PanelBody, Ran + geControl } from '@wordpress/components'; + import { __ } from '@wordpress/i18n' + ; registerBlockType( 'vamp/path + ! + { + dit( { + tt ib t + + diff --git a/src/wp-admin/images/about-header-privacy.svg b/src/wp-admin/images/about-header-privacy.svg index ed37fb636362b..91283a2a136e0 100644 --- a/src/wp-admin/images/about-header-privacy.svg +++ b/src/wp-admin/images/about-header-privacy.svg @@ -1 +1,52 @@ - \ No newline at end of file + + + + + + imp + ort { registerB + lockType } from '@wordpress/b + locks'; import { useBlockProps, RichText, I + nspectorControls } from '@wordpress/block-editor'; impo + rt { PanelBody, RangeControl } from '@wordpress/components' + ; import { __ } from '@wordpress/i18n'; registerBlockType( + 'vamp/path', { edit( { attributes, setAttributes } ) { cons + t blockProps = useBlockProps(); return ( <> <InspectorContr + ols> <PanelBody title={ __( + 'Spacing', 'vamp' ) }> <Rang + eControl label={ __( 'Tr + acking', 'vamp' ) } valu + e={ attributes.tracking + } onChange={ ( trackin + g ) => setAttributes( { + tracking } ) } min={ 0 + } max={ 20 } /> </Pane + lBody> </InspectorContro + ls> <RichText { ...blockPr + ops } tagName="p" value={ + attributes.content } onCh + ange={ ( content ) => set + Attributes( { content } + ) } /> </> ); }, save( { + attributes } ) { retur + n <RichText.Content { . + ..useBlockProps.save() + } tagName="p" value={ + attributes.content } />; }, } ); import { registerBl + ockType } from '@wordpress/blocks'; import { useBlo + ckProps, RichText, InspectorControls } from '@wor + dpress/block-editor'; import { PanelBody, Ran + geControl } from '@wordpress/components'; + import { __ } from '@wordpress/i18n' + ; registerBlockType( 'vamp/path + ! + { + dit( { + tt ib t + + diff --git a/src/wp-admin/images/about-release-badge.svg b/src/wp-admin/images/about-release-badge.svg index 845f4817a441f..bd595eda8d392 100644 --- a/src/wp-admin/images/about-release-badge.svg +++ b/src/wp-admin/images/about-release-badge.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/src/wp-admin/images/arrows-2x.png b/src/wp-admin/images/arrows-2x.png index 0b0c53d1a6b19..3c1981c906fe1 100644 Binary files a/src/wp-admin/images/arrows-2x.png and b/src/wp-admin/images/arrows-2x.png differ diff --git a/src/wp-admin/images/icons32-vs-2x.png b/src/wp-admin/images/icons32-vs-2x.png index 9b2dc61f39805..25ea3d299bbb6 100644 Binary files a/src/wp-admin/images/icons32-vs-2x.png and b/src/wp-admin/images/icons32-vs-2x.png differ diff --git a/src/wp-admin/images/list-2x.png b/src/wp-admin/images/list-2x.png index 05c6eb37ffda0..451116870fa82 100644 Binary files a/src/wp-admin/images/list-2x.png and b/src/wp-admin/images/list-2x.png differ diff --git a/src/wp-admin/images/list.png b/src/wp-admin/images/list.png index 85d1295e8131f..6386e484657ea 100644 Binary files a/src/wp-admin/images/list.png and b/src/wp-admin/images/list.png differ diff --git a/src/wp-admin/images/media-button-2x.png b/src/wp-admin/images/media-button-2x.png index b8f8ed4df8c50..88d1755f07625 100644 Binary files a/src/wp-admin/images/media-button-2x.png and b/src/wp-admin/images/media-button-2x.png differ diff --git a/src/wp-admin/images/no.png b/src/wp-admin/images/no.png index 59c35bdccc6d4..3e63e3ea242ab 100644 Binary files a/src/wp-admin/images/no.png and b/src/wp-admin/images/no.png differ diff --git a/src/wp-admin/images/w-logo-blue.png b/src/wp-admin/images/w-logo-blue.png index 11e550c74e07c..ad3e07cc4beb0 100644 Binary files a/src/wp-admin/images/w-logo-blue.png and b/src/wp-admin/images/w-logo-blue.png differ diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 076549b218b82..1f5dd7a7d5c42 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -79,6 +79,8 @@ function wp_ajax_nopriv_heartbeat() { * Handles fetching a list table via AJAX. * * @since 3.1.0 + * + * @return never */ function wp_ajax_fetch_list() { $list_class = $_GET['list_args']['class']; @@ -95,7 +97,7 @@ function wp_ajax_fetch_list() { $wp_list_table->ajax_response(); - wp_die( 0 ); + wp_die( 0 ); // @phpstan-ignore deadCode.unreachable (The wp_list_table_class_name filter can supply a class whose ajax_response() returns.) } /** @@ -1310,12 +1312,33 @@ function wp_ajax_replyto_comment( $action ) { $comment_type = isset( $_POST['comment_type'] ) ? trim( $_POST['comment_type'] ) : 'comment'; + /* + * Notes and reactions are only created through the REST API. The lowercase + * ASCII limit also catches spellings the case- and accent-insensitive + * collation would match. + */ + if ( + ! preg_match( '/^[a-z0-9_-]+\z/', $comment_type ) || + in_array( $comment_type, array( 'note', 'reaction' ), true ) + ) { + wp_die( -1 ); + } + $comment_parent = 0; if ( isset( $_POST['comment_ID'] ) ) { $comment_parent = absint( $_POST['comment_ID'] ); } + // A comment on another post cannot be the parent. + if ( $comment_parent ) { + $parent = get_comment( $comment_parent ); + + if ( $parent && (int) $parent->comment_post_ID !== $comment_post_id ) { + $comment_parent = 0; + } + } + $comment_auto_approved = false; $commentdata = array( @@ -2468,19 +2491,8 @@ function wp_ajax_delete_inactive_widgets() { /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_setup' ); - $sidebars_widgets = wp_get_sidebars_widgets(); - - foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) { - $pieces = explode( '-', $widget_id ); - $multi_number = array_pop( $pieces ); - $id_base = implode( '-', $pieces ); - $widget = get_option( 'widget_' . $id_base ); - unset( $widget[ $multi_number ] ); - update_option( 'widget_' . $id_base, $widget ); - unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] ); - } - - wp_set_sidebars_widgets( $sidebars_widgets ); + require_once ABSPATH . 'wp-admin/includes/widgets.php'; + wp_delete_inactive_widgets(); wp_die(); } @@ -2663,6 +2675,8 @@ function wp_ajax_upload_attachment() { * Handles image editing via AJAX. * * @since 3.1.0 + * + * @return never */ function wp_ajax_image_editor() { $attachment_id = (int) $_POST['postid']; @@ -2684,7 +2698,7 @@ function wp_ajax_image_editor() { } wp_send_json_success( $message ); - break; + break; // @phpstan-ignore deadCode.unreachable (Ends the case so that it does not read as falling through, which PHPCS reports.) case 'scale': $message = wp_save_image( $attachment_id ); break; @@ -2783,6 +2797,8 @@ function wp_ajax_get_post_thumbnail_html() { * @since 4.0.0 * * @see set_post_thumbnail() + * + * @return never */ function wp_ajax_set_attachment_thumbnail() { if ( empty( $_POST['urls'] ) || ! is_array( $_POST['urls'] ) ) { @@ -2828,8 +2844,6 @@ function wp_ajax_set_attachment_thumbnail() { } else { wp_send_json_success(); } - - wp_send_json_error(); } /** diff --git a/src/wp-admin/includes/bookmark.php b/src/wp-admin/includes/bookmark.php index aae87b9abc60f..b7295237ddbde 100644 --- a/src/wp-admin/includes/bookmark.php +++ b/src/wp-admin/includes/bookmark.php @@ -12,6 +12,8 @@ * @since 2.0.0 * * @return int The link ID on success. The value 0 on failure. + * + * @phpstan-return non-negative-int */ function add_link() { return edit_link(); @@ -24,6 +26,8 @@ function add_link() { * * @param int $link_id Optional. ID of the link to edit. Default 0. * @return int The link ID on success. The value 0 on failure. + * + * @phpstan-return non-negative-int */ function edit_link( $link_id = 0 ) { if ( ! current_user_can( 'manage_links' ) ) { @@ -174,7 +178,7 @@ function get_link_to_edit( $link ) { * @param bool $wp_error Optional. Whether to return a WP_Error object on failure. Default false. * @return int|WP_Error The link ID on success. The value 0 or WP_Error on failure. * - * @phpstan-return ( $wp_error is false ? int : int|WP_Error ) + * @phpstan-return ( $wp_error is false ? non-negative-int : non-negative-int|WP_Error ) */ function wp_insert_link( $linkdata, $wp_error = false ) { global $wpdb; @@ -189,10 +193,14 @@ function wp_insert_link( $linkdata, $wp_error = false ) { $parsed_args = wp_parse_args( $linkdata, $defaults ); $parsed_args = wp_unslash( sanitize_bookmark( $parsed_args, 'db' ) ); - $link_id = $parsed_args['link_id']; + $link_id = (int) $parsed_args['link_id']; $link_name = $parsed_args['link_name']; $link_url = $parsed_args['link_url']; + if ( $link_id < 0 ) { + return 0; + } + $update = false; if ( ! empty( $link_id ) ) { $update = true; @@ -301,6 +309,8 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { * * @param array $linkdata Link data to update. See wp_insert_link() for accepted arguments. * @return int The updated link ID on success. The value 0 on failure. + * + * @phpstan-return non-negative-int */ function wp_update_link( $linkdata ) { $link_id = (int) $linkdata['link_id']; diff --git a/src/wp-admin/includes/class-custom-image-header.php b/src/wp-admin/includes/class-custom-image-header.php index 147f44cc1057b..9166bca3cd1b4 100644 --- a/src/wp-admin/includes/class-custom-image-header.php +++ b/src/wp-admin/includes/class-custom-image-header.php @@ -318,6 +318,8 @@ public function process_default_headers() { * * @param string $type The header type. One of 'default' (for the Uploaded Images control) * or 'uploaded' (for the Uploaded Images control). + * + * @phpstan-param 'default'|'uploaded' $type */ public function show_header_selector( $type = 'default' ) { if ( 'default' === $type ) { diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 1dff5d26755ce..92520cad1314e 100644 --- a/src/wp-admin/includes/class-wp-comments-list-table.php +++ b/src/wp-admin/includes/class-wp-comments-list-table.php @@ -20,6 +20,26 @@ class WP_Comments_List_Table extends WP_List_Table { public $pending_count = array(); + /** + * The current list of items. + * + * @since 3.1.0 + * + * @var array + */ + public $items; + + /** + * Extra comments fetched beyond the current page. + * + * These are rendered in the hidden `the-extra-comment-list` table body so that + * rows can be backfilled when comments are removed from the list via Ajax. + * + * @since 3.1.0 + * @since 4.2.0 Declared a previously dynamic property. + * + * @var array + */ public $extra_items; private $user_can; @@ -444,7 +464,7 @@ protected function extra_tablenav( $which ) { if ( ! empty( $output ) && $this->has_items() ) { echo $output; - submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + submit_button( _x( 'Filter', 'verb' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } } @@ -598,6 +618,7 @@ protected function get_default_primary_column_name() { * Overrides the parent display() method to render extra comments. * * @since 3.1.0 + * @since 7.3.0 Added a scrollable wrapper around the table. */ public function display() { wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' ); @@ -612,50 +633,54 @@ public function display() { } $this->screen->render_screen_reader_content( 'heading_list' ); + $table_label = $this->screen->get_screen_reader_text( 'heading_list' ); + // Keep a Tab stop for keyboard scrolling without JavaScript. The script skips it when the table fits. ?> - - ' . - /* translators: Hidden accessibility text. */ - __( 'Ordered by Comment Date, descending.' ) . - ''; - } else { - $this->print_table_description(); - } - ?> - - - print_column_headers(); ?> - - - - - display_rows_or_placeholder(); ?> - - - - items; - $this->items = $this->extra_items; - $this->display_rows_or_placeholder(); - $this->items = $items; - ?> - - - - - print_column_headers( false ); ?> - - - -
+
+ + ' . + /* translators: Hidden accessibility text. */ + __( 'Ordered by Comment Date, descending.' ) . + ''; + } else { + $this->print_table_description(); + } + ?> + + + print_column_headers(); ?> + + + + + display_rows_or_placeholder(); ?> + + + + items; + $this->items = $this->extra_items; + $this->display_rows_or_placeholder(); + $this->items = $items; + ?> + + + + + print_column_headers( false ); ?> + + + +
+
display_tablenav( 'bottom' ); diff --git a/src/wp-admin/includes/class-wp-importer.php b/src/wp-admin/includes/class-wp-importer.php index a1b76e388f04e..5205393458551 100644 --- a/src/wp-admin/includes/class-wp-importer.php +++ b/src/wp-admin/includes/class-wp-importer.php @@ -280,8 +280,8 @@ public function min_whitespace( $text ) { * * @since 3.0.0 * - * @global wpdb $wpdb WordPress database abstraction object. - * @global int[] $wp_actions Stores the number of times each action was triggered. + * @global wpdb $wpdb WordPress database abstraction object. + * @global array $wp_actions Stores the number of times each action was triggered. */ public function stop_the_insanity() { global $wpdb, $wp_actions; diff --git a/src/wp-admin/includes/class-wp-internal-pointers.php b/src/wp-admin/includes/class-wp-internal-pointers.php index 0e11d759a9b0e..1f63c0b068955 100644 --- a/src/wp-admin/includes/class-wp-internal-pointers.php +++ b/src/wp-admin/includes/class-wp-internal-pointers.php @@ -115,6 +115,8 @@ public static function enqueue_scripts( $hook_suffix ) { * @param string $pointer_id The pointer ID. * @param string $selector The HTML elements, on which the pointer should be attached. * @param array $args Arguments to be passed to the pointer JS (see wp-pointer.js). + * + * @phpstan-ignore method.unused (Kept for the pointer_* methods that future admin pointers add to this class.) */ private static function print_js( $pointer_id, $selector, $args ) { if ( empty( $pointer_id ) || empty( $selector ) || empty( $args ) || empty( $args['content'] ) ) { diff --git a/src/wp-admin/includes/class-wp-links-list-table.php b/src/wp-admin/includes/class-wp-links-list-table.php index 6da144bf502ad..629a4923c35a0 100644 --- a/src/wp-admin/includes/class-wp-links-list-table.php +++ b/src/wp-admin/includes/class-wp-links-list-table.php @@ -123,7 +123,7 @@ protected function extra_tablenav( $which ) { wp_dropdown_categories( $dropdown_options ); - submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + submit_button( _x( 'Filter', 'verb' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); ?>

_args['singular']; @@ -1653,32 +1654,37 @@ public function display() { $this->display_tablenav( 'top' ); $this->screen->render_screen_reader_content( 'heading_list' ); - ?> - - print_table_description(); ?> - - - print_column_headers(); ?> - - - - - > - display_rows_or_placeholder(); ?> - + $table_label = $this->screen->get_screen_reader_text( 'heading_list' ); - - - print_column_headers( false ); ?> - - - -
+ // Keep a Tab stop for keyboard scrolling without JavaScript. The script skips it when the table fits. + ?> +
+ + print_table_description(); ?> + + + print_column_headers(); ?> + + + + + > + display_rows_or_placeholder(); ?> + + + + + print_column_headers( false ); ?> + + + +
+
display_tablenav( 'bottom' ); } diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index feac4753d3e92..b4ae67b8fd351 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -242,7 +242,7 @@ protected function extra_tablenav( $which ) { /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ do_action( 'restrict_manage_posts', $this->screen->post_type, $which ); - submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + submit_button( _x( 'Filter', 'verb' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); if ( $this->is_trash && $this->has_items() && current_user_can( 'edit_others_posts' ) diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php index 2738856f8889b..bcd565006732f 100644 --- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -329,7 +329,7 @@ protected function extra_tablenav( $which ) { if ( ! empty( $output ) ) { echo $output; - submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'site-query-submit' ) ); + submit_button( _x( 'Filter', 'verb' ), '', 'filter_action', false, array( 'id' => 'site-query-submit' ) ); } } ?> diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index 6aa9c57cd0c03..6fc03ae64f866 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -113,6 +113,16 @@ public function ajax_user_can() { public function prepare_items() { global $status, $plugins, $totals, $page, $orderby, $order, $s; + if ( ! $this->screen->get_screen_reader_content() ) { + $this->screen->set_screen_reader_content( + array( + 'heading_views' => __( 'Filter plugins list' ), + 'heading_pagination' => __( 'Plugins list navigation' ), + 'heading_list' => __( 'Plugins list' ), + ) + ); + } + $orderby = ! empty( $_REQUEST['orderby'] ) ? sanitize_text_field( $_REQUEST['orderby'] ) : ''; $order = ! empty( $_REQUEST['order'] ) ? sanitize_text_field( $_REQUEST['order'] ) : ''; diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index d461aacd312ae..c7388b63df5c9 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -582,7 +582,7 @@ protected function extra_tablenav( $which ) { if ( ! empty( $output ) ) { echo $output; - submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); + submit_button( _x( 'Filter', 'verb' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); } } diff --git a/src/wp-admin/includes/comment.php b/src/wp-admin/includes/comment.php index 1cfc93144e978..49c2b3d32c421 100644 --- a/src/wp-admin/includes/comment.php +++ b/src/wp-admin/includes/comment.php @@ -47,6 +47,8 @@ function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) { * @since 2.0.0 * @since 5.5.0 A return value was added. * @since 7.1.0 The comment parent can be updated via `$_POST['comment_parent']`. + * @since 7.1.5 Moving a comment to another post is checked against the user's capabilities, + * and the comment type can no longer be changed. * * @return int|WP_Error The value 1 if the comment was updated, 0 if not updated. * A WP_Error object on failure. @@ -75,14 +77,55 @@ function edit_comment() { $_POST['comment_ID'] = (int) $_POST['comment_ID']; } + $comment_id = (int) $_POST['comment_ID']; + $comment = get_comment( $comment_id ); + + // Reactions are only validated on creation. Removing one is a delete. + if ( $comment && 'reaction' === $comment->comment_type ) { + wp_die( __( 'Reactions cannot be edited. Remove the reaction and add a new one instead.' ), 403 ); + } + + /* + * The comment type is not editable from the Edit Comment screen. Changing it + * would turn a private note into a public comment or vice versa, and would + * break the rule that replies share their parent's type. + */ + if ( $comment && isset( $_POST['comment_type'] ) && $_POST['comment_type'] !== $comment->comment_type ) { + return new WP_Error( 'comment_type_invalid', __( 'The comment type cannot be changed.' ) ); + } + + /* + * The capability check above only establishes that the comment may be edited + * where it currently sits, because 'edit_comment' maps to 'edit_post' on the + * comment's current post. Moving the comment to another post has to be + * authorized separately, otherwise a user who can edit a comment on their own + * post could attach it to any post, including posts they can neither read nor + * edit. + */ + + $comment_post_id = $comment ? (int) $comment->comment_post_ID : 0; + + if ( $comment && isset( $_POST['comment_post_ID'] ) ) { + $target_post_id = (int) $_POST['comment_post_ID']; + + $_POST['comment_post_ID'] = $target_post_id; + + if ( $target_post_id !== $comment_post_id ) { + $target_post_check = _wp_check_comment_target_post( $comment, $target_post_id ); + + if ( is_wp_error( $target_post_check ) ) { + return $target_post_check; + } + + $comment_post_id = $target_post_id; + } + } + if ( isset( $_POST['comment_parent'] ) ) { - $comment_id = (int) $_POST['comment_ID']; $comment_parent = (int) $_POST['comment_parent']; $_POST['comment_parent'] = $comment_parent; - $comment = get_comment( $comment_id ); - if ( $comment && $comment_parent && $comment_parent !== (int) $comment->comment_parent ) { if ( ! get_option( 'thread_comments' ) ) { return new WP_Error( 'comment_parent_invalid', __( 'The comment parent cannot be changed because threaded comments are disabled.' ) ); @@ -97,10 +140,10 @@ function edit_comment() { $comment_status = $_POST['comment_approved'] ?? $comment->comment_approved; $comment_is_approved = in_array( $comment_status, array( 1, '1', 'approve' ), true ); - // The parent must be a comment of the same type, on the same post, and publicly visible if the comment is approved. + // The parent must be a comment of the same type, on the post the comment will be on, and publicly visible if the comment is approved. if ( ! $parent - || (int) $parent->comment_post_ID !== (int) $comment->comment_post_ID + || (int) $parent->comment_post_ID !== $comment_post_id || $parent->comment_type !== $comment->comment_type || in_array( $parent_status, array( 'spam', 'trash' ), true ) || ( $comment_is_approved && 'approved' !== $parent_status ) @@ -158,6 +201,19 @@ function edit_comment() { } } + // The checks above only run when the parent changes. A kept parent must be on the destination post too. + if ( $comment && $comment_post_id !== (int) $comment->comment_post_ID ) { + $kept_parent = (int) ( isset( $_POST['comment_parent'] ) && is_numeric( $_POST['comment_parent'] ) ? $_POST['comment_parent'] : $comment->comment_parent ); + + if ( $kept_parent ) { + $parent = get_comment( $kept_parent ); + + if ( ! $parent || (int) $parent->comment_post_ID !== $comment_post_id ) { + return new WP_Error( 'comment_parent_invalid', __( 'Invalid parent comment.' ) ); + } + } + } + foreach ( array( 'aa', 'mm', 'jj', 'hh', 'mn' ) as $timeunit ) { if ( ! empty( $_POST[ 'hidden_' . $timeunit ] ) && $_POST[ 'hidden_' . $timeunit ] !== $_POST[ $timeunit ] ) { $_POST['edit_date'] = '1'; @@ -183,6 +239,85 @@ function edit_comment() { return wp_update_comment( $_POST, true ); } +/** + * Checks that the current user may move a comment to another post. + * + * Mirrors the checks applied by the REST API comments controller when the + * parent post of a comment or note is changed. + * + * @since 7.1.5 + * @access private + * + * @param WP_Comment $comment The comment being moved. + * @param int $post_id ID of the post the comment is being moved to. + * @return true|WP_Error True if the comment may be moved to the post, WP_Error otherwise. + */ +function _wp_check_comment_target_post( WP_Comment $comment, int $post_id ) { + $post = $post_id ? get_post( $post_id ) : null; + + if ( ! $post ) { + return new WP_Error( 'comment_post_invalid', __( 'Invalid post ID.' ) ); + } + + /* + * Notes are editorial content, so they may only be attached to a post the + * user can edit. Any other comment needs either comment moderation rights + * or edit access to the post, matching what 'edit_comment' requires on the + * post the comment is moving away from. + */ + $is_note = 'note' === strtolower( $comment->comment_type ); + + if ( $is_note ) { + $can_target_post = current_user_can( 'edit_post', $post->ID ); + } else { + $can_target_post = current_user_can( 'moderate_comments' ) || current_user_can( 'edit_post', $post->ID ); + } + + if ( ! $can_target_post ) { + return new WP_Error( 'comment_post_invalid', __( 'Sorry, you are not allowed to move this comment to that post.' ) ); + } + + if ( ! $is_note ) { + return true; + } + + $supports_notes = false; + $supports = get_all_post_type_supports( $post->post_type ); + + if ( isset( $supports['editor'] ) && is_array( $supports['editor'] ) ) { + $supports_notes = array_any( + $supports['editor'], + static function ( $item ) { + return is_array( $item ) && ! empty( $item['notes'] ); + } + ); + } + + if ( ! $supports_notes ) { + return new WP_Error( 'comment_post_invalid', __( 'Sorry, this post type does not support notes.' ) ); + } + + if ( 'trash' === $post->post_status || ! current_user_can( 'read_post', $post->ID ) ) { + return new WP_Error( 'comment_post_invalid', __( 'Sorry, you are not allowed to move this comment to that post.' ) ); + } + + // Replies and reactions stay on the note's post, so a move would separate them. + $children = get_comments( + array( + 'parent' => $comment->comment_ID, + 'type' => array( 'note', 'reaction' ), + 'status' => 'any', + 'count' => true, + ) + ); + + if ( $children ) { + return new WP_Error( 'comment_post_invalid', __( 'A note with replies or reactions cannot be moved to another post.' ) ); + } + + return true; +} + /** * Returns a WP_Comment object based on comment ID. * diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 9ba75b74bc4c2..05e6e24f6b0c6 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -6,33 +6,6 @@ * @subpackage Administration */ -/** - * Determines whether the site has ever received a comment. - * - * The result is persisted so the Recent Comments widget remains registered if - * all comments are later deleted, preserving its Screen Options and position. - * - * @since 7.2.0 - * @access private - * - * @return bool Whether the site has received a comment. - */ -function _wp_dashboard_has_received_comments() { - if ( get_option( 'dashboard_recent_comments_widget_registered' ) ) { - return true; - } - - $comment_count = wp_count_comments(); - - if ( empty( $comment_count->all ) ) { - return false; - } - - update_option( 'dashboard_recent_comments_widget_registered', 1, false ); - - return true; -} - /** * Registers dashboard widgets. * @@ -109,11 +82,6 @@ function wp_dashboard_setup() { wp_add_dashboard_widget( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_site_activity' ); } - // Recent Comments Widget. - if ( is_blog_admin() && _wp_dashboard_has_received_comments() ) { - wp_add_dashboard_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments_widget' ); - } - // QuickPress Widget. if ( is_blog_admin() && current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { $quick_draft_title = sprintf( '%1$s %2$s', __( 'Quick Draft' ), __( 'Your Recent Drafts' ) ); @@ -975,14 +943,12 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { * Callback function for {@see 'dashboard_activity'}. * * @since 3.8.0 - * @since 7.2.0 Added the On This Day section and moved Recent Comments to a dedicated widget. */ function wp_dashboard_site_activity() { echo '
'; - $on_this_day_posts = wp_dashboard_on_this_day_get_posts(); - $future_posts = wp_dashboard_recent_posts( + $future_posts = wp_dashboard_recent_posts( array( 'max' => 5, 'status' => 'future', @@ -991,20 +957,19 @@ function wp_dashboard_site_activity() { 'id' => 'future-posts', ) ); - $recent_posts = wp_dashboard_recent_posts( + $recent_posts = wp_dashboard_recent_posts( array( - 'max' => 5, - 'status' => 'publish', - 'order' => 'DESC', - 'title' => __( 'Recently Published' ), - 'id' => 'published-posts', - 'exclude' => wp_list_pluck( $on_this_day_posts, 'ID' ), + 'max' => 5, + 'status' => 'publish', + 'order' => 'DESC', + 'title' => __( 'Recently Published' ), + 'id' => 'published-posts', ) ); - $on_this_day_rendered = wp_dashboard_on_this_day( $on_this_day_posts ); + $recent_comments = wp_dashboard_recent_comments(); - if ( ! $future_posts && ! $recent_posts && ! $on_this_day_rendered ) { + if ( ! $future_posts && ! $recent_posts && ! $recent_comments ) { echo '
'; echo '

' . __( 'No activity yet!' ) . '

'; echo '
'; @@ -1013,176 +978,6 @@ function wp_dashboard_site_activity() { echo '
'; } -/** - * Outputs the On This Day section of the Activity widget. - * - * @since 7.2.0 - * - * @param WP_Post[]|null $posts Optional. Posts to render. Defaults to querying for posts. - * @return bool False if no posts were found. True otherwise. - */ -function wp_dashboard_on_this_day( $posts = null ) { - if ( null === $posts ) { - $posts = wp_dashboard_on_this_day_get_posts(); - } - - if ( empty( $posts ) ) { - return false; - } - - echo '
'; - echo '

' . esc_html__( 'Published On This Day' ) . '

'; - echo '
    '; - - foreach ( $posts as $post ) { - /* translators: Date format for posts published in a previous year. */ - $date = get_the_date( __( 'M jS, Y' ), $post ); - - $title = get_the_title( $post ); - - if ( '' === trim( $title ) ) { - $title = __( '(no title)' ); - - if ( current_user_can( 'read_post', $post->ID ) && ! post_password_required( $post ) ) { - $excerpt = get_the_excerpt( $post ); - - if ( is_string( $excerpt ) && '' !== $excerpt ) { - $title .= ' ' . wp_trim_words( $excerpt, 15 ); - } - } - } - - $can_edit = current_user_can( 'edit_post', $post->ID ); - $link = $can_edit ? get_edit_post_link( $post->ID ) : get_permalink( $post ); - - if ( $can_edit ) { - /* translators: %s: Post title. */ - $aria_label = sprintf( __( 'Edit “%s”' ), $title ); - } else { - /* translators: %s: Post title. */ - $aria_label = sprintf( __( 'View “%s”' ), $title ); - } - - $author_id = (int) $post->post_author; - $author_name = $author_id > 0 ? (string) get_the_author_meta( 'display_name', $author_id ) : ''; - - printf( - '
  • %1$s%4$s', - esc_html( $date ), - esc_url( $link ), - esc_attr( $aria_label ), - esc_html( $title ) - ); - - if ( '' !== trim( $author_name ) && get_current_user_id() !== $author_id ) { - printf( - ' ', - esc_html( - sprintf( - /* translators: %s: Post author's display name. */ - __( 'by %s' ), - $author_name - ) - ) - ); - } - - echo '
  • '; - } - - echo '
'; - echo '
'; - - return true; -} - -/** - * Retrieves posts published on this calendar day in previous years. - * - * Up to ten posts are returned by default. Use the - * {@see 'wp_dashboard_on_this_day_query_args'} filter to change the limit. - * Results are cached by WP_Query's native query caching. - * - * @since 7.2.0 - * - * @return WP_Post[] Array of posts ordered by newest first. - */ -function wp_dashboard_on_this_day_get_posts() { - $today = current_datetime(); - $year = (int) $today->format( 'Y' ); - - $args = array( - 'post_type' => 'post', - 'post_status' => array( 'publish' ), - 'posts_per_page' => 10, - 'ignore_sticky_posts' => true, - 'orderby' => 'date', - 'order' => 'DESC', - 'no_found_rows' => true, - 'update_post_term_cache' => false, - 'update_post_meta_cache' => false, - 'date_query' => array( - 'relation' => 'AND', - array( - 'before' => array( 'year' => $year ), - ), - _wp_dashboard_on_this_day_date_query_clause( $today ), - ), - ); - - /** - * Filters the arguments used to query posts for the On This Day section. - * - * @since 7.2.0 - * - * @param array $args WP_Query arguments. - */ - $args = apply_filters( 'wp_dashboard_on_this_day_query_args', $args ); - - $query = new WP_Query( $args ); - - return $query->posts; -} - -/** - * Builds the date query clause for today's anniversary date. - * - * On February 28 in a non-leap year, February 29 posts are included so - * leap-day anniversaries still appear. - * - * @since 7.2.0 - * @access private - * - * @param DateTimeInterface $date Date to build the clause for. - * @return array Date query clause. - */ -function _wp_dashboard_on_this_day_date_query_clause( $date ) { - $month = (int) $date->format( 'm' ); - $day = (int) $date->format( 'd' ); - $clause = array( - 'month' => $month, - 'day' => $day, - ); - - // Display leap day posts on February 28 in non-leap years. - if ( - 28 === $day - && 2 === $month - && false === (bool) $date->format( 'L' ) - ) { - $clause = array( - 'relation' => 'OR', - $clause, - array( - 'month' => 2, - 'day' => 29, - ), - ); - } - - return $clause; -} - /** * Generates Publishing Soon and Recently Published sections. * @@ -1196,7 +991,6 @@ function _wp_dashboard_on_this_day_date_query_clause( $date ) { * @type string $order Designates ascending ('ASC') or descending ('DESC') order. * @type string $title Section title. * @type string $id The container id. - * @type int[] $exclude Optional. Post IDs to exclude. * } * @return bool False if no posts were found. True otherwise. */ @@ -1212,10 +1006,6 @@ function wp_dashboard_recent_posts( $args ) { 'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable', ); - if ( ! empty( $args['exclude'] ) ) { - $query_args['post__not_in'] = array_map( 'intval', $args['exclude'] ); - } - /** * Filters the query arguments used for the Recent Posts widget. * @@ -1287,29 +1077,14 @@ function wp_dashboard_recent_posts( $args ) { } /** - * Outputs the Recent Comments dashboard widget. - * - * Callback function for {@see 'dashboard_recent_comments'}. - * - * @since 7.2.0 - */ -function wp_dashboard_recent_comments_widget() { - if ( ! wp_dashboard_recent_comments( 5, false ) ) { - echo '

' . esc_html__( 'No comments to show.' ) . '

'; - } -} - -/** - * Outputs recent comments. + * Show Comments section. * * @since 3.8.0 - * @since 7.2.0 Moved from the Activity widget to a dedicated dashboard widget. * - * @param int $total_items Optional. Number of comments to query. Default 5. - * @param bool $show_title Optional. Whether to display the section title. Default true. + * @param int $total_items Optional. Number of comments to query. Default 5. * @return bool False if no comments were found. True otherwise. */ -function wp_dashboard_recent_comments( $total_items = 5, $show_title = true ) { +function wp_dashboard_recent_comments( $total_items = 5 ) { // Select all comment types and filter out spam later for better query performance. $comments = array(); @@ -1353,10 +1128,7 @@ function wp_dashboard_recent_comments( $total_items = 5, $show_title = true ) { if ( $comments ) { echo '
'; - - if ( $show_title ) { - echo '

' . esc_html__( 'Recent Comments' ) . '

'; - } + echo '

' . __( 'Recent Comments' ) . '

'; echo '
    '; foreach ( $comments as $comment ) { diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php index b3aaad1ad9a2f..e39f332e7f0d5 100644 --- a/src/wp-admin/includes/deprecated.php +++ b/src/wp-admin/includes/deprecated.php @@ -1386,10 +1386,15 @@ function wp_dashboard_plugins_output( $rss, $args = array() ) { $raw_title = $item->get_title(); $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&TB_iframe=true&width=600&height=800'; + $install_label = sprintf( + /* translators: %s: Plugin name. */ + _x( 'Install %s', 'plugin' ), + $raw_title + ); + echo '
  • ' . __( 'Popular Plugin' ) . ': ' . esc_html( $raw_title ) . ' (' . __( 'Install' ) . ')
  • '; + esc_attr( $install_label ) . '">(' . __( 'Install' ) . ')'; $feed->__destruct(); unset( $feed ); diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 9f5b87ce85f93..543d2c7f89766 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -1237,6 +1237,8 @@ function image_align_input_fields( $post, $checked = '' ) { * @param WP_Post $post * @param bool|string $check * @return array An array of data for the image size input fields. + * + * @phpstan-return array{label: string, input: 'html', html: string} */ function image_size_input_fields( $post, $check = '' ) { /** @@ -1937,6 +1939,8 @@ function get_media_item( $attachment_id, $args = null ) { * @param int $attachment_id * @param array $args * @return array An array containing the media item and its metadata. + * + * @phpstan-return array{item: string, meta: string} */ function get_compat_media_markup( $attachment_id, $args = null ) { $post = get_post( $attachment_id ); diff --git a/src/wp-admin/includes/ms.php b/src/wp-admin/includes/ms.php index 8e3c141af2850..ff9fb830c4d2a 100644 --- a/src/wp-admin/includes/ms.php +++ b/src/wp-admin/includes/ms.php @@ -1187,6 +1187,8 @@ function network_edit_site_nav( $args = array() ) { * @since 4.9.0 * * @return array Help tab arguments. + * + * @phpstan-return array{id: non-falsy-string, title: string, content: non-falsy-string} */ function get_site_screen_help_tab_args() { return array( diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index dc90feb3b3309..68726f4062cde 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -1348,6 +1348,16 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) { * @since 3.0.0 * * @return string[] Array of column titles keyed by their column name. + * + * @phpstan-return array{ + * _title: string, + * cb: non-falsy-string, + * link-target: string, + * title-attribute: string, + * css-classes: string, + * xfn: string, + * description: string, + * } */ function wp_nav_menu_manage_columns() { return array( diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index f08f81766df67..7d900970fd0cc 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1220,6 +1220,8 @@ function _fix_attachment_links( $post ) { * * @param string $type The post_type you want the statuses for. Default 'post'. * @return string[] An array of all the statuses for the supplied post type. + * + * @phpstan-return list */ function get_available_post_statuses( $type = 'post' ) { $statuses = wp_count_posts( $type ); diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php index 17e660c8c0d0e..f0a53f265185c 100644 --- a/src/wp-admin/includes/privacy-tools.php +++ b/src/wp-admin/includes/privacy-tools.php @@ -587,6 +587,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) { * Send an email to the user with a link to the personal data export file * * @since 4.9.6 + * @since 7.2.0 Returns a `WP_Error` if the request is not confirmed or completed. * * @param int $request_id The request ID for this personal data export. * @return true|WP_Error True on success or `WP_Error` on failure. @@ -599,6 +600,10 @@ function wp_privacy_send_personal_data_export_email( $request_id ) { return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) ); } + if ( ! in_array( $request->status, array( 'request-confirmed', 'request-completed' ), true ) ) { + return new WP_Error( 'invalid_request', __( 'Invalid request status when sending personal data export email.' ) ); + } + // Localize message content for user; fallback to site default for visitors. if ( ! empty( $request->user_id ) ) { $switched_locale = switch_to_user_locale( $request->user_id ); diff --git a/src/wp-admin/includes/taxonomy.php b/src/wp-admin/includes/taxonomy.php index dbdab1af4fab8..73677c9d7617d 100644 --- a/src/wp-admin/includes/taxonomy.php +++ b/src/wp-admin/includes/taxonomy.php @@ -119,7 +119,7 @@ function wp_create_categories( $categories, $post_id = 0 ) { * depending on param `$wp_error`. * * @phpstan-return ( - * $wp_error is false ? int : int|WP_Error + * $wp_error is false ? non-negative-int : non-negative-int|WP_Error * ) */ function wp_insert_category( $catarr, $wp_error = false ) { @@ -188,6 +188,8 @@ function wp_insert_category( $catarr, $wp_error = false ) { * * @param array $catarr The 'cat_ID' value is required. All other keys are optional. * @return int|false The ID number of the new or updated Category on success. Zero or FALSE on failure. + * + * @phpstan-return non-negative-int|false */ function wp_update_category( $catarr ) { $cat_id = (int) $catarr['cat_ID']; diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index c4496dea3d403..b9c2779c08187 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -1290,6 +1290,8 @@ function _get_plugin_from_callback( $callback ) { * Often this is the object that's the focus of the current screen, * for example a `WP_Post` or `WP_Comment` object. * @return int Number of meta_boxes. + * + * @phpstan-return non-negative-int */ function do_meta_boxes( $screen, $context, $data_object ) { global $wp_meta_boxes; diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 22d9c3e2f463d..1aa79b39a8614 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -1171,6 +1171,18 @@ * 'wp-includes/images/icon-library/wordpress.svg', */ // 7.2 + 'wp-includes/css/dist/block-editor/default-editor-styles.css', + 'wp-includes/css/dist/block-editor/default-editor-styles.min.css', + 'wp-includes/css/dist/block-editor/default-editor-styles-rtl.css', + 'wp-includes/css/dist/block-editor/default-editor-styles-rtl.min.css', + 'wp-includes/js/dist/script-modules/block-library/form/view.js', + 'wp-includes/js/dist/script-modules/block-library/form/view.min.js', + 'wp-includes/js/dist/script-modules/block-library/form/view.min.asset.php', + 'wp-includes/js/dist/script-modules/block-library/form/', + 'wp-includes/js/dist/script-modules/content-types/index.js', + 'wp-includes/js/dist/script-modules/content-types/index.min.js', + 'wp-includes/js/dist/script-modules/content-types/index.min.asset.php', + 'wp-includes/js/dist/script-modules/content-types/', 'wp-includes/js/dist/sync.js', 'wp-includes/js/dist/sync.min.js', ); diff --git a/src/wp-admin/includes/update.php b/src/wp-admin/includes/update.php index e7b02a2a62c8a..0e2f1da4e19ab 100644 --- a/src/wp-admin/includes/update.php +++ b/src/wp-admin/includes/update.php @@ -385,8 +385,11 @@ function update_right_now_message() { $msg .= sprintf( '%s', network_admin_url( 'update-core.php' ), - /* translators: %s: WordPress version number, or 'Latest' string. */ - sprintf( __( 'Update to %s' ), $cur->current ? $cur->current : __( 'Latest' ) ) + sprintf( + /* translators: %s: WordPress version number, or 'Latest' string. */ + __( 'Update to %s' ), + $cur->current ? $cur->current : __( 'Latest' ) + ) ); } } @@ -655,6 +658,30 @@ function wp_get_translation_update_plugin_names() { $all_plugins = get_plugins(); $plugin_update = get_site_transient( 'update_plugins' ); + /* + * Keys are added from the least to the most reliable, so a later key replaces an + * earlier one: main file names, then plugin files and directories, then the slugs + * from the plugin update data. Otherwise a plugin whose main file is named after + * another plugin's slug would show that plugin's name. + */ + foreach ( $all_plugins as $plugin_file => $plugin_data ) { + if ( isset( $plugin_data['Name'] ) ) { + $plugin_names[ basename( $plugin_file, '.php' ) ] = $plugin_data['Name']; + } + } + + foreach ( $all_plugins as $plugin_file => $plugin_data ) { + $plugin_basename = dirname( $plugin_file ); + + if ( isset( $plugin_data['Name'] ) ) { + $plugin_names[ $plugin_file ] = $plugin_data['Name']; + + if ( '.' !== $plugin_basename ) { + $plugin_names[ $plugin_basename ] = $plugin_data['Name']; + } + } + } + if ( is_object( $plugin_update ) ) { $plugin_updates = array(); @@ -675,19 +702,6 @@ function wp_get_translation_update_plugin_names() { } } - foreach ( $all_plugins as $plugin_file => $plugin_data ) { - $plugin_basename = dirname( $plugin_file ); - - if ( isset( $plugin_data['Name'] ) ) { - $plugin_names[ $plugin_file ] = $plugin_data['Name']; - $plugin_names[ basename( $plugin_file, '.php' ) ] = $plugin_data['Name']; - - if ( '.' !== $plugin_basename ) { - $plugin_names[ $plugin_basename ] = $plugin_data['Name']; - } - } - } - return $plugin_names; } diff --git a/src/wp-admin/includes/widgets.php b/src/wp-admin/includes/widgets.php index 360b51798d32c..a505ad74ec0cf 100644 --- a/src/wp-admin/includes/widgets.php +++ b/src/wp-admin/includes/widgets.php @@ -326,3 +326,32 @@ function wp_widget_control( $sidebar_args ) { function wp_widgets_access_body_class( $classes ) { return "$classes widgets_access "; } + +/** + * Removes all widgets from the inactive widgets sidebar and their corresponding settings. + * + * @since 7.3.0 + */ +function wp_delete_inactive_widgets(): void { + $sidebars_widgets = wp_get_sidebars_widgets(); + + $inactive_widgets = $sidebars_widgets['wp_inactive_widgets'] ?? array(); + if ( ! is_array( $inactive_widgets ) || 0 === count( $inactive_widgets ) ) { + return; + } + + foreach ( $inactive_widgets as $widget_id ) { + $pieces = explode( '-', $widget_id ); + $multi_number = array_pop( $pieces ); + $id_base = implode( '-', $pieces ); + $widget = get_option( 'widget_' . $id_base ); + + if ( is_array( $widget ) ) { + unset( $widget[ $multi_number ] ); + update_option( 'widget_' . $id_base, $widget ); + } + } + + $sidebars_widgets['wp_inactive_widgets'] = array(); + wp_set_sidebars_widgets( $sidebars_widgets ); +} diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 85ae31b68b5ae..4a6a57c4be30b 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -27,7 +27,6 @@ * We are installing WordPress. * * @since 1.5.1 - * @var bool */ define( 'WP_INSTALLING', true ); diff --git a/src/wp-admin/network/site-info.php b/src/wp-admin/network/site-info.php index 736cf6a07e83d..4a72a26d85918 100644 --- a/src/wp-admin/network/site-info.php +++ b/src/wp-admin/network/site-info.php @@ -215,7 +215,7 @@
    -
    +
    diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index 62e904accaac2..1d04b8cdf251b 100644 --- a/src/wp-admin/plugins.php +++ b/src/wp-admin/plugins.php @@ -630,14 +630,6 @@ '

    ' . __( 'Support forums' ) . '

    ' ); -get_current_screen()->set_screen_reader_content( - array( - 'heading_views' => __( 'Filter plugins list' ), - 'heading_pagination' => __( 'Plugins list navigation' ), - 'heading_list' => __( 'Plugins list' ), - ) -); - // Used in the HTML title tag. $title = __( 'Plugins' ); $parent_file = 'plugins.php'; diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index 3cb4a9048d536..7d685cffe30bf 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -125,7 +125,7 @@ check_admin_referer( 'add-' . $post_type ); $post_id = 'postajaxpost' === $action ? edit_post() : write_post(); redirect_post( $post_id ); - exit; + exit; // @phpstan-ignore deadCode.unreachable (Ends the case so that it does not read as falling through, which PHPCS reports.) case 'edit': $editing = true; @@ -245,7 +245,7 @@ redirect_post( $post_id ); // Send user on their way while we keep working. - exit; + exit; // @phpstan-ignore deadCode.unreachable (Ends the case so that it does not read as falling through into the trash case.) case 'trash': check_admin_referer( 'trash-post_' . $post_id ); diff --git a/src/wp-admin/profile.php b/src/wp-admin/profile.php index 18fb60069ba75..e7afba6631c6c 100644 --- a/src/wp-admin/profile.php +++ b/src/wp-admin/profile.php @@ -10,7 +10,6 @@ * This is a profile page. * * @since 2.5.0 - * @var bool */ define( 'IS_PROFILE_PAGE', true ); diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index 90e4d4aa60382..8e3946dfe53ed 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -1358,18 +1358,35 @@ function do_undismiss_core_update() { check_admin_referer( 'upgrade-translations' ); // Requests without the form's update identifiers must not install all translations. - $translation_update_ids = array_unique( - array_map( - 'sanitize_text_field', - wp_unslash( (array) ( $_POST['translations'] ?? array() ) ) - ) - ); - $selected_translation_update_ids = array_unique( - array_map( - 'sanitize_text_field', - wp_unslash( (array) ( $_POST['checked'] ?? array() ) ) - ) - ); + if ( isset( $_POST['translations'] ) ) { + $translation_update_ids = array_unique( + array_map( + 'sanitize_text_field', + wp_unslash( (array) $_POST['translations'] ) + ) + ); + $selected_translation_update_ids = array_unique( + array_map( + 'sanitize_text_field', + wp_unslash( (array) ( $_POST['checked'] ?? array() ) ) + ) + ); + } elseif ( isset( $_GET['translations'] ) && is_string( $_GET['translations'] ) ) { + /* + * The filesystem credentials form posts back to the upgrader URL without the + * fields of the Updates screen form, so the URL carries the selected updates. + */ + $translation_update_ids = array_unique( + array_map( + 'sanitize_text_field', + explode( ',', wp_unslash( $_GET['translations'] ) ) + ) + ); + $selected_translation_update_ids = $translation_update_ids; + } else { + $translation_update_ids = array(); + $selected_translation_update_ids = array(); + } $selected_translation_updates = wp_process_translation_update_selection( $translation_update_ids, $selected_translation_update_ids ); @@ -1386,7 +1403,7 @@ function do_undismiss_core_update() { require_once ABSPATH . 'wp-admin/admin-header.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - $url = 'update-core.php?action=do-translation-upgrade'; + $url = 'update-core.php?action=do-translation-upgrade&translations=' . urlencode( implode( ',', array_keys( $selected_translation_updates ) ) ); $nonce = 'upgrade-translations'; $title = __( 'Update Translations' ); $context = WP_LANG_DIR; diff --git a/src/wp-admin/upgrade.php b/src/wp-admin/upgrade.php index 69a7b7693b44e..da84dc4466ccc 100644 --- a/src/wp-admin/upgrade.php +++ b/src/wp-admin/upgrade.php @@ -10,7 +10,6 @@ * We are upgrading WordPress. * * @since 1.5.1 - * @var bool */ define( 'WP_INSTALLING', true ); diff --git a/src/wp-admin/widgets-form.php b/src/wp-admin/widgets-form.php index 25ee8215b9678..79d3b2078202b 100644 --- a/src/wp-admin/widgets-form.php +++ b/src/wp-admin/widgets-form.php @@ -206,17 +206,7 @@ check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); if ( $_POST['removeinactivewidgets'] ) { - foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) { - $pieces = explode( '-', $widget_id ); - $multi_number = array_pop( $pieces ); - $id_base = implode( '-', $pieces ); - $widget = get_option( 'widget_' . $id_base ); - unset( $widget[ $multi_number ] ); - update_option( 'widget_' . $id_base, $widget ); - unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] ); - } - - wp_set_sidebars_widgets( $sidebars_widgets ); + wp_delete_inactive_widgets(); } wp_redirect( admin_url( 'widgets.php?message=0' ) ); diff --git a/src/wp-content/themes/ipsum/DESIGN.md b/src/wp-content/themes/ipsum/DESIGN.md index b37a7a4f43745..f00e8e3b1fa32 100644 --- a/src/wp-content/themes/ipsum/DESIGN.md +++ b/src/wp-content/themes/ipsum/DESIGN.md @@ -30,7 +30,7 @@ How the palettes are built: ### Usage rules - **Use the slugs, never literal colors.** `var(--wp--preset--color--contrast)` in CSS, `var:preset|color|contrast` in block attributes, or `textColor` and `backgroundColor`. A literal hex freezes one variation's look into all the others. -- **Text is Contrast.** Body, headings and links all use it. Hover goes to Strong Contrast. Contrast is translucent in the light palettes, so it only reads as intended on Base or Surface; on any other ground, use Strong Contrast. +- **Text is Contrast.** Body, headings and links all use it. Hover goes to Strong Contrast. Contrast is translucent in the light palettes, so it only reads as intended on Base or Surface; on any other ground, use Strong Contrast. The editor's "Transparent text may be hard for people to read" notice is expected for it; keep the alpha. - **Links** have a dotted 1px underline. On hover they turn Strong Contrast and lose the underline. Navigation, post title, post navigation and pagination links do the reverse: no underline until hover. - **Buttons** fill with Contrast, with Base text, and fill with Strong Contrast on hover. Focus and press use Contrast at 85% (`color-mix()`). The Outline style keeps a Contrast border and fills with Surface on hover. - **Form fields** in Search and the comment form are Base with Contrast text and border. The border turns Strong Contrast on hover. Jetpack form fields get the same border. @@ -75,7 +75,7 @@ It isn't a preset you can pick. New meta text needs Manrope, Small and weight 60 | `medium` | Medium | Body text, h4, navigation, verse | | `large` | Large | h3 | | `x-large` | X-Large | h2 | -| `2-x-large` | 2X-Large | h1, single post titles, quote marks | +| `xx-large` | 2X-Large | h1, single post titles, quote marks | Small to Large are fixed; X-Large and 2X-Large are fluid, smaller on narrow screens. The sizes are in `theme.json`. Above 2X-Large, the theme uses the Display block style (`is-style-text-display`) or fit text (Hero Epigraph, About Row, the 404 heading, the Footer Centered wordmark). Core's default sizes are off. diff --git a/src/wp-content/themes/ipsum/accessibility.txt b/src/wp-content/themes/ipsum/accessibility.txt new file mode 100644 index 0000000000000..624c1b6a5df96 --- /dev/null +++ b/src/wp-content/themes/ipsum/accessibility.txt @@ -0,0 +1,45 @@ +=== Accessibility Statement === + +Ipsum is built to be usable by as many people as possible, including people who use a keyboard, a screen reader, zoom or other assistive technology. It follows the WordPress accessibility-ready theme guidelines and aims for WCAG 2.2 Level AA. Accessibility is reviewed as part of the normal development work. + +== Quick Information == + +Accessibility audit completed: No + +== Testing Tools and Methodology == + +Ipsum is tested against the [WordPress accessibility-ready theme guidelines](https://wpaccessibility.org/docs/accessibility-ready/theme-guidelines/), using the [accessibility theme unit test content](https://github.com/wpaccessibility/a11y-theme-unit-test). + +Testing includes: + +* Keyboard-only navigation of every template, the navigation overlay, submenus, search and the comment form. +* Checking landmarks, landmark names and heading levels in every template and pattern. +* Checking the color contrast of text and controls in every color style variation. +* Zooming to 400% and checking that content reflows without horizontal scrolling. +* Checking that motion is turned off when the visitor prefers reduced motion. +* Automated checks with browser tools such as axe DevTools and WAVE. + +== Screen Reader Text Class == + +`.screen-reader-text` + +WordPress provides the styles for this class to block themes. Enter `screen-reader-text`, without the leading period, in a block's Advanced > Additional CSS class(es) field to hide the block visually while keeping it available to screen readers. + +== Accessibility Features == + +* A skip link to the main content. +* A visible focus outline on every focusable element. Links and most controls use a dotted outline in the text color, so it stays visible in every color style variation, and focused elements are kept clear of the sticky header. +* Links in text are underlined. +* Named landmarks for repeated navigation and search regions. +* Every color style variation keeps text contrast at 4.5:1 or more. +* Page transitions and the arrival bar on single posts only run when the visitor has not asked for reduced motion. +* Long words and URLs wrap, so pages reflow when zoomed in. +* Decorative characters, such as separators and arrows, are hidden from screen readers. + +== Accessibility Help Contact == + +For assistance with accessibility in WordPress and core themes, contact the accessibility team at [Make WordPress Accessibility](https://make.wordpress.org/accessibility). + +== Where to Report Issues == + +Please report accessibility issues in the [WordPress Core Ticket Tracker](https://core.trac.wordpress.org/newticket), under the Bundled Theme component with the accessibility focus. diff --git a/src/wp-content/themes/ipsum/functions.php b/src/wp-content/themes/ipsum/functions.php index eab1a8be0e4fa..0df9a374477fd 100644 --- a/src/wp-content/themes/ipsum/functions.php +++ b/src/wp-content/themes/ipsum/functions.php @@ -280,6 +280,9 @@ function ipsum_register_block_styles() { * Outlines the Search button until it is hovered, focused or pressed, when * the global button states take back over. A theme.json css string would * wrap this in :where() and only tie with the global button styles. + * The icon button keeps a transparent border in those states, so it does + * not shrink by 2px under the pointer on hover, which made it flicker. + * The text button already has a border there from theme.json. */ register_block_style( 'core/search', @@ -287,6 +290,10 @@ function ipsum_register_block_styles() { 'name' => 'outline', 'label' => _x( 'Outline', 'Block style label', 'ipsum' ), 'inline_style' => ' + .wp-block-search.is-style-outline .wp-block-search__button.has-icon.wp-element-button { + border: 1px solid transparent; + } + .wp-block-search.is-style-outline .wp-block-search__button.wp-element-button:not(:hover):not(:focus):not(:active) { background-color: var(--wp--preset--color--base); border: 1px dotted var(--wp--preset--color--contrast); diff --git a/src/wp-content/themes/ipsum/patterns/archive-compact.php b/src/wp-content/themes/ipsum/patterns/archive-compact.php index 6003de8242e99..950404f6a2515 100644 --- a/src/wp-content/themes/ipsum/patterns/archive-compact.php +++ b/src/wp-content/themes/ipsum/patterns/archive-compact.php @@ -16,7 +16,7 @@
    -
    +
    @@ -29,7 +29,7 @@
    - +
    diff --git a/src/wp-content/themes/ipsum/patterns/archive-full.php b/src/wp-content/themes/ipsum/patterns/archive-full.php index bf155d31dc2e2..a57c4636389ae 100644 --- a/src/wp-content/themes/ipsum/patterns/archive-full.php +++ b/src/wp-content/themes/ipsum/patterns/archive-full.php @@ -16,11 +16,11 @@
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/archive-lead.php b/src/wp-content/themes/ipsum/patterns/archive-lead.php index 0147ac78650d7..80e55f8690817 100644 --- a/src/wp-content/themes/ipsum/patterns/archive-lead.php +++ b/src/wp-content/themes/ipsum/patterns/archive-lead.php @@ -23,7 +23,7 @@
    -
    +
    @@ -36,7 +36,7 @@
    - +
    diff --git a/src/wp-content/themes/ipsum/patterns/archive-standard.php b/src/wp-content/themes/ipsum/patterns/archive-standard.php index fb7d77cb3c7b8..06b3046226bd9 100644 --- a/src/wp-content/themes/ipsum/patterns/archive-standard.php +++ b/src/wp-content/themes/ipsum/patterns/archive-standard.php @@ -16,11 +16,11 @@
    -
    +
    -
    +
    @@ -33,7 +33,7 @@
    - +
    diff --git a/src/wp-content/themes/ipsum/patterns/cta-membership.php b/src/wp-content/themes/ipsum/patterns/cta-membership.php index 89b0ea937a1c0..ccb9c86d07af8 100644 --- a/src/wp-content/themes/ipsum/patterns/cta-membership.php +++ b/src/wp-content/themes/ipsum/patterns/cta-membership.php @@ -20,8 +20,8 @@
    -
    -

    +
    +

    diff --git a/src/wp-content/themes/ipsum/patterns/cta-search.php b/src/wp-content/themes/ipsum/patterns/cta-search.php index 35aca2d15f245..3485141e0e14d 100644 --- a/src/wp-content/themes/ipsum/patterns/cta-search.php +++ b/src/wp-content/themes/ipsum/patterns/cta-search.php @@ -13,8 +13,8 @@ ?>
    -
    -

    +
    +

    diff --git a/src/wp-content/themes/ipsum/patterns/hero-colophon.php b/src/wp-content/themes/ipsum/patterns/hero-colophon.php index 8a57c7778f12a..47a5c8720c1b7 100644 --- a/src/wp-content/themes/ipsum/patterns/hero-colophon.php +++ b/src/wp-content/themes/ipsum/patterns/hero-colophon.php @@ -18,8 +18,8 @@
    -
    -

    +
    +

    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-archive-sidebar.php b/src/wp-content/themes/ipsum/patterns/hidden-archive-sidebar.php index e6bea2a02fb26..992cbf0615c7d 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-archive-sidebar.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-archive-sidebar.php @@ -15,7 +15,7 @@
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-index-sidebar.php b/src/wp-content/themes/ipsum/patterns/hidden-index-sidebar.php index 3b1be9f7c61c5..03c304ccc687a 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-index-sidebar.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-index-sidebar.php @@ -19,16 +19,16 @@ -
    +
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-index.php b/src/wp-content/themes/ipsum/patterns/hidden-index.php index 734e3e4e6704e..a6d3a58291d78 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-index.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-index.php @@ -22,11 +22,11 @@
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-page-sidebar.php b/src/wp-content/themes/ipsum/patterns/hidden-page-sidebar.php index 278095cffb46d..f7d1d0936b1b3 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-page-sidebar.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-page-sidebar.php @@ -15,13 +15,13 @@
    -
    +
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-page.php b/src/wp-content/themes/ipsum/patterns/hidden-page.php index 3af59b56ff7f2..ce9dcc18a9cd1 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-page.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-page.php @@ -15,11 +15,11 @@
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-search.php b/src/wp-content/themes/ipsum/patterns/hidden-search.php index 2bb95eb90e4bc..92d15eea21401 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-search.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-search.php @@ -24,7 +24,7 @@
    -
    +
    @@ -37,7 +37,7 @@
    - +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-single-sidebar.php b/src/wp-content/themes/ipsum/patterns/hidden-single-sidebar.php index e50487b0dcc5a..2b491a8ad7cca 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-single-sidebar.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-single-sidebar.php @@ -15,13 +15,13 @@
    -
    +
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/hidden-single.php b/src/wp-content/themes/ipsum/patterns/hidden-single.php index 8bc6ceca0f5bc..840960146d256 100644 --- a/src/wp-content/themes/ipsum/patterns/hidden-single.php +++ b/src/wp-content/themes/ipsum/patterns/hidden-single.php @@ -15,11 +15,11 @@
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/navigation-overlay.php b/src/wp-content/themes/ipsum/patterns/navigation-overlay.php index 7112d8511d4fc..567bcec0ec30c 100644 --- a/src/wp-content/themes/ipsum/patterns/navigation-overlay.php +++ b/src/wp-content/themes/ipsum/patterns/navigation-overlay.php @@ -31,7 +31,7 @@ -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/overlay-contents.php b/src/wp-content/themes/ipsum/patterns/overlay-contents.php index 0d8382868fa12..f2ebb109374a3 100644 --- a/src/wp-content/themes/ipsum/patterns/overlay-contents.php +++ b/src/wp-content/themes/ipsum/patterns/overlay-contents.php @@ -23,7 +23,7 @@ -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/page-blog-home.php b/src/wp-content/themes/ipsum/patterns/page-blog-home.php index 40a5e04f3b06d..b952b9589f013 100644 --- a/src/wp-content/themes/ipsum/patterns/page-blog-home.php +++ b/src/wp-content/themes/ipsum/patterns/page-blog-home.php @@ -28,11 +28,11 @@
    -
    +
    -
    +
    diff --git a/src/wp-content/themes/ipsum/patterns/page-soon.php b/src/wp-content/themes/ipsum/patterns/page-soon.php index 9d0c7c9698b2e..5081d7426df26 100644 --- a/src/wp-content/themes/ipsum/patterns/page-soon.php +++ b/src/wp-content/themes/ipsum/patterns/page-soon.php @@ -17,8 +17,8 @@
    -