add_action('wp', function(){
    if (!is_user_logged_in()) return;
    $uid = get_current_user_id();
    echo '<pre>';
    // Listings
    $listings = get_posts(['post_type'=>'listing','author'=>$uid,'posts_per_page'=>-1,'fields'=>'ids']);
    echo "Listings: " . count($listings) . "\n";
    // Reviews
    $reviews = get_posts(['post_type'=>'site-review','posts_per_page'=>-1,'meta_key'=>'assigned_to','meta_value'=>$uid]);
    echo "Reviews (assigned_to): " . count($reviews) . "\n";
    foreach ($reviews as $r) {
        $rating = get_post_meta($r->ID, 'rating', true);
        echo "Review ID: {$r->ID}, rating: {$rating}\n";
    }
    // Bookings
    if (!empty($listings)) {
        $bookings = get_posts(['post_type'=>'client_booking','post_status'=>['pending','confirmed','completed'],'posts_per_page'=>-1,'meta_query'=>[['key'=>'_booking_listing_id','value'=>$listings,'compare'=>'IN']]]);
        echo "Bookings: " . count($bookings) . "\n";
        foreach ($bookings as $b) {
            echo "Booking {$b->ID}: status=" . get_post_status($b->ID) . ", date=" . get_the_date('Y-m-d', $b->ID) . "\n";
        }
    }
    exit;
});
add_shortcode('s2y_stats_debug', function(){
    if (!is_user_logged_in()) return 'Not logged in.';
    $uid = get_current_user_id();
    ob_start();
    echo '<div style="background:#fff; padding:20px; margin:20px; border:1px solid #ccc; font-family:monospace;">';
    echo '<h3>Debug – Stylist ID: ' . $uid . '</h3>';

    // Listings
    $listings = get_posts([
        'post_type' => 'listing',
        'author'    => $uid,
        'fields'    => 'ids',
        'posts_per_page' => -1,
        'post_status' => 'publish',
    ]);
    echo '<p>Listings found: ' . count($listings) . ' (IDs: ' . implode(',', $listings) . ')</p>';

    // Reviews (try both common keys)
    $reviews = get_posts([
        'post_type' => 'site-review',
        'post_status' => 'publish',
        'posts_per_page' => -1,
        'meta_key'   => 'assigned_to',
        'meta_value' => $uid,
        'fields' => 'ids',
    ]);
    echo '<p>Reviews (assigned_to): ' . count($reviews) . '</p>';
    if (empty($reviews)) {
        $reviews2 = get_posts([
            'post_type' => 'site-review',
            'post_status' => 'publish',
            'posts_per_page' => -1,
            'meta_key'   => '_review_stylist_id',
            'meta_value' => $uid,
            'fields' => 'ids',
        ]);
        echo '<p>Reviews (_review_stylist_id): ' . count($reviews2) . '</p>';
        $reviews = $reviews2; // use alternative
    }
    foreach ($reviews as $rid) {
        $rating = get_post_meta($rid, 'rating', true) ?: get_post_meta($rid, '_rating', true);
        echo '<p>Review #' . $rid . ' rating: ' . $rating . '</p>';
    }

    // Bookings
    if (!empty($listings)) {
        $bookings = get_posts([
            'post_type' => 'client_booking',
            'posts_per_page' => -1,
            'post_status' => ['pending','confirmed','completed','cancelled'],
            'meta_query' => [[ 'key' => '_booking_listing_id', 'value' => $listings, 'compare' => 'IN' ]],
            'fields' => 'ids',
        ]);
        echo '<p>Total bookings linked: ' . count($bookings) . '</p>';
        foreach ($bookings as $bid) {
            echo '<p>Booking #' . $bid . ' status: ' . get_post_status($bid) . ', date: ' . get_the_date('Y-m-d', $bid) . '</p>';
        }
    }

    // Check tier meta
    $tier = get_user_meta($uid, '_stylist_tier', true);
    $avg = get_user_meta($uid, '_stylist_booking_avg', true);
    echo '<p>Tier: ' . ($tier ?: 'none') . ', Avg bookings: ' . ($avg ?: '0') . '</p>';

    echo '</div>';
    return ob_get_clean();
});<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//style2you.shop/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://style2you.shop/post-sitemap.xml</loc>
		<lastmod>2019-02-01T00:55:49+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/page-sitemap.xml</loc>
		<lastmod>2026-07-26T17:59:39+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/manual_testimonial-sitemap.xml</loc>
		<lastmod>2026-07-19T01:15:16+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/style_feed-sitemap.xml</loc>
		<lastmod>2026-07-15T20:27:59+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/listing-sitemap.xml</loc>
		<lastmod>2026-07-26T21:32:38+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/category-sitemap.xml</loc>
		<lastmod>2019-02-01T00:55:49+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/post_tag-sitemap.xml</loc>
		<lastmod>2018-12-03T10:58:26+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/listing_category-sitemap.xml</loc>
		<lastmod>2026-07-24T02:08:32+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://style2you.shop/author-sitemap.xml</loc>
		<lastmod>2026-07-06T11:23:02+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->