Viewing 15 replies - 1 through 15 (of 26 total)
  • Thread Starter Marco Almeida | Webdados

    (@webdados)

    Plugin Author Frank Goossens

    (@futtta)

    Hi webdados;
    I’m on holiday now and can’t immediately in troubleshooting I’ll afraid, but if you look at the FAQ, you’ll find a topic about nextgen gallery which might also apply here. You could also ask the WPML developers what has changed on their side?

    Kind regards,
    Frank

    Plugin Author Frank Goossens

    (@futtta)

    had a quick look, comparing .pt and .co.uk sites;

    1. co.uk has 1 autoptimized JS file + jquery.js (2 files, I suppose you excluded jquery from optimization on purpose)
    2. pt has 1 autoptimized JS file + jquery.js (which I suppose your excluded from optimization on purpose) + jquery-migrate.js (3 files). the reason jquery-migrate.js is not aggregated is because WPML set the URL to that file on the .co.uk domain instead of the .pt domain (which is also the case for jquery.js).

    The trick as described in the other forum topic is just a workaround for the root cause which are domain mismatches, the best solution would be for you to contact the WPML-developers and ask how you can ensure all resources are loaded from the same domain as the base HTML (so .pt for the .pt site and .co.uk for the .co.uk site).

    hope this helps,
    frank

    Thread Starter Marco Almeida | Webdados

    (@webdados)

    I’m already in contact with WPML support: https://wpml.org/forums/topic/site_url-breaking-autoptimize/

    site_url() always returns the “main site” URL and it is NOT filtered by WPML, which means on WPML sites where the domain name is different for each language, this problem will always rise (I guess). Do you agree?

    Plugin Author Frank Goossens

    (@futtta)

    yes, except that for domain-mapped sites, AO uses

    domain_mapping_siteurl(get_current_blog_id())

    cfr. line 207-209 in autoptimize.php

    if WPML uses something else then domain mapping to map domains to subsites, do they have a similar function to get the siteurl of the “child domain”?

    frank

    Thread Starter Marco Almeida | Webdados

    (@webdados)

    I’m going to add a link to this thread on the WPML.org thread.

    I guess this should be a 3 party conversation. Any way you could join in on that thread?

    Plugin Author Frank Goossens

    (@futtta)

    Any way you could join in on that thread?

    I would if I could, but I don’t have an account there and don’t see a registration-page. Might that be a customer-only support forum?

    Plugin Author Frank Goossens

    (@futtta)

    did some more thinking; the basic problem is not what function I use to get the site’s URL (yielding either site_url() or the mapped domain), but rather that WPML subsites HTML contains links to CSS/ JS that in some cases have the main site’s domain and in some other cases the subsites domain. the only correct solution would be for WPML to ensure that the domain in the URL’s for JS/CSS always match the domain of the site that is requested really …

    frank

    Thread Starter Marco Almeida | Webdados

    (@webdados)

    Hi there,

    Just got a new reply from WPML:

    I saw the problem.

    To ensure that this plugin is made compatible with WPML we need to contact the plugin author and work with him on resolving the issue.

    I have forwarded the details to our Themes & Plugins Compatibility Team and they will contact the author. Our Compatibility Team will work with the author of the plugin for this to work properly.

    Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.

    Regarding “WPML subsites HTML contains links to CSS/ JS that in some cases have the main site’s domain and in some other cases the subsites domain”, you are right. It will only work for scripts that are called in the same subsite domain. Most scripts are correctly using the subsite domain. The ones that don’t we can’t do much about it.

    Plugin Author Frank Goossens

    (@futtta)

    Our Compatibility Team will work with the author of the plugin for this to work properly.

    super, looking forward to that! πŸ™‚

    Thread Starter Marco Almeida | Webdados

    (@webdados)

    Horray!

    What I think should be addressed:
    – Global WPML compatibility
    – Make sure Autoptimize sets the several constant URLs to the current language domain/subdomain so he can optimize the correct scripts
    – Maybe WPML should “force” scripts being loaded with the main language domain to use the current language domain so plugins like yours do not break

    I will post this same list to the WPML support thread.

    Plugin Author Frank Goossens

    (@futtta)

    I’ve indeed been contacted by the WPML-team and we will collaborate to ensure optimal compatibility. I’ll let you know how things are progressing here.

    frank

    Hi there, are there any news on this, I’m experiencing the same exactly issue for the secondary language-domain.

    Plugin Author Frank Goossens

    (@futtta)

    are there any news on this

    There is; I collaborated with the WPML-guys and AO2.0 actually should fix this issue as per this block of code (calling a WPML filter to get all domains). This was tested both on my and WPML’s side and confirmed working.

    There might, off course, always be edge cases, so if you’re on AO 2.0 and you still encounter this issue we might need to add some debug-code left and right to see what is _really_ happening. let me know if you want to proceed down that path πŸ™‚

    frank

    Hi Frank yes let me know what I should do to debug this. If you need any access let me know where I can sent you the credentials. I have replicated this issue on my testing server as well

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Problem with WPML – One script not being added to global JS on secondary languag’ is closed to new replies.