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-tooltip-meta.php

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

279 lines 8.6 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( 'WpssoMessagesTooltipMeta' ) ) {
19
20 /*
21 * Instantiated by WpssoMessagesTooltip->get() only when needed.
22 */
23 class WpssoMessagesTooltipMeta extends WpssoMessages {
24
25 private $msgs = array(); // WpssoMessagesTooltipMeta* class objects.
26
27 public function get( $msg_key = false, $info = array() ) {
28
29 $this->maybe_set_properties();
30
31 $text = '';
32
33 foreach ( array(
34 'tooltip-meta-contact_' => 'contact',
35 'tooltip-meta-og_' => 'opengraph',
36 'tooltip-meta-org_' => 'org',
37 'tooltip-meta-place_' => 'place',
38 'tooltip-meta-product_' => 'product',
39 'tooltip-meta-schema_' => 'schema',
40 ) as $msg_key_prefix => $class_suffix ) {
41
42 if ( 0 === strpos( $msg_key, $msg_key_prefix ) ) {
43
44 if ( ! isset( $this->msgs[ $msg_key_prefix ] ) ) {
45
46 $filename = WPSSO_PLUGINDIR . 'lib/messages-tooltip-meta-' . $class_suffix . '.php';
47 $classname = 'WpssoMessagesTooltipMeta' . $class_suffix;
48
49 require_once $filename;
50
51 $this->msgs[ $msg_key_prefix ] = new $classname( $this->p );
52 }
53
54 return $this->msgs[ $msg_key_prefix ]->get( $msg_key, $info );
55 }
56 }
57
58 if ( 0 === strpos( $msg_key, 'tooltip-meta-pin_' ) ) {
59
60 switch ( $msg_key ) {
61
62 case 'tooltip-meta-pin_img_desc': // Pinterest Description.
63
64 $text = __( 'A customized description for the Pinterest Pin It browser button.', 'wpsso' ) . ' ';
65
66 $text .= __( 'The default value is inherited from the social or SEO description.', 'wpsso' ) . ' ';
67
68 break;
69
70 case 'tooltip-meta-pin_img_id': // Image ID.
71
72 $text = __( 'A customized image ID for the Pinterest Pin It browser button.', 'wpsso' ) . ' ';
73
74 $text .= __( 'The default value is inherited from the Schema markup or priority image.', 'wpsso' ) . ' ';
75
76 $text .= '<em>' . __( 'This option is disabled if a custom image URL is entered.', 'wpsso' ) . '</em>';
77
78 break;
79
80 case 'tooltip-meta-pin_img_url': // or an Image URL.
81
82 $text = __( 'A customized image URL (instead of an image ID) for the Pinterest Pin It browser button.', 'wpsso' ) . ' ';
83
84 $text .= __( 'The default value is inherited from the Schema markup or priority image.', 'wpsso' ) . ' ';
85
86 $text .= '<em>' . __( 'This option is disabled if a custom image ID is selected.', 'wpsso' ) . '</em>';
87
88 break;
89
90 default:
91
92 $text = apply_filters( 'wpsso_messages_tooltip_meta_pin', $text, $msg_key, $info );
93
94 break;
95
96 } // End of 'tooltip-meta-pin' switch.
97
98 } elseif ( 0 === strpos( $msg_key, 'tooltip-meta-robots_' ) ) {
99
100 switch ( $msg_key ) {
101
102 /*
103 * See https://developers.google.com/search/reference/robots_meta_tag#noarchive.
104 */
105 case 'tooltip-meta-robots_noarchive':
106
107 $text = __( 'Do not show a cached link in search results.', 'wpsso' );
108
109 break;
110
111 /*
112 * See https://developers.google.com/search/reference/robots_meta_tag#nofollow.
113 */
114 case 'tooltip-meta-robots_nofollow':
115
116 $text = __( 'Do not follow links on this webpage.', 'wpsso' );
117
118 break;
119
120 /*
121 * See https://developers.google.com/search/reference/robots_meta_tag#noimageindex.
122 */
123 case 'tooltip-meta-robots_noimageindex':
124
125 $text = __( 'Do not index images on this webpage.', 'wpsso' );
126
127 break;
128
129 /*
130 * See https://developers.google.com/search/reference/robots_meta_tag#noindex.
131 */
132 case 'tooltip-meta-robots_noindex':
133
134 $text = __( 'Do not show this webpage in search results.', 'wpsso' );
135
136 break;
137
138 /*
139 * See https://developers.google.com/search/reference/robots_meta_tag#nosnippet.
140 */
141 case 'tooltip-meta-robots_nosnippet':
142
143 $text = __( 'Do not show a text snippet or a video preview in search results.', 'wpsso' ) . ' ';
144
145 $text .= __( 'Google may still show a static image thumbnail (if available) when it determines that using an image provides a better user-experience.', 'wpsso' );
146
147 break;
148
149 /*
150 * See https://developers.google.com/search/reference/robots_meta_tag#notranslate.
151 */
152 case 'tooltip-meta-robots_notranslate':
153
154 $text = __( 'Do not offer translation of this webpage in search results.', 'wpsso' );
155
156 break;
157
158 default:
159
160 $text = apply_filters( 'wpsso_messages_tooltip_meta_robots', $text, $msg_key, $info );
161
162 break;
163
164 } // End of 'tooltip-meta-robots' switch.
165
166 } elseif ( 0 === strpos( $msg_key, 'tooltip-meta-tc_' ) ) {
167
168 switch ( $msg_key ) {
169
170 case 'tooltip-meta-tc_title': // X (Twitter) Card Title.
171
172 $text = __( 'A customized title for the X (Twitter) Card title meta tag.', 'wpsso' ) . ' ';
173
174 $text .= __( 'The default value is inherited from the social or SEO title.', 'wpsso' ) . ' ';
175
176 $text .= sprintf( __( 'You may use the <code>%1$s</code> and/or <code>%2$s</code> filters to modify the default and custom values respectively.', 'wpsso' ), 'wpsso_the_title', 'wpsso_title' ) . ' ';
177
178 break;
179
180 case 'tooltip-meta-tc_desc': // X (Twitter) Card Description.
181
182 $text = __( 'A customized description for the X (Twitter) Card description meta tag.', 'wpsso' ) . ' ';
183
184 $text .= __( 'The default value is inherited from the social or SEO description.', 'wpsso' ) . ' ';
185
186 $text .= sprintf( __( 'You may use the <code>%1$s</code> and/or <code>%2$s</code> filters to modify the default and custom values respectively.', 'wpsso' ), 'wpsso_the_description', 'wpsso_description' ) . ' ';
187
188 break;
189
190 /*
191 * Document SSO > Edit Media tab.
192 */
193 case 'tooltip-meta-tc_lrg_img_id': // Image ID.
194 case 'tooltip-meta-tc_sum_img_id': // Image ID.
195
196 $text = __( 'A customized image ID for the X (Twitter) Card image.', 'wpsso' ) . ' ';
197
198 $text .= __( 'The default value is inherited from the priority image.', 'wpsso' ) . ' ';
199
200 $text .= '<em>' . __( 'This option is disabled if a custom image URL is entered.', 'wpsso' ) . '</em>';
201
202 break;
203
204 case 'tooltip-meta-tc_lrg_img_url': // or an Image URL.
205 case 'tooltip-meta-tc_sum_img_url': // or an Image URL.
206
207 $text = __( 'A customized image URL (instead of an image ID) for the X (Twitter) Card image.', 'wpsso' ) . ' ';
208
209 $text .= __( 'The default value is inherited from the priority image.', 'wpsso' ) . ' ';
210
211 $text .= '<em>' . __( 'This option is disabled if a custom image ID is selected.', 'wpsso' ) . '</em>';
212
213 break;
214
215 default:
216
217 $text = apply_filters( 'wpsso_messages_tooltip_meta_tc', $text, $msg_key, $info );
218
219 break;
220
221 } // End of 'tooltip-meta-tc' switch.
222
223 } else {
224
225 switch ( $msg_key ) {
226
227 case 'tooltip-meta-primary_term_id': // Primary Category.
228
229 $text .= __( 'The primary (ie. top most) category for breadcrumbs markup.' );
230
231 break;
232
233 case 'tooltip-meta-seo_title': // SEO Title Tag.
234
235 $text = __( 'A customized description for the SEO title tag and the default for all other title values.', 'wpsso' ) . ' ';
236
237 $text .= sprintf( __( 'You may use the <code>%1$s</code> and/or <code>%2$s</code> filters to modify the default and custom values respectively.', 'wpsso' ), 'wpsso_the_title', 'wpsso_title' ) . ' ';
238
239 break;
240
241 case 'tooltip-meta-seo_desc': // SEO Meta Description.
242
243 $text = __( 'A customized description for the SEO description meta tag and the default for all other description values.', 'wpsso' ) . ' ';
244 $text .= sprintf( __( 'You may use the <code>%1$s</code> and/or <code>%2$s</code> filters to modify the default and custom values respectively.', 'wpsso' ), 'wpsso_the_description', 'wpsso_description' ) . ' ';
245
246 $text .= $this->maybe_add_seo_tag_disabled_link( 'meta name description' );
247
248 break;
249
250 case 'tooltip-meta-canonical_url': // Canonical URL.
251
252 $text = __( 'A customized URL for meta tags and Schema markup.', 'wpsso' ) . ' ';
253
254 $text .= __( 'Make sure the custom URL you enter here is functional and redirects correctly.', 'wpsso' );
255
256 break;
257
258 case 'tooltip-meta-redirect_url': // 301 Redirect URL.
259
260 $text = __( 'Permanently redirect this URL to another.', 'wpsso' ) . ' ';
261
262 $text .= __( 'Make sure the custom URL you enter here is functional and redirects correctly.', 'wpsso' );
263
264 break;
265
266 default:
267
268 $text = apply_filters( 'wpsso_messages_tooltip_meta', $text, $msg_key, $info );
269
270 break;
271
272 } // End of 'tooltip-meta' switch.
273 }
274
275 return $text;
276 }
277 }
278 }
279