diff --git a/projects/packages/jetpack-mu-wpcom/changelog/pcg-guard-updates-default-true b/projects/packages/jetpack-mu-wpcom/changelog/pcg-guard-updates-default-true new file mode 100644 index 00000000000..5d886832c7d --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/pcg-guard-updates-default-true @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Plugin Conflicts Guardian: pcg_guard_updates now defaults to true, enabling the post-update health check and rollback flow by default. diff --git a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/README.md b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/README.md index a3cdd389901..a649905499b 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/README.md +++ b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/README.md @@ -5,7 +5,7 @@ Pre-flight plugin-activation check. When an admin clicks Activate (or finishes a Two independent filters: - `pcg_guard_activation` — enables the activation probe and the syntax-only install/update gate. Defaults `true`. -- `pcg_guard_updates` — enables the post-update health check + rollback flow. Defaults `false`. +- `pcg_guard_updates` — enables the post-update health check + rollback flow. Defaults `true`. ## Files diff --git a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/probe-endpoint.php b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/probe-endpoint.php index d8b606712f1..cd3d9eddc13 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/probe-endpoint.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/probe-endpoint.php @@ -51,8 +51,7 @@ function pcg_maybe_handle_probe() { // pull in the other as an unintended dependency. $is_update_mode = PCG_Load_Tester::MODE_UPDATE === $mode; $gate_filter = $is_update_mode ? 'pcg_guard_updates' : 'pcg_guard_activation'; - $gate_default = ! $is_update_mode; - if ( ! apply_filters( $gate_filter, $gate_default ) ) { + if ( ! apply_filters( $gate_filter, true ) ) { pcg_probe_bail_error( 'Plugin Conflicts Guardian is disabled.', 403 ); } diff --git a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/update-healthcheck.php b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/update-healthcheck.php index 3c8f1e405c5..af4a38652e6 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/update-healthcheck.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/update-healthcheck.php @@ -26,7 +26,7 @@ * @return bool|WP_Error Passed through unchanged. */ function pcg_healthcheck_capture_snapshot( $return, $hook_extra ) { - if ( ! apply_filters( 'pcg_guard_updates', false ) ) { + if ( ! apply_filters( 'pcg_guard_updates', true ) ) { return $return; } if ( ! pcg_healthcheck_is_plugin_pre_install_update( $hook_extra ) ) { @@ -66,7 +66,7 @@ function pcg_healthcheck_capture_snapshot( $return, $hook_extra ) { * @return void */ function pcg_healthcheck_after_update( $upgrader, $hook_extra ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed -- $upgrader is the WP-Upgrader-supplied argument; we accept it for the action signature. - if ( ! apply_filters( 'pcg_guard_updates', false ) ) { + if ( ! apply_filters( 'pcg_guard_updates', true ) ) { return; } if ( ! pcg_healthcheck_is_plugin_update( $hook_extra ) ) {