private function resolve_post_id_from_row($row) {
    $url = '';

    if (!empty($row['new_url'])) {
        $url = $row['new_url'];
    } elseif (!empty($row['url'])) {
        $url = $row['url'];
    }

    $url = esc_url_raw(trim($url));

    if ($url === '') {
        return 0;
    }

    $home_host = wp_parse_url(home_url(), PHP_URL_HOST);
    $url_host  = wp_parse_url($url, PHP_URL_HOST);

    // Sadece kendi domainindeki URL'leri çöz
    if ($url_host && $home_host && strtolower($url_host) !== strtolower($home_host)) {
        return 0;
    }

    $path = wp_parse_url($url, PHP_URL_PATH);

    if (!$path) {
        return 0;
    }

    $path = trim($path, '/');

    if ($path === '') {
        return (int) get_option('page_on_front');
    }

    $parts = explode('/', $path);
    $slug  = sanitize_title(end($parts));

    if ($slug === '') {
        return 0;
    }

    $post_types = array(
        'page',
        'post',
        'product',
        'guides',
        'transfer',
        'tours',
    );

    $query = new WP_Query(array(
        'name'           => $slug,
        'post_type'      => $post_types,
        'post_status'    => array('publish', 'draft', 'pending', 'private'),
        'posts_per_page' => 1,
        'fields'         => 'ids',
        'no_found_rows'  => true,
    ));

    if (!empty($query->posts[0])) {
        return (int) $query->posts[0];
    }

    return 0;
}<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://www.alanyagroup.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://www.alanyagroup.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://www.alanyagroup.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://www.alanyagroup.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://www.alanyagroup.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
