From 911ff9ab9dc6ad76a96f8c6741f04a6eb39883c3 Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Wed, 8 Jan 2025 15:49:22 -0500 Subject: [PATCH 1/8] Add VIP_SEARCH_ENABLED_BY (#6082) * Add new constant VIP_SEARCH_ENABLED_BY * Add to SDS for tracking * Move up * lint --- 000-vip-init.php | 3 +++ config/class-site-details-index.php | 2 ++ integrations/enterprise-search.php | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/000-vip-init.php b/000-vip-init.php index dce6df9fa4..4897b83cdf 100644 --- a/000-vip-init.php +++ b/000-vip-init.php @@ -280,6 +280,9 @@ if ( ( defined( 'USE_VIP_ELASTICSEARCH' ) && USE_VIP_ELASTICSEARCH ) || // legacy constant name ( defined( 'VIP_ENABLE_VIP_SEARCH' ) && true === VIP_ENABLE_VIP_SEARCH ) ) { require_once __DIR__ . '/search/search.php'; + if ( ! defined( 'VIP_SEARCH_ENABLED_BY' ) ) { + define( 'VIP_SEARCH_ENABLED_BY', 'constant' ); + } } // Set WordPress environment type diff --git a/config/class-site-details-index.php b/config/class-site-details-index.php index bd3dd2f1ff..022ddcd402 100644 --- a/config/class-site-details-index.php +++ b/config/class-site-details-index.php @@ -260,10 +260,12 @@ public function get_search_info() { $search_info['enabled'] = true; $search_info['query_integration_enabled'] = \Automattic\VIP\Search\Search::is_query_integration_enabled(); $search_info['network_enabled'] = defined( 'EP_IS_NETWORK' ) && true === constant( 'EP_IS_NETWORK' ); + $search_info['enabled_by'] = defined( 'VIP_SEARCH_ENABLED_BY' ) ? constant( 'VIP_SEARCH_ENABLED_BY' ) : 'unknown'; } else { $search_info['enabled'] = false; $search_info['query_integration_enabled'] = false; $search_info['network_enabled'] = false; + $search_info['enabled_by'] = false; } return $search_info; diff --git a/integrations/enterprise-search.php b/integrations/enterprise-search.php index 39b5ab4e02..d1ad2d6234 100644 --- a/integrations/enterprise-search.php +++ b/integrations/enterprise-search.php @@ -44,6 +44,10 @@ public function load(): void { } else { require_once __DIR__ . '/../search/search.php'; } + + if ( ! defined( 'VIP_SEARCH_ENABLED_BY' ) ) { + define( 'VIP_SEARCH_ENABLED_BY', 'integration' ); + } } /** From 8f9d8a013dc8a078c6bb44926c48252df9cfeea5 Mon Sep 17 00:00:00 2001 From: Rinat K Date: Wed, 8 Jan 2025 15:29:44 -0600 Subject: [PATCH 2/8] Update Jetpack submodule to 14.2 (#6083) --- jetpack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetpack b/jetpack index bffb936e33..13e4e39d56 160000 --- a/jetpack +++ b/jetpack @@ -1 +1 @@ -Subproject commit bffb936e330309322d6f165bfc46f931aba0ac5a +Subproject commit 13e4e39d563ced4c36eb7ae61e242b3dc3b59e3e From cb46606546811e04368a8e1ecd781ad8e24ad703 Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Thu, 9 Jan 2025 13:28:07 -0500 Subject: [PATCH 3/8] Jetpack: Update to 14.2 (#6084) * Jetpack: Update to 14.2 * lint --- jetpack.php | 7 +++++-- tests/test-jetpack.php | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jetpack.php b/jetpack.php index d2c4a964e9..e399482342 100644 --- a/jetpack.php +++ b/jetpack.php @@ -31,9 +31,12 @@ function vip_default_jetpack_version() { } elseif ( version_compare( $wp_version, '6.5', '<' ) ) { // WordPress 6.4.x return '13.6'; - } else { - // WordPress 6.5 and newer. + } elseif ( version_compare( $wp_version, '6.6', '<' ) ) { + // WordPress 6.5.x return '14.0'; + } else { + // WordPress 6.6 and newer. + return '14.2'; } } diff --git a/tests/test-jetpack.php b/tests/test-jetpack.php index ebfb9ac179..d85a6a14ea 100644 --- a/tests/test-jetpack.php +++ b/tests/test-jetpack.php @@ -7,7 +7,7 @@ public function test__vip_default_jetpack_version() { global $wp_version; $saved_wp_version = $wp_version; - $latest = '14.0'; + $latest = '14.2'; $versions_map = [ // WordPress version => Jetpack version @@ -15,7 +15,7 @@ public function test__vip_default_jetpack_version() { '6.2' => '12.8', '6.3' => '13.1', '6.4' => '13.6', - '6.5' => $latest, + '6.5' => '14.0', '6.6' => $latest, ]; From 07d498d48baf82ff4cd8261a3964ae886ed4730a Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Mon, 13 Jan 2025 17:52:52 -0500 Subject: [PATCH 4/8] Update Jetpack submodule to 14.2.1 (#6085) --- jetpack | 2 +- jetpack.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jetpack b/jetpack index 13e4e39d56..e32e542192 160000 --- a/jetpack +++ b/jetpack @@ -1 +1 @@ -Subproject commit 13e4e39d563ced4c36eb7ae61e242b3dc3b59e3e +Subproject commit e32e5421925e9cde59e0c4799825b3ed5b54c764 diff --git a/jetpack.php b/jetpack.php index e399482342..0323c936d3 100644 --- a/jetpack.php +++ b/jetpack.php @@ -4,7 +4,7 @@ * Plugin URI: https://jetpack.com * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things. * Author: Automattic - * Version: 14.0 + * Version: 14.2.1 * Author URI: https://jetpack.com * License: GPL2+ * Text Domain: jetpack From 3bfa28dd10077469e69abb4867a7345b9bd45bb8 Mon Sep 17 00:00:00 2001 From: Caleb Burks Date: Tue, 14 Jan 2025 01:58:09 -0600 Subject: [PATCH 5/8] Update Cron Control publish queries (#6097) --- .../.github/workflows/ci-grunt.yaml | 3 +- .../.github/workflows/ci-php.yaml | 29 ++-- .../cron-control/.github/workflows/phpcs.yaml | 21 +-- .../unit-tests/test-internal-events.php | 143 +++++++++++++++++- .../includes/class-internal-events.php | 4 +- cron/cron-control/package-lock.json | 28 ++-- 6 files changed, 171 insertions(+), 57 deletions(-) diff --git a/cron/cron-control/.github/workflows/ci-grunt.yaml b/cron/cron-control/.github/workflows/ci-grunt.yaml index df0574eda5..8a354446be 100644 --- a/cron/cron-control/.github/workflows/ci-grunt.yaml +++ b/cron/cron-control/.github/workflows/ci-grunt.yaml @@ -13,7 +13,6 @@ env: jobs: build: - if: "!contains(github.event.head_commit.message, '[ci skip]')" name: Run Grunt tasks runs-on: ubuntu-latest steps: @@ -24,7 +23,7 @@ jobs: uses: actions/setup-node@v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - caching: true + cache: npm - name: Install dependencies run: npm ci --ignore-scripts diff --git a/cron/cron-control/.github/workflows/ci-php.yaml b/cron/cron-control/.github/workflows/ci-php.yaml index 63b5e70c94..5e0239a064 100644 --- a/cron/cron-control/.github/workflows/ci-php.yaml +++ b/cron/cron-control/.github/workflows/ci-php.yaml @@ -12,13 +12,15 @@ jobs: test: name: Run tests runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: fail-fast: false matrix: php: - - "7.4" - "8.0" + - "8.1" + - "8.2" + - "8.3" + - "8.4" wpmu: - "0" - "1" @@ -34,6 +36,9 @@ jobs: - 3306 options: --health-cmd="healthcheck.sh --innodb_initialized" --health-interval=5s --health-timeout=2s --health-retries=3 steps: + - name: Install svn + run: sudo apt-get update && sudo apt-get install -y subversion + - name: Check out source code uses: actions/checkout@v3.3.0 @@ -42,24 +47,8 @@ jobs: with: php-version: ${{ matrix.php }} - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer packages - uses: actions/cache@v3.2.3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ matrix.php }} - ${{ runner.os }}-php- - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-interaction --ignore-platform-reqs + - name: Install PHP Dependencies + uses: ramsey/composer-install@3.0.0 - name: Verify MariaDB connection run: | diff --git a/cron/cron-control/.github/workflows/phpcs.yaml b/cron/cron-control/.github/workflows/phpcs.yaml index 1570665878..390eb1750c 100644 --- a/cron/cron-control/.github/workflows/phpcs.yaml +++ b/cron/cron-control/.github/workflows/phpcs.yaml @@ -12,7 +12,6 @@ jobs: codestyle: name: Run code style check runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Check out source code uses: actions/checkout@v3.3.0 @@ -20,24 +19,10 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.1 - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Composer packages - uses: actions/cache@v3.2.3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-php-7.4-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-php-7.4 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-interaction --ignore-platform-reqs + - name: Install PHP Dependencies + uses: ramsey/composer-install@3.0.0 - name: Add error matcher run: echo "::add-matcher::$(pwd)/.github/checkstyle-problem-matcher.json" diff --git a/cron/cron-control/__tests__/unit-tests/test-internal-events.php b/cron/cron-control/__tests__/unit-tests/test-internal-events.php index a5447c68bb..c1220d4ee4 100644 --- a/cron/cron-control/__tests__/unit-tests/test-internal-events.php +++ b/cron/cron-control/__tests__/unit-tests/test-internal-events.php @@ -74,12 +74,27 @@ function test_prune_duplicate_events() { $duplicate_recurring_event2 = Utils::create_test_event( [ 'timestamp' => time() + 200, 'action' => 'recurring_event', 'schedule' => 'hourly', 'interval' => \HOUR_IN_SECONDS ] ); $unique_recurring_event = Utils::create_test_event( [ 'timestamp' => time() + 100, 'action' => 'recurring_event', 'schedule' => 'hourly', 'interval' => \HOUR_IN_SECONDS, 'args' => [ 'unique' ] ] ); + // This prevent events starting with `wp_` from being scheduled, like wp_version_check, + // wp_update_plugins or wp_update_themes to avoid affecting the count assertions. + $prevent_wp_cron_events = function ( $event ) { + if ( str_starts_with( $event->hook, 'wp_' ) ) { + return false; + } + return $event; + }; + + // Filter to block any WordPress core cron events so the test events are isolated. + add_filter( 'schedule_event', $prevent_wp_cron_events ); + // Run the pruning. Cron_Control\Internal_Events::instance()->clean_legacy_data(); + // Remove the filter after the pruning calls. + remove_filter( 'schedule_event', $prevent_wp_cron_events ); + // Should have 5 events left, and the oldest IDs should have been kept.. $remaining_events = Cron_Control\Events::query( [ 'limit' => 100, 'orderby' => 'ID', 'order' => 'ASC' ] ); - $this->assertEquals( 5, count( $remaining_events ), 'correct number of registered events left after pruning' ); + $this->assertCount( 5, $remaining_events, 'correct number of registered events left after pruning' ); $this->assertEquals( $remaining_events[0]->get_id(), $original_single_event->get_id(), 'original single event was kept' ); $this->assertEquals( $remaining_events[1]->get_id(), $duplicate_single_event->get_id(), 'duplicate single event was also kept' ); $this->assertEquals( $remaining_events[2]->get_id(), $unique_single_event->get_id(), 'unique single event was kept' ); @@ -92,4 +107,130 @@ function test_prune_duplicate_events() { $this->assertEquals( $duplicate_recurring_1->get_status(), Cron_Control\Events_Store::STATUS_COMPLETED, 'duplicate recurring event 1 was marked as completed' ); $this->assertEquals( $duplicate_recurring_2->get_status(), Cron_Control\Events_Store::STATUS_COMPLETED, 'duplicate recurring event 2 was marked as completed' ); } + + function test_force_publish_missed_schedules() { + // Define the filter callback to override post status. + $future_insert_filter = function ( $data ) { + if ( 'publish' === $data['post_status'] ) { + $data['post_status'] = 'future'; // Ensure it remains future even if the date is in the past. + } + return $data; + }; + + // Add the filter to ensure 'future' posts with past dates are not auto-published. + add_filter( 'wp_insert_post_data', $future_insert_filter ); + + // Create two posts with a 'future' status. + $this->factory()->post->create( + array( + 'post_title' => 'Future post that should be published', + 'post_status' => 'future', + 'post_type' => 'post', + 'post_date' => gmdate( 'Y-m-d H:i:s', time() - 1000 ), + ) + ); + + $this->factory()->post->create( + array( + 'post_title' => 'Future post that should not be published', + 'post_status' => 'future', + 'post_type' => 'post', + 'post_date' => gmdate( 'Y-m-d H:i:s', time() + 1000 ), + ) + ); + + // Remove the filter after creating the test posts. + remove_filter( 'wp_insert_post_data', $future_insert_filter ); + + // Count posts with 'future' status before running the method. + $future_posts_before = get_posts( + array( + 'post_status' => 'future', + 'numberposts' => -1, + ) + ); + + $this->assertCount( 2, $future_posts_before, 'Two posts should be scheduled initially.' ); + + // Run the function to publish missed schedules. + Cron_Control\Internal_Events::instance()->force_publish_missed_schedules(); + + // Query posts again after running the function. + $future_posts_after = get_posts( + array( + 'post_status' => 'future', + 'post_type' => 'post', + 'numberposts' => -1, + ) + ); + + $published_posts = get_posts( + array( + 'post_status' => 'publish', + 'post_type' => 'post', + 'numberposts' => -1, + ) + ); + + // Assert counts after the function runs. + $this->assertCount( 1, $future_posts_after, 'One post should still be scheduled.' ); + $this->assertCount( 1, $published_posts, 'One post should be published.' ); + } + + public function test_confirm_scheduled_posts() { + // Create posts with 'future' status. + $future_posts = array( + $this->factory()->post->create( + array( + 'post_title' => '1 hour in the future', + 'post_status' => 'future', + 'post_type' => 'post', + 'post_date' => gmdate( 'Y-m-d H:i:s', strtotime( '+1 hour' ) ), + ) + ), + $this->factory()->post->create( + array( + 'post_title' => '2 hours in the future', + 'post_status' => 'future', + 'post_type' => 'post', + 'post_date' => gmdate( 'Y-m-d H:i:s', strtotime( '+2 hours' ) ), + ) + ), + $this->factory()->post->create( + array( + 'post_title' => '3 hours in the future', + 'post_status' => 'future', + 'post_type' => 'post', + 'post_date' => gmdate( 'Y-m-d H:i:s', strtotime( '+3 hours' ) ), + ) + ), + ); + + // Clear existing cron events to isolate the test. + Utils::clear_cron_table(); + + // Query all cron events to confirm none exist. + $events = Cron_Control\Events::query(); + $this->assertEmpty( $events, 'No scheduled events should exist initially.' ); + + // Call the method to confirm scheduled posts. + Cron_Control\Internal_Events::instance()->confirm_scheduled_posts(); + + // Verify that cron jobs are scheduled for each future post. + foreach ( $future_posts as $future_post_id ) { + $timestamp = wp_next_scheduled( 'publish_future_post', array( $future_post_id ) ); + $this->assertNotFalse( $timestamp, "Cron job should be scheduled for post ID: $future_post_id." ); + } + + // Reschedule one post with a different timestamp and call the method again. + $future_post_gmt_time = strtotime( get_gmt_from_date( get_post( $future_posts[0] )->post_date ) . ' GMT' ); + wp_clear_scheduled_hook( 'publish_future_post', array( $future_posts[0] ) ); + wp_schedule_single_event( $future_post_gmt_time - 3600, 'publish_future_post', array( $future_posts[0] ) ); // Schedule 1 hour earlier. + + Cron_Control\Internal_Events::instance()->confirm_scheduled_posts(); + + // Verify the post's cron job has been rescheduled to the correct timestamp. + $rescheduled_timestamp = wp_next_scheduled( 'publish_future_post', array( $future_posts[0] ) ); + $this->assertEquals( $future_post_gmt_time, $rescheduled_timestamp, 'Cron job for post 1 should be rescheduled to the correct timestamp.' ); + } } diff --git a/cron/cron-control/includes/class-internal-events.php b/cron/cron-control/includes/class-internal-events.php index 808ba85f3f..8d647c3713 100644 --- a/cron/cron-control/includes/class-internal-events.php +++ b/cron/cron-control/includes/class-internal-events.php @@ -146,7 +146,7 @@ public function is_internal_event( $action ): bool { public function force_publish_missed_schedules() { global $wpdb; - $missed_posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_status = 'future' AND post_date <= %s LIMIT 0,100;", current_time( 'mysql', false ) ) ); + $missed_posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} p JOIN (SELECT DISTINCT post_type FROM {$wpdb->posts}) AS t ON p.post_type = t.post_type WHERE post_status = 'future' AND post_date <= %s LIMIT 0,100;", current_time( 'mysql', false ) ) ); foreach ( $missed_posts as $missed_post ) { $missed_post = absint( $missed_post ); @@ -168,7 +168,7 @@ public function confirm_scheduled_posts() { do { $offset = max( 0, $page - 1 ) * $quantity; - $future_posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_date FROM {$wpdb->posts} WHERE post_status = 'future' AND post_date > %s LIMIT %d,%d", current_time( 'mysql', false ), $offset, $quantity ) ); + $future_posts = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_date FROM {$wpdb->posts} p JOIN (SELECT DISTINCT post_type FROM {$wpdb->posts}) AS t ON p.post_type = t.post_type WHERE post_status = 'future' AND post_date > %s LIMIT %d,%d", current_time( 'mysql', false ), $offset, $quantity ) ); if ( ! empty( $future_posts ) ) { foreach ( $future_posts as $future_post ) { diff --git a/cron/cron-control/package-lock.json b/cron/cron-control/package-lock.json index 2b6d2f89e7..16d8c690c9 100644 --- a/cron/cron-control/package-lock.json +++ b/cron/cron-control/package-lock.json @@ -97,12 +97,12 @@ } }, "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { - "fill-range": "^7.1.1" + "fill-range": "^7.0.1" }, "engines": { "node": ">=8" @@ -243,9 +243,9 @@ "dev": true }, "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -1347,12 +1347,12 @@ } }, "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "fill-range": "^7.1.1" + "fill-range": "^7.0.1" } }, "chalk": { @@ -1458,9 +1458,9 @@ "dev": true }, "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From fc27467f1160741cc5746755d2f8140473f1f22e Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Tue, 14 Jan 2025 14:22:05 -0500 Subject: [PATCH 6/8] Integrations: Implement network_wide_enable to disallow inheriting env status automatically (#6096) --- integrations/integration-vip-config.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integrations/integration-vip-config.php b/integrations/integration-vip-config.php index 934b30fbd0..45714eed92 100644 --- a/integrations/integration-vip-config.php +++ b/integrations/integration-vip-config.php @@ -134,6 +134,12 @@ public function get_site_status() { if ( $network_site_status ) { return $network_site_status; } + + $env_config = $this->get_env_config(); + if ( isset( $env_config['network_wide_enable'] ) && 'false' === $env_config['network_wide_enable'] ) { + // If network_wide_enable is false, then return disabled status (rather than inheriting) since $network_site_status wasn't found. + return Env_Integration_Status::DISABLED; + } } return $this->get_value_from_config( 'env', 'status' ); From b444319ea60f07dcb9543bbe7fe5953fa7ca7013 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:03:53 -0600 Subject: [PATCH 7/8] chore(deps-dev): Bump @types/node in /__tests__/e2e (#6095) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.5 to 22.10.6. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- __tests__/e2e/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/__tests__/e2e/package-lock.json b/__tests__/e2e/package-lock.json index 945a7118fb..acfc3bcd0b 100644 --- a/__tests__/e2e/package-lock.json +++ b/__tests__/e2e/package-lock.json @@ -714,9 +714,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", - "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", + "version": "22.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz", + "integrity": "sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==", "dev": true, "dependencies": { "undici-types": "~6.20.0" From 92b3227e134dc0390f3fbd349cdd87c1c2c9f976 Mon Sep 17 00:00:00 2001 From: Caleb Burks Date: Tue, 21 Jan 2025 15:15:18 -0600 Subject: [PATCH 8/8] Set JP plan as a default, but not as an override (#6104) --- jetpack.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/jetpack.php b/jetpack.php index 0323c936d3..a3c111475c 100644 --- a/jetpack.php +++ b/jetpack.php @@ -25,7 +25,7 @@ function vip_default_jetpack_version() { } elseif ( version_compare( $wp_version, '6.3', '<' ) ) { // WordPress 6.2.x. return '12.8'; - } elseif ( version_compare( $wp_version, '6.4', '<' ) ) { + } elseif ( version_compare( $wp_version, '6.4', '<' ) ) { // WordPress 6.3.x return '13.1'; } elseif ( version_compare( $wp_version, '6.5', '<' ) ) { @@ -492,22 +492,17 @@ function vip_jetpack_token_send_signature_error_headers( $error ) { ) ); /** - * Prevent the jetpack_active_plan from ever being overridden. - * - * All VIP sites should always have have a valid Jetpack plan. - * - * This will prevent issues from the plan option being corrupted, - * which can then break features like Jetpack Search. + * Prevent the jetpack_active_plan from missing. + * All VIP sites should always have a valid Jetpack plan. */ -add_filter( 'pre_option_jetpack_active_plan', function ( $pre_option ) { +add_filter( 'default_option_jetpack_active_plan', function ( $default_value ) { if ( true === WPCOM_IS_VIP_ENV && defined( 'VIP_JETPACK_DEFAULT_PLAN' ) ) { - return VIP_JETPACK_DEFAULT_PLAN; + $default_value = VIP_JETPACK_DEFAULT_PLAN; } - return $pre_option; + return $default_value; } ); - /** * Load the jetpack plugin according to several defines: * - If VIP_JETPACK_SKIP_LOAD is true, Jetpack will not be loaded