Skip to content

Conversation

@andrewserong
Copy link
Member

@andrewserong andrewserong commented Dec 5, 2019

This syncs changes in WPCOM from D36164-code and D36219-code, where an is_fse_eligible property is added to the Site object in the REST API. For Full Site Editing this allows the site to flag whether or not it's eligible for FSE (e.g. the plugin is installed and activated), even if the current theme doesn't support FSE.

Changes proposed in this Pull Request:

  • Add is_fse_eligible property to the Get Site endpoint, e.g. https://public-api.wordpress.com/rest/v1.1/sites/<site_id>
  • Add is_fse_eligible function that calls is_site_eligible_for_full_site_editing() within the Full Site Editing function — returning whether the site is eligible for FSE irrespective of whether the current theme supports FSE.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

Testing instructions:

Before checking out this change
  • Connect your local site to WordPress.com via ngrok.io and activate Jetpack
  • Call https://public-api.wordpress.com/rest/v1.1/sites/<site_id> from an authenticated environment, e.g. https://developer.wordpress.com/docs/api/console/ or using wpcom.req.get('/sites/<site_id_or_domain>').then( function( result ) { console.log( result ) } );'); from the console in calypso.localhost:3000.
  • In the site response object you should see is_fse_active and no is_fse_eligible property.
  • In the ngrok.io dashboard http://localhost:4040/inspect/http you should see that the POST request to /xmlrpc.php includes the string is_fse_eligible in its payload.
Apply this change
  • Follow the above steps, and after running the API call, in the response object you should see is_fse_eligible: false
  • Install the Full Site Editing plugin by Automattic from the plugins directory (/wp-admin/plugin-install.php), but don't activate it just yet
  • Run the API call again, and you should still see is_fse_eligible: false
  • Activate the Full Site Editing plugin, run the API call again, and you should see is_fse_eligible: true in the response object.

image

Proposed changelog entry for your changes:

  • WordPress.com REST API: add flag to determine site eligibility for Full Site Editing.

@andrewserong andrewserong requested a review from a team December 5, 2019 06:10
@andrewserong andrewserong self-assigned this Dec 5, 2019
@andrewserong andrewserong requested review from a team December 5, 2019 06:11
@jetpackbot
Copy link
Collaborator

Warnings
⚠️

The PR is missing at least one [Status] label. Suggestions: [Status] In Progress, [Status] Needs Review

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against fc37e53

@andrewserong andrewserong added the [Status] Needs Review This PR is ready for review. label Dec 5, 2019
@jeherve jeherve added this to the 8.1 milestone Dec 5, 2019
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello andrewserong! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D36271-code before merging this PR. Thank you!

@jeherve jeherve added [Status] Tested on WP.com [Type] Dotcom Merge [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Dec 5, 2019
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

Looks good to me. 👍

Merging.

@jeherve jeherve merged commit 7381801 into master Dec 5, 2019
@jeherve jeherve deleted the add/is-fse-eligible-to-site-object-in-rest-api branch December 5, 2019 12:14
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Dec 5, 2019
jeherve added a commit that referenced this pull request Dec 13, 2019
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <[email protected]>
zinigor added a commit that referenced this pull request Dec 30, 2019
* Changelog: 8.1 additions

* Changelog: add #13858

* Changelog: add #13963

* Changelog: add #14174

* Changelog: add #14178

* Changelog: add #14175

* Changelog: add #14192

* Changelog: add #14196

* Changelog: add #14182

* Changelog: add #14218

* Changelog: add #14214

* Changelog: add #13757

* Changelog: add #14190

* Changelog: add #14131

* Changelog: add #14101

* Changelog: add #14203

* Changelog: add #14211

* Changelog: add #14224

* Changelog: add #14230

* Changelog: add #14241

* Changelog: add #14249

* Changelog: add #14264

* Changelog: add #14263

* Changelog: add #14256

* Changelog: add #10189

* Changelog: add #14240

* Changelog: add #14239

Also added some new entries to the testing file.

Co-authored-by: Igor Zinovyev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants