<?php

/**
 * Internal Linking Module
 *
 * Provides basic internal linking suggestions and editor integration.
 *
 * @package ProRank\SEO\Modules\Content
 * @since   1.0.0
 */

declare(strict_types=1);

namespace ProRank\SEO\Modules\Content;

use ProRank\SEO\Modules\BaseModule;
use ProRank\SEO\Core\Compatibility\CompetitorDetector;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}




class InternalLinkingModule extends BaseModule {
    protected string $slug = 'internal-linking';

    protected string $name = 'Internal Linking';

    protected string $description = 'Get basic internal linking suggestions while editing content.';

    protected string $feature_tier = 'free';

    protected ?string $parent_slug = 'on-page-seo';

    public function init_hooks(): void {
        // Suppress ProRank internal linking when a competing plugin
        // (e.g. Link Whisper) is active.
        $detector = new CompetitorDetector();
        if ($detector->should_enable_internal_linking_safe_mode()) {
            return;
        }

        // REST routes are registered centrally in Plugin::init_rest_api().
    }
}
