Contracts

PluginContract

v1.0.0

Base identity contract for any registerable Meteorack plugin or module.

Namespace

use Meteorack\Sdk\Core\Contracts\PluginContract;

How To Use It

  • Treat it as the minimum identity surface every registerable Meteorack plugin or module exposes to the runtime.
  • When you extend AbstractModule you already satisfy most of this contract, so override the metadata methods only when you need non-default description, icon, or SDK compatibility values.

Methods

public function getSlug(): string

Returns the stable runtime slug for the module or plugin.

public function getName(): string

Returns the human-readable display name.

public function getVersion(): string

Returns the current semantic version.

public function getMinSdk(): string

Declares the minimum supported Meteorack SDK version.

public function getMaxTestedSdk(): string

Declares the latest SDK version this module has been tested against.

public function getDescription(): string

Returns the long-form module description used in listings and metadata views.

public function getIconUrl(): string

Returns the icon URL shown in admin or marketplace surfaces.

Example

bootstrap.php
<?php

declare(strict_types=1);

use Meteorack\Sdk\RuntimeWp\AbstractModule;

class ReportsModule extends AbstractModule
{
    public function getSlug(): string { return 'reports'; }
    public function getName(): string { return 'Reports'; }
    public function getVersion(): string { return '1.2.0'; }
    public function getMinSdk(): string { return '1.0.0'; }
    public function getMaxTestedSdk(): string { return '1.0.0'; }
    public function getDescription(): string { return 'Operational reporting tools.'; }
    public function getIconUrl(): string { return content_url('meteorack/modules/reports/icon.svg'); }
}

return new ReportsModule();