Skip to content

Commit

Permalink
Connection: Unset jetpack conection active plugins from sync callable…
Browse files Browse the repository at this point in the history
… checksum when sync is not active (#39098)

* Remove the checksum for active plugins, so it gets recalculated when sync gets activated.

* changelog

* Version bump

* Version bump

* Update projects/packages/connection/src/class-plugin-storage.php

Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com>

---------

Co-authored-by: Sergey Mitroshin <sergeymitr@gmail.com>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10599559752

Upstream-Ref: Automattic/jetpack@84631d5
  • Loading branch information
darssen authored and matticbot committed Aug 28, 2024
1 parent 3ef2577 commit 8c96df4
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 86 deletions.
58 changes: 29 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Changed
- Sync: Remove the checksum for active plugins if present when sync is not active, so it gets recalculated when sync gets activated
- Updated package dependencies.

## [2.12.4] - 2024-08-23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Automattic\Jetpack\Connection;

use Jetpack_Options;
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

0 comments on commit 8c96df4

Please sign in to comment.