woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
235 stars 206 forks source link

Font issues with locally hosted fonts #2489

Open lnsbckr opened 1 year ago

lnsbckr commented 1 year ago

Describe the bug In the stripe payment gateway iframe on the woocommerce checkout page the fonts are not displayed correctly (see screenshot). It looks like the font is generated inline by the javascript. The issue seems to be resolved as soon as I deactivate our GDPR cookie plugin blocking cookies and external resources.

To Reproduce Steps to reproduce the behavior:

  1. Go to woocommerce checkout
  2. Chose Stripe/WooCommerce Payments option

Expected behavior Change the javascript code of the iframe that is generating what font will be used.

Screenshots

Screenshot 2022-12-01 at 15 20 48

Environment (please complete the following information):

ricardo commented 1 year ago

Hi there @lnsbckr,

The issue seems to be resolved as soon as I deactivate our GDPR cookie plugin blocking cookies and external resources.

What's the plugin name on WordPress.org?

From what you said, it looks like the GDPR plugin is conflicting with the Stripe plugin and you managed to fix the issue by disabling the GDPR plugin.

Change the javascript code of the iframe that is generating what font will be used.

I'm not sure I understand the suggestion. If the GDPR blocks external resources, I'm afraid there's nothing we can do.

shameemreza commented 1 month ago

Another report here: 8722392-zen Thread link: https://wordpress.org/support/topic/why-your-plugin-is-loading-google-fonts-from-cdn-when-it-is-not-used

As a workaround, I suggested discussing with their theme developer so they can hook into Stripe's hooks.

dziudek commented 1 month ago

Hi,

I have reported the bug mentioned by @shameemreza - unfortunately your suggested solution from https://woocommerce.com/document/stripe/customization/style-payment-form/#section-3 is not working - your scripts are still loading Google fonts

dziudek commented 1 month ago

Also for further debugging - the problem occurs only when Stripe payment gateway is enabled - the Google fonts are downloaded via fetch (it is not included in the website source code):

Screenshot 2024-09-16 at 08 36 33

Additionally the request refers to this point:

Screenshot 2024-09-16 at 08 38 00

So it seems to be triggered by your scripts not the theme or other plugin