This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Do not show disconnected Jetpack sites #835
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What does WP.com do in the same scenario? Does it also remove the site from your account? What does "active Jetpack" mean? Can a site temporarily become inactive?
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.
jetpack_connection = truemeans the site was connected to WP.com via jetpack.jetpack = truemeans WP.com can still communicate with the site via Jetpack (a.k.a, jetpack connection is active).You typically get
jetpack_connection = true && jetpack = falsewhen the site was connected to WP.com a while ago, but its domain expired.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.
WP.com does not show sites with
jetpack_connection = true && jetpack = false, hence the fix.There is more complicated logic on WP.com (see here) to decide whether to show a site or not. I didn't try to understand all of them. But this PR fixes the particular case where the site domain has expired.
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.
I think that's entirely possible, like when the site is down, or for whatever reason that WP.com decides that it can't communicate with the site.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'm not entirely sure how the logic on WP.com translate to this:
Is there a good way to test it?
There is also a chance the UX on WP.com isn't optimal. WP.com can't not if the site was actually deleted or if it's a temporarily issue, can it? As a user, I'd probably expect it to show some kind of a message like "site is not responding" with a way to remove it from my WP.com account.
I'd also suggest moving filtering (the entire logic inside
wpkit_filter) to the app. It's notWordPressKitjob to decide what app displays.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.
I didn't follow the exact filtering logic on calypso. This is the code I referenced when looking into the API responses.
Agreed. I'll do that.