• 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 in plugins_url(). This means that the XOO_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 move define("XOO_WSC_URL", plugins_url('/',__FILE__)); inside an add_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.

    • This topic was modified 5 years, 5 months ago by Philip Rosing. Reason: Wrong path in quick-fix
  • The topic ‘Compatibility’ is closed to new replies.