Skip to content

Plugin Conflicts Guardian: default pcg_guard_updates to true#48595

Open
arthur791004 wants to merge 1 commit intotrunkfrom
try/pcg-guard-updates-default-true
Open

Plugin Conflicts Guardian: default pcg_guard_updates to true#48595
arthur791004 wants to merge 1 commit intotrunkfrom
try/pcg-guard-updates-default-true

Conversation

@arthur791004
Copy link
Copy Markdown
Contributor

Proposed changes

Follow-up to #48553 (which flipped pcg_guard_activation to default true). This flips the second gate, pcg_guard_updates, the same way:

  • update-healthcheck.php — both apply_filters( 'pcg_guard_updates', false ) callsites (snapshot capture on upgrader_pre_install, post-update healthcheck on upgrader_process_complete) now default true.
  • probe-endpoint.php — drops the per-mode default split ($gate_default = ! $is_update_mode) introduced when only activation defaulted on. With both gates now default true the probe endpoint applies true uniformly: apply_filters( $gate_filter, true ).
  • README.md — updates the pcg_guard_updates line to "Defaults true."

No behavior change for sites that have explicitly filtered pcg_guard_updates to false. For everyone else: post-update probes run, and a fatal-on-update triggers the snapshot-based rollback flow that PCG already had wired up but defaulted dark.

Related product discussion/links

Does this pull request change what data or activity we track or use?

Indirectly — pcg_guard_updates controls whether the Update rolled back logstash event from #48565 fires in the wild. The event payload itself is unchanged.

Testing instructions

  1. Sync jetpack-mu-wpcom to a test site (no explicit pcg_guard_updates filter set).
  2. Install a "good" plugin and activate it.
  3. Update it to a version that fatals only at runtime (passes the parse-error gate).
  4. Expected: post-update probe fails, plugin rolls back to its snapshot, admin notice points at the failed update, and one Update rolled back row lands in the plugin-conflicts-guardian logstash bucket.
  5. Add add_filter( 'pcg_guard_updates', '__return_false' ); and repeat — expected: snapshot is not captured, no probe runs, update completes (or fatals) without rollback.
  6. Activation guard regression check: clicking Activate on a fataling plugin still blocks via the activation guard (unchanged).

🤖 Generated with Claude Code

Post-update health check, snapshot capture, and the update-mode probe
endpoint now default on. Mirrors the prior pcg_guard_activation
default-true switch — both gates can now also drop the per-mode default
split in probe-endpoint.php and apply true uniformly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the try/pcg-guard-updates-default-true branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin try/pcg-guard-updates-default-true

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label May 7, 2026
@arthur791004 arthur791004 added the [Status] Needs Review This PR is ready for review. label May 7, 2026
@arthur791004 arthur791004 requested a review from taipeicoder May 7, 2026 09:32
@arthur791004 arthur791004 self-assigned this May 7, 2026
@jp-launch-control
Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/plugin-conflicts-guardian/probe-endpoint.php 0/81 (0.00%) 0.00% -1 💚

Full summary · PHP report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs [mu wpcom Feature] Plugin Conflicts Guardian [Package] Jetpack mu wpcom WordPress.com Features [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants