• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 481faf637ba3a7c1e5f2bfef59b582ac39523de6

21 May 2025 09:11AM UTC coverage: 46.174%. First build
481faf637ba3a7c1e5f2bfef59b582ac39523de6

Pull #22291

github

web-flow
Merge pull request #22278 from Yoast/577-sanitize-and-deal-with-special-markdown-characters-before-writing-to-file

577 sanitize and deal with special markdown characters before writing to file
Pull Request #22291: Introduce the llms.txt feature

52 of 403 new or added lines in 30 files covered. (12.9%)

15586 of 33755 relevant lines covered (46.17%)

3.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/llms-txt/infrastructure/markdown-services/sitemap-link-collector.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
4
namespace Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services;
5

6
use WPSEO_Options;
7
use WPSEO_Sitemaps_Router;
8
use Yoast\WP\SEO\Llms_Txt\Domain\Markdown\Items\Link;
9

10
/**
11
 * The sitemap link collector.
12
 */
13
class Sitemap_Link_Collector {
14

15
        /**
16
         * Gets the link for the sitemap.
17
         *
18
         * @return Link The link for the sitemap.
19
         */
NEW
20
        public function get_link(): ?Link {
×
NEW
21
                if ( WPSEO_Options::get( 'enable_xml_sitemap' ) ) {
×
NEW
22
                        $sitemap_url = WPSEO_Sitemaps_Router::get_base_url( 'sitemap_index.xml' );
×
NEW
23
                        return new Link( 'sitemap', $sitemap_url );
×
24
                }
25

NEW
26
                $sitemap_url = \get_sitemap_url( 'index' );
×
27

NEW
28
                if ( $sitemap_url !== false ) {
×
NEW
29
                        return new Link( 'sitemap', $sitemap_url );
×
30
                }
31

NEW
32
                return null;
×
33
        }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc