API / Minn\Runtime / PluginUpdates

PluginUpdates final class

Minn\Runtime\PluginUpdates · public/minn/src/Minn/Runtime/PluginUpdates.php · 65 lines

The update offers the site's own plugins publish. A plugin that hosts itself, or sells itself, is not in the wordpress.org directory and never appears in the directory's answer: it publishes its offer by filtering the update transient WordPress reads, which is the only place anyone learns of it. The engine asks the same question of the runtime, in the shape the reference asks it, so a self-hosted plugin is offered its update here exactly as it would be on WordPress.

The transient carries `checked` (every installed plugin and its version), and a plugin's updater returns early when that is empty, so the installed versions are what make the question answerable.

Uses 1
Used by 1

Constants and properties

privateHOOK = 'site_transient_update_plugins'

Public

staticsupplied(array $installed): array#

What the site's plugins offer for themselves, empty when no runtime is booted or nothing filters the transient.

$installedarray<string, string>plugin file => installed version
@return array{plugins: array<string, array<string, mixed>>, no_update: array<string, array<string, mixed>>}
staticfromFiltered(mixed $filtered, array $installed): array#

The filtered transient as the state's two buckets: offers under `plugins`, plugins that answered "current" under `no_update`, both as arrays, and only for files this site actually has.

$installedarray<string, string>
@return array{plugins: array<string, array<string, mixed>>, no_update: array<string, array<string, mixed>>}

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatebucket(mixed $filtered, string $name, array $installed): array#

One bucket of the transient, normalised.

$installedarray<string, string>
@return array<string, array<string, mixed>>