-
Notifications
You must be signed in to change notification settings - Fork 823
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
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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. |
Code Coverage SummaryCoverage changed in 4 files.
2 files are newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
There was a problem hiding this 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.
projects/plugins/boost/changelog/remove-boost-isa-filter-HOG-209
Outdated
Show resolved
Hide resolved
projects/plugins/boost/app/modules/image-size-analysis/class-image-size-analysis.php
Outdated
Show resolved
Hide resolved
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; | ||
} ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
projects/plugins/boost/tests/php/Image_Size_Analysis_Deprecation_Test.php
Show resolved
Hide resolved
Co-authored-by: Peter Petrov <[email protected]>
Fixes HOG-209
Proposed changes:
Other information:
Jetpack product discussion
pc9hqz-3CD-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions: