From 3bc496292c57bc853d1958debee9e01d17a64611 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 10 Nov 2025 10:08:53 +1300 Subject: [PATCH 1/6] Fix CMM-940: Allow accessing Jetpack sites without the jetpack plugin --- .../AccountServiceRemoteREST.m | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m b/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m index fe0d75aefc18..bf31f024fb0e 100644 --- a/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m +++ b/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m @@ -376,6 +376,19 @@ - (void)getBlogsWithParameters:(NSDictionary *)parameters { NSString *requestUrl = [self pathForEndpoint:@"me/sites" withVersion:WordPressComRESTAPIVersion_1_2]; + // site_activity=active filters out many sites that are not longer available. + // + // For example, if you have a self-hosted site that's connected to a WP.com account, and later the site domain expires + // and couldn't be accessed, we don't want to show this site in the app. These sites are filtered out by the + // `site_activity=active` parameter. + // + // For reference, this paramter is hard-coded in "My Sites" in calyspo: + // https://github.com/Automattic/wp-calypso/blob/64806d21520e5489b30fbabf04e2f427a3ad392c/packages/api-core/src/me-sites/fetchers.ts#L30 + if (parameters[@"site_activity"] == nil) { + NSMutableDictionary *updated = [NSMutableDictionary dictionaryWithDictionary:parameters]; + updated[@"site_activity"] = @"active"; + parameters = updated; + } [self.wordPressComRESTAPI get:requestUrl parameters:parameters success:^(id responseObject, NSHTTPURLResponse *httpResponse) { @@ -417,11 +430,6 @@ - (NSArray *)remoteBlogsFromJSONArray:(NSArray *)jsonBlogs return false; } - // Exclude sites that are connected via Jetpack, but without an active Jetpack connection. - if (blog.jetpackConnection && !blog.jetpack) { - return false; - } - return true; }]; } From d7beb70b9b5d2130a38ed0efbba745be05f125b4 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 10 Nov 2025 10:14:13 +1300 Subject: [PATCH 2/6] Update release notes --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 439ae0936e76..ac03389c19c0 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -10,6 +10,7 @@ * [*] Add permalink preview in the slug editor and make other improvements [#24949] * [*] Add "Taxonomies" to Site Settings [#24955] * [*] Update "Categories" picker to indicate multiple selection [#24952] +* [*] Fix a bug where the app can't access some Jetpack connected sites [#24976] 26.4 ----- From 804c60112b99d92dd13ce7cbeb4549105b02e676 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 10 Nov 2025 10:17:00 +1300 Subject: [PATCH 3/6] Add a missing release note --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index ac03389c19c0..0357354dbd1b 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -11,6 +11,7 @@ * [*] Add "Taxonomies" to Site Settings [#24955] * [*] Update "Categories" picker to indicate multiple selection [#24952] * [*] Fix a bug where the app can't access some Jetpack connected sites [#24976] +* [*] Add support for editing custom taxonomy terms from "Post Settings" [#24964] 26.4 ----- From e68ec69fc572b3fdc7da1be620ad9d36bec83b79 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 17 Nov 2025 15:41:15 +1300 Subject: [PATCH 4/6] Fix a typo Co-authored-by: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> --- Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m b/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m index bf31f024fb0e..984df146bfc8 100644 --- a/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m +++ b/Modules/Sources/WordPressKitObjC/AccountServiceRemoteREST.m @@ -382,7 +382,7 @@ - (void)getBlogsWithParameters:(NSDictionary *)parameters // and couldn't be accessed, we don't want to show this site in the app. These sites are filtered out by the // `site_activity=active` parameter. // - // For reference, this paramter is hard-coded in "My Sites" in calyspo: + // For reference, this paramter is hard-coded in "My Sites" in calypso: // https://github.com/Automattic/wp-calypso/blob/64806d21520e5489b30fbabf04e2f427a3ad392c/packages/api-core/src/me-sites/fetchers.ts#L30 if (parameters[@"site_activity"] == nil) { NSMutableDictionary *updated = [NSMutableDictionary dictionaryWithDictionary:parameters]; From bac24649eccdd0ba526bd5ceec991c2e4acf43e4 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 17 Nov 2025 16:30:27 +1300 Subject: [PATCH 5/6] Fix an issue where jetpack site is not merged after WP.com log in --- WordPress/Classes/Services/BlogService.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/Services/BlogService.m b/WordPress/Classes/Services/BlogService.m index 1df554172984..55e2588e779d 100644 --- a/WordPress/Classes/Services/BlogService.m +++ b/WordPress/Classes/Services/BlogService.m @@ -493,7 +493,12 @@ - (void)updateBlogWithRemoteBlog:(RemoteBlog *)remoteBlog account:(WPAccount *)a { Blog *blog = [self findBlogWithDotComID:remoteBlog.blogID inAccount:account]; - if (!blog && remoteBlog.jetpack) { + // Previously the `remoteBlog.jetpack` property was used to check if the `blog` is connected to Jetpack. + // However, the `jetpack` property indicated whether the Jetpack plugin is installed, and we should check the + // `jetpack_connection` property instead. + // See this calypso code for reference: + // https://github.com/Automattic/wp-calypso/blob/61a1eb0968da82e62d992f8d081a4ab3075c7719/client/dashboard/utils/site-types.ts#L3 + if (!blog && remoteBlog.jetpackConnection) { blog = [self migrateRemoteJetpackBlog:remoteBlog forAccount:account inContext:context]; } From bec278c6c5960b15eff2d1e02b204b84b5038c13 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 17 Nov 2025 21:26:24 +1300 Subject: [PATCH 6/6] Update HTTP stubs --- .../Resources/Mocks/User/me-sites-with-jetpack.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tests/KeystoneTests/Resources/Mocks/User/me-sites-with-jetpack.json b/Tests/KeystoneTests/Resources/Mocks/User/me-sites-with-jetpack.json index 01895678fad8..f3dfd99c55a6 100644 --- a/Tests/KeystoneTests/Resources/Mocks/User/me-sites-with-jetpack.json +++ b/Tests/KeystoneTests/Resources/Mocks/User/me-sites-with-jetpack.json @@ -17,6 +17,7 @@ "is_following": false, "is_private": false, "jetpack": false, + "jetpack_connection": false, "lang": "en", "logo": { "id": 0, @@ -102,6 +103,7 @@ "is_following": false, "is_private": false, "jetpack": true, + "jetpack_connection": true, "lang": "en", "logo": { "id": 0,