Skip to content
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

One-click site verification and search console integration #10041

Merged
merged 4 commits into from
Sep 13, 2018

Conversation

gravityrail
Copy link
Contributor

@gravityrail gravityrail commented Aug 21, 2018

The primary purpose of this change is to simplify site verification by letting the user connect their Google account and automatically set the meta tag value and verify their site with Google in one step. It will also register with Search Console in order to set the sitemap.xml address.

This provides a foundation for further improvements, including:

  • Automatically registering the site with Search Console
  • Track indexing status of new posts
  • Access to Speedy Indexing API

Changes proposed in this Pull Request:

  • Add a button to verify site with Google
  • If it's easy, add the site to Search Console at the same time

Testing instructions:

Setup

  • Apply D17515-code
  • Point Jetpack to Sandbox
  • Set public-api.wordpress.com to your sandbox IP

Testing

  • Go to Jetpack -> Settings -> Traffic
  • Click "Verify with Google"
  • You will be prompted to authorize the connection in a popup
  • The UI should change to tell you that your site was verified (and added to Search Console?)

Proposed changelog entry for your changes:

Enable one-click site verification and sitemap.xml registration with Google

@gravityrail gravityrail requested a review from a team as a code owner August 21, 2018 22:53
@jetpackbot
Copy link
Collaborator

jetpackbot commented Aug 21, 2018

That's a great PR description, thank you so much for your effort!

Generated by 🚫 dangerJS

@brbrr brbrr added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Aug 23, 2018
@Tug Tug force-pushed the try/one-click-site-verify branch from 254e3a5 to 13fd8e9 Compare August 23, 2018 16:43
@Tug Tug changed the title Prototype to do one-click site verification and search console integration One-click site verification and search console integration Sep 4, 2018
@Tug Tug force-pushed the try/one-click-site-verify branch 3 times, most recently from bc80ab2 to a1464aa Compare September 4, 2018 18:01
@cbauerman cbauerman force-pushed the try/one-click-site-verify branch from a1464aa to 36c23fa Compare September 4, 2018 23:25
Copy link
Contributor

@cbauerman cbauerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look great! Everything works as described 👍

@Tug Tug force-pushed the try/one-click-site-verify branch from 54b8edd to d108b4f Compare September 5, 2018 20:47
@cbauerman cbauerman added [Status] Needs Review This PR is ready for review. [Status] Needs Testing We need to add this change to the testing call for this month's release and removed [Status] In Progress labels Sep 6, 2018
@brbrr brbrr requested a review from a team September 6, 2018 18:57
@jeherve jeherve added [Feature] Verification tools Admin Page React-powered dashboard under the Jetpack menu labels Sep 7, 2018
@jeherve jeherve added this to the 6.6 milestone Sep 7, 2018
@jeherve
Copy link
Member

jeherve commented Sep 7, 2018

I can't seem to be able to test this. I get the following error when trying to open the popup:

screenshot 2018-09-07 at 10 08 13

The phab diff appears to be properly installed on my sandbox, so I am not sure why this is happening. Any idea about what I should try next?

@cbauerman
Copy link
Contributor

cbauerman commented Sep 7, 2018

@jeherve sorry about that, our testing instructions were missing a key piece of setup. In addition to D17515 you need to set public-api.wordpress.com to your sandbox IP.

@jeherve jeherve added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Sep 10, 2018
@jeherve
Copy link
Member

jeherve commented Sep 10, 2018

Thank you! This worked better.

I'd have a few remarks:

  • Should the Google app be "WordPress.com" instead of just "WordPress"?
  • Some of the notifications (like "Updating settings") happen through the usual Jetpack admin UI notifications at the top of the page, but the "Verifying" state is only displayed inside the button. I found it a bit confusing to have the status of the connection in 2 places.
  • After the "verifying" status appeared in the button it reverted back to "click to verify". When I clicked "click to verify" again, it sticked.
  • I got an error in my sandbox during the verification process. It may have been what caused the issue above. I posted the error on the Phab diff.
  • When I refresh the page, "click to verify" appears again, just like if I had not verified anything yet.

Other than that, it worked quite nicely!

@cbauerman
Copy link
Contributor

The Sandbox Error & the "Click to Verify" on refresh are fixed: both were typos/ missing args in D17515. The same fix may have also fixed the need to click the verify button twice, I have not been able to reproduce. As far the button text vs notification we will have a chat and see if we can do some work to clean that up. Thanks for the feedback!

@jeherve jeherve added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Testing We need to add this change to the testing call for this month's release labels Sep 11, 2018
@jeherve
Copy link
Member

jeherve commented Sep 11, 2018

One small issue that I found with this is when you remove the site from the Google Search Console after it's been verified and marked as verified in your Jetpack admin settings. Our interface does not get updated to take the changes into account; it keeps telling you that your site is verified, when in fact it is not anymore since you removed the property in your Google Search console.

@Tug
Copy link
Contributor

Tug commented Sep 11, 2018

@jeherve it's not enough to Delete a property from Google Search Console, you have to unverify it. To do that you need to clear the meta tag in the jetpack UI (you can remove the disabled property manually from chrome devtools Elements tab to edit the input and save the settings) and from Google Search Console you need to add the the site back and go to site verification settings and unverify.

@jeherve
Copy link
Member

jeherve commented Sep 11, 2018

Thank you, that helped, I was able to unverify the site.

I seem to be getting a different error on wpcom now when I try to reverify, but I may just have messed up something with my site at this point:
Google Site Verification Error: Keyring_Error Object

                                            [body] => {"error":{"errors":[{"domain":"global","reason":"forbidden","message":"You are not an owner of this site."}],"code":403,"message":"You are not an owner of this site."}}
                                            [raw] => HTTP/1.1 403 Forbidden

Should I try on brand new site?

@cbauerman
Copy link
Contributor

@jeherve actually I would love to know what sites are in your search console. The error was from Google and I was not able to reproduce it, even with using multiple logins to verify.

@Tug
Copy link
Contributor

Tug commented Sep 12, 2018

@jeherve @cbauerman That error was fixed yesterday on the server patch as I investigated the issue Jeremy had. We now just make sure to clear the site keyring in that case insead of returning the error.

@jeherve
Copy link
Member

jeherve commented Sep 12, 2018

I still get the error today with the updated version of the wpcom patch.

The property is there in my search console, just not verified:

screenshot 2018-09-12 at 11 23 50

In wp-admin, I only see the "Click to verify" prompt:

screenshot 2018-09-12 at 11 25 19

When clicking it, the button changes into a greyed out "Connect to Google" for a couple of seconds, there I get the 500 error on the wp-json/jetpack/v4/verify-site/google call and the "Click to verify" button reappears. The detailed error is the same as I posted yesterday, in the API response or my error logs in my wpcom sandbox:

{"code":"keyring-request-error","message":{"headers":[],"body":"{\"error\":{\"errors\":[{\"domain\":\"global\",\"reason\":\"forbidden\",\"message\":\"You are not an owner of this site.\"}],\"code\":403,\"message\":\"You are not an owner of this site.\"}}","response":{"code":403,"message":"Forbidden"},"cookies":[],"filename":"","http_response":{"data":"","headers":"","status":""}},"data":null}

@Tug
Copy link
Contributor

Tug commented Sep 12, 2018

Sorry to ask, but did you try reloading the page?

@jeherve
Copy link
Member

jeherve commented Sep 12, 2018

Yeah, that does not seem to change anything.

@Tug
Copy link
Contributor

Tug commented Sep 12, 2018

After investigating, it seems your site was in a bad state, it seems we're unable to reproduce the error now!

Copy link
Contributor

@cbauerman cbauerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is looking good! LGTM 👍

@cbauerman cbauerman removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Sep 12, 2018
@Tug Tug merged commit f536cd1 into master Sep 13, 2018
@Tug Tug deleted the try/one-click-site-verify branch September 13, 2018 09:47
@jeherve jeherve added [Status] Needs Testing We need to add this change to the testing call for this month's release and removed [Status] Needs Review This PR is ready for review. labels Sep 13, 2018
jeherve added a commit that referenced this pull request Sep 14, 2018
@jeffgolenski
Copy link
Member

jeffgolenski commented Sep 18, 2018

Left design feedback + mockups at p6TEKc-2j2-p2

jeherve added a commit that referenced this pull request Sep 24, 2018
jeherve added a commit that referenced this pull request Sep 25, 2018
* Readme: add boilerplate for next release, 6.6

* Add 6.5 to the changelog.txt file

* Set boilerplate testing list for 6.6

* Readme: update stable tag to 6.5

* Add bullets to 6.5 changelog items

* Readme: add link to previous changelogs

This will help folks who want to know more about past releases,
while keeping the readme.txt short so as to not overwhelm translators and site owners only looking for information about the last release.

* Changelog: add information at the top of the changelog file.

* Changelog: add #10054

* Changelog: add #10078

* Changelog: add #10079

* Changelog: add #10064

* Changelog: add #10094

* Changelog: add #10096

* Testing list: add more information based on #10087

* Changelog: add #9847

* Changelog: add #10084

* Changelog: add #9918

* Changelog: add #7614

* Changelog: add #10116

* Changelog: add #10108

* Changelog: add #10041

* Changelog: add #10121

* Changelog: add #10134

* Changelog: add #10130

* Changelog: add #10109

* changelog: add #10137

* changelog: add #9952

* changelog: add #10120

* changelog: add #10162

* Changelog: add #10163

* Changelog: add #10092

* changelog: add #10156

* Changelog: add #10154

* changelog: add #10122

* Changelog: add #10101

* changelog: add #10105

* changelog: add #10190

* Changelog: add #10196

* changelog: add #10152

* Changelog: add #10153

* Testing list: add more details to Site Verification testing steps.

@see #10143 (comment)

* changelog: add #10194

* Changelog: add #10193
@jeherve jeherve removed the [Status] Needs Testing We need to add this change to the testing call for this month's release label Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Feature] Verification tools [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants