-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure compatibility with Google Site Kit #934
Comments
hello, |
This was the reason:
That makes sense, if the admin language is changed, the home value will also change. By adding the filter we should avoid that switch specifically for google sitekit. Sounds fine! Would be good if the user can validate it. |
@herrvigg Thank you for reviewing this. I will ask the user to test out the fix I am suggesting here. I was also able to reproduce the issue locally and verify the fix by setting up both plugins, then using the customizer I believe. At some point we get an admin side request with a "home_url" that includes a language folder, eg One thing I wasn't certain about here: does the plugin store a site's home/canonical URL - if so I would use this vs. |
With qTranslate, we don't change the stored value of the home site, but we change it dynamically through the About the canonical URL, we have a base homesite that we may consider "canonical", but the translated content should contain a reference to the language. For a translated page or post, the canonical URL should have the full path including the language to be properly indexed in SEO, for example:
When you wrote that you got a admin side request causing the disconnect, was it without your patch just to reproduce the issue? Did it work with the patch? |
It was without the patch. With the patch, everything works fine and I am no longer disconnected. |
A better integrated fix has been pushed to master. New release to come soon. |
Support of Google Site Kit released in 3.9.2 |
Hi! Adam here from the Google Site Kit team (https://sitekit.withgoogle.com).
We recently had some users reporting issues when they were using qtranslate-xt and Site Kit at the same time (WordPress support forum).
The underlying issue is that Site Kit identifies site's by their URL, as returned by WordPress's
home_url
function. When we detect that a site's URL has changed, we prompt (/force) the user to reconnect their site (going thru the auth process again). We do this to help users when they change their site URL for any reason (because otherwise, their connection is broken).As a consequence, when plugins filter the home_url this logic can cause issues as the user gets unexpectedly disconnected. qtranslate-xt does this in qtranxf_home_url.
To improve compatibility in these types of situations, in Site Kit we added a
googlesitekit_canonical_home_url
filter (in google/site-kit-wp#2131). Site Kit uses the URL returned from this filter as our canonical URL, and as long as this URL doesn't change users will remain connected.Using this filter, qtranslate-xt could add compatibility with Site Kit by returning the root site url of the site.
Pseudo code:
I would be happy to open a PR with this change. Is this something you would consider adding to your plugin?
The text was updated successfully, but these errors were encountered: