-
Notifications
You must be signed in to change notification settings - Fork 220
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
Fix 4472 - Display notice when DelayJS is activated with Autoptimize Aggregate JS already in effect #4501
Fix 4472 - Display notice when DelayJS is activated with Autoptimize Aggregate JS already in effect #4501
Conversation
This approach should work, as the integration tests prove that notice data is added to the Marking this as blocked by #4314. |
@iCaspar Please find notes below based on test analysis and exploratory test: 1- If Delay JS was enabled, then we enable auto-optimize with the aggregate JS features => no warning will be displayed (we will need to re-enable delay js to see the warning), can we display the warning without needing to re-enable Delay JS (maybe with cache clear, refresh settings)? 2- When Autooptimize aggregate js files and inline js is enabled along with WPR LL video and preview image, result in removing LL videos script from HTML => Do we need a separate GH issue for that? or is it something we can handle on this PR? (same already on trunk) 3- @piotrbak Q: Why not handle the current conflict, the same way as we do with minify/combine CSS/JS (disable the option and display red msg)? 4- Just for UI confirmation => Current msg which is displayed only when enable delay js while aggregate options are enabled in auto-optimize is as attached, is this what we need? |
@Mai-Saad When it comes to the 3: @iCaspar Can we make the warning border yellow instead of blue? |
For 2: For 4:
CSS files are disabled because the CSS optimisations are enabled in the Autoptimize, below we have an explanation |
@piotrbak @Mai-Saad On 2, interaction with Lazyload -- this PR is ONLY about messaging -- see the User Story. It will not include any fixes for conflicts with LazyLoad (or anything else). On 3, see 2. On 4, the message is (again) specified in the User Story. |
@iCaspar Will it be possible to cover both scenarios? We want to display the warning in all possible use cases. The same should be applied to other Autoptimize compatibilities. Sorry for the misunderstanding. |
@piotrbak No problem. Let's update the User Story and I can make that change this morning. |
This will display the notice as expected, but the integration test will not run in isolation. Other functions from preload still run on admin_notice.
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.
Small minor comments
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.
Working as expected.
As per discussion, we agreed on the following notes:
- Notice won't be displayed after dismissing with plugin(s) reactivation (with same settings), import same settings
- Notice will be normally displayed when delay js is enabled independent of exclusions (i.e with default exclusions, notice is displayed)
- When enabling autoptimize while LL video is enabled, LL video will be automatically unchecked (this is already on the trunk and added ticket for this)
testrail-report-311.pdf
Description
Please include a summary of the change and which issue is fixed/closed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #4472
Fixes #3707
Type of change
Is the solution different from the one proposed during the grooming?
Yes
In the grooming I had thought we would be adding a helper notice into the DelayJS selection field. In fact, we are adding a notice to the notices area at the top of the page.
Also, to do this, we had been adding the notice via the '
settings_errors
transient, but that was failing to display messages properly. Instead, this adds a method in the DelayJS Admin/Subscriber to check if Autoptimize Aggregate JS is active, and if so, usesadd_settings_errors()
for display.How Has This Been Tested?
Checklist:
Please delete the options that are not relevant.