β π Bug Report: Global fonts always calls fonts.googleapis.com #16023
Labels
bug
Indicates a bug with one or multiple components.
compatibility/assets
Indicates a compatibility problem with scripts or CSS.
compatibility/3rd-party
Indicates a compatibility problem with a 3rd-party plugin or theme.
mod*
[Temp.] For internal use only.
solved
Indicates that an Issue has been Solved, or a Feature Request has been Released.
status/merged
Indicates when a Pull Request has been merged to a Release.
type/global-styles
Indicates when a topic is related to Global Styles.
type/performance
Indicates when a topic is related to Performance.
type/privacy
Indicates when a topic is related to user Privacy.
Prerequisites
Description
The default
elementor_scheme_typography
controls cause an unnecessary fonts.googleapis.com http request that has speed and performance implications and cannot be set to be switched off by default no matter what the user does.Goal: Complete removal of all http requests to Google font servers.
Steps to reproduce
1.) Clean install of Elementor (3.4.0), WordPress (5.8). Default theme: Twenty Twenty-One
2.) Disable Default Colors and Fonts in Elementor -> Settings
3.) Create new Page in Pages -> Add new
4.) Add a heading and a text editor. Observe that typography is set to "Default"
5.) Publish page and open it.
6.) Open network tab in Google Chrome dev tools and search for "fonts.googleapis.com". Observe that a completely unnecessary http request is sent to fonts.googleapis.com
The root cause of this issue is the Site Settings -> Global Fonts trigger Roboto, Robot Slab et. al. to be called even though we disabled Default fonts in Step 2 above.
The
elementor_scheme_typography
DB option looks like this despite Elementor fonts being disabled globally.This additional http request is very expensive for those of us conducting webperf optimization. The only way to avoid it is to manually update Site Settings -> Global Fonts and set it to use "Default" too manually, but this is a problem for lots of reasons:
1.) It's not at all clear that the user needs to do this to avoid the fonts.googleapis.com http request
2.) As far as the user is concerned, they already completed this step in Step 2 above.
3.) The only way to make this change is by first creating a page - so it's not at all obvious to the user that they need to update a global typography scheme option at a page level editor.
I would strongly recommend 2 things:
a.) Update the
elementor_scheme_typography
DB option to remove the Elementor Typography scheme default fonts when a user completes Step 2 above.b.) Allow theme authors/plugin devs to set/filter
elementor_scheme_typography
so as to set this upon installation of a theme.Isolating the problem
Environment
System Info
```== Server Environment ==
Operating System: Darwin
Software: nginx/1.16.0
MySQL version: MySQL Community Server - GPL v8.0.16
PHP Version: 7.3.5
PHP Max Input Vars: 4000
PHP Max Post Size: 1000M
GD Installed: Yes
ZIP Installed: Yes
Write Permissions: All right
Elementor Library: Connected
== WordPress Environment ==
Version: 5.8
Site URL: http://localhost:10003
Home URL: http://localhost:10003
WP Multisite: No
Max Upload Size: 300 MB
Memory limit: 256M
Permalink Structure: Plain
Language: en-US
Timezone: 0
Debug Mode: Active
== Theme ==
Name: Twenty Twenty-One
Version: 1.4
Author: the WordPress team
Child Theme: No
== User ==
Role: administrator
WP Profile lang: en_US
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
== Active Plugins ==
Elementor
Version: 3.4.0
Author: Elementor.com
== Elementor - Compatibility Tag ==
== Elements Usage ==
== Log ==
The text was updated successfully, but these errors were encountered: