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

Yoast / Yoast-SEO-for-TYPO3 / 13327579701

14 Feb 2025 10:43AM UTC coverage: 1.276%. First build
13327579701

push

github

web-flow
Merge pull request #597 from Yoast/feature/v11

[FEATURE] Release 11.0.0

21 of 894 new or added lines in 76 files covered. (2.35%)

35 of 2744 relevant lines covered (1.28%)

0.04 hits per line

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

0.0
/Classes/Service/Preview/ContentExtractors/ContentMetadataExtractor.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Service\Preview\ContentExtractors;
6

7
class ContentMetadataExtractor implements ContentMetadataExtractorInterface
8
{
9
    public function getTitle(string $content): string
10
    {
NEW
11
        $title = '';
×
NEW
12
        $titleFound = preg_match("/<title[^>]*>(.*?)<\/title>/is", $content, $matchesTitle);
×
13

NEW
14
        if ($titleFound) {
×
NEW
15
            $title = $matchesTitle[1];
×
16
        }
17

NEW
18
        return strip_tags(html_entity_decode($title));
×
19
    }
20

21
    public function getDescription(string $content): string
22
    {
NEW
23
        $metaDescription = '';
×
NEW
24
        $descriptionFound = preg_match(
×
NEW
25
            "/<meta[^>]*name=[\" | \']description[\"|\'][^>]*content=[\"]([^\"]*)[\"][^>]*>/i",
×
NEW
26
            $content,
×
NEW
27
            $matchesDescription
×
NEW
28
        );
×
29

NEW
30
        if ($descriptionFound) {
×
NEW
31
            $metaDescription = $matchesDescription[1];
×
32
        }
33

NEW
34
        return strip_tags(html_entity_decode($metaDescription));
×
35
    }
36

37
    public function getLocale(string $content): string
38
    {
NEW
39
        $locale = 'en';
×
NEW
40
        $localeFound = preg_match('/<html[^>]*lang="([a-z\-A-Z]*)"/is', $content, $matchesLocale);
×
41

NEW
42
        if ($localeFound) {
×
NEW
43
            [$locale] = explode('-', trim($matchesLocale[1]));
×
44
        }
45

NEW
46
        return $locale;
×
47
    }
48
}
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

© 2026 Coveralls, Inc