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

Yoast / Yoast-SEO-for-TYPO3 / 21521134747

30 Jan 2026 03:30PM UTC coverage: 0.866% (-0.4%) from 1.275%
21521134747

push

github

RinyVT
[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

0 of 550 new or added lines in 53 files covered. (0.0%)

33 existing lines in 21 files now uncovered.

23 of 2657 relevant lines covered (0.87%)

0.03 hits per line

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

0.0
/Classes/Service/TcaService.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\Utility\ExtensionManagementUtility;
15

16
class TcaService
17
{
18
    protected const LL_PREFIX_TCA = 'LLL:EXT:yoast_seo/Resources/Private/Language/TCA.xlf:';
19
    protected const LL_PREFIX_BACKEND = 'LLL:EXT:yoast_seo/Resources/Private/Language/BackendModule.xlf:';
20

21
    protected string $table = '';
22
    protected string $types = '';
23
    protected string $descriptionField = '';
24

25
    public function addYoastFields(string $table, string $types, string $descriptionField = 'description'): void
26
    {
27
        $this->table = $table;
×
28
        $this->types = $types;
×
29
        $this->descriptionField = $descriptionField;
×
30

31
        $this->addDefaultFields();
×
NEW
32
        $this->addSocialPreviewFields();
×
33

34
        $this->addPalettes();
×
35
        $this->addToTypes();
×
36
    }
37

38
    protected function addDefaultFields(): void
39
    {
40
        $columns = [
×
41
            'tx_yoastseo_snippetpreview' => [
×
42
                'label' => self::LL_PREFIX_BACKEND . 'snippetPreview',
×
43
                'exclude' => true,
×
44
                'displayCond' => 'FIELD:tx_yoastseo_hide_snippet_preview:REQ:false',
×
45
                'config' => [
×
46
                    'type' => 'none',
×
47
                    'renderType' => 'snippetPreview',
×
48
                    'settings' => [
×
49
                        'titleField' => 'seo_title',
×
50
                        'descriptionField' => $this->descriptionField,
×
51
                    ],
×
52
                ],
×
53
            ],
×
54
            'tx_yoastseo_readability_analysis' => [
×
55
                'label' => self::LL_PREFIX_BACKEND . 'analysis',
×
56
                'exclude' => true,
×
57
                'displayCond' => 'FIELD:tx_yoastseo_hide_snippet_preview:REQ:false',
×
58
                'config' => [
×
59
                    'type' => 'none',
×
60
                    'renderType' => 'readabilityAnalysis',
×
61
                ],
×
62
            ],
×
63
            'tx_yoastseo_focuskeyword' => [
×
64
                'label' => self::LL_PREFIX_BACKEND . 'seoFocusKeyword',
×
65
                'exclude' => true,
×
66
                'displayCond' => 'FIELD:tx_yoastseo_hide_snippet_preview:REQ:false',
×
67
                'config' => [
×
68
                    'type' => 'input',
×
69
                ],
×
70
            ],
×
71
            'tx_yoastseo_focuskeyword_analysis' => [
×
72
                'label' => self::LL_PREFIX_BACKEND . 'analysis',
×
73
                'exclude' => true,
×
74
                'displayCond' => 'FIELD:tx_yoastseo_hide_snippet_preview:REQ:false',
×
75
                'config' => [
×
76
                    'type' => 'none',
×
77
                    'renderType' => 'focusKeywordAnalysis',
×
78
                    'settings' => [
×
79
                        'focusKeywordField' => 'tx_yoastseo_focuskeyword',
×
80
                    ],
×
81
                ],
×
82
            ],
×
83
            'tx_yoastseo_cornerstone' => [
×
84
                'label' => '',
×
85
                'exclude' => true,
×
86
                'config' => [
×
87
                    'type' => 'input',
×
88
                    'default' => 0,
×
89
                    'renderType' => 'cornerstone',
×
90
                ],
×
91
            ],
×
92
            'tx_yoastseo_score_readability' => [
×
93
                'label' => '',
×
94
                'exclude' => false,
×
95
                'config' => [
×
96
                    'type' => 'passthrough',
×
97
                ],
×
98
            ],
×
99
            'tx_yoastseo_score_seo' => [
×
100
                'label' => '',
×
101
                'exclude' => false,
×
102
                'config' => [
×
103
                    'type' => 'passthrough',
×
104
                ],
×
105
            ],
×
106
            'tx_yoastseo_focuskeyword_related' => [
×
107
                'label' => self::LL_PREFIX_TCA . 'pages.fields.tx_yoastseo_focuskeyword_related',
×
108
                'exclude' => true,
×
109
                'config' => [
×
110
                    'type' => 'inline',
×
111
                    'foreign_table' => 'tx_yoastseo_related_focuskeyword',
×
112
                    'foreign_field' => 'uid_foreign',
×
113
                    'foreign_table_field' => 'tablenames',
×
114
                    'maxitems' => 5,
×
115
                ],
×
116
            ],
×
117
            'tx_yoastseo_insights' => [
×
118
                'exclude' => true,
×
119
                'config' => [
×
120
                    'type' => 'none',
×
121
                    'renderType' => 'insights',
×
122
                ],
×
123
            ],
×
124
            'tx_yoastseo_focuskeyword_synonyms' => [
×
125
                'label' => self::LL_PREFIX_TCA . 'synonyms',
×
126
                'exclude' => true,
×
127
                'displayCond' => 'FIELD:tx_yoastseo_hide_snippet_preview:REQ:false',
×
128
                'config' => [
×
129
                    'type' => 'input',
×
130
                ],
×
131
            ],
×
132
            'tx_yoastseo_robots_noimageindex' => [
×
133
                'label' => self::LL_PREFIX_TCA . 'pages.fields.robots.noimageindex',
×
134
                'exclude' => true,
×
135
                'config' => [
×
136
                    'type' => 'check',
×
137
                    'renderType' => 'checkboxToggle',
×
138
                    'items' => $this->getInvertedCheckbox(),
×
139
                ],
×
140
            ],
×
141
            'tx_yoastseo_robots_noarchive' => [
×
142
                'label' => self::LL_PREFIX_TCA . 'pages.fields.robots.noarchive',
×
143
                'exclude' => true,
×
144
                'config' => [
×
145
                    'type' => 'check',
×
146
                    'renderType' => 'checkboxToggle',
×
147
                    'items' => $this->getInvertedCheckbox(),
×
148
                ],
×
149
            ],
×
150
            'tx_yoastseo_robots_nosnippet' => [
×
151
                'label' => self::LL_PREFIX_TCA . 'pages.fields.robots.nosnippet',
×
152
                'exclude' => true,
×
153
                'config' => [
×
154
                    'type' => 'check',
×
155
                    'renderType' => 'checkboxToggle',
×
156
                    'items' => $this->getInvertedCheckbox(),
×
157
                ],
×
158
            ],
×
159
        ];
×
160
        if ($this->table === 'pages') {
×
161
            $columns['tx_yoastseo_hide_snippet_preview'] = [
×
162
                'label' => self::LL_PREFIX_BACKEND . 'hideSnippetPreview',
×
163
                'exclude' => true,
×
164
                'config' => [
×
165
                    'type' => 'check',
×
166
                ],
×
167
            ];
×
168
        }
169
        ExtensionManagementUtility::addTCAcolumns(
×
170
            $this->table,
×
171
            $columns
×
172
        );
×
173
    }
174

175
    protected function addSocialPreviewFields(): void
176
    {
NEW
177
        ExtensionManagementUtility::addTCAcolumns(
×
NEW
178
            $this->table,
×
NEW
179
            [
×
NEW
180
                'tx_yoastseo_facebook_preview' => [
×
NEW
181
                    'label' => self::LL_PREFIX_TCA . 'pages.fields.tx_yoastseo_facebook_preview',
×
NEW
182
                    'exclude' => true,
×
NEW
183
                    'config' => [
×
NEW
184
                        'type' => 'none',
×
NEW
185
                        'renderType' => 'facebookPreview',
×
NEW
186
                    ],
×
NEW
187
                ],
×
NEW
188
                'tx_yoastseo_twitter_preview' => [
×
NEW
189
                    'label' => self::LL_PREFIX_TCA . 'pages.fields.tx_yoastseo_twitter_preview',
×
NEW
190
                    'exclude' => true,
×
NEW
191
                    'config' => [
×
NEW
192
                        'type' => 'none',
×
NEW
193
                        'renderType' => 'twitterPreview',
×
NEW
194
                    ],
×
NEW
195
                ],
×
NEW
196
            ]
×
NEW
197
        );
×
198

NEW
199
        ExtensionManagementUtility::addFieldsToPalette(
×
NEW
200
            'pages',
×
NEW
201
            'opengraph',
×
NEW
202
            'tx_yoastseo_facebook_preview,--linebreak--',
×
NEW
203
            'before:og_title'
×
NEW
204
        );
×
205

NEW
206
        ExtensionManagementUtility::addFieldsToPalette(
×
NEW
207
            'pages',
×
NEW
208
            'twittercards',
×
NEW
209
            'tx_yoastseo_twitter_preview,--linebreak--',
×
NEW
210
            'before:twitter_title'
×
NEW
211
        );
×
212
    }
213

214
    protected function addPalettes(): void
215
    {
216
        ExtensionManagementUtility::addFieldsToPalette(
×
217
            $this->table,
×
218
            'seo',
×
219
            '--linebreak--, tx_yoastseo_snippetpreview, --linebreak--',
×
220
            'before: seo_title'
×
221
        );
×
222

223
        ExtensionManagementUtility::addFieldsToPalette(
×
224
            $this->table,
×
225
            'seo',
×
226
            '--linebreak--, ' . $this->descriptionField . ', --linebreak--, tx_yoastseo_cornerstone',
×
227
            'after: seo_title'
×
228
        );
×
229

230
        ExtensionManagementUtility::addFieldsToPalette(
×
231
            $this->table,
×
232
            'yoast-readability',
×
233
            '--linebreak--, tx_yoastseo_readability_analysis'
×
234
        );
×
235

236
        ExtensionManagementUtility::addFieldsToPalette(
×
237
            $this->table,
×
238
            'yoast-focuskeyword',
×
239
            '--linebreak--, tx_yoastseo_focuskeyword,
×
240
            --linebreak--, tx_yoastseo_focuskeyword_synonyms,
241
            --linebreak--, tx_yoastseo_focuskeyword_analysis'
×
242
        );
×
243

244
        ExtensionManagementUtility::addFieldsToPalette(
×
245
            $this->table,
×
246
            'yoast-relatedkeywords',
×
247
            '--linebreak--, tx_yoastseo_focuskeyword_related '
×
248
        );
×
249

250
        ExtensionManagementUtility::addFieldsToPalette(
×
251
            $this->table,
×
252
            'yoast-insights',
×
253
            '--linebreak--, tx_yoastseo_insights'
×
254
        );
×
255

256
        ExtensionManagementUtility::addFieldsToPalette(
×
257
            $this->table,
×
258
            'yoast-advanced-robots',
×
259
            '--linebreak--, tx_yoastseo_robots_noimageindex,tx_yoastseo_robots_noarchive,tx_yoastseo_robots_nosnippet'
×
260
        );
×
261

262
        ExtensionManagementUtility::addFieldsToPalette(
×
263
            $this->table,
×
264
            'yoast-advanced',
×
265
            '--linebreak--, tx_yoastseo_hide_snippet_preview'
×
266
        );
×
267
    }
268

269
    protected function addToTypes(): void
270
    {
271
        ExtensionManagementUtility::addToAllTCAtypes(
×
272
            $this->table,
×
273
            '--palette--;Label;yoast-snippetpreview,',
×
274
            $this->types,
×
275
            'before:seo_title'
×
276
        );
×
277

278
        ExtensionManagementUtility::addToAllTCAtypes(
×
279
            $this->table,
×
280
            '--palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.readability;yoast-readability,
×
281
            --palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.focusKeyphrase;yoast-focuskeyword,
×
282
            --palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.focusRelatedKeyphrases;yoast-relatedkeywords,
×
283
            --palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.insights;yoast-insights,',
×
284
            $this->types,
×
285
            'after: tx_yoastseo_cornerstone'
×
286
        );
×
287

288
        ExtensionManagementUtility::addToAllTCAtypes(
×
289
            $this->table,
×
290
            '--palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.robots;yoast-advanced-robots,',
×
291
            $this->types,
×
292
            'after:no_follow'
×
293
        );
×
294

295
        ExtensionManagementUtility::addToAllTCAtypes(
×
296
            $this->table,
×
297
            '--palette--;' . self::LL_PREFIX_TCA . 'pages.palettes.advances;yoast-advanced,',
×
298
            $this->types,
×
299
            'after: sitemap_priority'
×
300
        );
×
301
    }
302

303
    /**
304
     * @return array<array<int|string, string|bool>>
305
     */
306
    protected function getInvertedCheckbox(): array
307
    {
308
        return [
×
309
            [
×
310
                1 => '',
×
311
                'invertStateDisplay' => true,
×
NEW
312
                'label' => '',
×
313
            ],
×
314
        ];
×
315
    }
316
}
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