Automattic / Automattic/jetpack

Core REST API: Do not register Publicize endpoints if Publicize is not available

Open
#11,521 3 comments 0 reactions 0 assignees View on GitHub
[Feature] Publicize [Feature] WP REST API [Status] Stale [Type] Question
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

See #10727, #11170, #11483, #11503

I'm not certain if this is by design or not--publicize endpoints are registered even when publicize is not enabled.

Does the Gutenberg client have awareness of module state? Do we need these endpoints registered or can we selectively register them only when the module is enabled?

#### Steps to reproduce the issue

1. Setup a Jetpack site with Publicize disabled.
2. Visit /wp-json/
3. See the /publicize/connections/ and other publicize endpoints listed.

#### What I expected
No publicize endpoints registered if Publicize is not available.

#### What happened instead
Publicize endpoints were available.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue on a Jetpack site with Publicize disabled, then inspect /wp-json/ for /publicize/connections/ and the other Publicize endpoints. Review the REST API registration path and determine whether the Gutenberg client depends on these endpoints when the module is unavailable. Done means the expected endpoint visibility behavior is defined and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.