From 9cccbc592bb8bc8f8c2e6727075ef859b47afc45 Mon Sep 17 00:00:00 2001 From: Colin Stewart Date: Wed, 11 Oct 2023 04:32:00 +0000 Subject: [PATCH 1/5] Plugins: Fix broken `sprintf()` call in plugins list table. In [56599], a `sprintf()` call was modified which resulted in an insufficient number of arguments. This caused a Fatal Error when an incompatible plugin notice was displayed. This fixes the `sprintf()` call. Follow-up to [56599]. Props petitphp, TobiasBg, sabernhardt, mukesh27. Fixes #59590. See #57791. git-svn-id: https://develop.svn.wordpress.org/trunk@56824 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-plugins-list-table.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 d16349928dabb..5c92fba7aad1c 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -1280,8 +1280,7 @@ public function single_row( $item ) { if ( ! $compatible_php || ! $compatible_wp ) { printf( - '' . - '' . + '', esc_attr( $this->get_column_count() ) ); From d95c0e1c79739b3360c50821ee215cda343e0cbc Mon Sep 17 00:00:00 2001 From: Colin Stewart Date: Wed, 11 Oct 2023 07:03:04 +0000 Subject: [PATCH 2/5] Docs: Use US spelling and correct a typing mistake. This changes two inline comments and a docblock so that they use US spelling as advised by the Core Handbook's Best Practices. A typing mistake is also corrected. Reference: - [https://make.wordpress.org/core/handbook/best-practices/spelling/ Core Handbook - Best Practices - Spelling]. Follow-up to [18632], [38120], [44954]. Props kebbet, mukesh27. See #58833. git-svn-id: https://develop.svn.wordpress.org/trunk@56825 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-filesystem-base.php | 4 ++-- src/wp-admin/includes/file.php | 2 +- src/wp-includes/class-wp-http-requests-response.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/includes/class-wp-filesystem-base.php b/src/wp-admin/includes/class-wp-filesystem-base.php index b20a4b99e4a97..8b291279e172e 100644 --- a/src/wp-admin/includes/class-wp-filesystem-base.php +++ b/src/wp-admin/includes/class-wp-filesystem-base.php @@ -216,13 +216,13 @@ public function find_folder( $folder ) { } } } elseif ( 'direct' === $this->method ) { - $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation. + $folder = str_replace( '\\', '/', $folder ); // Windows path sanitization. return trailingslashit( $folder ); } $folder = preg_replace( '|^([a-z]{1}):|i', '', $folder ); // Strip out Windows drive letter if it's there. - $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation. + $folder = str_replace( '\\', '/', $folder ); // Windows path sanitization. if ( isset( $this->cache[ $folder ] ) ) { return $this->cache[ $folder ]; diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 7ea3619e077b0..600ddc27dfd6e 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -1266,7 +1266,7 @@ function download_url( $url, $timeout = 300, $signature_verification = false ) { $signature_verification = in_array( parse_url( $url, PHP_URL_HOST ), $signed_hostnames, true ); } - // Perform signature valiation if supported. + // Perform signature validation if supported. if ( $signature_verification ) { $signature = wp_remote_retrieve_header( $response, 'X-Content-Signature' ); diff --git a/src/wp-includes/class-wp-http-requests-response.php b/src/wp-includes/class-wp-http-requests-response.php index 821077656c84b..8032c54d875a7 100644 --- a/src/wp-includes/class-wp-http-requests-response.php +++ b/src/wp-includes/class-wp-http-requests-response.php @@ -8,7 +8,7 @@ */ /** - * Core wrapper object for a WpOrg\Requests\Response for standardisation. + * Core wrapper object for a WpOrg\Requests\Response for standardization. * * @since 4.6.0 * From 80931f0c2d1dd962488cb192de3d7fa186c4881f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 11 Oct 2023 10:41:50 +0000 Subject: [PATCH 3/5] Help/About: Ensure that focus outline on the Credits screen is not cut off. Props ivanzhuck, oglekler, wildworks, dhrumilk, audrasjb, tejadev, ankit-k-gupta, sumitbagthariya16, mukesh27, marybaum. Fixes #59033. git-svn-id: https://develop.svn.wordpress.org/trunk@56826 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/about.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/css/about.css b/src/wp-admin/css/about.css index f4eec067e2bee..607e7676485a4 100644 --- a/src/wp-admin/css/about.css +++ b/src/wp-admin/css/about.css @@ -733,7 +733,7 @@ ------------------------------------------------------------------------------*/ .about__section .wp-people-group-title { - margin-bottom: calc(var(--gap) * 2); + margin-bottom: calc(var(--gap) * 2 - 10px); text-align: center; } @@ -748,7 +748,7 @@ display: inline-block; vertical-align: top; box-sizing: border-box; - margin-bottom: var(--gap); + margin-bottom: calc(var(--gap) - 10px); width: 25%; text-align: center; } @@ -780,8 +780,10 @@ } .about__section .wp-person .web { + display: block; font-size: 1.4em; font-weight: 600; + padding: 10px 10px 0; text-decoration: none; } From ce8aed4698117fd0f8c362825e62d01586c8799d Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 11 Oct 2023 12:15:18 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Build/Test=20Tools:=20Don=E2=80=99t=20send?= =?UTF-8?q?=20Slack=20notification=20for=20workflow=20retries.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [56780] changed Slack failure notifications to not send a failure notification during the first run of a workflow. Because workflows automatically restart once, a failure during the first run can be ignored. This adjusts the workflow to also not send a “fixed” notification when the second run of a workflow succeeds after a failure. Because the original failure is no longer reported, these notifications are unnecessary. See #58867. git-svn-id: https://develop.svn.wordpress.org/trunk@56827 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/slack-notifications.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index b3d8ef663f2ae..f9b0f04723495 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -75,8 +75,10 @@ jobs: return 'first-failure'; } - // When a workflow has been restarted to fix a failure, check the previous run attempt. - if ( workflow_run.data.run_attempt > 1 ) { + // When a workflow has been restarted, check the previous run attempt. Because workflows are automatically + // restarted once and a failure on the first run is not reported, failures on the second run should not be + // considered. + if ( workflow_run.data.run_attempt > 2 ) { const previous_run = await github.rest.actions.getWorkflowRunAttempt({ owner: context.repo.owner, repo: context.repo.repo, From bb4ab816b5c2bc5b821fb028eea9e0fe05e75a13 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Wed, 11 Oct 2023 15:14:01 +0000 Subject: [PATCH 5/5] Editor: Add further test coverage for `wp_render_elements_support()`. Props dmsnell, aaronrobertshaw. Fixes #59578. git-svn-id: https://develop.svn.wordpress.org/trunk@56828 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-supports/elements.php | 3 + .../wpRenderElementsSupport.php | 63 ++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/block-supports/elements.php b/src/wp-includes/block-supports/elements.php index 770e3e95c30e1..4f3de8c5b863e 100644 --- a/src/wp-includes/block-supports/elements.php +++ b/src/wp-includes/block-supports/elements.php @@ -36,6 +36,9 @@ function wp_render_elements_support( $block_content, $block ) { } $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); + if ( ! $block_type ) { + return $block_content; + } $element_color_properties = array( 'button' => array( diff --git a/tests/phpunit/tests/block-supports/wpRenderElementsSupport.php b/tests/phpunit/tests/block-supports/wpRenderElementsSupport.php index a65f53b471b35..db5307d20743f 100644 --- a/tests/phpunit/tests/block-supports/wpRenderElementsSupport.php +++ b/tests/phpunit/tests/block-supports/wpRenderElementsSupport.php @@ -18,6 +18,39 @@ public function tear_down() { parent::tear_down(); } + /** + * Tests that block supports leaves block content alone if the block type + * isn't registered. + * + * @ticket 59578 + * + * @covers ::wp_render_elements_support + * + * @return void + */ + public function test_leaves_block_content_alone_when_block_type_not_registered() { + $block = array( + 'blockName' => 'test/element-block-supports', + 'attrs' => array( + 'style' => array( + 'elements' => array( + 'button' => array( + 'color' => array( + 'text' => 'var:preset|color|vivid-red', + 'background' => '#fff', + ), + ), + ), + ), + ), + ); + + $block_markup = '

Hello WordPress!

'; + $actual = wp_render_elements_support( $block_markup, $block ); + + $this->assertSame( $block_markup, $actual, 'Expected to leave block content unmodified, but found changes.' ); + } + /** * Tests that elements block support applies the correct classname. * @@ -64,7 +97,7 @@ public function test_elements_block_support_class( $color_settings, $elements_st $this->assertMatchesRegularExpression( $expected_markup, $actual, - 'Position block wrapper markup should be correct' + 'Block wrapper markup should be correct' ); } @@ -80,6 +113,34 @@ public function data_elements_block_support_class() { ); return array( + // @ticket 59578 + 'empty block markup remains untouched' => array( + 'color_settings' => array( + 'button' => true, + ), + 'elements_styles' => array( + 'button' => array( 'color' => $color_styles ), + ), + 'block_markup' => '', + 'expected_markup' => '/^$/', + ), + 'empty block markup remains untouched when no block attributes' => array( + 'color_settings' => array( + 'button' => true, + ), + 'elements_styles' => null, + 'block_markup' => '', + 'expected_markup' => '/^$/', + ), + 'block markup remains untouched when block has no attributes' => array( + 'color_settings' => array( + 'button' => true, + ), + 'elements_styles' => null, + 'block_markup' => '

Hello WordPress!

', + 'expected_markup' => '/^

Hello WordPress<\/a>!<\/p>$/', + ), + // @ticket 5418 'button element styles with serialization skipped' => array( 'color_settings' => array( 'button' => true,