Skip to content

Commit 68c4f7e

Browse files
Merge branch 'trunk' into perf/10777
2 parents a331593 + 5d3de27 commit 68c4f7e

17 files changed

Lines changed: 395 additions & 33 deletions

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
},
3333
"lock": false
3434
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"WordPress\\PHPStan\\": "tests/phpstan/"
38+
}
39+
},
3540
"scripts": {
3641
"phpstan": "@php ./vendor/bin/phpstan analyse --memory-limit=2G",
3742
"compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source",

src/wp-admin/css/common.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,6 @@ a#remove-post-thumbnail:hover,
961961

962962
#publishing-action .spinner {
963963
float: none;
964-
margin-top: 5px;
965964
}
966965

967966
#misc-publishing-actions {
@@ -2460,7 +2459,7 @@ h1.nav-tab-wrapper, /* Back-compat for pre-4.4 */
24602459
filter: alpha(opacity=70);
24612460
width: 20px;
24622461
height: 20px;
2463-
margin: 4px 10px 0;
2462+
margin: 10px 10px 0;
24642463
}
24652464

24662465
.spinner.is-active,
@@ -2480,6 +2479,7 @@ h1.nav-tab-wrapper, /* Back-compat for pre-4.4 */
24802479
}
24812480
#template .submit .spinner {
24822481
float: none;
2482+
vertical-align: top;
24832483
}
24842484

24852485
.metabox-holder .stuffbox > h3, /* Back-compat for pre-4.4 */

src/wp-admin/css/customize-controls.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ body {
7070

7171
#customize-save-button-wrapper {
7272
float: right;
73-
margin-top: 3px; /* Vertically center 40px button in 45px header */
73+
margin-top: 7px; /* Vertically center 32px button in 45px header */
7474
}
7575

7676
body:not(.ready) #customize-save-button-wrapper .save {
@@ -572,6 +572,10 @@ body.trashing #publish-settings {
572572
display: block;
573573
}
574574

575+
.accordion-section-title button.accordion-trigger .spinner {
576+
margin-top: 0;
577+
}
578+
575579
@media (prefers-reduced-motion: reduce) {
576580
#customize-theme-controls .accordion-section-title,
577581
#customize-outer-theme-controls .accordion-section-title {
@@ -2996,9 +3000,8 @@ body.adding-widget .add-new-widget:before,
29963000
}
29973001

29983002
.wp-core-ui.wp-customizer .button {
2999-
min-height: 30px;
30003003
padding: 0 14px;
3001-
line-height: 2;
3004+
line-height: 2.14285714; /* 30px */
30023005
font-size: 14px;
30033006
vertical-align: middle;
30043007
}

src/wp-admin/css/list-tables.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,7 @@ tr.inline-edit-row td {
11041104
}
11051105

11061106
.inline-edit-row select {
1107+
line-height: 2.14285714; /* 30px for 32px height with 14px font */
11071108
padding-right: 24px;
11081109
}
11091110

src/wp-admin/css/themes.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ body.full-overlay-active {
19671967

19681968
.theme-install-overlay .wp-full-overlay-header .button {
19691969
float: right;
1970-
margin: 3px 10px 0 0; /* Vertically center 40px button in 45px header */
1970+
margin: 7px 10px 0 0; /* Vertically center 32px button in 45px header */
19711971
}
19721972

19731973
.theme-install-overlay .wp-full-overlay-sidebar {
@@ -2053,8 +2053,6 @@ body.full-overlay-active {
20532053

20542054
.theme-install-overlay .wp-full-overlay-header .button {
20552055
font-size: 13px;
2056-
line-height: 2.15384615;
2057-
min-height: 30px;
20582056
}
20592057

20602058
.theme-browser .theme .theme-actions .button {

src/wp-admin/customize.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@
198198
<?php if ( $compatible_wp && $compatible_php ) : ?>
199199
<?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate &amp; Publish' ); ?>
200200
<div id="customize-save-button-wrapper" class="customize-save-button-wrapper" >
201-
<?php submit_button( $save_text, 'primary save', 'save', false ); ?>
202-
<button id="publish-settings" class="publish-settings button-primary button dashicons dashicons-admin-generic" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled></button>
201+
<?php submit_button( $save_text, 'primary button-compact save', 'save', false ); ?>
202+
<button id="publish-settings" class="publish-settings button-primary button-compact button dashicons dashicons-admin-generic" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled></button>
203203
</div>
204204
<?php else : ?>
205205
<?php $save_text = _x( 'Cannot Activate', 'theme' ); ?>
206206
<div id="customize-save-button-wrapper" class="customize-save-button-wrapper disabled" >
207-
<button class="button button-primary disabled" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled><?php echo $save_text; ?></button>
207+
<button class="button button-primary button-compact disabled" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled><?php echo $save_text; ?></button>
208208
</div>
209209
<?php endif; ?>
210210
<span class="spinner"></span>

src/wp-admin/theme-install.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,18 @@
487487
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
488488
?>
489489
<# if ( ! data.active ) { #>
490-
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
490+
<a class="button button-primary button-compact activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
491491
<# } else { #>
492-
<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
492+
<button class="button button-primary button-compact disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
493493
<# } #>
494494
<# } else { #>
495-
<a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
495+
<a class="button button-primary button-compact disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
496496
<# } #>
497497
<# } else { #>
498498
<# if ( data.compatible_wp && data.compatible_php ) { #>
499-
<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
499+
<a href="{{ data.install_url }}" class="button button-primary button-compact theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
500500
<# } else { #>
501-
<a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
501+
<a class="button button-primary button-compact disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
502502
<# } #>
503503
<# } #>
504504
</div>

src/wp-includes/block-supports/custom-css.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function wp_register_custom_css_support( $block_type ) {
132132
}
133133

134134
/**
135-
* Strips `style.css` attributes from all blocks in post content.
135+
* Strips custom CSS (`style.css` in attributes) from all blocks in post content.
136136
*
137137
* Uses {@see WP_Block_Parser::next_token()} to scan block tokens and surgically
138138
* replace only the attribute JSON that changed — no parse_blocks() +

src/wp-includes/collaboration/class-wp-http-polling-sync-server.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,14 @@ private function process_sync_update( string $room, int $client_id, int $cursor,
498498
return $this->add_update( $room, $client_id, $type, $data );
499499
}
500500

501-
// Reaching this point means there's a newer compaction, so we can
502-
// silently ignore this one.
503-
return true;
501+
/*
502+
* A newer compaction already advanced the cursor, but we
503+
* can not safely drop an update. The incoming bytes still encode
504+
* operations other clients may not have seen, so store them as a
505+
* regular update. Y.applyUpdateV2 merges state-as-update blobs
506+
* idempotently, so overlap with the existing compaction is safe.
507+
*/
508+
return $this->add_update( $room, $client_id, self::UPDATE_TYPE_UPDATE, $data );
504509

505510
case self::UPDATE_TYPE_SYNC_STEP1:
506511
case self::UPDATE_TYPE_SYNC_STEP2:

src/wp-includes/http.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,26 @@ function ms_allowed_http_request_hosts( $is_external, $host ) {
716716
* When a specific component has been requested: null if the component
717717
* doesn't exist in the given URL; a string or - in the case of
718718
* PHP_URL_PORT - integer when it does. See parse_url()'s return values.
719+
*
720+
* @phpstan-param int<-1, 7> $component
721+
* @phpstan-return (
722+
* $component is -1
723+
* ? false|array{
724+
* scheme?: string,
725+
* host?: string,
726+
* port?: int<0, 65535>,
727+
* user?: string,
728+
* pass?: string,
729+
* path?: string,
730+
* query?: string,
731+
* fragment?: string,
732+
* }
733+
* : (
734+
* $component is 2
735+
* ? int<0, 65535>|null
736+
* : string|null
737+
* )
738+
* )
719739
*/
720740
function wp_parse_url( $url, $component = -1 ) {
721741
$to_unset = array();
@@ -763,6 +783,36 @@ function wp_parse_url( $url, $component = -1 ) {
763783
* When a specific component has been requested: null if the component
764784
* doesn't exist in the given URL; a string or - in the case of
765785
* PHP_URL_PORT - integer when it does. See parse_url()'s return values.
786+
*
787+
* @phpstan-param false|array{
788+
* scheme?: string,
789+
* host?: string,
790+
* port?: int<0, 65535>,
791+
* user?: string,
792+
* pass?: string,
793+
* path?: string,
794+
* query?: string,
795+
* fragment?: string,
796+
* } $url_parts
797+
* @phpstan-param int<-1, 7> $component
798+
* @phpstan-return (
799+
* $component is -1
800+
* ? false|array{
801+
* scheme?: string,
802+
* host?: string,
803+
* port?: int<0, 65535>,
804+
* user?: string,
805+
* pass?: string,
806+
* path?: string,
807+
* query?: string,
808+
* fragment?: string,
809+
* }
810+
* : (
811+
* $component is 2
812+
* ? int<0, 65535>|null
813+
* : string|null
814+
* )
815+
* )
766816
*/
767817
function _get_component_from_parsed_url_array( $url_parts, $component = -1 ) {
768818
if ( -1 === $component ) {
@@ -789,6 +839,9 @@ function _get_component_from_parsed_url_array( $url_parts, $component = -1 ) {
789839
*
790840
* @param int $constant PHP_URL_* constant.
791841
* @return string|false The named key or false.
842+
*
843+
* @phpstan-param int<-1, 7> $constant
844+
* @phpstan-return 'scheme'|'host'|'port'|'user'|'pass'|'path'|'query'|'fragment'|false
792845
*/
793846
function _wp_translate_php_url_constant_to_key( $constant ) {
794847
$translation = array(

0 commit comments

Comments
 (0)