From bc231f62f66fa8283ccb8283762b7c5ed50e2c53 Mon Sep 17 00:00:00 2001 From: Foteini Giannaropoulou Date: Mon, 9 Sep 2024 16:15:28 +0300 Subject: [PATCH] Jetpack Sync: Stop syncing 'automatic_updates_complete' actions (#39296) * Jetpack Sync: Stop syncing 'automatic_updates_complete' actions --- ...c-remove-automatic_updates_complete-action | 4 ++++ .../sync/src/modules/class-updates.php | 2 -- ...c-remove-automatic_updates_complete-action | 5 +++++ .../sync/test_class.jetpack-sync-updates.php | 19 ------------------- 4 files changed, 9 insertions(+), 21 deletions(-) create mode 100644 projects/packages/sync/changelog/update-sync-remove-automatic_updates_complete-action create mode 100644 projects/plugins/jetpack/changelog/update-sync-remove-automatic_updates_complete-action diff --git a/projects/packages/sync/changelog/update-sync-remove-automatic_updates_complete-action b/projects/packages/sync/changelog/update-sync-remove-automatic_updates_complete-action new file mode 100644 index 0000000000000..e2d64c93a11a6 --- /dev/null +++ b/projects/packages/sync/changelog/update-sync-remove-automatic_updates_complete-action @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Jetpack Sync: Stop syncing 'automatic_updates_complete' actions diff --git a/projects/packages/sync/src/modules/class-updates.php b/projects/packages/sync/src/modules/class-updates.php index 570e24a46802c..0c31f93a0e10d 100644 --- a/projects/packages/sync/src/modules/class-updates.php +++ b/projects/packages/sync/src/modules/class-updates.php @@ -103,8 +103,6 @@ public function init_listeners( $callable ) { 2 ); - add_action( 'automatic_updates_complete', $callable ); - if ( is_multisite() ) { add_filter( 'pre_update_site_option_wpmu_upgrade_site', array( $this, 'update_core_network_event' ), 10, 2 ); add_action( 'jetpack_sync_core_update_network', $callable, 10, 3 ); diff --git a/projects/plugins/jetpack/changelog/update-sync-remove-automatic_updates_complete-action b/projects/plugins/jetpack/changelog/update-sync-remove-automatic_updates_complete-action new file mode 100644 index 0000000000000..bc4a0243c52d1 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-sync-remove-automatic_updates_complete-action @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Jetpack plugin: Update unit tests + + diff --git a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-updates.php b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-updates.php index 8c206de5e6318..9b794ce33debd 100644 --- a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-updates.php +++ b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-updates.php @@ -202,25 +202,6 @@ public function test_sync_wp_version() { $this->assertEquals( 'bar', $this->server_replica_storage->get_callable( 'wp_version' ) ); } - public function test_automatic_updates_complete_sync_action() { - // Commenting this out for now. wp_maybe_auto_update(); - do_action( - 'automatic_updates_complete', - array( - 'core' => array( - 'item' => array( 'somedata' ), - 'result' => 'some more data', - 'name' => 'WordPress 4.7', - 'messages' => array( 'it worked.' ), - ), - ) - ); - $this->sender->do_sync(); - - $event = $this->server_event_storage->get_most_recent_event( 'automatic_updates_complete' ); - $this->assertTrue( (bool) $event ); - } - public function test_network_core_update_sync_action() { if ( ! is_multisite() ) { $this->markTestSkipped( 'Not compatible with single site mode' );