Skip to content

proposal: additions to the plugin system #945

@thewilli

Description

@thewilli

I have some requirements the current plugin system does not fulfill. Would you accept the following changes / additions (as a PR 😉)?

Settings

The plugin-name.meta file allows to set parameter descriptions. I want to introduce another optional possibility:
Defining type.<PARAMETER_NAME> and setting it to string value of either string (default), bool or number will lead to a rendered text field, checkbox or number input field in the plugin administration, and save the values with the corresponding type in the configuration when changed.

Might break plugin administration of external themes.

Might get extended by additional types (e.g. enums rendering to radio button list).

New Hooks

  • activated: the plugin is now activated (was deactivated before). not triggered for default plugin(s) upon setup, only for manual activation.
  • deactivated: the plugin is now deactivated (was activated before), do e.g. some cleanup
  • cronjob: cronjob handler, see API addition below

REST API addition

I want to introduce a new endpoint, GET /cronjob. All it does is to trigger the cronjob hook (see above) of all supported and activated plugins. I need this for plugins to e.g. check the status of a link (is the page still available? has it changed?) and cleanup of e.g. cancelled or timeouted uploads. Currently I see now way to trigger the plugins regularly to do these kinds of lookups or cleanups.

The interval of cronjob invocation would be up to the user, and cronjoob hook would get the date and time of the last run in order to do some timing. Finally Shaarli itself could use this handler to do some (optional) cleanup as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions