Skip to content

Commit b06109b

Browse files
committed
Merge branch 'trunk' into try/php85-tests
2 parents 0a66b53 + c978e55 commit b06109b

67 files changed

Lines changed: 10401 additions & 718 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ updates:
129129
- "underscore"
130130

131131
# Monitor npm dependencies within default themes.
132+
- package-ecosystem: "npm"
133+
directory: "/src/wp-content/themes/twentytwentyfive"
134+
schedule:
135+
interval: "weekly"
136+
open-pull-requests-limit: 20
137+
groups:
138+
twentytwentyfive-css:
139+
patterns:
140+
- "**browserslist*"
141+
- "*css*"
142+
143+
- package-ecosystem: "npm"
144+
directory: "/src/wp-content/themes/twentytwentytwo"
145+
schedule:
146+
interval: "weekly"
147+
open-pull-requests-limit: 20
148+
groups:
149+
twentytwentytwo-css:
150+
patterns:
151+
- "**browserslist*"
152+
- "*css*"
153+
132154
- package-ecosystem: "npm"
133155
directory: "/src/wp-content/themes/twentytwentyone"
134156
schedule:

.github/workflows/test-and-zip-default-themes.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
- 'src/wp-content/themes/twentynineteen/**'
1515
- 'src/wp-content/themes/twentytwenty/**'
1616
- 'src/wp-content/themes/twentytwentyone/**'
17+
- 'src/wp-content/themes/twentytwentytwo/**'
18+
- 'src/wp-content/themes/twentytwentyfive/**'
1719
# Changes to this workflow file should always verify success.
1820
- '.github/workflows/test-and-zip-default-themes.yml'
1921
pull_request:
@@ -29,6 +31,8 @@ on:
2931
- 'src/wp-content/themes/twentynineteen/**'
3032
- 'src/wp-content/themes/twentytwenty/**'
3133
- 'src/wp-content/themes/twentytwentyone/**'
34+
- 'src/wp-content/themes/twentytwentytwo/**'
35+
- 'src/wp-content/themes/twentytwentyfive/**'
3236
# Changes to this workflow file should always verify success.
3337
- '.github/workflows/test-and-zip-default-themes.yml'
3438
workflow_dispatch:
@@ -120,6 +124,8 @@ jobs:
120124
fail-fast: false
121125
matrix:
122126
theme: [
127+
'twentytwentyfive',
128+
'twentytwentytwo',
123129
'twentytwentyone',
124130
'twentytwenty',
125131
'twentynineteen',
@@ -221,11 +227,31 @@ jobs:
221227
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
222228
persist-credentials: false
223229

230+
- name: Set up Node.js for themes needing minification
231+
if: matrix.theme == 'twentytwentytwo' || matrix.theme == 'twentytwentyfive'
232+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
233+
with:
234+
node-version-file: '.nvmrc'
235+
cache: npm
236+
cache-dependency-path: src/wp-content/themes/${{ matrix.theme }}/package-lock.json
237+
238+
- name: Install npm dependencies
239+
if: matrix.theme == 'twentytwentytwo' || matrix.theme == 'twentytwentyfive'
240+
run: npm ci
241+
working-directory: src/wp-content/themes/${{ matrix.theme }}
242+
243+
- name: Build theme assets
244+
if: matrix.theme == 'twentytwentytwo' || matrix.theme == 'twentytwentyfive'
245+
run: npm run build
246+
working-directory: src/wp-content/themes/${{ matrix.theme }}
247+
224248
- name: Upload theme ZIP as an artifact
225249
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
226250
with:
227251
name: ${{ matrix.theme }}
228-
path: src/wp-content/themes/${{ matrix.theme }}
252+
path: |
253+
src/wp-content/themes/${{ matrix.theme }}
254+
!src/wp-content/themes/${{ matrix.theme }}/node_modules
229255
if-no-files-found: error
230256
include-hidden-files: true
231257

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ wp-tests-config.php
8888
/src/wp-content/themes/twentynineteen/node_modules
8989
/src/wp-content/themes/twentytwentyone/node_modules
9090
/src/wp-content/themes/twentytwenty/node_modules
91+
/src/wp-content/themes/twentytwentytwo/node_modules
92+
/src/wp-content/themes/twentytwentyfive/node_modules
93+
94+
# Minified files in bundled themes
95+
/src/wp-content/themes/twentytwentytwo/*.min.css
96+
/src/wp-content/themes/twentytwentyfive/*.min.css
9197

9298
# Operating system specific files
9399
.DS_Store

Gruntfile.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,16 @@ module.exports = function(grunt) {
567567
src: [
568568
'wp-admin/css/colors/*/*.css'
569569
]
570+
},
571+
themes: {
572+
expand: true,
573+
cwd: WORKING_DIR,
574+
dest: WORKING_DIR,
575+
ext: '.min.css',
576+
src: [
577+
'wp-content/themes/twentytwentytwo/style.css',
578+
'wp-content/themes/twentytwentyfive/style.css',
579+
]
570580
}
571581
},
572582
rtlcss: {
@@ -1591,6 +1601,7 @@ module.exports = function(grunt) {
15911601
'rtl',
15921602
'cssmin:rtl',
15931603
'cssmin:colors',
1604+
'cssmin:themes',
15941605
'usebanner'
15951606
] );
15961607

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ services:
7070
- wpdevnet
7171

7272
ports:
73-
- "3306"
73+
- "${LOCAL_DB_PORTS-3306}"
7474

7575
environment:
7676
MYSQL_ROOT_PASSWORD: password

phpcs.xml.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
#############################################################################
230230
SELECTIVE EXCLUSIONS
231231
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.
232-
232+
233233
These exclusions are listed ordered by alphabetic sniff name.
234234
#############################################################################
235235
-->
@@ -266,8 +266,9 @@
266266

267267
<!-- Goto is an effective way to handle errors in decoders which expect valid bytes
268268
without impacting the fast path while avoiding bloating the code with redundant
269-
and risky handling code. Exclude forbidding goto in UTF-8 fallback code. -->
269+
and risky handling code. Exclude forbidding goto in parser code. -->
270270
<exclude-pattern>/wp-includes/compat-utf8\.php</exclude-pattern>
271+
<exclude-pattern>/wp-includes/class-wp-block-processor\.php</exclude-pattern>
271272
</rule>
272273

273274
<!-- Exclude sample config from modernization to prevent breaking CI workflows based on WP-CLI scaffold.

src/wp-admin/admin.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,30 @@
7272
* @param bool $do_mu_upgrade Whether to perform the Multisite upgrade routine. Default true.
7373
*/
7474
if ( apply_filters( 'do_mu_upgrade', true ) ) {
75-
$c = get_blog_count();
75+
$blog_count = get_blog_count();
7676

7777
/*
7878
* If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load:
7979
* attempt to do no more than threshold value, with some +/- allowed.
8080
*/
81-
if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) === 1 ) ) {
81+
if ( $blog_count <= 50 || ( $blog_count > 50 && mt_rand( 0, (int) ( $blog_count / 50 ) ) === 1 ) ) {
8282
require_once ABSPATH . WPINC . '/http.php';
83+
8384
$response = wp_remote_get(
8485
admin_url( 'upgrade.php?step=1' ),
8586
array(
8687
'timeout' => 120,
8788
'httpversion' => '1.1',
8889
)
8990
);
91+
9092
/** This action is documented in wp-admin/network/upgrade.php */
9193
do_action( 'after_mu_upgrade', $response );
94+
9295
unset( $response );
9396
}
94-
unset( $c );
97+
98+
unset( $blog_count );
9599
}
96100
}
97101

src/wp-admin/includes/class-wp-site-health.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,9 +3541,9 @@ private function get_good_response_time_threshold() {
35413541
*
35423542
* The default is based on https://web.dev/time-to-first-byte/.
35433543
*
3544-
* @param int $threshold Threshold in milliseconds. Default 600.
3545-
*
35463544
* @since 6.1.0
3545+
*
3546+
* @param int $threshold Threshold in milliseconds. Default 600.
35473547
*/
35483548
return (int) apply_filters( 'site_status_good_response_time_threshold', 600 );
35493549
}

src/wp-admin/options-general.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,20 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
479479

480480
foreach ( $date_formats as $format ) {
481481
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
482+
482483
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
483484
echo " checked='checked'";
484485
$custom = false;
485486
}
486-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
487+
488+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
489+
'<code>' . esc_html( $format ) . '</code>';
490+
491+
if ( __( 'F j, Y' ) === $format ) {
492+
echo ' ' . __( '(Site language default)' );
493+
}
494+
495+
echo "</label><br />\n";
487496
}
488497

489498
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
@@ -524,11 +533,20 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
524533

525534
foreach ( $time_formats as $format ) {
526535
echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
536+
527537
if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
528538
echo " checked='checked'";
529539
$custom = false;
530540
}
531-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
541+
542+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
543+
'<code>' . esc_html( $format ) . '</code>';
544+
545+
if ( __( 'g:i a' ) === $format ) {
546+
echo ' ' . __( '(Site language default)' );
547+
}
548+
549+
echo "</label><br />\n";
532550
}
533551

534552
echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';

src/wp-admin/plugin-editor.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@
9393
$posted_content = null;
9494

9595
if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
96-
$r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
97-
if ( is_wp_error( $r ) ) {
98-
$edit_error = $r;
96+
$edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) );
97+
98+
if ( is_wp_error( $edit_result ) ) {
99+
$edit_error = $edit_result;
100+
99101
if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) {
100102
$posted_content = wp_unslash( $_POST['newcontent'] );
101103
}
@@ -122,9 +124,10 @@
122124
} else {
123125
// Get the extension of the file.
124126
if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) {
125-
$ext = strtolower( $matches[1] );
127+
$extension = strtolower( $matches[1] );
128+
126129
// If extension is not in the acceptable list, skip it.
127-
if ( ! in_array( $ext, $editable_extensions, true ) ) {
130+
if ( ! in_array( $extension, $editable_extensions, true ) ) {
128131
wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) );
129132
}
130133
}

0 commit comments

Comments
 (0)