Skip to content

Commit d3c0bd3

Browse files
authored
Merge pull request #7966 from ampproject/bump/min-wp-version-to-6.6
Bump minimum WordPress version to 6.6
2 parents 76ab0ae + bcdc21d commit d3c0bd3

9 files changed

+78
-142
lines changed

Diff for: .github/workflows/build-test-measure.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,11 @@ jobs:
335335
external-http: true
336336

337337
- php: '7.4'
338-
wp: '6.5'
338+
wp: '6.6'
339339
phpunit: '7'
340340

341341
- php: '7.4'
342-
wp: '6.5'
342+
wp: '6.6'
343343
phpunit: '7'
344344
external-http: true
345345
steps:
@@ -408,6 +408,9 @@ jobs:
408408
# The JSON file is provided by the `shivammathur/setup-php` action. See https://github.com/shivammathur/setup-php#problem-matchers.
409409
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
410410

411+
- name: Install SVN
412+
run: sudo apt-get install subversion
413+
411414
- name: Install WP tests
412415
if: needs.pre-run.outputs.changed-php-count > 0
413416
run: bash bin/ci/install-wp-tests.sh wordpress_test root '' 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp }} true
@@ -518,7 +521,7 @@ jobs:
518521
wp: 'latest'
519522

520523
- php: '7.4'
521-
wp: '6.5'
524+
wp: '6.6'
522525
steps:
523526
- name: Shutdown default MySQL service
524527
if: needs.pre-run.outputs.changed-php-count > 0

Diff for: amp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Version: 2.5.6-alpha
99
* License: GPLv2 or later
1010
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11-
* Requires at least: 6.5
11+
* Requires at least: 6.6
1212
* Requires PHP: 7.4
1313
* Text Domain: amp
1414
*

Diff for: src/DependencySupport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DependencySupport implements Service {
3030
*
3131
* @var string
3232
*/
33-
const WP_MIN_VERSION = '6.5';
33+
const WP_MIN_VERSION = '6.6';
3434

3535
/**
3636
* Determines whether core or Gutenberg provides minimal support.

Diff for: tests/php/src/Admin/AmpPluginsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function test_is_needed() {
161161
$this->assertFalse( AmpPlugins::is_needed() );
162162

163163
// Test 3: Admin request in supported WordPress .
164-
$wp_version = '6.5';
164+
$wp_version = '6.6';
165165
set_current_screen( 'index.php' );
166166
$this->assertTrue( AmpPlugins::is_needed() );
167167

Diff for: tests/php/src/Admin/AmpThemesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function test_is_needed() {
8383
$this->assertFalse( AmpThemes::is_needed() );
8484

8585
// Test 3: Admin request.
86-
$wp_version = '6.5';
86+
$wp_version = '6.6';
8787
set_current_screen( 'index.php' );
8888
$this->assertTrue( is_admin() );
8989
$this->assertTrue( AmpThemes::is_needed() );

Diff for: tests/php/src/PluginRegistryTest.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,9 @@ public function test_get_mu_plugins_data() {
8787
'Title',
8888
'AuthorName',
8989
'UpdateURI',
90+
'RequiresPlugins',
9091
];
9192

92-
// Add `RequiresPlugins` for WP 6.5+.
93-
if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.5', '>=' ) ) {
94-
$expected_keys[] = 'RequiresPlugins';
95-
}
96-
9793
$plugins = $this->call_private_method( $plugin_registry, 'get_mu_plugins_data' );
9894
$this->assertIsArray( $plugins );
9995
foreach ( $plugins as $plugin_data ) {

Diff for: tests/php/test-amp-soundcloud-embed-handler.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AMP_SoundCloud_Embed_Handler_Test extends TestCase {
3131
*
3232
* @var string
3333
*/
34-
protected $playlist_url = 'https://soundcloud.com/classical-music-playlist/sets/classical-music-essential-collection';
34+
protected $playlist_url = 'https://soundcloud.com/hasnaa-tabra/sets/classical-music';
3535

3636
/**
3737
* Response for track oEmbed request.
@@ -47,7 +47,7 @@ class AMP_SoundCloud_Embed_Handler_Test extends TestCase {
4747
* @see AMP_SoundCloud_Embed_Test::$playlist_url
4848
* @var string
4949
*/
50-
protected $playlist_oembed_response = '{"version":1.0,"type":"rich","provider_name":"SoundCloud","provider_url":"http://soundcloud.com","height":450,"width":500,"title":"Classical Music - The Essential Collection by Classical Music","description":"Classical Music - The Essential Collection features 50 of the finest Classical Masterpieces ever written. Definitely not to working to! ","thumbnail_url":"http://i1.sndcdn.com/artworks-000083473866-mno23j-t500x500.jpg","html":"\u003Ciframe width=\"500\" height=\"450\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?visual=true\u0026url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F40936190\u0026show_artwork=true\u0026maxwidth=500\u0026maxheight=750\u0026dnt=1\"\u003E\u003C/iframe\u003E","author_name":"Classical Music","author_url":"https://soundcloud.com/classical-music-playlist"}';
50+
protected $playlist_oembed_response = '{"version":1.0,"type":"rich","provider_name":"SoundCloud","provider_url":"https://soundcloud.com","height":450,"width":"500","title":"Classical Music by Hasnaa Tabra","description":"","thumbnail_url":"https://i1.sndcdn.com/artworks-000092720295-kjpq3h-t500x500.jpg","html":"<iframe width=\"500\" height=\"450\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F53337986&show_artwork=true\"></iframe>","author_name":"Hasnaa Tabra","author_url":"https://soundcloud.com/hasnaa-tabra"}';
5151

5252
/**
5353
* Set up.
@@ -121,7 +121,7 @@ public function get_embed_conversion_data() {
121121

122122
'playlist_simple' => [
123123
$this->playlist_url . PHP_EOL,
124-
'<p><amp-soundcloud data-playlistid="40936190" data-visual="true" height="450" width="500" layout="responsive">' . ( function_exists( 'wp_filter_oembed_iframe_title_attribute' ) ? '<a fallback href="https://soundcloud.com/classical-music-playlist/sets/classical-music-essential-collection">Classical Music &#8211; The Essential Collection by Classical Music</a>' : '' ) . '</amp-soundcloud></p>' . PHP_EOL,
124+
'<p><amp-soundcloud data-playlistid="53337986" data-visual="true" height="450" width="500" layout="responsive">' . ( function_exists( 'wp_filter_oembed_iframe_title_attribute' ) ? '<a fallback href="https://soundcloud.com/hasnaa-tabra/sets/classical-music">Classical Music by Hasnaa Tabra</a>' : '' ) . '</amp-soundcloud></p>' . PHP_EOL,
125125
],
126126
];
127127
}

Diff for: tests/php/test-amp-style-sanitizer.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -3517,12 +3517,7 @@ function ( $original_dom, $original_source, $amphtml_dom, $amphtml_source ) {
35173517
$this->assertInstanceOf( 'DOMElement', $original_dom->getElementById( 'admin-bar-css' ), 'Expected admin bar CSS to be present originally.' );
35183518
$this->assertStringContainsString( 'admin-bar', $original_dom->body->getAttribute( 'class' ) );
35193519
$this->assertStringContainsString( 'earlyprintstyle', $original_source, 'Expected early print style to not be present.' );
3520-
3521-
if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '18.7', '>=' ) ) {
3522-
$this->assertStringContainsString( '.wp-block-audio :where(figcaption)', $amphtml_source, 'Expected block-library/style.css' );
3523-
} else {
3524-
$this->assertStringContainsString( '.wp-block-audio figcaption', $amphtml_source, 'Expected block-library/style.css' );
3525-
}
3520+
$this->assertStringContainsString( '.wp-block-audio :where(figcaption)', $amphtml_source, 'Expected block-library/style.css' );
35263521

35273522
$this->assertStringContainsString(
35283523
'[class^="wp-block-"]:not(.wp-block-gallery) figcaption',

Diff for: tests/php/validation/test-class-amp-validation-manager.php

+63-121
Original file line numberDiff line numberDiff line change
@@ -1838,138 +1838,80 @@ public function test_decorate_shortcode_and_filter_source() {
18381838

18391839
$filtered_content = apply_filters( 'the_content', 'before[test]after' );
18401840

1841-
if ( has_filter( 'the_content', 'do_blocks' ) ) {
1842-
$sources = [
1843-
[
1844-
'type' => 'core',
1845-
'name' => 'wp-includes',
1846-
'function' => 'WP_Embed::run_shortcode',
1847-
],
1848-
[
1849-
'type' => 'core',
1850-
'name' => 'wp-includes',
1851-
'function' => 'WP_Embed::autoembed',
1852-
],
1853-
[
1854-
'type' => 'core',
1855-
'name' => 'wp-includes',
1856-
'function' => 'do_blocks',
1857-
],
1858-
[
1859-
'type' => 'core',
1860-
'name' => 'wp-includes',
1861-
'function' => 'wptexturize',
1862-
],
1863-
[
1864-
'type' => 'core',
1865-
'name' => 'wp-includes',
1866-
'function' => 'wpautop',
1867-
],
1868-
[
1869-
'type' => 'core',
1870-
'name' => 'wp-includes',
1871-
'function' => 'shortcode_unautop',
1872-
],
1873-
[
1874-
'type' => 'core',
1875-
'name' => 'wp-includes',
1876-
'function' => 'prepend_attachment',
1877-
],
1878-
];
1879-
} else {
1880-
$sources = [
1881-
[
1882-
'type' => 'core',
1883-
'name' => 'wp-includes',
1884-
'function' => 'WP_Embed::run_shortcode',
1885-
],
1886-
[
1887-
'type' => 'core',
1888-
'name' => 'wp-includes',
1889-
'function' => 'WP_Embed::autoembed',
1890-
],
1891-
[
1892-
'type' => 'core',
1893-
'name' => 'wp-includes',
1894-
'function' => 'wptexturize',
1895-
],
1896-
[
1897-
'type' => 'core',
1898-
'name' => 'wp-includes',
1899-
'function' => 'wpautop',
1900-
],
1901-
[
1902-
'type' => 'core',
1903-
'name' => 'wp-includes',
1904-
'function' => 'shortcode_unautop',
1905-
],
1906-
[
1907-
'type' => 'core',
1908-
'name' => 'wp-includes',
1909-
'function' => 'prepend_attachment',
1910-
],
1911-
];
1912-
}
1913-
1914-
// This will be called after `do_shortcode` in WP 6.4 and later.
1915-
// @see <https://core.trac.wordpress.org/ticket/58853>.
1916-
if ( version_compare( strtok( get_bloginfo( 'version' ), '-' ), '6.4', '<' ) ) {
1917-
$sources[] = [
1841+
$sources = [
1842+
[
19181843
'type' => 'core',
19191844
'name' => 'wp-includes',
1920-
'function' => 'wp_filter_content_tags',
1921-
];
1922-
}
1923-
1924-
if ( function_exists( 'wp_replace_insecure_home_url' ) ) {
1925-
$sources[] = [
1845+
'function' => 'WP_Embed::run_shortcode',
1846+
],
1847+
[
1848+
'type' => 'core',
1849+
'name' => 'wp-includes',
1850+
'function' => 'WP_Embed::autoembed',
1851+
],
1852+
[
1853+
'type' => 'core',
1854+
'name' => 'wp-includes',
1855+
'function' => 'do_blocks',
1856+
],
1857+
[
1858+
'type' => 'core',
1859+
'name' => 'wp-includes',
1860+
'function' => 'wptexturize',
1861+
],
1862+
[
1863+
'type' => 'core',
1864+
'name' => 'wp-includes',
1865+
'function' => 'wpautop',
1866+
],
1867+
[
1868+
'type' => 'core',
1869+
'name' => 'wp-includes',
1870+
'function' => 'shortcode_unautop',
1871+
],
1872+
[
1873+
'type' => 'core',
1874+
'name' => 'wp-includes',
1875+
'function' => 'prepend_attachment',
1876+
],
1877+
[
19261878
'type' => 'core',
19271879
'name' => 'wp-includes',
19281880
'function' => 'wp_replace_insecure_home_url',
1929-
];
1930-
}
1931-
1932-
if ( function_exists( 'gutenberg_trim_footnotes' ) ) {
1933-
$sources[] = [
1934-
'type' => 'plugin',
1935-
'name' => 'gutenberg',
1936-
'function' => 'gutenberg_trim_footnotes',
1937-
];
1938-
}
1939-
1940-
$sources = array_merge(
1941-
$sources,
1881+
],
1882+
[
1883+
'type' => 'core',
1884+
'name' => 'wp-includes',
1885+
'function' => 'capital_P_dangit',
1886+
],
1887+
[
1888+
'type' => 'core',
1889+
'name' => 'wp-includes',
1890+
'function' => 'do_shortcode',
1891+
],
19421892
[
1943-
[
1944-
'type' => 'core',
1945-
'name' => 'wp-includes',
1946-
'function' => 'capital_P_dangit',
1947-
],
1948-
[
1949-
'type' => 'core',
1950-
'name' => 'wp-includes',
1951-
'function' => 'do_shortcode',
1952-
],
1953-
]
1954-
);
1955-
1956-
// `wp_filter_content_tags` is called after `do_shortcode` in WP 6.4 and later.
1957-
// @see <https://core.trac.wordpress.org/ticket/58853>.
1958-
if ( version_compare( get_bloginfo( 'version' ), '6.4-alpha', '>=' ) ) {
1959-
$sources[] = [
19601893
'type' => 'core',
19611894
'name' => 'wp-includes',
19621895
'function' => 'wp_filter_content_tags',
1963-
];
1964-
}
1965-
1966-
// `wp_filter_content_tags` is called before `convert_smilies` in WP 6.4 and later.
1967-
$sources[] = [
1968-
'type' => 'core',
1969-
'name' => 'wp-includes',
1970-
'function' => 'convert_smilies',
1896+
],
1897+
[
1898+
'type' => 'core',
1899+
'name' => 'wp-includes',
1900+
'function' => 'convert_smilies',
1901+
],
19711902
];
19721903

1904+
if ( function_exists( 'apply_block_hooks_to_content' ) && has_filter( 'the_content', 'apply_block_hooks_to_content' ) ) {
1905+
array_unshift(
1906+
$sources,
1907+
[
1908+
'type' => 'core',
1909+
'name' => 'wp-includes',
1910+
'function' => 'apply_block_hooks_to_content',
1911+
]
1912+
);
1913+
}
1914+
19731915
foreach ( $sources as &$source ) {
19741916
$function = $source['function'];
19751917
unset( $source['function'] );

0 commit comments

Comments
 (0)