Skip to content

Boost: add filter to disable ISA UI #44287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 15, 2025
Merged

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Jul 11, 2025

Fixes HOG-209

Proposed changes:

  • Adds a filter that, by default, removes the ISA from the main Boost page.
  • Removes reference to the feature in the upsell modal

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

pc9hqz-3CD-p2

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

No.

Testing instructions:

  • On a new site, choose Free Boost.
  • Ensures on the Boost settings page, there is not an upsell for the feature.
  • Add paid Boost.
  • Ensure there is not the ISA settings area.
  • Add a filter:
    add_filter( 'jetpack_boost_image_size_analysis_display_ui', '__return_true' );
  • See the settings on the Boost settings page.

@kraftbj kraftbj added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Jul 11, 2025
@kraftbj kraftbj self-assigned this Jul 11, 2025
@kraftbj kraftbj requested review from dilirity and a team July 11, 2025 17:25
Copy link
Contributor

github-actions bot commented Jul 11, 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!


Boost 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 Jul 11, 2025

Code Coverage Summary

Coverage changed in 4 files.

File Coverage Δ% Δ Uncovered
projects/plugins/boost/app/modules/image-size-analysis/data-sync/class-data-sync-schema.php 0/117 (0.00%) 0.00% 5 💔
projects/plugins/boost/app/assets/src/js/features/image-guide/image-guide.tsx 0/7 (0.00%) 0.00% 1 ❤️‍🩹
projects/plugins/boost/app/assets/src/js/pages/index/index.tsx 0/16 (0.00%) 0.00% 1 ❤️‍🩹
projects/plugins/boost/app/modules/image-size-analysis/class-image-size-analysis.php 1/10 (10.00%) 10.00% 1 ❤️‍🩹

2 files are newly checked for coverage.

File Coverage
projects/plugins/boost/app/assets/src/js/features/image-size-analysis/lib/stores/isa-ui-state.ts 0/2 (0.00%) 💔
projects/plugins/boost/app/modules/image-size-analysis/data-sync/class-image-size-analysis-ui-state.php 0/3 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@kraftbj kraftbj added [Status] In Progress I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Status] Needs Review This PR is ready for review. and removed [Status] Needs Review This PR is ready for review. [Status] In Progress labels Jul 11, 2025
Copy link
Member

@dilirity dilirity left a comment

Choose a reason for hiding this comment

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

There's two small things and the rest are questions/notes.

After those are done, feel free to merge.

Comment on lines 36 to 42
add_filter( 'jetpack_boost_image_size_analysis_display_ui', function( $should_display ) {
// Show UI only for administrators
if ( current_user_can( 'manage_options' ) ) {
return true;
}
return false;
} );
Copy link
Member

Choose a reason for hiding this comment

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

I get the idea of the example. However, the Boost settings page is only accessible if you have manage_options cap.

It's a nitpick more than anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that's fair. I was just wanting to show an example of conditionally enabling the UI and didn't think about the if the example condition made sense.

@kraftbj kraftbj requested a review from dilirity July 15, 2025 19:47
@kraftbj kraftbj dismissed dilirity’s stale review July 15, 2025 19:47

applied suggestions

@kraftbj kraftbj merged commit db09298 into trunk Jul 15, 2025
69 checks passed
@kraftbj kraftbj deleted the remove/boost/isa/filter-HOG-209 branch July 15, 2025 20:21
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Boost Feature] Image Size Analysis Docs I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Plugin] Boost A feature to speed up the site and improve performance. [Tests] Includes Tests [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.

2 participants