-
Notifications
You must be signed in to change notification settings - Fork 228
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
Closes #7280: Preload Fonts - Enable feature automatically for specific cases #7319
base: feature/3.19
Are you sure you want to change the base?
Conversation
Co-authored-by: WordPressFan <[email protected]> Co-authored-by: Michael Lee <[email protected]> Co-authored-by: Gaël Robin <[email protected]>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
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.
A few comments to make it works.
Thanks
if ( version_compare( $old_version, '3.19', '>' ) ) { | ||
return; | ||
} |
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.
This part means that we will bailout when the old version is more than 3.19 and I don't think this is the case here.
I think we need to negate the condition.
Description
Fixes #7280
It will enable automatically if the user is using the old Preload Fonts feature when upgrading to 3.19.
Type of change
Detailed scenario
What was tested
Manual test of this feature.
How to test
When upgrading to 3.19, if the old preload fonts feature was enabled, it should enabled the new one by default.
Technical description
Documentation
This pull request includes changes to the
inc/Engine/Admin/Settings/Subscriber.php
file to improve the handling of font preloading during version upgrades. The most important changes include modifying themaybe_enable_auto_preload_fonts
method to accept version parameters and adding a version comparison check.Enhancements to version handling:
inc/Engine/Admin/Settings/Subscriber.php
: Modified themaybe_enable_auto_preload_fonts
method to accept$new_version
and$old_version
parameters, and added a version comparison check to ensure the method only runs for versions older than 3.19.inc/Engine/Admin/Settings/Subscriber.php
: Updated theget_subscribed_events
method to include the version parameters in themaybe_enable_auto_preload_fonts
callback.New dependencies
None
Risks
None
Mandatory Checklist
Code validation
Code style