Skip to content

Disable Jetpack Stats for local sites#4035

Draft
shaunandrews wants to merge 3 commits into
trunkfrom
stu-1945-disable-jetpack-stats
Draft

Disable Jetpack Stats for local sites#4035
shaunandrews wants to merge 3 commits into
trunkfrom
stu-1945-disable-jetpack-stats

Conversation

@shaunandrews

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Codex investigated the localhost Stats repro, confirmed that local Studio-rendered pages can emit Jetpack Stats pixels with live blog IDs, and prepared this scoped fix. I reviewed the generated change and kept the PR limited to the Studio MU plugin behavior plus a regression test.

Proposed Changes

  • Prevent Studio-served local sites from reporting page views to the remote WordPress.com/Jetpack Stats site when an imported or synced local database still contains a live Jetpack connection.
  • Preserve the existing local-development behavior that disables Jetpack Protect for auto-login, while also disabling Jetpack Stats through the same module filter path.
  • Keep the fix server-side in the local WordPress runtime so it applies to Studio previews, thumbnail captures, and local sites opened in an external browser.

Testing Instructions

  • npx eslint --fix tools/common/lib/mu-plugins.ts tools/common/lib/tests/mu-plugins.test.ts
  • npm test -- tools/common/lib/tests/mu-plugins.test.ts
  • npm run typecheck

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@shaunandrews shaunandrews changed the title [codex] Disable Jetpack Stats for local sites Disable Jetpack Stats for local sites Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant