Skip to content

Conversation

edanzer
Copy link
Contributor

@edanzer edanzer commented Sep 1, 2025

Proposed changes:

BEFORE MERGING: We should merge 191699-ghe-Automattic/wpcom, which adds add_filter( 'jetpack_forms_enable-integrations', '__return_false' ); to WordPress.com. Otherwise as soon as this is merged, integrations will show there. I'd like to get this one merged to make testing the feature flag on WordPress.com easier as part of this PR.

  • Introduces a form integrations feature flag. This defaults to true. Going forward, if any environment (like WordPress.com or VIP, CIAB) wants to hide integrations, they can use the new filter: add_filter( 'jetpack_forms_is_integrations_enabled', '__return_false' );

  • Uses the new feature flag to determine if we show integrations in the form dashboard and form block (rather than checking other elements like isSimpleSite or canUserInstallPlugins).

  • Replaces a similar, existing feature flag in class-dashboard.php file. We need a flag plugin wide, not just in the dashboard.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

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

Testing instructions:

  • Test default: Without any custom code for the feature flag, confirm that integrations interface shows in the forms dashboard and form block block.
  • Test hiding integrations: Turn off integrations with add_filter( 'jetpack_forms_is_integrations_enabled', '__return_false' );, and confirm you no longer see our integrations interface in the forms dashboard or form block.

@edanzer edanzer requested a review from a team September 1, 2025 19:42
@edanzer edanzer self-assigned this Sep 1, 2025
@edanzer edanzer added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Pri] Normal [Package] Forms labels Sep 1, 2025
Copy link
Contributor

github-actions bot commented Sep 1, 2025

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), and enable the add/form-show-integrations-filter branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/form-show-integrations-filter

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 [Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Sep 1, 2025
Copy link
Contributor

github-actions bot commented Sep 1, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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:

No scheduled milestone found for this plugin.

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

Copy link

jp-launch-control bot commented Sep 1, 2025

Code Coverage Summary

Coverage changed in 4 files.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/blocks/contact-form/class-contact-form-block.php 283/588 (48.13%) -0.08% 1 ❤️‍🩹
projects/packages/forms/src/blocks/contact-form/edit.js 0/232 (0.00%) 0.00% 1 ❤️‍🩹
projects/packages/forms/src/class-jetpack-forms.php 8/22 (36.36%) -1.73% 1 ❤️‍🩹
projects/packages/forms/src/dashboard/class-dashboard.php 0/107 (0.00%) 0.00% -1 💚

Full summary · PHP report · JS report

};
},
[ clientId ]
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are seeing a lot of changes here, try hiding white space on the diff. It's easier to read. We just remove canUserInstallPlugins here since we are using the feature flag instead of this permissions check.

@@ -755,7 +748,7 @@ function JetpackContactFormEdit( { name, attributes, setAttributes, clientId, cl
/>
</PanelBody>

{ ! isSimpleSite() && canUserInstallPlugins && (
{ showFormIntegrations && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change. We no longer check ifSimpleSite or check permissions. We just the feature flag. Any given environment (WordPress.com, CIAB, VIP) is now responsible for turning this off if needed.

* @var bool
*/
public static $show_integrations = false;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're just replacing this with the new, more general feature flag / filter.

Copy link
Contributor

@CGastrell CGastrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked well for me. Good call on the function name change.

Copy link
Contributor

@dhasilva dhasilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Package] Forms [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Status] Needs Review This PR is ready for review. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants