# flywp/1.8.0/includes/StaticSite/Engine/Discovery/SitemapSource.php

FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel, version 1.8.0. 38 lines.

- Page: https://pluginprobe.com/plugins/flywp/1.8.0/code/includes/StaticSite/Engine/Discovery/SitemapSource.php
- Raw: https://pluginprobe.com/plugins/flywp/1.8.0/raw/includes/StaticSite/Engine/Discovery/SitemapSource.php
- Modified: 2026-10-01T05:36:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/flywp/1.8.0/code/includes/StaticSite/Engine/Discovery/SitemapSource.php#L10-L20`.

```php
<?php

namespace FlyWP\StaticSite\Engine\Discovery;

/**
 * Sitemaps: the WordPress core sitemap with its sub-sitemaps, or the index of an active SEO plugin.
 *
 * No HTTP probes. The gateway gives only sitemaps that are on.
 * The crawler follows the <loc> links in the sitemap files.
 *
 * @since 1.8.0
 */
class SitemapSource implements UrlSource {

    /**
     * @var WordPressGateway
     */
    private $wp;

    /**
     * @param WordPressGateway $wp Gateway.
     */
    public function __construct( WordPressGateway $wp ) {
        $this->wp = $wp;
    }

    /**
     * {@inheritdoc}
     */
    public function urls() {
        foreach ( $this->wp->sitemap_urls() as $url ) {
            $stylesheet = '.xsl' === substr( $url, -4 ) || false !== strpos( $url, 'sitemap-stylesheet=' );

            yield new DiscoveredUrl( $url, $stylesheet ? 'asset' : 'sitemap' );
        }
    }
}

```
