Plugins: let another plugin ask a plugin to act, without polling through a hook

Open
#687 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
laravel, php

Research direction

Start by reading HookSender in teme/contracts to see how notify, transform and collect are offered to the declaring plugin, then read docs/guides/developers/plugins/your-own-hooks.md. Compare that with how ContentWriter is offered to plugins and how plugin register() listeners receive hooks. The issue leaves the API shape open between declared actions and a Resolve hook, so this is design work before any patch.

Written by the indexing model from the issue text.

Description

area/plugins type/enhancement when/later

A plugin can declare hooks of its own (Notification, Transform, Collect), but another plugin can only listen to them; nothing lets another plugin call into it. So when a scheduling plugin wants a sharing plugin to "share this item now", the sharing plugin has to declare a Collect hook and ask for requests on a timer (each minute), and the scheduling plugin has to return the same request every time until it is taken, with a key so it is planned once.

That works, but it polls for something an event would do, it delays every request by up to the poll interval, and the asking plugin can't be told the request was accepted or refused.

Expected: a way for a plugin to publish a small declared action (a name, a typed payload, a capability needed to ask) that another plugin, which requires it, may call, and which runs as the caller's person through the receiver's own checks and returns an accepted or refused answer, much as ContentWriter is offered to plugins. Or at least a hook the sender can raise for an event it wasn't listening for: the receiving plugin's register() listens, and the call returns the first listener's answer (a Resolve hook, raised by another plugin).

Where: teme/contracts (HookSender offers notify, transform and collect for the declaring plugin only), docs/guides/developers/plugins/your-own-hooks.md.

🤖 Generated with Claude Code

Dominant language
PHP
Stars
1
Forks
1
Avg merge
1h 40m
Merged PRs (30d)
143

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from temecms/teme

All issues in temecms/teme

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.