Compatibility
-
Hi,
I have discovered an issue when using Polylang or other multilingual plugins.
The font-icons cannot be loaded on some servers due to CORS restrictions.The issue is that the
XOO_WSC_URL
constant is being defined before the plugins have had a chance to filter the siteurl inplugins_url()
. This means that theXOO_WSC_URL
constant will contain the primary URL and this is causing the issue since fonts often come with CORS restrictions.The fix/workaround for it? Either skip using the
XOO_WSC_URL
constant or movedefine("XOO_WSC_URL", plugins_url('/',__FILE__));
inside anadd_action('init', ...)
function to ensure the rest of the plugins have a chance to add their filters.—
This is currently only an issue with the font CSS file so changing the following line in class-xoo-wsc-public.php:60:
wp_enqueue_style( $this->xoo_wsc.'-fonts', XOO_WSC_URL . 'lib/fonts/xoo-wsc-fonts.css', array(), $this->version, 'all' );
=>
wp_enqueue_style( $this->xoo_wsc.'-fonts', '/wp-content/plugins/woocommerce-side-cart-premium/lib/fonts/xoo-wsc-fonts.css', array(), $this->version, 'all' );
—
How to test
Activate 2+ languages on a website that contains the plugin and woocommerce.
Go to another language than the primary one.
These languages have to use different domains (ex: website.com & website.de) since it’s a Cross Domain issue. So using /en/ or /de/ will not cause it.This should cause CORS issues that ends up in the icons not being loaded.
- The topic ‘Compatibility’ is closed to new replies.