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

Add Self-host Google Fonts to the Meta Generator tag #7258

Open
camilamadronero opened this issue Jan 29, 2025 · 4 comments · May be fixed by #7269
Open

Add Self-host Google Fonts to the Meta Generator tag #7258

camilamadronero opened this issue Jan 29, 2025 · 4 comments · May be fixed by #7269
Assignees
Labels
effort: [XS] < 1 day of estimated development time
Milestone

Comments

@camilamadronero
Copy link

Description
The Self-host Google Fonts feature should be included in the listed features of the Meta Generator tag

Additional context
Slack: https://wp-media.slack.com/archives/C8L4EE8N9/p1738107801647279

@piotrbak piotrbak added this to the 3.18.2 milestone Jan 29, 2025
@Miraeld Miraeld added the effort: [XS] < 1 day of estimated development time label Jan 30, 2025
@Miraeld Miraeld self-assigned this Jan 30, 2025
@Miraeld
Copy link
Contributor

Miraeld commented Jan 30, 2025

Scope a solution

In https://github.com/wp-media/wp-rocket/blob/30e6ab6126524fe8f6717babb1360ce066b33a0f/inc/Engine/Support/Meta.php,
We would need to add

		if ( (bool) $this->options->get( 'host_fonts_locally' ) ) {
			$features[] = 'wpr_host_fonts_locally';
		}

exactly here

@wordpressfan
Copy link
Contributor

Looks good to me, if u think also that this will be needed in the future, we can have an array of options as keys and feature names as value then loop over them to check the option and add the feature name into features array, what do u think?

@Miraeld
Copy link
Contributor

Miraeld commented Jan 30, 2025

I totally agree with this @wordpressfan

Pretty simple tho to make it,

Having a array such as:

$features_to_check = [
'name_displayed_in_meta_tag' => 'name_of_feature', 
...
];

And then having a foreach loop:

foreach ( $features_to_check as $meta_name => $option_name ) {
  		if ( (bool) $this->options->get( $option_name ) ) {
			$features[] = $meta_name;
		}
}

1 similar comment
@Miraeld
Copy link
Contributor

Miraeld commented Jan 30, 2025

I totally agree with this @wordpressfan

Pretty simple tho to make it,

Having a array such as:

$features_to_check = [
'name_displayed_in_meta_tag' => 'name_of_feature', 
...
];

And then having a foreach loop:

foreach ( $features_to_check as $meta_name => $option_name ) {
  		if ( (bool) $this->options->get( $option_name ) ) {
			$features[] = $meta_name;
		}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [XS] < 1 day of estimated development time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants