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

Closes #7280: Preload Fonts - Enable feature automatically for specific cases #7319

Open
wants to merge 18 commits into
base: feature/3.19
Choose a base branch
from

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Feb 21, 2025

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

  • Enhancement (non-breaking change which improves an existing functionality).

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 the maybe_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 the maybe_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 the get_subscribed_events method to include the version parameters in the maybe_enable_auto_preload_fonts callback.

New dependencies

None

Risks

None

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

@Miraeld Miraeld requested a review from a team February 21, 2025 04:10
@Miraeld Miraeld self-assigned this Feb 21, 2025
Copy link

codacy-production bot commented Feb 21, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 01c2bc21 0.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (01c2bc2) Report Missing Report Missing Report Missing
Head commit (b220bad) 39748 17425 43.84%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7319) 28 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Base automatically changed from feature/preload-fonts to feature/3.19 February 24, 2025 13:45
Copy link
Contributor

@wordpressfan wordpressfan left a 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

Comment on lines 304 to 306
if ( version_compare( $old_version, '3.19', '>' ) ) {
return;
}
Copy link
Contributor

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.

@Miraeld Miraeld requested a review from wordpressfan February 28, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.19 - Preload Fonts - Enable feature automatically for specific cases
3 participants