Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection: Unset jetpack conection active plugins from sync callable checksum when sync is not active #39098

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Sync: Remove the checksum for active plugins if present when sync is not active, so it gets recalculated when sync gets activated
8 changes: 7 additions & 1 deletion projects/packages/connection/src/class-plugin-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Automattic\Jetpack\Connection;

use Jetpack_options;
darssen marked this conversation as resolved.
Show resolved Hide resolved
use WP_Error;

/**
Expand Down Expand Up @@ -222,9 +223,14 @@ public static function maybe_update_active_connected_plugins() {
public static function update_active_plugins_option() {
// Note: Since this option is synced to wpcom, if you change its structure, you have to update the sanitizer at wpcom side.
update_option( self::ACTIVE_PLUGINS_OPTION_NAME, self::$plugins );

if ( ! class_exists( 'Automattic\Jetpack\Sync\Settings' ) || ! \Automattic\Jetpack\Sync\Settings::is_sync_enabled() ) {
self::update_active_plugins_wpcom_no_sync_fallback();
// Remove the checksum for active plugins, so it gets recalculated when sync gets activated.
$jetpack_callables_sync_checksum = Jetpack_Options::get_raw_option( 'jetpack_callables_sync_checksum' );
if ( isset( $jetpack_callables_sync_checksum['jetpack_connection_active_plugins'] ) ) {
unset( $jetpack_callables_sync_checksum['jetpack_connection_active_plugins'] );
Jetpack_Options::update_raw_option( 'jetpack_callables_sync_checksum', $jetpack_callables_sync_checksum );
}
}
}

Expand Down
Loading