Skip to content

Blaze: warn before disabling active campaigns#49522

Draft
chriskmnds wants to merge 3 commits into
trunkfrom
add/ads-1159-blaze-disable-warning
Draft

Blaze: warn before disabling active campaigns#49522
chriskmnds wants to merge 3 commits into
trunkfrom
add/ads-1159-blaze-disable-warning

Conversation

@chriskmnds

@chriskmnds chriskmnds commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/a8c/issue/ADS-1159/show-warning-when-user-disables-blaze-module-while-active-campaigns

Proposed changes

  • Add a Blaze package helper that checks whether the connected site has active Blaze campaigns.
  • Expose the campaign status through GET /wp-json/jetpack/v4/blaze/active-campaigns.
  • Add a Jetpack API client helper for the new endpoint.
  • Show a confirmation modal before disabling the Blaze module when active campaigns are present or when the campaign status check is unavailable.
  • Keep the modal centered and content-sized on desktop and mobile viewports.
  • Add PHP and JS test coverage plus changelog entries for the affected projects.

Media

Screenshot 2026-06-10 at 1 58 43 PM

Related product discussion/links

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

Yes. When an admin tries to disable the Blaze module, Jetpack checks whether the connected site has active Blaze campaigns and uses that status to decide whether to show the warning. This does not add new tracking events or persist new user activity.

Testing instructions

Automated checks:

  • pnpm run test-gui -- _inc/client/traffic/blaze/test/component.js
  • pnpm run lint-file -- projects/plugins/jetpack/_inc/client/traffic/blaze.jsx projects/plugins/jetpack/_inc/client/traffic/blaze/test/component.js
  • pnpm run build-client

Manual testing:

  • Build or sync this branch to any connected Jetpack test site where Blaze can initialize, such as a temporary test site (JN) or sandbox.
  • In WP Admin, confirm the Blaze module is enabled and the Traffic settings card is visible.
  • To test the active-campaign warning without using a real campaign, run this WP-CLI fixture on the test site:
wp eval '$site_id = \Automattic\Jetpack\Connection\Manager::get_site_id(); if ( is_wp_error( $site_id ) ) { var_dump( $site_id ); return; } $mods = (array) get_option( "jetpack_active_modules", array() ); if ( ! in_array( "blaze", $mods, true ) ) { $mods[] = "blaze"; update_option( "jetpack_active_modules", array_values( $mods ) ); } set_transient( "jetpack_blaze_active_campaigns_status_" . $site_id, array( "has_active_campaigns" => true, "status" => "active" ), HOUR_IN_SECONDS ); var_export( array( "site_id" => $site_id, "blaze_active" => in_array( "blaze", (array) get_option( "jetpack_active_modules", array() ), true ), "fixture" => get_transient( "jetpack_blaze_active_campaigns_status_" . $site_id ) ) );'
  • Go to Jetpack > Settings > Traffic, or open wp-admin/admin.php?page=jetpack#/traffic.
  • Toggle Blaze off.
  • Confirm the warning modal appears with the title "Active Blaze campaigns are still running".
  • Confirm the modal explains that disabling the setting only hides the Blaze interface, and that campaigns continue to serve ads and charge until stopped in campaign management.
  • Click "Keep Blaze enabled" and confirm the modal closes and Blaze stays enabled.
  • Toggle Blaze off again, then click "Manage campaigns". Confirm the campaign management destination opens and Blaze stays enabled.
  • Toggle Blaze off again, then click "Disable anyway". Confirm the modal closes and the Blaze module is disabled.
  • Re-enable Blaze before continuing if needed.
  • To test the no-active-campaign path, run this WP-CLI fixture:
wp eval '$site_id = \Automattic\Jetpack\Connection\Manager::get_site_id(); if ( is_wp_error( $site_id ) ) { var_dump( $site_id ); return; } $mods = (array) get_option( "jetpack_active_modules", array() ); if ( ! in_array( "blaze", $mods, true ) ) { $mods[] = "blaze"; update_option( "jetpack_active_modules", array_values( $mods ) ); } set_transient( "jetpack_blaze_active_campaigns_status_" . $site_id, array( "has_active_campaigns" => false, "status" => "none" ), HOUR_IN_SECONDS ); var_export( array( "site_id" => $site_id, "blaze_active" => in_array( "blaze", (array) get_option( "jetpack_active_modules", array() ), true ), "fixture" => get_transient( "jetpack_blaze_active_campaigns_status_" . $site_id ) ) );'
  • Go back to Jetpack > Settings > Traffic and toggle Blaze off.
  • Confirm Blaze disables without showing the warning modal.
  • Repeat the active-campaign warning test at a narrow mobile viewport, for example under 600px wide. Confirm the modal stays centered, uses content height, and does not fill the whole page.

@chriskmnds chriskmnds added the [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account label Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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 (Jetpack or WordPress.com Site Helper), and enable the add/ads-1159-blaze-disable-warning branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/ads-1159-blaze-disable-warning
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/ads-1159-blaze-disable-warning

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 github-actions Bot added [JS Package] API [Package] Blaze [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests Admin Page React-powered dashboard under the Jetpack menu RNA labels Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 7, 2026
    • Code freeze: July 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@chriskmnds chriskmnds self-assigned this Jun 10, 2026
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 8 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/blaze/src/class-blaze.php 141/224 (62.95%) 8.00% 1 ❤️‍🩹
projects/js-packages/api/index.jsx 26/154 (16.88%) 0.54% 0 💚
projects/plugins/jetpack/_inc/client/components/settings-group/index.jsx 16/17 (94.12%) 5.88% -1 💚
projects/plugins/jetpack/_inc/client/state/connection/reducer.js 53/79 (67.09%) 1.27% -1 💚
projects/plugins/jetpack/_inc/client/components/settings-card/index.jsx 61/129 (47.29%) 1.55% -2 💚

Full summary · PHP report · JS report

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

Labels

Admin Page React-powered dashboard under the Jetpack menu [JS Package] API [Package] Blaze [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA [Status] In Progress [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant