-
Notifications
You must be signed in to change notification settings - Fork 2
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 #4
Comments
@sareiodata Is there a better venue to submit this type of request? |
Hi, The latest TranslatePress version contains a compatibility fix that solves this issue. Google Site Kit’s dashboard no longer disconnects. Thank you for your debugging effort! P.S. This repository is not the official TranslatePress repo. We are not associated with the user who created this repo. |
Thank you for the update, @razvan-translatepress! We'll let our users know that this fix has been added. |
Hi! Adam here from the Google Site Kit team (https://sitekit.withgoogle.com).
We recently had some users reporting issues when they were using translatepress and Site Kit at the same time. (WordPress support forum and also here).
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. translatepress does this in add_language_to_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, translatepress 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: