Skip to content

Conversation

crazytonyli
Copy link
Contributor

Note

This PR touched quite a few areas. It might be easier to review this PR commit by commit.

Description

This PR adds a card to the blog details screen to ask users to authenticate with application passwords. This card is only available when the "Application Passwords for self-hosted sites" feature flag/experimental feature is enabled.

Once an application password is authorized to the app, comments and media use it to talk directly to the site via REST API.

This card will show up on all self-hosted sites, with or without WP.com account. Here are a couple of recordings:

⬇️ Site outside of WP.com

self-hosted-sites.mp4

⬇️ Sites within WP.com

wp-com-sites.mp4

Testing instructions

Enable the "Application Passwords for self-hosted sites" feature flag and test the new card on vanilla sites and sites that are connected to WP.com.

@crazytonyli crazytonyli added this to the 26.1 milestone May 23, 2025
@crazytonyli crazytonyli requested a review from jkmassel May 23, 2025 04:18
@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 23, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number27808
VersionPR #24561
Bundle IDorg.wordpress.alpha
Commitbcad039
Installation URL2gkq9eugsit1o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 23, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number27808
VersionPR #24561
Bundle IDcom.jetpack.alpha
Commitbcad039
Installation URL7ka44s0cc3jpo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli crazytonyli force-pushed the comments-backed-by-wordpress-rs branch from 38dff55 to 8e51c99 Compare May 25, 2025 22:52
@crazytonyli crazytonyli force-pushed the site-rest-api-via-wpcom branch from 71236d7 to 2733ea7 Compare May 25, 2025 23:28

if let site = try? WordPressSite(blog: blog) {
return MediaServiceRemoteCoreREST(client: .init(site: site))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a reminder to myself that we'll keep the original implementation for media, where we prefer the WP.com API over the REST API.

@crazytonyli crazytonyli force-pushed the site-rest-api-via-wpcom branch from 63314b5 to aa71a8d Compare May 28, 2025 22:40
Base automatically changed from comments-backed-by-wordpress-rs to trunk May 29, 2025 02:44
@crazytonyli crazytonyli force-pushed the site-rest-api-via-wpcom branch from 2a0dc27 to 88e4269 Compare May 29, 2025 03:05
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 26.1. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

This LGTM, though we should ask Jetpack to make an Application Password for us. There's an API for that, but we should only use it if the background auto discovery works.

I think we'll need to add support for that API to wordpress-rs first in the jetpack namespace.

return CommentServiceRemoteREST(wordPressComRestApi: api, siteID: dotComID)
}

// The REST API does not have information about comment "likes". We'll continue to use WordPress.com API for now.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkmassel FYI, I have reverted the comment API changes, due to lack of "likes" support in the REST API.

@crazytonyli crazytonyli enabled auto-merge May 29, 2025 23:48
Copy link

@crazytonyli crazytonyli added this pull request to the merge queue May 30, 2025
Merged via the queue into trunk with commit 121f472 May 30, 2025
32 of 34 checks passed
@crazytonyli crazytonyli deleted the site-rest-api-via-wpcom branch May 30, 2025 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants