Self-hosted Google Fonts are not preloaded with Remove Unused CSS when the HTTPS protocol is missing
Describe the bug
When Google Fonts are included without the HTTPS protocol and the 'Self-host Google Fonts' option is enabled along with the 'Remove Unused CSS' option, the non-self-hosted fonts are preloaded instead.
Here is an example of code that triggers this issue:
<link href="//fonts.googleapis.com/css?family=Lato:100,100italic,300,300italic,400,400italic,700,700italic,900,900italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
Once we add the HTTPS protocol, self-hosted fonts were preloaded.
To Reproduce Steps to reproduce the behavior:
- Add a Google fonts CSS without the HTTPS protocol.
- Add a CSS font-family using the Google fonts to an HTML element.
- Clear the Used CSS of the testing page.
- See the preload fonts, the Google fonts are loaded from https://fonts.gstatic.com
Expected behavior We should preload the Self-hosted fonts.
Screenshots Without the HTTPS protocol:
With the HTTPS protocol:
Additional context
Slack discussion: https://wp-media.slack.com/archives/C07PZNW7BJ5/p1737643980094689 HelpScout ticket: https://secure.helpscout.net/conversation/2823761415/535995?viewId=8127840
Hello team!
Same situation here, Ticket
Slack discussion: Font https://fonts.googleapis.com/css?family=Akatab%3A400%2C700%7CBayon%3A400%2C700&ver=6.7.2
Is referenced in the HTML Without the HTTPS protocol:
Screenshot: https://jmp.sh/khaxVtct
Self-host Google Fonts not applied.
another case: https://secure.helpscout.net/conversation/3112443619/593527?viewId=377611