Contracts

AdapterContract

v1.0.0

Implemented by adapter modules that wrap or enhance third-party plugin screens inside Meteorack UI chrome.

Namespace

use Meteorack\Sdk\Core\Contracts\AdapterContract;

How To Use It

  • Use this on adapter modules that bridge an existing third-party plugin into Meteorack-managed navigation and UI chrome.
  • Combine it with a normal module implementation so availability checks can prevent broken routes when the target plugin is missing or inactive.

Methods

public function getTargetPluginSlug(): string

Returns the third-party plugin slug being adapted.

public function getAdaptedPages(): array

Lists the menu slugs or page identifiers the adapter handles.

public function isAvailable(): bool

Reports whether the target plugin is active and adaptable on the current site.

Example

bootstrap.php
<?php

declare(strict_types=1);

use Meteorack\Sdk\Core\Contracts\AdapterContract;
use Meteorack\Sdk\RuntimeWp\AbstractModule;

class WooCommerceAdapter extends AbstractModule implements AdapterContract
{
    public function getSlug(): string { return 'woocommerce-adapter'; }
    public function getName(): string { return 'WooCommerce Adapter'; }
    public function getVersion(): string { return '1.0.0'; }

    public function getTargetPluginSlug(): string
    {
        return 'woocommerce';
    }

    public function getAdaptedPages(): array
    {
        return ['wc-admin'];
    }

    public function isAvailable(): bool
    {
        return is_plugin_active('woocommerce/woocommerce.php');
    }
}

return new WooCommerceAdapter();