Skip to content

βœ… 🐞 Bug Report: Global fonts always calls fonts.googleapis.com Β #16023

@colmtroy

Description

@colmtroy

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Elementor.

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

  • This bug happens with only Elementor plugin active (and Elementor Pro).
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

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 ==

wp-page : 2
	heading : 1
	text-editor : 1

== Log ==

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates a bug with one or multiple components.compatibility/3rd-partyIndicates a compatibility problem with a 3rd-party plugin or theme.compatibility/assetsIndicates a compatibility problem with scripts or CSS.mod*[Temp.] For internal use only.solvedIndicates that an Issue has been Solved, or a Feature Request has been Released.status/mergedIndicates when a Pull Request has been merged to a Release.type/global-stylesIndicates when a topic is related to Global Styles.type/performanceIndicates when a topic is related to Performance.type/privacyIndicates when a topic is related to user Privacy.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions