Problem with WPML with multiple domains
-
All the API calls made by the plugin fail when using WPML with several domains when the plugin is trying to purge_cage (for example) on a secondary domain.
Imagine this scenario:
– Website with WPML and 3 domains:
– english.co.uk (main domain used for wp-admin)
– portuguese.pt
– french.fr
– All the domains are active on the same Cloudflare account.
– The plugin is installed and the domain is set on option cloudflare_cached_domain_name (this will be the main english.co.uk, of course)
– The plugin gets the Zone Tag (ID) needed for the API calls using getZoneTag() that gets the main domain name as an argument
– The plugin then uses that Tag to build the API call URLProblem:
– The cloudflare plugin needs to use the correct Zone ID on secondary domainsSolution:
– In theory we could hook into option_cloudflare_cached_domain_name and return the current domain, so that the getZoneTag() function uses that domain to fetch the Zone ID
– I’ve done this, and when you do get_option(‘cloudflare_cached_domain_name’) on a secondary domain it does returns the correct domain and not the main one, but I’m still getting 400 Bad Request API errors on the error_logGIST:
https://gist.github.com/webdados/00942124f355d1a3c9f0542eca01757b
- The topic ‘Problem with WPML with multiple domains’ is closed to new replies.