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

Yoast / Yoast-SEO-for-TYPO3 / 24723291290

21 Apr 2026 12:50PM UTC coverage: 10.457% (+9.2%) from 1.275%
24723291290

push

github

web-flow
Merge pull request #632 from Yoast/feature/yoast-v12

[FEATURE] Version 12.0.0, added v14 support, removed v11 support including php8.0 and php8.1, rewrote backend javascript functionality to typescript and webcomponents

40 of 806 new or added lines in 69 files covered. (4.96%)

40 existing lines in 23 files now uncovered.

284 of 2716 relevant lines covered (10.46%)

0.29 hits per line

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

0.0
/Classes/Service/SnippetPreviewService.php
1
<?php
2

3
/**
4
 * This file is part of the "yoast_seo" extension for TYPO3 CMS.
5
 *
6
 * For the full copyright and license information, please read the
7
 * LICENSE.txt file that was distributed with this source code.
8
 */
9

10
declare(strict_types=1);
11

12
namespace YoastSeoForTypo3\YoastSeo\Service;
13

14
use TYPO3\CMS\Core\Configuration\Features;
15
use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
16
use TYPO3\CMS\Core\Page\PageRenderer;
17
use YoastSeoForTypo3\YoastSeo\Dto\RequestData;
18
use YoastSeoForTypo3\YoastSeo\Service\Javascript\JsonTranslationsService;
19
use YoastSeoForTypo3\YoastSeo\Utility\PathUtility;
20

21
class SnippetPreviewService
22
{
23
    public function __construct(
24
        protected UrlService $urlService,
25
        protected PageRenderer $pageRenderer,
26
        protected LocaleService $localeService,
27
        protected JsonTranslationsService $jsonTranslationsService,
28
        protected Features $features,
UNCOV
29
    ) {}
×
30

31
    /**
32
     * @param array<string, mixed> $currentData
33
     * @param array<string, mixed> $additionalConfiguration
34
     */
35
    public function buildSnippetPreview(
36
        RequestData $requestData,
37
        array $currentData,
38
        array $additionalConfiguration,
39
    ): void {
40
        $config = [
×
41
            'urls' => [
×
42
                'workerUrl' => PathUtility::getPublicPathToResources() . '/JavaScript/dist/worker.js',
×
43
                'saveScores' => $this->urlService->getSaveScoresUrl(),
×
44
                'prominentWords' => $this->urlService->getProminentWordsUrl(),
×
NEW
45
                'yoastCss' => PathUtility::getPublicPathToResources() . '/CSS/yoast.min.css',
×
46
            ],
×
NEW
47
            'analysisEnabled' => !((bool)($currentData['tx_yoastseo_disable_analysis'] ?? false)),
×
48
            'isCornerstoneContent' => (bool)($currentData['tx_yoastseo_cornerstone'] ?? false),
×
49
            'focusKeyphrase' => [
×
50
                'keyword' => (string)($currentData['tx_yoastseo_focuskeyword'] ?? ''),
×
51
                'synonyms' => (string)($currentData['tx_yoastseo_focuskeyword_synonyms'] ?? ''),
×
52
            ],
×
53
            'supportedLanguages' => $this->localeService->getSupportedLanguages(),
×
NEW
54
            'inclusiveLanguageEnabled' => $this->features->isFeatureEnabled('yoastSeoInclusiveLanguage'),
×
NEW
55
            'requestData' => $requestData->toArray(),
×
UNCOV
56
        ];
×
57

NEW
58
        $this->pageRenderer->getJavaScriptRenderer()->addJavaScriptModuleInstruction(
×
NEW
59
            JavaScriptModuleInstruction::create('@yoast/yoast-seo-for-typo3/yoast-plugin.js')->invoke(
×
NEW
60
                'initialize',
×
NEW
61
                array_merge($config, $additionalConfiguration)
×
NEW
62
            )
×
NEW
63
        );
×
64

NEW
65
        $this->jsonTranslationsService->addTranslations();
×
UNCOV
66
        $this->pageRenderer->addCssFile('EXT:yoast_seo/Resources/Public/CSS/yoast.min.css');
×
67
    }
68
}
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