When either sites-rewind
or sites-scan
endpoint returns a response object with no_connected_jetpack
code and 412
status, we know there is some issue with the Jetpack Connection. Currently, we are not handling this case, and we show users a blank screen that tells them nothing.
Changes proposed in this Pull Request
- In both the Jetpack Backup and Jetpack Scan sections, show a special page for when the Jetpack Connection is not working.
Testing instructions
Prerequisites: Jetpack Site, and WPCOM sandbox.
- Run this PR (both Calypsos).
- Select a site with a paid plan (we want a site that has both Jetpack Backup and Jetpack Scan).
- Visit the Jetpack > Backup section.
- Verify that everything looks normal and you can see your site’s latest backup.
- Visit the Jetpack > Scan section.
- Verify that everything looks and you can see the current state of Scan.
- Modify
/wp-content/rest-api-plugins/endpoints/sites-rewind.php
and /wpcom-sandbox/wp-content/rest-api-plugins/endpoints/sites-scan.php
from your sandbox to make these endpoints return a 412. In the first file, on line number 72, you will have to remove the !
from the if condition. In the other file, do the same but on line number 290. Please reach out to me if you need help with this.
- Sandbox
public-api.wordpress.com
.
- Visit the Jetpack > Backup section.
- Verify that you see a new page that tells you there is a problem with the Jetpack Connection.
- Verify that the first button takes you to a page within WordPress.com, while the second takes you to our Support pages.
- Visit the Jetpack > Scan section.
- Verify that you see a new page that tells you there is a problem with the Jetpack Connection.
- Verify that the first button takes you to a page within WordPress.com, while the second takes you to our Support pages.
- Repeat this process in Jetpack Cloud.
Fixes 1164141197617539-as-1198191229840349
Demo
WPCOM – Backup
![image](https://user-images.githubusercontent.com/3418513/98169438-0110ba80-1ecb-11eb-8c50-c203dc639f56.png)
WPCOM – Scan
![image](https://user-images.githubusercontent.com/3418513/98169459-066e0500-1ecb-11eb-8711-83f53c39da20.png)
Jetpack Cloud – Backup
![image](https://user-images.githubusercontent.com/3418513/98169697-83997a00-1ecb-11eb-9f86-17b6b7ddecc9.png)
Jetpack Cloud – Scan
![image](https://user-images.githubusercontent.com/3418513/98169697-83997a00-1ecb-11eb-9f86-17b6b7ddecc9.png)
Unfortunately, no screenshots were provided by the developer.