-
Notifications
You must be signed in to change notification settings - Fork 384
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 Site Scan Feature #6610
Add Site Scan Feature #6610
Conversation
This comment has been minimized.
This comment has been minimized.
6bdc3b5
to
bbbaaf5
Compare
b7af591
to
ef7fed0
Compare
bbbaaf5
to
20a0d7e
Compare
This comment has been minimized.
This comment has been minimized.
ef7fed0
to
7a788c6
Compare
e746e8f
to
8bc4895
Compare
08ce98e
to
55d8a74
Compare
@delawski There we go, quick and easy: 3986b6e. In the Onboarding Wizard you can fetch just the necessary data (the URLs themselves) via a request like On the Settings screen you can omit the |
The Site Scan results always showed as stale on the settings screen because the settings screen was passing So the Similarly, if a given template type is not enabled for AMP (e.g. when in legacy Reader mode the archive templates aren't available), then such requests will be returning a different error: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@westonruter I've updated the logic in the Unfortunately, I'm still getting stale validation results whenever I'm refreshing the Settings page. I'm not sure why that happens. On top of that, I've been working today on improving the frontend logic. Right now, if a user changes the template mode and saves the settings, the site scan results are going to be marked as stale immediately and the "Rescan Site" button will be shown.
If the template mode is switched when the scan is in progress, it will be cancelled and a message will be displayed: If no errors are found by the Site Scan, a short message is displayed. We may want to improve this screen visually a bit (what are your thoughts, @jwold?): |
Quick note regarding error handling: I did a quick for stale results by activating Yoast, and when I did so I got an error: The issue is that Yoast redirects attachment page links to the attachment files themselves, so that is why there is an error. So if the in this case as well, when the response is not |
Or generally, if there is any error with the fetching of the URL like this, instead of throwing up the error screen takeover, it would probably be better to list out the errors in the panel as part of the results. |
59ee0a2
to
b67cf55
Compare
9f3a80c
to
5b46ffd
Compare
b67cf55
to
89e8ea6
Compare
@westonruter It turns out that the template mode recommendation logic on the AMP Settings screen is different than the one we use in the Onboarding Wizard. It doesn't make any use of the Site Scan results. I went ahead and refactored the recommendation logic out of the Wizard and into the common helpers. Then, I've re-used that logic for generating the notices and messages in the Template Mode selection on the AMP Settings screen. This is all done in cf218ea. Now, for a non-technical user and Hestia theme, the Reader mode is recommended and the Standard mode is actually discouraged (it follows the recommendation matrix): |
Reason: the Template Mode recommendation logic underwent an overhaul when Site Scan feature had been added. New, tests that would be shared between the Settings screen and the Onboarding Wizard need to be written.
@milindmore22 That's interesting. I've installed bbPress and imported the test data. When scanning in the Reader mode, I'm seeing Gutenberg as the only plugin causing AMP incompatibility: Validated URLs page says the same. However, we get more context now. It's not only Gutenberg, it's the Core, too: However, it's clear that bbPress is the root problem. When I deactivate the plugin, I get no issues: @westonruter What are your thoughts? Is there a way we could attribute an error to a plugin that is in fact causing it? |
I activated Hestia (a theme lacking AMP compatibility) and the result is it shows Standard mode as being recommended, when it shouldn't be: Since there are validation errors coming from Hestia, there should be no recommendation to use Standard mode, even if the user is technical. Interestingly, as soon as I started the scan, it showed Reader as recommended but then once it finished it showed Standard. |
@westonruter Yeah, it makes sense to me. I didn't implement this change yet just because there might be more cases like this since the current recommendation logic maps the matrix in the doc. However, what I did is I made the recommendation logic much more explicit and wrapped it in a custom hook (7920d78). This way we can go through the logic and the matrix and fix all the issues.
This flicker should not happen anymore. Right now the logic is encapsulated in a custom hook where we keep the recommendation state untouched as long as the options, user meta or scannable URLs are being saved/fetched. One more addition is a notice in the Template Mode section saying that the recommendation may be inaccurate whenever the site scan results become stale: |
Codecov Report
@@ Coverage Diff @@
## develop #6610 +/- ##
=============================================
- Coverage 77.37% 76.38% -0.99%
- Complexity 6465 6475 +10
=============================================
Files 197 261 +64
Lines 19432 20697 +1265
=============================================
+ Hits 15035 15809 +774
- Misses 4397 4888 +491
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Another magnum opus‽
QA Passed
|
Summary
develop
into this branch: Add AMP-first preview and args to validate request for Site Scanning #6615Fixes #4719
Fixes #6650
The Site Scan feature is added to both the Onboarding Wizard and to the Settings screen.
Onboarding Wizard
In the Wizard, a new step has been added that triggers a site scan automatically. The scan is always done in the Standard mode and its results are not stored.
Based on the scan results, the best template mode is recommended in the next step. Note that the recommendations step and the copy has been updated according to the recommendation matrix.
Settings Screen
The Site Scan panel on the Settings Screen is more robust than the one you can find in the Wizard.
First of all, it shows scan results based on cached validation errors. It also indicates stale state of the results.
It is possible to trigger new scan whenever the template mode is changed and saved. What's more, if a scan is in progress, it will be cancelled in such a case.
In case there are no errors, a success message will be shown. If none of the URLs could be scanned (an edge case), an error message will be displatyed.
Todos
Checklist