RFC Feature PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
15 Jun 2024

Summary of Changes

Adding Subscriber Registration Checker. Interface that allows Plugins to be checked before listener registration.
This allows the plugin to be registered only wheen special conditions are met, eg: only for specific application.

Testing Instructions

Code review by maintainers.

Edit

public function onBeforeCompileHead()
{
$app = $this->getApplication();

And add dd('Works'); at top of this method.

Then open Administrator page: you should get message "works"
And then open Site page: the page should be opened as usual

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: joomla/Manual#272
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 15 Jun 2024
avatar Fedik Fedik - change - 15 Jun 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Jun 2024
Category Libraries Front End Plugins
avatar Fedik Fedik - change - 15 Jun 2024
Title
[5.2] CMSPlugin: Subscriber Registration Checker Interface
[5.2][RFC] CMSPlugin: Subscriber Registration Checker Interface
avatar Fedik Fedik - edited - 15 Jun 2024
avatar Fedik Fedik - change - 15 Jun 2024
The description was changed
avatar Fedik Fedik - edited - 15 Jun 2024
avatar Fedik Fedik - change - 15 Jun 2024
The description was changed
avatar Fedik Fedik - edited - 15 Jun 2024
avatar Fedik Fedik - change - 15 Jun 2024
Title
[5.2][RFC] CMSPlugin: Subscriber Registration Checker Interface
[5.x][RFC] CMSPlugin: Subscriber Registration Checker Interface
avatar Fedik Fedik - edited - 15 Jun 2024
avatar HLeithner
HLeithner - comment - 2 Sep 2024

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 2 Sep 2024
Title
[5.x][RFC] CMSPlugin: Subscriber Registration Checker Interface
[5.3] [RFC] CMSPlugin: Subscriber Registration Checker Interface
avatar HLeithner HLeithner - edited - 2 Sep 2024
avatar Fedik Fedik - change - 2 Sep 2024
Labels Added: RFC Feature PR-5.2-dev PR-5.3-dev
avatar HLeithner
HLeithner - comment - 4 Mar 2025

This pull request has been automatically rebased to 6.0-dev.

avatar HLeithner HLeithner - change - 4 Mar 2025
Title
[5.3] [RFC] CMSPlugin: Subscriber Registration Checker Interface
[6.0] [RFC] CMSPlugin: Subscriber Registration Checker Interface
avatar HLeithner HLeithner - edited - 4 Mar 2025
avatar Fedik Fedik - change - 14 Jul 2025
Labels Added: PR-6.0-dev
Removed: PR-5.2-dev PR-5.3-dev
avatar HLeithner
HLeithner - comment - 31 Aug 2025

This pull request has been automatically rebased to 6.1-dev.

avatar HLeithner HLeithner - change - 31 Aug 2025
Title
[6.0] [RFC] CMSPlugin: Subscriber Registration Checker Interface
[6.1] [RFC] CMSPlugin: Subscriber Registration Checker Interface
avatar HLeithner HLeithner - edited - 31 Aug 2025
avatar Fedik Fedik - change - 19 Oct 2025
Labels Added: PR-6.1-dev
Removed: PR-6.0-dev
07c97b1 15 Feb 2026 avatar Fedik upd
avatar HLeithner
HLeithner - comment - 15 Feb 2026

It's a bit contra productive if the check function gets no information about where to register.

We have the situation that we might not have an own dispatcher we want the plugin to register. Or we boot the plugin for the SiteRouter in the backend (see autoredirect plugin).

I also think it should be static so it doesn't access the plugin object it self.

More might be provided to the plugin to get a qualified answer to the "should register" question.

avatar Fedik
Fedik - comment - 15 Feb 2026

Initially I wanted detached handler. Then service provider could be:

$container->set(PluginRegistrationChecker::class, function() {
  return true/false; 
});
$container->set(PluginInterface::class, function() {
 // our existing code for plugin initialisation
});

Then plugin helper checking for PluginRegistrationChecker first and only then for plugin.
But with current architecture it is not possible, and the checker need to be part of PluginInterface.

Also the idea that checker can access to the plugin parameters. We have plugin that can be configured to run: site/admin/both (example skipto plugin).

I set it to draft for now. Maybe later we will get a better idea.

Add a Comment

Login with GitHub to post a comment