Skip to content
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

Enhancement/4013 add notice for compat autoptimize aggregatecss rocket cpcss #4525

Conversation

iCaspar
Copy link
Contributor

@iCaspar iCaspar commented Nov 23, 2021

Description

Adds a warning notice to advise users of conflict between Autoptimize Aggregate Inline CSS and CPCSS ("Optimize CSS Delivery")

Fixes #4013

Type of change

  • Enhancement (non-breaking change which improves an existing functionality)
  • This change requires a documentation update

Is the solution different from the one proposed during the grooming?

Yes. This solution builds on the solution from #4501, using the Autoptimize compatibility class implemented there. It is no longer dependent on settings_transients.

How Has This Been Tested?

Integration tests have been added for the new notice method.
Verified functionality locally.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@iCaspar iCaspar requested a review from a team November 23, 2021 15:23
@iCaspar iCaspar self-assigned this Nov 23, 2021
@iCaspar iCaspar added the 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting label Nov 23, 2021
…toptimize-aggregatecss-rocket-cpcss

# Conflicts:
#	inc/ThirdParty/Plugins/Optimization/Autoptimize.php
#	tests/Fixtures/inc/ThirdParty/Plugins/Optimization/Autoptimize/warnWhenJsAggregationAndDelayJsActive.php
#	tests/Integration/inc/ThirdParty/Plugins/Optimization/Autoptimize/warnWhenJsAggregationAndDelayJsActive.php
@Mai-Saad Mai-Saad self-requested a review November 23, 2021 17:25
@Mai-Saad
Copy link
Contributor

@iCaspar @piotrbak
Now Notice is displayed even if Aggregate CSS-files is unchecked (at this point aggregate inline CSS is disabled with its previous state i.e if it was checked then it will be checked and dim) => in this case we normally apply CPCSS on existing files and I think no need for the notice in this case (probably same will be in similar issues). So what do you think?
Screenshot from 2021-11-23 19-59-11
Screenshot from 2021-11-23 19-58-52

@iCaspar
Copy link
Contributor Author

iCaspar commented Nov 23, 2021

On the one hand, the notice isn't really necessary in this case of dimmed sub-options. On the other, since we're not actually changing the behavior of the features, it won't actually break anything.
@piotrbak Shall we try to fix this now for 3.10.4, or later for 3.10.5?

@iCaspar
Copy link
Contributor Author

iCaspar commented Nov 23, 2021

@piotrbak @Mai-Saad
The last change should take into account the "up the chain" settings for both this and the previous (DelayJS/AggregateJS) notices. The last one (#4528) is the main CSS setting, so shouldn't be affected by this.

Copy link
Contributor

@Mai-Saad Mai-Saad 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

@engahmeds3ed engahmeds3ed merged commit 7b69a64 into develop Nov 24, 2021
@engahmeds3ed engahmeds3ed deleted the enhancement/4013-add-notice-for-compat-autoptimize-aggregatecss-rocket-cpcss branch November 24, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoptimize compatibility: make CPCSS compatible when using their "aggregate inline CSS" option
4 participants