/*
 * ==========================================
 * 410 TABLOSU
 * ==========================================
 */

function tesisat_410_tablo_hazirla() {

    global $wpdb;

    $table = $wpdb->prefix . '410_takip';

    if ( get_option('tesisat_410_takip_hazir') === '1' ) {
        return;
    }

    $charset = $wpdb->get_charset_collate();

    $sql = "CREATE TABLE {$table} (
        id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
        url VARCHAR(500) NOT NULL,
        added_at DATETIME NOT NULL,
        PRIMARY KEY (id),
        UNIQUE KEY url (url(191))
    ) {$charset};";

    require_once ABSPATH . 'wp-admin/includes/upgrade.php';

    dbDelta($sql);

    update_option(
        'tesisat_410_takip_hazir',
        '1'
    );
}

add_action(
    'init',
    'tesisat_410_tablo_hazirla',
    1
);


/*
 * ==========================================
 * 410 KONTROLÜ
 * ==========================================
 */

function tesisat_410_kontrol() {

    global $wpdb;

    $table = $wpdb->prefix . '410_takip';

    $url = isset($_SERVER['REQUEST_URI'])
        ? wp_unslash($_SERVER['REQUEST_URI'])
        : '';

    if ( empty($url) ) {
        return;
    }

    $url = sanitize_text_field($url);

    if ( strlen($url) > 500 ) {
        $url = substr($url, 0, 500);
    }

    $var = $wpdb->get_var(
        $wpdb->prepare(
            "SELECT id
             FROM {$table}
             WHERE url = %s
             LIMIT 1",
            $url
        )
    );

    if ( ! $var ) {
        return;
    }

    /*
     * GERÇEK HTTP 410
     */

    status_header(410);

    nocache_headers();


    /*
     * 410.php VARSA ONU GÖSTER
     */

    $template = locate_template(
        array('410.php')
    );

    if ( $template ) {

        include $template;

        exit;
    }


    /*
     * 410.php YOKSA
     */

    wp_die(
        'Bu sayfa artık mevcut değil.',
        '410 Gone',
        array(
            'response' => 410
        )
    );
}


/*
 * 301'LARDAN ÖNCE ÇALIŞSIN
 */

add_action(
    'template_redirect',
    'tesisat_410_kontrol',
    -999
);

<script>
document.addEventListener('DOMContentLoaded', function () {

    const ana = document.getElementById('tesisat-ana-checkbox');

    const kutular = document.querySelectorAll(
        '.tesisat-410-checkbox'
    );

    const tumunuSec = document.getElementById(
        'tesisat-tumunu-sec'
    );

    const secimiKaldir = document.getElementById(
        'tesisat-secimi-kaldir'
    );


    /*
     * ANA CHECKBOX
     */

    if (ana) {

        ana.addEventListener('change', function () {

            kutular.forEach(function (kutu) {

                kutu.checked = ana.checked;

            });

        });

    }


    /*
     * TÜMÜNÜ SEÇ
     */

    if (tumunuSec) {

        tumunuSec.addEventListener('click', function () {

            kutular.forEach(function (kutu) {

                kutu.checked = true;

            });

            if (ana) {
                ana.checked = true;
            }

        });

    }


    /*
     * SEÇİMİ KALDIR
     */

    if (secimiKaldir) {

        secimiKaldir.addEventListener('click', function () {

            kutular.forEach(function (kutu) {

                kutu.checked = false;

            });

            if (ana) {
                ana.checked = false;
            }

        });

    }

});


/*
 * ONAY
 */

function tesisat410Onay() {

    const secilen = document.querySelectorAll(
        '.tesisat-410-checkbox:checked'
    );

    if (secilen.length === 0) {

        alert(
            'Önce 410 yapmak istediğiniz URL\\'leri seçin.'
        );

        return false;
    }


    return confirm(
        secilen.length +
        ' URL 410 yapılacak ve 404 listesinden çıkarılacak.\\n\\nDevam edilsin mi?'
    );
}
</script>
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//www.tesisatvizyon.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap1.xml</loc>
		<lastmod>2026-08-17T13:14:02+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap2.xml</loc>
		<lastmod>2026-08-17T12:42:11+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap3.xml</loc>
		<lastmod>2026-08-17T12:31:31+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap4.xml</loc>
		<lastmod>2026-08-17T12:30:14+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap5.xml</loc>
		<lastmod>2026-08-17T12:25:43+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap6.xml</loc>
		<lastmod>2026-08-15T22:35:45+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap7.xml</loc>
		<lastmod>2026-08-15T22:06:10+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap8.xml</loc>
		<lastmod>2026-08-15T22:06:09+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap9.xml</loc>
		<lastmod>2026-08-15T22:06:08+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap10.xml</loc>
		<lastmod>2026-08-15T22:06:07+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap11.xml</loc>
		<lastmod>2026-08-15T22:06:06+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap12.xml</loc>
		<lastmod>2026-08-15T22:06:04+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap13.xml</loc>
		<lastmod>2026-08-15T22:06:03+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap14.xml</loc>
		<lastmod>2026-08-15T22:06:02+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap15.xml</loc>
		<lastmod>2026-08-15T22:06:01+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap16.xml</loc>
		<lastmod>2026-08-15T22:06:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/post-sitemap17.xml</loc>
		<lastmod>2026-08-15T22:05:58+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/page-sitemap.xml</loc>
		<lastmod>2026-08-15T18:45:06+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.tesisatvizyon.com/category-sitemap.xml</loc>
		<lastmod>2026-08-17T13:14:02+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->