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

Request - Combine Google Font Requests as an Option #112

Closed
idevwebs opened this Issue Sep 23, 2017 · 9 comments

Comments

4 participants
@idevwebs

idevwebs commented Sep 23, 2017

Great plugin. Thank you for your works.

In addition to "Remove Google Fonts" I think it would be great if there was a "Combine Google Font Requests" option as well.

In pagespeed for a site I'm working on, ironically google complains about 6 separate font requests and suggests reducing number of requests. Between all the plugins and theme features, one can end up with many different font lines in the html. In my case, 6.

All can be combined to a single request:

For example:

    <link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Ubuntu:400,700,400italic,700italic' rel='stylesheet' type='text/css'>

Down to:

<link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700|Ubuntu:400,700,400italic,700italic' rel='stylesheet' type='text/css'>

Hopefully this can be a quick addition to your plugin.

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Sep 24, 2017

Owner

Thanks for the suggestion @idevwebs. although this is not my focus for now, I might add this at a later stage. And if you're into development, I do welcome Pull Requests, so ... :-)

Owner

futtta commented Sep 24, 2017

Thanks for the suggestion @idevwebs. although this is not my focus for now, I might add this at a later stage. And if you're into development, I do welcome Pull Requests, so ... :-)

@futtta futtta added the enhancement label Sep 24, 2017

@zytzagoo

This comment has been minimized.

Show comment
Hide comment
@zytzagoo
Collaborator

zytzagoo commented Oct 12, 2017

You may want to give https://github.com/zytzagoo/wp-google-fonts-optimizer a try :)

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 6, 2017

Owner

Update: I'm working on "AO Extra", which is a separate plugin for now but which will be integrated in Autoptimize and optimizing Google Fonts will actually be one of the new features (the last one to be added, working on it now).

Owner

futtta commented Dec 6, 2017

Update: I'm working on "AO Extra", which is a separate plugin for now but which will be integrated in Autoptimize and optimizing Google Fonts will actually be one of the new features (the last one to be added, working on it now).

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 7, 2017

Owner

I just committed the Google Font optimization (choice between "remove", "combine fonts & link" and "combine fonts and load asynchronous with webfont.js") feature to AO Extra (it will integrate with your Autoptimize installation), so if you want download https://github.com/futtta/ao_extra/archive/master.zip and give it a spin maybe? :-)

Owner

futtta commented Dec 7, 2017

I just committed the Google Font optimization (choice between "remove", "combine fonts & link" and "combine fonts and load asynchronous with webfont.js") feature to AO Extra (it will integrate with your Autoptimize installation), so if you want download https://github.com/futtta/ao_extra/archive/master.zip and give it a spin maybe? :-)

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 7, 2017

Owner

closing here, feedback welcome at https://github.com/futtta/ao_extra/issues/ :-)

Owner

futtta commented Dec 7, 2017

closing here, feedback welcome at https://github.com/futtta/ao_extra/issues/ :-)

@futtta futtta closed this Dec 7, 2017

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Dec 17, 2017

Owner

just added all of ao_extra to autoptimize dev version (here on github), feedback would be very welcome @idevwebs :-)

Owner

futtta commented Dec 17, 2017

just added all of ao_extra to autoptimize dev version (here on github), feedback would be very welcome @idevwebs :-)

@winstondu

This comment has been minimized.

Show comment
Hide comment
@winstondu

winstondu Jul 1, 2018

@futtta , for some reason "combine fonts and load asynchronously with webfont.js" appears to not be asynchronous.

The webfont loader script is forced into head for my website (http://vanderbilthistoricalreview.com/), which is fine (and I expect intended), except for some reason my sites header code has wf.defer = 'true' even though you clearly wrote "async='true'" at https://github.com/futtta/ao_extra/blob/master/ao_extra.php#L225

This behavior occurs even with all of my other plugins turned off. I suspect somewhere in Auto-optimize, the plugin is aggressive adding "defer = 'true'".

I noticed in a user's question about a separate issue a couple of months, they also have "defer = 'true'" on their header despite having the option on. See:
https://wordpress.org/support/topic/combine-and-load-fonts-asy-webfont-js-not-working-properly/

winstondu commented Jul 1, 2018

@futtta , for some reason "combine fonts and load asynchronously with webfont.js" appears to not be asynchronous.

The webfont loader script is forced into head for my website (http://vanderbilthistoricalreview.com/), which is fine (and I expect intended), except for some reason my sites header code has wf.defer = 'true' even though you clearly wrote "async='true'" at https://github.com/futtta/ao_extra/blob/master/ao_extra.php#L225

This behavior occurs even with all of my other plugins turned off. I suspect somewhere in Auto-optimize, the plugin is aggressive adding "defer = 'true'".

I noticed in a user's question about a separate issue a couple of months, they also have "defer = 'true'" on their header despite having the option on. See:
https://wordpress.org/support/topic/combine-and-load-fonts-asy-webfont-js-not-working-properly/

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta
Owner

futtta commented Jul 1, 2018

@winstondu

This comment has been minimized.

Show comment
Hide comment
@winstondu

winstondu Jul 1, 2018

Ah. Didn't realize 2.3.4 still had defer = 'true'. Will definitely switch to 2.4.
Thanks so much for this excellent plugin.

winstondu commented Jul 1, 2018

Ah. Didn't realize 2.3.4 still had defer = 'true'. Will definitely switch to 2.4.
Thanks so much for this excellent plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment