<?php

namespace WPSN\Modules\Revisions;

use WPSN\Core\AbstractModule;

defined('ABSPATH') || exit;

/**
 * Unified revisions/undo history (cross-module).
 */
final class RevisionsModule extends AbstractModule
{
    public function id(): string
    {
        return 'revisions';
    }

    public function name(): string
    {
        return __('Revisions', 'wp-seo-next');
    }

    public function description(): string
    {
        return __('Unified change history + rollback for WP SEO Next actions (bulk/meta/media/internal links).', 'wp-seo-next');
    }

    public function defaultEnabled(): bool
    {
        // Enabled by default (admin-only + useful safety net).
        return true;
    }

    public function register(): void
    {
        add_action('init', [RevisionsInstaller::class, 'maybeInstall'], 1);

        if (is_admin()) {
            $admin = new Admin\RevisionsAdmin($this->container);
            $admin->register();
        }
    }
}
