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 #7258: Add self hosted font to metatag generator #7269

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Jan 31, 2025

Description

Fixes #7258

Self hosted google fonts will be added to the meta tag of enabled features.

Type of change

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

Detailed scenario

Refer to the issue.

Technical description

Documentation

This pull request includes significant refactoring and improvements to the get_meta_tag method in the Meta.php file. The changes focus on simplifying the code, improving readability, and enhancing the feature mapping for meta tags.

Key changes include:

Code Simplification and Readability Improvements:

  • Refactored the method to use a more readable and maintainable structure by introducing the $features_to_check array for feature mapping.
  • Simplified the logic for checking and adding features to the $features array, reducing redundancy and improving clarity.

Feature Enhancements:

  • Added a new feature mapping mechanism for meta tags, allowing easier addition and management of features.
  • Improved the handling of mobile/desktop caching and CDN & DNS prefetch checks by streamlining the conditions and making the code more concise.

Meta Tag Generation:

  • Modified the meta tag generation to use sprintf for better readability and maintainability.
  • Ensured that the WP Rocket version inclusion is handled through a filter, maintaining flexibility and configurability.

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 added the type: enhancement Improvements that slightly enhance existing functionality and are fast to implement label Jan 31, 2025
@Miraeld Miraeld requested a review from a team January 31, 2025 12:47
@Miraeld Miraeld self-assigned this Jan 31, 2025
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -0.10%) 94.74% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5b018e4) 38787 17157 44.23%
Head commit (078e1cd) 38791 (+4) 17160 (+3) 44.24% (+0.00%)

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 (#7269) 19 18 94.74%

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Self-host Google Fonts to the Meta Generator tag
1 participant