Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 11 replies, has 2 voices.

Last updated by Bruno Kos 5 months, 1 week ago.

Assigned support staff: Bruno Kos.

Author Posts
April 11, 2019 at 10:40 pm #3593163

plataformaE

This site is using my site loading directly in the CDN if the following way:
- The CDN Pull Zone is loading static.domain.com (local host)
- In the CDN was created a zone alias with the regular domain hidden link
- In Cloudflare, on the www CNAME is pointing directly to CDN Zone URL

Everything is working as expected, but as soon as WPML is activated, static files like JS, CSS are loaded from the origin domain instead of the CDN.

It's like WPML changes siteurl address when activated, based on origin.

This option e affecting all the performance of the website.

I've tried to define siteurl in wp-config.php, update the same vars in functions, but nothing works.

If you check the network information, most of the files are being loaded from the original hosts, different from the site host (CDN).

Can you tell me how to override this option in WPML?

April 12, 2019 at 11:29 am #3598267

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for contacting WPML support!

Can you update WPML 4.2.0 plugin first before we resume debugging this? We can only support our clients if they have the latest versions installed, as this means that there have been many upgrades, bug fixes and general improvements since.

If you are using other WPML addons, make sure to update all of these as well.
https://wpml.org/account/downloads/

After you do this, can you answer the following:
- are you using any plugin for Cloudflare CDN?
-- perhaps something like https://wordpress.org/plugins/cloudflare/

Regards,
Bruno Kos

April 12, 2019 at 11:40 am #3598383

plataformaE

Of course I'll update it, but the first time I tried to do it, it broke some parts of my site, so first I have to solve it.

About the CDN, I'm not using any particular plugin to work with CDN.
Cloudflare is managing my site DNS directly, pointing the www to CDN which is retrieving the site from the origin host server (wwvv). So there is no plugin doing nothing for it.

Because I experimented deactivating plugins one by one, when I reach WPML, the site started to load from the CDN as it should do.

It's like WPML is changing SITEURL or HOMEURL vars from the site.

In the meanwhile I'll update the plugin.

April 12, 2019 at 1:05 pm #3599233

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

In that case, would it be possible if you set this on our Cloudways test install? Perhaps with a demo Clouldflare account? If you are unable to do sot, I can check about creating one for this purpose only.

I have created a new site for this alone for which I am providing credentials in the next private reply.

Regards,
Bruno Kos

April 12, 2019 at 2:05 pm #3599771

plataformaE

I'm afraid that won't do the trick. Because the site is not being loaded from my own server. My hosting only serves as the origin to the CDN Pull Zone, and Cloudflare only gets the site from the CDN.

Here is a full example of my structure: hidden link

The only reason I see is WPML changing something on .htaccess or changing SITURL or HOMEURL or using $_SERVER in P to change base url.

April 12, 2019 at 3:13 pm #3600165

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I see - in this case, would it be possible if you provide us with:
- temporary WordPress admin username and password
- Duplicator package
-- https://wpml.org/faq/provide-supporters-copy-site/

I would need to bring this to our 2nd tier for further opinions and how to proceed or even test this - we may need, however, the above information so that they can see and possibly test your setup, while providing a possible solution or a workaround.

I have marked your next reply private so you can safely add this information.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Please make a full backup of your site before sharing this info!

Regards,
Bruno Kos

April 14, 2019 at 4:39 pm #3608401

plataformaE

One more thing that can help you discover the issue I'm having. I've already included in wp-config.php:
define( 'WP_HOME', 'hidden link' );
define( 'WP_SITEURL', 'hidden link' );

I've putted all my enqueue_scripts and enqueue_styles with full links and not relative ones.

In the end, with WPML active, the first request and the images are being loaded correctly, through the CDN (www.happymindtravels.com). The JS and CSS files are being loaded from the origin host (wwvv.happymindtravels), which should be used only as the Pull Zone.

This is strange because all my styles and scripts are not with relative URL, but full URL, so I believe there is some kind of rewriting being done by WPML, changing all the enqueue_scripts and enqueue_styles.

By the way, I'm using Apache Servers, and I've already tried this same structure with NGINX servers and, just by defining the WP_HOME and WP_SITEURL made all files to be loaded by the server defined on these VARS,

Hope this helps to find the issue.

April 15, 2019 at 6:42 am #3610053

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I've asked our 2nd tier about this. I'll get back to you as soon as I have any news or questions for you.

Regards,
Bruno Kos

April 15, 2019 at 8:29 am #3611041

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

The 2nd tier asked me if we could take a look at this ticket:
https://wpml.org/forums/topic/requests-to-wrong-domain-for-asset-reverse-proxy-setup-caused-by-wp_options/

Can you tell me if this is the similar or even the same setup as yours?

Regards,
Bruno Kos

April 15, 2019 at 8:45 am #3611217

plataformaE

Hi Bruno,
yes, it looks like it's the same issue.

I've done all those things, like search and replace the database and all of that, without success.

Hope it helps to solve both issues.

Regards,
Daniel

April 15, 2019 at 10:47 am #3612599

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for the confirmation! This issue has been escalated to WPML developers. As for fixing it, I can't give you any dates, it could end up in the next release or in 6 months. This is totally up to developers - severity of the issue and number of reported cases (among other things) decide its queue on the list.

I will keep this thread updated as soon as I get any new information from them!

Regards,
Bruno Kos

August 11, 2021 at 2:39 pm #9383409

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I know It has been a long time since this ticket was opened, but this is covered with https://wpml.org/errata/different-domain-per-language-and-nginx-as-a-reverse-proxy-is-not-supported/ and there will be no other solutions.

Regards,
Bruno Kos