Skip to content

fix: leave the site deploy webhook and the fragment sync to the theme - #17

Open
YvesCesar wants to merge 4 commits into
mainfrom
fix/drop-site-deploy-webhook
Open

YvesCesar wants to merge 4 commits into
mainfrom
fix/drop-site-deploy-webhook

Conversation

@YvesCesar

@YvesCesar YvesCesar commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

What was wrong

The plugin and the libresign theme both register POST libresign/v1/site-deploy-webhook. WordPress dispatches to the first handler registered, which is the plugin's, so the theme's handler never ran: the secret set for the theme was ignored, and the plugin stored the fetched header and footer in options (libresign_site_fragment_*) that nothing renders, while the fragments the theme actually renders stopped being updated. The plugin also kept a copy of the fetched HTML, unfiltered, behind a public helper with no caller.

What changed

The theme becomes the only owner of the route and of the fragment sync. This removes from the plugin:

  • the webhook receiver (includes/github-site-webhook.php) and the fragment sync (includes/site-fragment-sync.php);
  • src/Github/SiteDeploy.php, WebhookDecision.php, WebhookGate.php, WebhookRequest.php, WebhookSignature.php and WorkflowRun.php, with their tests;
  • the webhook secret, static site origin, workflow and branch fields of the settings page, and their registered settings.

The deploy dispatch on publish, the deploy token and Secret stay: the theme reads the encrypted libresign_github_deploy_token to comment on the deployed pull request.

Before merging

Verification

  • composer ci green locally on PHP 8.3: lint, PHPCS, PHPStan and the remaining 145 tests; the structure test still pairs every file with its test.
  • On a local install, the route had two handlers with the plugin answering before the change; with the change, only the theme's handler is registered and it answers the delivery.

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
…ting

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
test: cover what the plugin keeps after the webhook removal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants