PluginProbe
WPSSO Core – Complete Schema Markup and Meta Tags / 22.7.0
WPSSO Core – Complete Schema Markup and Meta Tags v22.7.0
22.7.0 22.6.1 22.6.0 22.5.3 22.5.2 22.5.1 22.4.0 22.3.0 22.2.1 22.2.0 22.1.3 22.1.2 22.1.1 22.1.0 22.0.0 21.13.3 21.13.2 trunk 21.13.1
wpsso / lib / messages-info-meta.php

messages-info-meta.php in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at lib/messages-info-meta.php

385 lines 11.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * License: GPLv3
4 * License URI: https://www.gnu.org/licenses/gpl.txt
5 * Copyright 2012-2026 Jean-Sebastien Morisset (https://wpsso.com/)
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9
10 die( 'These aren\'t the droids you\'re looking for.' );
11 }
12
13 if ( ! defined( 'WPSSO_PLUGINDIR' ) ) {
14
15 die( 'Do. Or do not. There is no try.' );
16 }
17
18 if ( ! class_exists( 'WpssoMessagesInfoMeta' ) ) {
19
20 /*
21 * Instantiated by WpssoMessagesInfo->get() only when needed.
22 */
23 class WpssoMessagesInfoMeta extends WpssoMessages {
24
25 public function get( $msg_key = false, $info = array() ) {
26
27 $this->maybe_set_properties();
28
29 $text = '';
30
31 if ( 0 === strpos( $msg_key, 'info-meta-schema-' ) ) {
32
33 switch ( $msg_key ) {
34
35 /*
36 * Document SSO > Edit Schema tab.
37 */
38 case 'info-meta-schema-item-list':
39
40 $text = '<blockquote class="top-info">';
41
42 $text .= '<p>';
43
44 $text .= __( 'Schema ItemList elements are added dynamically based on the WordPress archive page query (ie. taxonomy term, sort order, date based, search query, etc.).', 'wpsso' ) . ' ';
45
46 $text .= __( 'The Schema ItemList type can also be selected for a parent page with child pages.', 'wpsso' ) . ' ';
47
48 $text .= __( 'Schema ItemList markup without elements (ie. an archive page without posts or a parent page without children) is considered invalid by Google.', 'wpsso' ) . ' ';
49
50 $text .= '</p>';
51
52 $text .= '</blockquote>';
53
54 break;
55
56 case 'info-meta-schema-question':
57
58 $text = '<blockquote class="top-info">';
59
60 $text .= '<p>';
61
62 $text .= __( 'The Schema Question document name / title is a summary of the question, the description is a summary of the answer, and the full text is the complete answer.', 'wpsso' ) . ' ';
63
64 /*
65 * Avoid showing possible duplicate and confusing information.
66 */
67 if ( empty( $this->p->avail[ 'p_ext' ][ 'faq' ] ) ) {
68
69 $faq_info = $this->p->cf[ 'plugin' ][ 'wpssofaq' ];
70 $faq_info_name = _x( $faq_info[ 'name' ], 'plugin name', 'wpsso' );
71
72 $text .= __( 'The Schema Question type can be a child page of a Schema FAQPage parent, or assigned to a Schema FAQPage taxonomy term.', 'wpsso' ) . ' ';
73 $text .= sprintf( __( 'Note that using the %1$s add-on is often the easiest and preferred way to manage FAQ groups and Question pages.', 'wpsso' ), $faq_info_name ) . ' ';
74 }
75
76 $text .= '</p>';
77
78 $text .= '</blockquote>';
79
80 break;
81
82 case 'info-meta-schema-webpage-faq':
83
84 /*
85 * Avoid showing possible duplicate and confusing information.
86 */
87 if ( empty( $this->p->avail[ 'p_ext' ][ 'faq' ] ) ) {
88
89 $faq_info = $this->p->cf[ 'plugin' ][ 'wpssofaq' ];
90 $faq_info_name = _x( $faq_info[ 'name' ], 'plugin name', 'wpsso' );
91
92 $text = '<blockquote class="top-info">';
93
94 $text .= '<p>';
95
96 $text .= __( 'Schema FAQPage markup is a collection of Questions and Answers.', 'wpsso' ) . ' ';
97
98 $text .= __( 'WordPress manages related singular content, like Questions and Answers, in two different ways:', 'wpsso' ) . ' ';
99
100 $text .= __( 'A Schema FAQPage can be a parent page with Schema Question child pages, or a taxonomy term (ie. categories, tags or custom taxonomies) with Schema Question pages assigned to that term.', 'wpsso' ) . ' ';
101
102 $text .= sprintf( __( 'Note that using the %1$s add-on is the easiest and preferred way to manage FAQ pages and its associated question pages.', 'wpsso' ), $faq_info_name ) . ' ';
103
104 $text .= '</p>';
105
106 $text .= '</blockquote>';
107 }
108
109 break;
110
111 case 'info-meta-schema-webpage-qa':
112
113 $text = '<blockquote class="top-info">';
114
115 $text .= '<p>';
116
117 $text .= __( 'Google requires that Schema QAPage markup include one or more user submitted and upvoted answers.', 'wpsso' ) . ' ';
118
119 $text .= __( 'The Schema QAPage document name / title is a summary of the question, and the full text is the complete question.', 'wpsso' ) . ' ';
120
121 $text .= '</p>';
122
123 $text .= '</blockquote>';
124
125 break;
126
127 } // End of 'info-meta-schema' switch.
128
129 } elseif ( 0 === strpos( $msg_key, 'info-meta-validate-' ) ) {
130
131 switch ( $msg_key ) {
132
133 /*
134 * Document SSO > Validators tab.
135 */
136 case 'info-meta-validate-facebook-debugger':
137
138 $text = '<p class="top">';
139
140 $text .= __( 'All social sites (except for LinkedIn) read Open Graph meta tags.', 'wpsso' ) . ' ';
141
142 $text .= __( 'The Facebook debugger allows you to validate Open Graph meta tags and refresh Facebook\'s cache.', 'wpsso' ) . ' ';
143
144 $text .= __( 'The Facebook debugger is the most reliable validation tool for Open Graph meta tags.', 'wpsso' );
145
146 $text .= '</p>';
147
148 break;
149
150 case 'info-meta-validate-facebook-microdata':
151
152 $text = '<p class="top">';
153
154 $text .= __( 'The Facebook catalog microdata debug tool allows you to validate the structured data used to indicate key information about the items on your website, such as their name, description and prices.', 'wpsso' );
155
156 $text .= '</p>';
157
158 break;
159
160 case 'info-meta-validate-google-amp':
161
162 $text = '<p class="top">';
163
164 $text .= __( 'Validate the HTML syntax and conformance of the AMP (aka Accelerated Mobile Pages) webpage.', 'wpsso' ) . ' ';
165
166 if ( ! function_exists( 'amp_get_permalink' ) ) {
167
168 $text .= __( 'Note that an AMP plugin is required to create AMP webpages for WordPress.', 'wpsso' );
169 }
170
171 $text .= '</p>';
172
173 break;
174
175 case 'info-meta-validate-google-page-speed':
176
177 $text = '<p class="top">';
178
179 $text .= __( 'Analyzes the webpage content and suggests ways to make the webpage faster for better ranking in search results.', 'wpsso' );
180
181 $text .= '</p>';
182
183 break;
184
185 case 'info-meta-validate-google-rich-results':
186
187 $text = '<p class="top">';
188
189 $text .= sprintf( __( 'Check the webpage structured data markup for <a href="%s">Google Rich Result types</a> (Job posting, Product, Recipe, etc.).', 'wpsso' ), __( 'https://developers.google.com/search/docs/appearance/structured-data/search-gallery', 'wpsso' ) ) . ' ';
190
191 $text .= __( 'To test and validate Schema markup beyond the limited subset of Google Rich Result types, use the Schema Markup Validator.', 'wpsso' );
192
193 $text .= '</p>';
194
195 break;
196
197 case 'info-meta-validate-linkedin':
198
199 $text = '<p class="top">';
200
201 $text .= __( 'Refresh LinkedIn\'s cache and validate the webpage oEmbed data.', 'wpsso' ) . ' ';
202
203 $text .= '</p>';
204
205 break;
206
207 case 'info-meta-validate-pinterest':
208
209 $text = '<p class="top">';
210
211 $text .= __( 'Validate Rich Pin markup and submit a request to show Rich Pin markup in zoomed pins.', 'wpsso' );
212
213 $text .= '</p>';
214
215 break;
216
217 case 'info-meta-validate-schema-markup-validator':
218
219 $text = '<p class="top">';
220
221 $text .= __( 'Validate the webpage Schema JSON-LD, Microdata and RDFa structured data markup.', 'wpsso' ) . ' ';
222
223 $text .= sprintf( __( 'This tool provides additional validation for Schema types beyond the limited subset of <a href="%s">Google Rich Result types</a>.', 'wpsso' ), __( 'https://developers.google.com/search/docs/appearance/structured-data/search-gallery', 'wpsso' ) );
224
225 $text .= '</p>';
226
227 break;
228
229 case 'info-meta-validate-twitter':
230
231 $text = '<p class="top">';
232
233 $text .= __( 'The X (Twitter) Card validator does not (currently) accept query arguments - paste the following URL in the X (Twitter) Card validator "Card URL" input field:', 'wpsso' );
234
235 $text .= '</p>';
236
237 break;
238
239 case 'info-meta-validate-w3c':
240
241 $text = '<p class="top">';
242
243 $text .= __( 'Validate the HTML syntax and HTML 5 conformance of your meta tags and theme templates.', 'wpsso' ) . ' ';
244
245 $text .= __( 'Validating your theme templates is important - theme templates with serious errors can prevent social and search crawlers from understanding the webpage structure.', 'wpsso' ) . ' ';
246
247 $text .= '</p>';
248
249 break;
250
251 case 'info-meta-validate-footer':
252
253 if ( ! function_exists( 'amp_get_permalink' ) ) {
254
255 $text .= '<p class="status-msg left">* ';
256
257 $text .= __( 'Activate an AMP plugin to create and validate AMP pages.', 'wpsso' );
258
259 $text .= '</p>';
260 }
261
262 if ( empty( $this->p->avail[ 'p' ][ 'schema' ] ) ) {
263
264 $text .= '<p class="status-msg left">** ';
265
266 $text .= __( 'Schema markup is disabled.', 'wpsso' );
267
268 $text .= '</p>';
269 }
270
271 break;
272
273 } // End of 'info-meta-schema' switch.
274
275 } else {
276
277 switch ( $msg_key ) {
278
279 /*
280 * Document SSO > Edit Media tab.
281 */
282 case 'info-meta-priority-media':
283
284 $upload_page_url = get_admin_url( $blog_id = null, 'upload.php' );
285
286 $text = '<blockquote class="top-info">';
287
288 $text .= '<p>';
289
290 $text .= sprintf( __( 'You can edit images in the <a href="%s">WordPress Media Library</a> to select a preferred image cropping area (ie. top or bottom) and optimize the image SEO information.', 'wpsso' ), $upload_page_url ) . ' ';
291
292 $text .= '</p><p>';
293
294 $text .= __( 'Note that the Schema CreativeWork type (and its sub-types) has a \'video\' property for VideoObject markup, but other Schema types (like Event, Job Posting, Place, Product, and Brand) do not have a \'video\' property.', 'wpsso' ). ' ';
295
296 $text .= __( 'In these cases - assuming the video(s) are about the content subject - they will be added to a \'subjectOf\' property instead.', 'wpsso' ). ' ';
297
298 $text .= '</p>' . "\n";
299
300 $text .= '</blockquote>';
301
302 break;
303
304 /*
305 * Document SSO > Edit Visibility tab.
306 */
307 case 'info-meta-robots-meta':
308
309 $text = '<blockquote class="top-info">';
310
311 $text .= '<p>';
312
313 $text .= __( 'The robots meta tag lets you utilize a granular, webpage-specific approach to controlling how an individual webpage should be indexed and served to users in Google Search results.', 'wpsso' ) . ' ';
314
315 $text .= '</p>';
316
317 $text .= '</blockquote>';
318
319 break;
320
321 /*
322 * Document SSO > Preview Social tab.
323 */
324 case 'info-meta-social-preview':
325
326 $upload_page_url = get_admin_url( $blog_id = null, 'upload.php' );
327
328 $fb_img_dims = '600x314px';
329
330 $text = '<p class="status-msg">';
331
332 $text .= sprintf( __( 'The example image container uses the minimum recommended Facebook image dimensions of %s.', 'wpsso' ), $fb_img_dims ) . ' ';
333
334 $text .= '<br/>' . "\n";
335
336 $text .= sprintf( __( 'You can edit images in the <a href="%s">WordPress Media Library</a> to select a preferred image cropping area (ie. top or bottom) and optimize the image SEO information.', 'wpsso' ), $upload_page_url );
337
338 $text .= '</p>' . "\n";
339
340 break;
341
342 /*
343 * Document SSO > Preview oEmbed tab.
344 */
345 case 'info-meta-oembed-footer':
346
347 $text = '<p class="status-msg">';
348
349 $text .= sprintf( __( 'oEmbed HTML provided by the <code>%s</code> template.', 'wpsso' ),
350 'wpsso/embed-content' ) . '<br/>';
351
352 $text .= sprintf( __( 'You may use the <code>%s</code> filter to modify the oEmbed template file path.', 'wpsso' ),
353 'wpsso_embed_content_template_path' ) . '<br/>';
354
355 $text .= '</p>';
356
357 break;
358
359 /*
360 * SSO Orgs > Edit Organization page.
361 */
362 case 'info-meta-org-schema-type':
363
364 $text = '<p class="status-msg">';
365
366 $text .= $this->p->msgs->get( 'tooltip-meta-org_schema_type', array( 'no-tooltip' => true ) );
367
368 $text .= '</p>';
369
370 break;
371
372 default:
373
374 $text = apply_filters( 'wpsso_messages_info_meta', $text, $msg_key, $info );
375
376 break;
377
378 } // End of 'info-meta' switch.
379 }
380
381 return $text;
382 }
383 }
384 }
385