diff --git a/projects/js-packages/components/changelog/update-remove-wp-6.4-compat b/projects/js-packages/components/changelog/update-remove-wp-6.4-compat new file mode 100644 index 0000000000000..e01fc59c60398 --- /dev/null +++ b/projects/js-packages/components/changelog/update-remove-wp-6.4-compat @@ -0,0 +1,4 @@ +Significance: major +Type: removed + +Remove compatibility with WordPress 6.4. diff --git a/projects/js-packages/components/components/stat-card/index.tsx b/projects/js-packages/components/components/stat-card/index.tsx index 6b47b244d605a..93db43246d695 100644 --- a/projects/js-packages/components/components/stat-card/index.tsx +++ b/projects/js-packages/components/components/stat-card/index.tsx @@ -31,8 +31,7 @@ const StatCard = ( { className, icon, label, value, variant = 'square' }: StatCa
{ label } { variant === 'square' ? ( - // @todo Switch to `placement` once WordPress 6.4 is the minimum. - + { compactValue } diff --git a/projects/js-packages/components/components/stat-card/test/component.tsx b/projects/js-packages/components/components/stat-card/test/component.tsx index 4dd4dc4bde5b9..350777634f5eb 100644 --- a/projects/js-packages/components/components/stat-card/test/component.tsx +++ b/projects/js-packages/components/components/stat-card/test/component.tsx @@ -12,11 +12,6 @@ describe( 'StatCard', () => { it( 'renders the compact value', () => { render( ); expect( screen.getByText( '1.8K' ) ).toBeInTheDocument(); - - // @todo Remove this once WordPress 6.4 is the minimum. - expect( console ).toHaveWarned( - '`position` prop in wp.components.tooltip is deprecated since version 6.4. Please use `placement` prop instead.' - ); } ); } ); diff --git a/projects/js-packages/components/package.json b/projects/js-packages/components/package.json index 63a37b72eab0a..ac2c0605dafef 100644 --- a/projects/js-packages/components/package.json +++ b/projects/js-packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/jetpack-components", - "version": "0.54.4-alpha", + "version": "0.55.0-alpha", "description": "Jetpack Components Package", "author": "Automattic", "license": "GPL-2.0-or-later", diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-remove-wp-6.4-compat b/projects/packages/jetpack-mu-wpcom/changelog/update-remove-wp-6.4-compat new file mode 100644 index 0000000000000..89f9d8bb83085 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/update-remove-wp-6.4-compat @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Update a test to remove WP 6.4 compat. + + diff --git a/projects/packages/jetpack-mu-wpcom/tests/php/features/verbum-comments/class-verbum-block-utils-test.php b/projects/packages/jetpack-mu-wpcom/tests/php/features/verbum-comments/class-verbum-block-utils-test.php index 35cc2e567c63e..d966fd117f035 100644 --- a/projects/packages/jetpack-mu-wpcom/tests/php/features/verbum-comments/class-verbum-block-utils-test.php +++ b/projects/packages/jetpack-mu-wpcom/tests/php/features/verbum-comments/class-verbum-block-utils-test.php @@ -45,14 +45,8 @@ public function test_comment_text_block_sanitization_sanity_check() { $comment_content = '

test

  • 1
  • 2
  • 3

something

someone
'; $filtered_content = preg_replace( '/\R+/', '', Verbum_Block_Utils::render_verbum_blocks( $comment_content ) ); - // Once we drop WP 6.4, we can change this back to assertSame(). - $expected_content = $this->logicalOr( - // WP 6.4 - $this->identicalTo( '

test

  • 1
  • 2
  • 3

something

someone
' ), - // WP 6.5+ - $this->identicalTo( '

test

  • 1
  • 2
  • 3

something

someone
' ) - ); - $this->assertThat( $filtered_content, $expected_content ); + $expected_content = '

test

  • 1
  • 2
  • 3

something

someone
'; + $this->assertSame( $expected_content, $filtered_content ); } /** diff --git a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php index 9ab364a594341..468263df18c3c 100644 --- a/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php +++ b/projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php @@ -49,7 +49,6 @@ public static function get_minimal_state() { */ public static function get_initial_state() { global $is_safari; - global $wp_version; // Load API endpoint base classes and endpoints for getting the module list fed into the JS Admin Page. require_once JETPACK__PLUGIN_DIR . '_inc/lib/core-api/class.jetpack-core-api-xmlrpc-consumer-endpoint.php'; @@ -248,7 +247,7 @@ public static function get_initial_state() { 'gutenbergInitialState' => self::get_gutenberg_initial_state(), 'isSubscriptionSiteEnabled' => apply_filters( 'jetpack_subscription_site_enabled', false ), 'newsletterDateExample' => gmdate( get_option( 'date_format' ), time() ), - 'subscriptionSiteEditSupported' => $current_theme->is_block_theme() && version_compare( $wp_version, '6.5-beta2', '>=' ), + 'subscriptionSiteEditSupported' => $current_theme->is_block_theme(), ); } @@ -263,10 +262,9 @@ private static function get_gutenberg_initial_state() { // If Gutenberg is not installed, // check if we run a version of WP that would include support. if ( ! Constants::is_true( 'IS_GUTENBERG_PLUGIN' ) ) { - global $wp_version; return array( 'isAvailable' => false, - 'hasInteractivityApi' => version_compare( $wp_version, '6.4', '>=' ), + 'hasInteractivityApi' => true, ); } diff --git a/projects/plugins/jetpack/changelog/update-remove-wp-6.4-compat b/projects/plugins/jetpack/changelog/update-remove-wp-6.4-compat new file mode 100644 index 0000000000000..b130e22392646 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-remove-wp-6.4-compat @@ -0,0 +1,4 @@ +Significance: major +Type: compat + +General: remove code for compatibility with WordPress versions before 6.5. diff --git a/projects/plugins/jetpack/class.jetpack.php b/projects/plugins/jetpack/class.jetpack.php index c71bcf2848e6c..fa0a279635a60 100644 --- a/projects/plugins/jetpack/class.jetpack.php +++ b/projects/plugins/jetpack/class.jetpack.php @@ -618,7 +618,6 @@ public static function upgrade_on_load() { if ( class_exists( 'Jetpack_Sitemap_Manager' ) - && version_compare( JETPACK__VERSION, '5.3', '>=' ) ) { do_action( 'jetpack_sitemaps_purge_data' ); } diff --git a/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php b/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php index 5177987cf2bf2..e063ed2c84444 100644 --- a/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php +++ b/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php @@ -299,22 +299,7 @@ private static function verify( $msg, $signature, $key, $alg ) { * @throws DomainException Provided string was invalid JSON. */ public static function json_decode( $input ) { - if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) && ! ( defined( 'JSON_C_VERSION' ) && PHP_INT_SIZE > 4 ) ) { - /** In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you - * to specify that large ints (like Steam Transaction IDs) should be treated as - * strings, rather than the PHP default behaviour of converting them to floats. - */ - $obj = json_decode( $input, false, 512, JSON_BIGINT_AS_STRING ); - } else { - /** Not all servers will support that, however, so for older versions we must - * manually detect large ints in the JSON string and quote them (thus converting - *them to strings) before decoding, hence the preg_replace() call. - */ - $max_int_length = strlen( (string) PHP_INT_MAX ) - 1; - $json_without_bigints = preg_replace( '/:\s*(-?\d{' . $max_int_length . ',})/', ': "$1"', $input ); - $obj = json_decode( $json_without_bigints ); - } - + $obj = json_decode( $input, false, 512, JSON_BIGINT_AS_STRING ); $errno = json_last_error(); if ( $errno ) { diff --git a/projects/plugins/jetpack/extensions/blocks/sharing-button/sharing-button.php b/projects/plugins/jetpack/extensions/blocks/sharing-button/sharing-button.php index 0464f81d15613..776f6568a4b84 100644 --- a/projects/plugins/jetpack/extensions/blocks/sharing-button/sharing-button.php +++ b/projects/plugins/jetpack/extensions/blocks/sharing-button/sharing-button.php @@ -33,15 +33,10 @@ function register_block() { ); /* - * Automatically add the sharing block to the end of single posts - * only when running WordPress 6.5 or later. - * @todo: remove when WordPress 6.5 is the minimum required version. + * Automatically add the sharing block to the end of single posts. */ - global $wp_version; - if ( version_compare( $wp_version, '6.5-beta2', '>=' ) ) { - add_filter( 'hooked_block_types', __NAMESPACE__ . '\add_block_to_single_posts_template', 10, 4 ); - add_filter( 'hooked_block_' . PARENT_BLOCK_NAME, __NAMESPACE__ . '\add_default_services_to_block', 10, 5 ); - } + add_filter( 'hooked_block_types', __NAMESPACE__ . '\add_block_to_single_posts_template', 10, 4 ); + add_filter( 'hooked_block_' . PARENT_BLOCK_NAME, __NAMESPACE__ . '\add_default_services_to_block', 10, 5 ); } add_action( 'init', __NAMESPACE__ . '\register_block' ); diff --git a/projects/plugins/jetpack/extensions/blocks/subscriber-login/class-jetpack-subscription-site.php b/projects/plugins/jetpack/extensions/blocks/subscriber-login/class-jetpack-subscription-site.php index 981de6b289cf1..43c117e6ad16b 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriber-login/class-jetpack-subscription-site.php +++ b/projects/plugins/jetpack/extensions/blocks/subscriber-login/class-jetpack-subscription-site.php @@ -67,14 +67,12 @@ protected function is_header_context( $context ) { * @return void */ protected function handle_subscriber_login_block_navigation_placement() { - global $wp_version; - $subscriber_login_navigation_enabled = get_option( 'jetpack_subscriptions_login_navigation_enabled', false ); if ( ! $subscriber_login_navigation_enabled ) { return; } - if ( ! wp_is_block_theme() || version_compare( $wp_version, '6.5-beta2', '<' ) ) { // TODO Fallback for classic themes and wp core < 6.5-beta2. + if ( ! wp_is_block_theme() ) { // TODO Fallback for classic themes. return; } diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/class-jetpack-subscription-site.php b/projects/plugins/jetpack/extensions/blocks/subscriptions/class-jetpack-subscription-site.php index bbd03d24da285..43ed36a5cf938 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/class-jetpack-subscription-site.php +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/class-jetpack-subscription-site.php @@ -116,14 +116,12 @@ protected function is_header_context( $context ) { * @return void */ protected function handle_subscribe_block_navigation_placement() { - global $wp_version; - $is_enabled = get_option( 'jetpack_subscriptions_subscribe_navigation_enabled', false ); if ( ! $is_enabled ) { return; } - if ( ! wp_is_block_theme() || version_compare( $wp_version, '6.5-beta2', '<' ) ) { // TODO Fallback for classic themes and wp core < 6.5-beta2. + if ( ! wp_is_block_theme() ) { // TODO Fallback for classic themes. return; } @@ -171,14 +169,12 @@ function ( $hooked_block, $hooked_block_type, $relative_position, $anchor_block * @return void */ protected function handle_subscribe_block_post_end_placement() { - global $wp_version; - $subscribe_post_end_enabled = get_option( 'jetpack_subscriptions_subscribe_post_end_enabled', false ); if ( ! $subscribe_post_end_enabled ) { return; } - if ( ! wp_is_block_theme() || version_compare( $wp_version, '6.5-beta2', '<' ) ) { // Fallback for classic themes and wp core < 6.5-beta2. + if ( ! wp_is_block_theme() ) { // Fallback for classic themes. add_filter( 'the_content', function ( $content ) { diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js index b108995852ec1..3840c4b6eb5ff 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/email-preview.js @@ -37,10 +37,7 @@ export default function EmailPreview( { isModalOpen, closeModal } ) { // Save post revision so that we send what they see in the editor, and not what previous draft/revision might've saved // Introduced at GB 16.3 at https://github.com/WordPress/gutenberg/pull/44971 - // @todo Remove the `if` check once WP 6.4 is the minimum supported version - if ( typeof __unstableSaveForPreview === 'function' ) { - await __unstableSaveForPreview(); - } + await __unstableSaveForPreview(); apiFetch( { path: '/wpcom/v2/send-email-preview/', diff --git a/projects/plugins/jetpack/extensions/plugins/ai-content-lens/editor.js b/projects/plugins/jetpack/extensions/plugins/ai-content-lens/editor.js index 0181f440ec89d..6ab3ab297ab25 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-content-lens/editor.js +++ b/projects/plugins/jetpack/extensions/plugins/ai-content-lens/editor.js @@ -1,6 +1,5 @@ import { registerJetpackPlugin } from '@automattic/jetpack-shared-extension-utils'; import { dispatch } from '@wordpress/data'; -import { store as editPostStore } from '@wordpress/edit-post'; import { store as editorStore } from '@wordpress/editor'; import { addFilter } from '@wordpress/hooks'; import debugFactory from 'debug'; @@ -43,11 +42,7 @@ function extendAiContentLensFeatures( settings, name ) { // check if the removeEditorPanel function exists in the editorStore. // íf not, look for it in the editPostStore. - // @todo: remove this once Jetpack requires WordPres 6.5, - // where the removeEditorPanel function will be available in the editorStore. - const removeEditorPanel = dispatch( editorStore )?.removeEditorPanel - ? dispatch( editorStore )?.removeEditorPanel - : dispatch( editPostStore )?.removeEditorPanel; + const removeEditorPanel = dispatch( editorStore ).removeEditorPanel; // Remove the excerpt panel by dispatching an action. removeEditorPanel( 'post-excerpt' ); diff --git a/projects/plugins/jetpack/extensions/shared/external-media/media-service/index.ts b/projects/plugins/jetpack/extensions/shared/external-media/media-service/index.ts index 394396bc8a344..0c1bcf22623b6 100644 --- a/projects/plugins/jetpack/extensions/shared/external-media/media-service/index.ts +++ b/projects/plugins/jetpack/extensions/shared/external-media/media-service/index.ts @@ -196,13 +196,7 @@ const isMediaSourceConnected = async ( source: MediaSource ) => * @returns {boolean} True if the inserter is opened false otherwise. */ const isInserterOpened = (): boolean => { - // Prior to WP 6.5, the isInserterOpened selector was available in core/edit-post. - // In WP 6.5, it was moved to core/editor. This check is to support both versions of WordPress. - // @to-do: remove exception when Jetpack requires WordPress 6.5. - const selectIsInserterOpened = - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - ( select( 'core/editor' ) as any )?.isInserterOpened ?? - select( 'core/edit-post' )?.isInserterOpened; + const selectIsInserterOpened = select( 'core/editor' )?.isInserterOpened; const editorIsInserterOpened = selectIsInserterOpened?.(); diff --git a/projects/plugins/wpcomsh/assets/wp-polyfill-dom-rect.js b/projects/plugins/wpcomsh/assets/wp-polyfill-dom-rect.js deleted file mode 100644 index d1b85093a4dfe..0000000000000 --- a/projects/plugins/wpcomsh/assets/wp-polyfill-dom-rect.js +++ /dev/null @@ -1,99 +0,0 @@ -(function (global) { - function number(v) { - return v === undefined ? 0 : Number(v); - } - - function different(u, v) { - return u !== v && !(isNaN(u) && isNaN(v)); - } - - function DOMRect(xArg, yArg, wArg, hArg) { - var x, y, width, height, left, right, top, bottom; - - x = number(xArg); - y = number(yArg); - width = number(wArg); - height = number(hArg); - - Object.defineProperties(this, { - x: { - get: function () { return x; }, - set: function (newX) { - if (different(x, newX)) { - x = newX; - left = right = undefined; - } - }, - enumerable: true - }, - y: { - get: function () { return y; }, - set: function (newY) { - if (different(y, newY)) { - y = newY; - top = bottom = undefined; - } - }, - enumerable: true - }, - width: { - get: function () { return width; }, - set: function (newWidth) { - if (different(width, newWidth)) { - width = newWidth; - left = right = undefined; - } - }, - enumerable: true - }, - height: { - get: function () { return height; }, - set: function (newHeight) { - if (different(height, newHeight)) { - height = newHeight; - top = bottom = undefined; - } - }, - enumerable: true - }, - left: { - get: function () { - if (left === undefined) { - left = x + Math.min(0, width); - } - return left; - }, - enumerable: true - }, - right: { - get: function () { - if (right === undefined) { - right = x + Math.max(0, width); - } - return right; - }, - enumerable: true - }, - top: { - get: function () { - if (top === undefined) { - top = y + Math.min(0, height); - } - return top; - }, - enumerable: true - }, - bottom: { - get: function () { - if (bottom === undefined) { - bottom = y + Math.max(0, height); - } - return bottom; - }, - enumerable: true - } - }); - } - - global.DOMRect = DOMRect; -}(this)); diff --git a/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat b/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat new file mode 100644 index 0000000000000..1b6e17fc78af3 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat @@ -0,0 +1,4 @@ +Significance: major +Type: removed + +Remove code for compatibility with WordPress before 6.5. diff --git a/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat#2 b/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat#2 new file mode 100644 index 0000000000000..34e3260d8a7c9 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-remove-wp-6.4-compat#2 @@ -0,0 +1,4 @@ +Significance: major +Type: removed + +Remove checks for Jetpack versions over a year old. diff --git a/projects/plugins/wpcomsh/feature-plugins/additional-css.php b/projects/plugins/wpcomsh/feature-plugins/additional-css.php index c6bf1490dcb31..a3eb70e8db1e8 100644 --- a/projects/plugins/wpcomsh/feature-plugins/additional-css.php +++ b/projects/plugins/wpcomsh/feature-plugins/additional-css.php @@ -14,11 +14,6 @@ function wpcomsh_maybe_disable_custom_css() { return; } - // Do not execute for older versions of Jetpack. - if ( version_compare( JETPACK__VERSION, '9.9-alpha', '<' ) ) { - return; - } - if ( wpcom_site_has_feature( WPCOM_Features::CUSTOM_DESIGN ) ) { return; } diff --git a/projects/plugins/wpcomsh/feature-plugins/blaze.php b/projects/plugins/wpcomsh/feature-plugins/blaze.php index de900297a407e..1c269f7e9fe43 100644 --- a/projects/plugins/wpcomsh/feature-plugins/blaze.php +++ b/projects/plugins/wpcomsh/feature-plugins/blaze.php @@ -16,11 +16,6 @@ function wpcomsh_activate_blaze_module() { return; } - // Blaze was introduced in Jetpack 12.3-a.9. - if ( version_compare( JETPACK__VERSION, '12.3-a.9', '<' ) ) { - return; - } - if ( ! Jetpack::is_module_active( 'blaze' ) ) { Jetpack::activate_module( 'blaze', false, false ); } diff --git a/projects/plugins/wpcomsh/feature-plugins/google-fonts.php b/projects/plugins/wpcomsh/feature-plugins/google-fonts.php index e2486a8d4edac..b550680b6922a 100644 --- a/projects/plugins/wpcomsh/feature-plugins/google-fonts.php +++ b/projects/plugins/wpcomsh/feature-plugins/google-fonts.php @@ -24,11 +24,6 @@ function wpcomsh_activate_google_fonts_module() { return; } - // Google fonts was introduced in Jetpack 10.8. - if ( version_compare( JETPACK__VERSION, '10.8', '<' ) ) { - return; - } - if ( ! Jetpack::is_module_active( 'google-fonts' ) ) { Jetpack::activate_module( 'google-fonts', false, false ); } diff --git a/projects/plugins/wpcomsh/feature-plugins/gutenberg-mods.php b/projects/plugins/wpcomsh/feature-plugins/gutenberg-mods.php index 179d9073acadf..064214f26f0cc 100644 --- a/projects/plugins/wpcomsh/feature-plugins/gutenberg-mods.php +++ b/projects/plugins/wpcomsh/feature-plugins/gutenberg-mods.php @@ -41,54 +41,6 @@ function wpcomsh_remove_gutenberg_experimental_menu() { remove_submenu_page( 'gutenberg', 'gutenberg-experiments' ); } -/** - * Adds a polyfill for DOMRect in environments which do not support it. - * - * This can be removed when plugin support requires WordPress 5.4.0+. - * - * @see gutenberg_add_url_polyfill - * @see https://core.trac.wordpress.org/ticket/49360 - * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect - * @see https://developer.wordpress.org/reference/functions/wp_default_packages_vendor/ - * - * @param WP_Scripts $scripts WP_Scripts object. - */ -function wpcomsh_add_dom_rect_polyfill( $scripts ) { - // WP.com: Only register if viewing the block editor. - global $pagenow; - if ( ! ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) ) { - return; - } - - /* - * Only register polyfill if not already registered. This prevents handling - * in an environment where core has updated to manage the polyfill. This - * depends on the action being handled after default script registration. - */ - $is_polyfill_script_registered = (bool) $scripts->query( 'wp-polyfill-dom-rect', 'registered' ); - if ( $is_polyfill_script_registered ) { - return; - } - - $scripts->add( - 'wp-polyfill-dom-rect', - plugins_url( 'assets/wp-polyfill-dom-rect.js', __DIR__ ), - array(), - '3.42.0' - ); - - did_action( 'init' ) && $scripts->add_inline_script( - 'wp-polyfill', - wp_get_script_polyfill( - $scripts, - array( - 'window.DOMRect' => 'wp-polyfill-dom-rect', - ) - ) - ); -} -add_action( 'wp_default_scripts', 'wpcomsh_add_dom_rect_polyfill', 30 ); - /** * Updates the site_logo option when the custom_logo theme-mod gets updated. * @@ -206,11 +158,6 @@ function ( $html ) use ( $style_properties ) { } } -if ( version_compare( get_bloginfo( 'version' ), '5.8.2', '<' ) && 30 === has_action( 'enqueue_block_assets', 'enqueue_block_styles_assets' ) && false === has_action( 'enqueue_block_assets', 'gutenberg_enqueue_block_styles_assets' ) ) { - remove_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 ); - add_action( 'enqueue_block_assets', 'gutenberg_enqueue_block_styles_assets', 30 ); -} - /** * Disable the Widgets Block Editor screen feature. * diff --git a/projects/plugins/wpcomsh/feature-plugins/masterbar.php b/projects/plugins/wpcomsh/feature-plugins/masterbar.php index 242b49d60039e..cb6d739e42a6f 100644 --- a/projects/plugins/wpcomsh/feature-plugins/masterbar.php +++ b/projects/plugins/wpcomsh/feature-plugins/masterbar.php @@ -18,11 +18,6 @@ function wpcomsh_activate_masterbar_module() { return; } - // Masterbar was introduced in Jetpack 4.8. - if ( version_compare( JETPACK__VERSION, '4.8', '<' ) ) { - return; - } - if ( ! Jetpack::is_module_active( 'masterbar' ) ) { Jetpack::activate_module( 'masterbar', false, false ); } diff --git a/tools/cli/commands/build.js b/tools/cli/commands/build.js index 1a2e42e9077c7..51e6bfcdf55fc 100644 --- a/tools/cli/commands/build.js +++ b/tools/cli/commands/build.js @@ -566,20 +566,7 @@ async function copyFileAtomic( src, dest ) { * @returns {string[]} Colliding file names. */ async function checkCollisions( basedir ) { - // @todo Once we require Node 20.1+, use the new `recursive` option to `fs.readdir` instead of manually recursing here. - // Doing `const files = await fs.readdir( basedir, { recursive: true } );` should suffice. - const files = []; - const ls = async dir => { - for ( const file of await fs.readdir( dir, { withFileTypes: true } ) ) { - const path = npath.join( dir, file.name ); - files.push( npath.relative( basedir, path ) ); - if ( file.isDirectory() ) { - await ls( path ); - } - } - }; - await ls( basedir ); - + const files = await fs.readdir( basedir, { recursive: true } ); const collisions = new Set(); const compare = Intl.Collator( 'und', { sensitivity: 'accent' } ).compare; let prev = null;