-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add the Google Site Verification process #139
Conversation
f855d6c
to
d5efef2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @layoutd !
Tested a live connection (via the middleware) using the ConnectTest Page and site/verification endpoint
Also confirmed in webmaster tools that the site/domain was linked to my account/s.
Also confirmed I could unlink and relink (manually) and have multiple people linked at the same time.
The one thing that caught me out was when swapping my GLA linked GA account. Because the option was already saved for the other account I couldn't do another verification so to speak which could catch people out if there is any account juggling going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, just left a few small comments.
910d954
to
a3c1e18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @layoutd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, it looks like it's pretty much ready to go. I just added a few small comments.
- Service - Google API service - REST API controller
* Currently uses `wp_remote_get` as the WCS proxy isn't available
And add a GET endpoint that simply returns the
(Again)
5c34065
to
afd69c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all looks good to me. Although I'm not quite sure if the do_action
names are a bit too fancy. Especially if we consider that a logging implementation needs to hook into each of them. In my mind I was thinking it would be best to stick to a handful of names mainly based on the type of exception it's passing so it can handle retrieving the details correctly. I personally prefer hardcoded strings (without get_slug) so I can search for them much easier.
Either way though, I'm fine to roll with whatever you think is best, so I'll approve this PR so we can move forward.
Thanks for your reviews and the thoughtful and insightful comments, @mikkamp. I'll merge now and make a note to revisit the issues you bring up regarding exceptions (naming and hard-coding the slug). |
Changes proposed in this Pull Request:
This PR provides a REST endpoint to perform site verification using Google's Site Verification API.
Works towards #9 (and is a stepping stone towards #10).
site/verify
performs the full verification process:getToken
retrieves the<meta>
tag to be added to the site ''<meta>
tag into the site `insert
which instructs Google to check for the<meta>
tag<meta>
tag once the site is verified.[slug]_site_verification
option inwp_option
that stores the Google-generatedmeta_tag
, and whether the site has beenverified
so far.SiteVerification
service that displays the<meta>
tag when it is found in the DB option, and the site isn't marked as verified (so it should only actually be displayed for the < 1 second between the Site Verification APIgetToken
andinsert
calls).google-sv
proxy endpoint included - PR 1692)token
retrieval ormeta-tag
verification).Notes
site_url()
to specify the site to verify.verified
, the WP endpoint returns a success message.Detailed test instructions:
site/verify
endpoint in the REST API.