Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#50321 closed enhancement (fixed)

REST API: Add plugin and block directory endpoints

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 5.5 Priority: high
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch has-unit-tests has-dev-note
Focuses: Cc:

Description

Gutenberg is introducing REST API endpoints for installing blocks, and activating/deactivating plugins. This is a tracking ticket for handling the core merge of this feature.

https://github.com/WordPress/gutenberg/pull/22454

Change History (14)

#1 @TimothyBlynJacobs
5 years ago

  • Owner set to TimothyBlynJacobs
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core-restapi by timothybjacobs. View the logs.


5 years ago

This ticket was mentioned in PR #359 on WordPress/wordpress-develop by TimothyBJacobs.


5 years ago
#3

  • Keywords has-patch has-unit-tests added

Original Gutenberg PR: https://github.com/WordPress/gutenberg/pull/22454

This also introduces a change in plugins_api to not perform a trigger error if this is a json request since we don't want that to break the JSON output.

Trac ticket: https://core.trac.wordpress.org/ticket/50321

#4 @TimothyBlynJacobs
5 years ago

  • Type changed from defect (bug) to enhancement

TimothyBJacobs commented on PR #359:


5 years ago
#5

We'll also need a PR to update Gutenberg to use the wp/v2 namespace.

ellatrix commented on PR #359:


5 years ago
#6

@TimothyBJacobs Can we keep everything experimental? Or are these APIs fully ready?

TimothyBJacobs commented on PR #359:


5 years ago
#7

Thoughts on shipping experimental endpoints in core are [mixed](https://make.wordpress.org/core/2020/06/14/shipping-experimental-endpoints-in-core-rest-api-meeting-summary-june-11-2020/) so I'm not really sure about shipping experimental endpoints in general.

For this endpoint in particular, I don't think it needs to be shipped as experimental.

ryelle commented on PR #359:


5 years ago
#8

Created a PR for updating the namespaces in Gutenberg: https://github.com/WordPress/gutenberg/pull/23528

I tested out the endpoints, and once I got this PR done , I was able to test out using the block directory — it all worked as expected.

#9 @TimothyBlynJacobs
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48242:

REST API: Introduce plugin management and block directory endpoints.

These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.

Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.

#10 @SergeyBiryukov
5 years ago

In 48333:

Tests: Correct hardcoded "3 months ago" assertion in tests/rest-api/rest-block-directory-controller.php.

Now that more than 3 months have passed since 2020-03-23, this was causing test failures.

Follow-up to [48242].

See #50321.

#12 @SergeyBiryukov
5 years ago

In 48626:

Docs: Correct @since version for WP_REST_Plugins_Controller::get_item_schema().

Follow-up to [48242].

See #50321.

#13 @SergeyBiryukov
5 years ago

In 48627:

REST API: Use a consistent name for the textdomain schema property between plugins, themes, and block directory controllers.

Follow-up to [48242].

See #50321, #50776.

#14 @SergeyBiryukov
5 years ago

In 48628:

REST API: Use a consistent description for the textdomain schema property between plugins and themes controllers.

Follow-up to [48242], [48627].

Props audrasjb.
Fixes #50776. See #50321.

Note: See TracTickets for help on using tickets.