Skip to content

Adopt silverassist/wp-plugin-kernel across all sub-plugins - #5

Merged
miguelcolmenares merged 2 commits into
mainfrom
feat/adopt-wp-plugin-kernel
Aug 18, 2026
Merged

Adopt silverassist/wp-plugin-kernel across all sub-plugins#5
miguelcolmenares merged 2 commits into
mainfrom
feat/adopt-wp-plugin-kernel

Conversation

@miguelcolmenares

Copy link
Copy Markdown
Member

Summary

PR B1 of the standardization effort (see plan) — closes the wp-plugin-kernel rollout gap. This monorepo was the only SilverAssist WordPress plugin holdout still using a locally-duplicated bootstrap pattern instead of the shared silverassist/wp-plugin-kernel package (already adopted in 7 other plugins).

Changes

  • Every LoadableInterface-implementing class in the 3 sub-plugins now implements the kernel's interface (get_priority(): int, should_load(): bool, init(): void) instead of the old local priority()/register() contract, plus a static instance(): self singleton method — AbstractPlugin::load_components() calls $class::instance() with no arguments.
  • Core/Plugin.php in all 3 sub-plugins now extends AbstractPlugin, implementing only get_components(): array (a list of class-strings). Singleton access, priority-ordered loading, and per-component error isolation are inherited, not re-typed per plugin.
  • contentful-tables' TableDataLoader was constructor-injected into ShortcodeRegistrar/SettingsPage before this — since kernel-managed components can't take constructor arguments, TableDataLoader became a proper singleton and the other two now fetch it via TableDataLoader::instance().
  • graphql-shortcode-support had already independently converged on the same get_priority()/should_load()/init() method names before the kernel existed — its migration was just swapping the interface import and Plugin.php's base class.
  • The 3 local Core/Interfaces/LoadableInterface.php files are deleted.
  • silverassist/wp-plugin-kernel added to require (runtime, not --dev) in all 3 composer.json.

Docs

A pre-PR core-review pass caught 3 READMEs' directory trees and CONTRIBUTING.md's documented interface contract still describing the old local pattern — updated all 4.

Verified

  • make phpcs, make phpstan, and make build all clean across all three sub-plugins
  • Read-only core-review pass (read-only subagent): confirmed every migrated class has all 4 required singleton pieces, no orphaned references to the deleted interface files, contentful-tables' DI-to-singleton change didn't leave any stale new TableDataLoader() call sites, and composer.json changes are valid

Not done in this PR (see plan)

  • Live functional verification in the Local Sites WordPress install — no automated test suite exists yet for any of the 3 sub-plugins (that's PR B2), so this PR relies on static analysis + CI's PHP 8.2/8.3/8.4 matrix rather than runtime testing. Recommended as a manual follow-up before merging, or accept CI as sufficient given the mechanical nature of the change.

Replaces each sub-plugin's own duplicated LoadableInterface + Plugin
bootstrap with the shared silverassist/wp-plugin-kernel package,
closing the gap documented after the wp-plugin-kernel rollout (7
other plugins already migrated; this monorepo was the one holdout).

- Every component now implements the kernel's LoadableInterface
  (get_priority(): int, should_load(): bool, init(): void) instead of
  the old local priority()/register() contract, plus a static
  instance(): self method — AbstractPlugin's load_components() calls
  $class::instance() with no arguments.
- The 3 Core/Plugin.php files shrink to extending AbstractPlugin with
  just get_components(): array (a list of class-strings); the
  singleton access, priority sort, and per-component error isolation
  are all inherited, not re-typed per plugin.
- contentful-tables' TableDataLoader was constructor-injected into
  ShortcodeRegistrar/SettingsPage before this change — since
  kernel-managed components can't take constructor arguments,
  TableDataLoader became a proper singleton and the other two now
  fetch it via TableDataLoader::instance() in their own constructors.
- graphql-shortcode-support already used get_priority()/should_load()/
  init() method names independently (it converged on nearly the same
  shape as the kernel before the kernel existed) — its migration was
  just swapping the interface import and Plugin.php's base class.
- Updated 3 READMEs' directory trees and CONTRIBUTING.md's documented
  interface contract, which still described the old local pattern
  (caught by a pre-PR core-review pass).

Verified: make phpcs, make phpstan, and make build all clean across
all three sub-plugins.
Clears the 'Node.js 20 is deprecated' warnings now surfacing on every
CI job step (actions/checkout, actions/cache, actions/upload-artifact
were still pinned to their Node 20 majors).
@miguelcolmenares
miguelcolmenares merged commit 687d0e4 into main Aug 18, 2026
3 checks passed
@miguelcolmenares
miguelcolmenares deleted the feat/adopt-wp-plugin-kernel branch August 18, 2026 03:00
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.

1 participant