• Resolved glocc

    (@glocc)


    Hello,

    I have multilingual website powered by Polylang with subdomain structure:
    https://example.com/
    https://fr.example.com/
    https://ge.example.com/
    and etc…

    While I used “The language is set from the subdomain name in pretty permalinks” setting Smart Slider worked fine.

    Now I changed the setting to “The language is set from different domains” and fill in different urls for each locale:
    https://example.com/
    https://fr.example.com/
    https://example-german.com/

    example.com and fr.example.com continue work fine. But on example-german.com Smart Slider’s style and scripts files enqueuing from example.com (and not from example-german.com like it should).

    I think I found a solution in /wp-content/smart-slider-3/nextend/wordpress/libraries/uri/uri.php on line 9:
    $this->uris[] = WP_PLUGIN_URL;
    rewrote to:
    $this->uris[] = plugins_url();
    and this enqueued all of the Smart Slider’s js and css files on every domain correctly (including example-german.com).

    Can you please resolve the problem or give me any advice?

    Thank you!

    • This topic was modified 6 years, 6 months ago by glocc.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter glocc

    (@glocc)

    I checked my site once again and can tell that all locale enqueuing js and css files from the main domain (example.com).

    So, my statement

    example.com and fr.example.com continue work fine

    – is wrong. Only example.com continue work fine.

    Plugin Author Nextendweb

    (@nextendweb)

    Hi @glocc,
    I set up Polylang on my dev site. In Languages -> Settings -> URL modifications I choose The language is set from the subdomain name in pretty permalinks. Probably this is your setup too.

    I can confirm that when we use WP_PLUGIN_URL, the plugin asset files are loaded from the main domain, but the slider worked as expected (even Gutenberg loads their CSS files from the main domain).

    Then I replaced WP_PLUGIN_URL -> plugins_url() and cleared the cache of Smart Slider 3 Smart Slider -> Settings -> Clear cache button on the bottom and the assets are started to load from the language specific subdomain. Everything seems to work on my language specific subdomains.

    Could you help me to reproduce the issue what you see currently? If it is not public, please write us to [email protected] by referencing this topic and I will try to help you in private.

    Thread Starter glocc

    (@glocc)

    Hi, @nextendweb.

    Thanks for your reply!

    When I replaced WP_PLUGIN_URL -> plugins_url() (even without clearing the cache of Smart Slider 3), I get needed paths to js and css files of slider. So, it resolving my task. Problem is automatic update of plugin, because my changes will be lose after it.

    As I know, plugins_url() is universal (instead of WP_PLUGIN_URL). Can you change WP_PLUGIN_URL to plugins_url() next update?

    Plugin Author Nextendweb

    (@nextendweb)

    Hi @glocc,
    We will push this change in our next update. If there will be a good cause which prevents us to push this change, I will update you with the details. But I think we are good to go with this change.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Wrong enqueue url with Polylang different domain website’ is closed to new replies.