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 / conflict-seo.php

conflict-seo.php in WPSSO Core – Complete Schema Markup and Meta Tags 22.7.0, at lib/conflict-seo.php

729 lines 27.2 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( 'WpssoConflictSeo' ) ) {
19
20 class WpssoConflictSeo {
21
22 private $p; // Wpsso class object.
23
24 private $log_pre = '';
25 private $notice_pre = '';
26
27 /*
28 * Instantiated by WpssoConflict->conflict_checks().
29 */
30 public function __construct( &$plugin ) {
31
32 $this->p =& $plugin;
33
34 if ( $this->p->debug->enabled ) {
35
36 $this->p->debug->mark();
37 }
38 }
39
40 public function conflict_checks() {
41
42 if ( empty( $this->p->avail[ 'seo' ][ 'any' ] ) ) {
43
44 return;
45 }
46
47 $this->log_pre = 'seo plugin conflict detected - ';
48 $this->notice_pre = __( 'Plugin conflict detected:', 'wpsso' ) . ' ';
49
50 $this->conflict_check_aioseop(); // All in One SEO Pack.
51 $this->conflict_check_rankmath(); // Rank Math.
52 $this->conflict_check_seoframework(); // The SEO Framework.
53 $this->conflict_check_seopress(); // SEOPress.
54 $this->conflict_check_seoultimate(); // SEO Ultimate.
55 $this->conflict_check_squirrlyseo(); // Squirrly SEO.
56 $this->conflict_check_wpmetaseo(); // WP Meta SEO.
57 $this->conflict_check_wpseo(); // Yoast SEO.
58 $this->conflict_check_wpseo_wc(); // Yoast WooCommerce SEO.
59 }
60
61 /*
62 * All in One SEO Pack.
63 */
64 private function conflict_check_aioseop() {
65
66 if ( empty( $this->p->avail[ 'seo' ][ 'aioseop' ] ) ) {
67
68 return;
69 }
70
71 $plugin_name = __( 'All in One SEO', 'wpsso' );
72
73 /*
74 * Check for minimum supported version.
75 */
76 $min_version = '4.0.16';
77
78 if ( ! defined( 'AIOSEO_VERSION' ) || version_compare( AIOSEO_VERSION, $min_version, '<' ) ) {
79
80 $notice_msg = __( 'The %1$s plugin is too old - please update the %1$s plugin to version %2$s or newer.', 'wpsso' );
81 $notice_msg = sprintf( $notice_msg, $plugin_name, $min_version );
82 $notice_key = 'aioseo-version-' . AIOSEO_VERSION . '-too-old';
83
84 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
85
86 return;
87 }
88
89 /*
90 * Check for Open Graph.
91 */
92 if ( aioseo()->options->social->facebook->general->enable ) {
93
94 // translators: Please ignore - translation uses a different text domain.
95 $label_transl = '<strong>' . __( 'Enable Open Graph Markup', 'all-in-one-seo-pack' ) . '</strong>';
96 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=aioseo-social-networks#/facebook' );
97 $settings_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
98 // translators: Please ignore - translation uses a different text domain.
99 __( 'Social Networks', 'all-in-one-seo-pack' ) . ' &gt; ' .
100 // translators: Please ignore - translation uses a different text domain.
101 __( 'Facebook', 'all-in-one-seo-pack' ) . '</a>';
102
103 if ( $this->p->debug->enabled ) {
104
105 $this->p->debug->log( $this->log_pre . 'aioseop open graph markup is enabled' );
106 }
107
108 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
109 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
110 $notice_key = 'aioseo-open-graph-markup-enabled';
111
112 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
113 }
114
115 /*
116 * Check for X (Twitter).
117 */
118 if ( aioseo()->options->social->twitter->general->enable ) {
119
120 // translators: Please ignore - translation uses a different text domain.
121 $label_transl = '<strong>' . __( 'Enable Twitter Card', 'all-in-one-seo-pack' ) . '</strong>';
122 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=aioseo-social-networks#/twitter' );
123 $settings_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
124 // translators: Please ignore - translation uses a different text domain.
125 __( 'Social Networks', 'all-in-one-seo-pack' ) . ' &gt; ' .
126 // translators: Please ignore - translation uses a different text domain.
127 __( 'Twitter', 'all-in-one-seo-pack' ) . '</a>';
128
129 if ( $this->p->debug->enabled ) {
130
131 $this->p->debug->log( $this->log_pre . 'aioseop twitter card is enabled' );
132 }
133
134 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
135 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
136 $notice_key = 'aioseo-twitter-card-enabled';
137
138 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
139 }
140 }
141
142 /*
143 * Rank Math.
144 */
145 private function conflict_check_rankmath() {
146
147 if ( empty( $this->p->avail[ 'seo' ][ 'rankmath' ] ) ) {
148
149 return;
150 }
151
152 // translators: Please ignore - translation uses a different text domain.
153 $plugin_name = __( 'Rank Math', 'rank-math' );
154
155 /*
156 * Check for Schema (Structured Data) module.
157 */
158 if ( ( new class { use \RankMath\Helpers\Conditional; } )::is_module_active( 'rich-snippet' ) ) {
159
160 // translators: Please ignore - translation uses a different text domain.
161 $label_transl = __( 'Schema (Structured Data)', 'rank-math' );
162
163 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=rank-math' );
164
165 // translators: Please ignore - translation uses a different text domain.
166 $settings_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' . __( 'Dashboard', 'rank-math' ) . '</a>';
167
168 if ( $this->p->debug->enabled ) {
169
170 $this->p->debug->log( $this->log_pre . 'rankmath schema module is enabled' );
171 }
172
173 $notice_msg = __( 'Please disable the %1$s module in the %2$s settings.', 'wpsso' );
174 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
175 $notice_key = 'rankmath-schema-module-enabled';
176
177 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
178 }
179 }
180
181 /*
182 * The SEO Framework.
183 */
184 private function conflict_check_seoframework() {
185
186 if ( empty( $this->p->avail[ 'seo' ][ 'seoframework' ] ) ) {
187
188 return;
189 }
190
191 $plugin_name = __( 'The SEO Framework', 'wpsso' );
192
193 $tsf = the_seo_framework();
194
195 $opts = version_compare( THE_SEO_FRAMEWORK_VERSION, '5.0.0', '>=' ) ?
196 $tsf->get_options() :
197 $tsf->get_all_options();
198
199 /*
200 * Check for Open Graph and X (Twitter) Cards.
201 */
202 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=theseoframework-settings' );
203
204 $social_gen_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
205 // translators: Please ignore - translation uses a different text domain.
206 __( 'Social Meta Settings', 'autodescription' ) . ' &gt; ' .
207 // translators: Please ignore - translation uses a different text domain.
208 __( 'General', 'autodescription' ) . '</a>';
209
210 $social_post_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
211 // translators: Please ignore - translation uses a different text domain.
212 __( 'Social Meta Settings', 'autodescription' ) . ' &gt; ' .
213 // translators: Please ignore - translation uses a different text domain.
214 __( 'Post Dates', 'autodescription' ) . '</a>';
215
216 $schema_presence_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
217 // translators: Please ignore - translation uses a different text domain.
218 __( 'Schema.org Settings', 'autodescription' ) . ' &gt; ' .
219 // translators: Please ignore - translation uses a different text domain.
220 __( 'Presence', 'autodescription' ) . '</a>';
221
222 // translators: Please ignore - translation uses a different text domain.
223 $posts_i18n = __( 'posts', 'autodescription' );
224
225 /*
226 * The SEO Framework options that must be disabled.
227 */
228 foreach ( array(
229 $social_gen_link => array(
230 // translators: Please ignore - translation uses a different text domain.
231 'og_tags' => '<strong>' . __( 'Output Open Graph meta tags?', 'autodescription' ) . '</strong>',
232 // translators: Please ignore - translation uses a different text domain.
233 'facebook_tags' => '<strong>' . __( 'Output Facebook meta tags?', 'autodescription' ) . '</strong>',
234 // translators: Please ignore - translation uses a different text domain.
235 'twitter_tags' => '<strong>' . __( 'Output Twitter meta tags?', 'autodescription' ) . '</strong>',
236 // translators: Please ignore - translation uses a different text domain.
237 'oembed_scripts' => '<strong>' . __( 'Output oEmbed scripts?', 'autodescription' ) . '</strong>',
238 ),
239 $social_post_link => array(
240 // translators: Please ignore - translation uses a different text domain.
241 'post_publish_time' => '<strong>' . sprintf( __( 'Add %1$s to %2$s?', 'autodescription' ),
242 'article:published_time', $posts_i18n ) . '</strong>',
243 // translators: Please ignore - translation uses a different text domain.
244 'post_modify_time' => '<strong>' . sprintf( __( 'Add %1$s to %2$s?', 'autodescription' ),
245 'article:modified_time', $posts_i18n ) . '</strong>',
246 ),
247 $schema_presence_link => array(
248 // translators: Please ignore - translation uses a different text domain.
249 'knowledge_output' => '<strong>' . __( 'Output Authorized Presence?', 'autodescription' ) . '</strong>',
250 ),
251 ) as $settings_link => $keys ) {
252
253 foreach ( $keys as $opt_key => $label_transl ) {
254
255 if ( ! empty( $opts[ $opt_key ] ) ) {
256
257 if ( $this->p->debug->enabled ) {
258
259 $this->p->debug->log( $this->log_pre . 'seoframework ' . $opt_key . ' option is enabled' );
260 }
261
262 $notice_msg = __( 'Please disable the %1$s option under the %2$s tab.', 'wpsso' );
263 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
264 $notice_key = 'seoframework-' . $opt_key . '-option-disabled';
265
266 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
267 }
268 }
269 }
270
271 /*
272 * The SEO Framework options that must be enabled.
273 */
274 foreach ( array(
275 $social_gen_link => array(
276 // translators: Please ignore - translation uses a different text domain.
277 'social_title_rem_additions' => '<strong>' . __( 'Remove site title from generated social titles?', 'autodescription' ) . '</strong>',
278 ),
279 ) as $settings_link => $keys ) {
280
281 foreach ( $keys as $opt_key => $label_transl ) {
282
283 if ( empty( $opts[ $opt_key ] ) ) {
284
285 if ( $this->p->debug->enabled ) {
286
287 $this->p->debug->log( $this->log_pre . 'seoframework ' . $opt_key . ' option is disabled' );
288 }
289
290 $notice_msg = __( 'Please enable the %1$s option under the %2$s tab.', 'wpsso' );
291 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
292 $notice_key = 'seoframework-' . $opt_key . '-option-disabled';
293
294 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
295 }
296 }
297 }
298 }
299
300 /*
301 * SEOPress.
302 */
303 private function conflict_check_seopress() {
304
305 if ( empty( $this->p->avail[ 'seo' ][ 'seopress' ] ) ) {
306
307 return;
308 }
309
310 $plugin_name = __( 'SEOPress', 'wpsso' );
311
312 $opts = get_option( 'seopress_toggle' );
313
314 /*
315 * Check for Social Networks module.
316 */
317 if ( ! empty( $opts[ 'toggle-social' ] ) ) {
318
319 // translators: Please ignore - translation uses a different text domain.
320 $label_transl = '<strong>' . __( 'Social Networks', 'wp-seopress' ) . '</strong>';
321 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=seopress-option' );
322 $settings_link = '<a href="' . $settings_url . '">' .
323 // translators: Please ignore - translation uses a different text domain.
324 __( 'SEO', 'wp-seopress' ) . ' &gt; ' .
325 // translators: Please ignore - translation uses a different text domain.
326 __( 'Social Networks', 'wp-seopress' ) . '</a>';
327
328 if ( $this->p->debug->enabled ) {
329
330 $this->p->debug->log( $this->log_pre . 'seopress social networks module is enabled' );
331 }
332
333 $notice_msg = __( 'Please disable the %1$s module in the %2$s settings.', 'wpsso' );
334 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
335 $notice_key = 'seopress-social-networks-module-enabled';
336
337 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
338 }
339 }
340
341 /*
342 * SEO Ultimate.
343 */
344 private function conflict_check_seoultimate() {
345
346 if ( empty( $this->p->avail[ 'seo' ][ 'seoultimate' ] ) ) {
347
348 return;
349 }
350
351 $plugin_name = __( 'SEO Ultimate', 'wpsso' );
352
353 $opts = get_option( 'seo_ultimate' );
354
355 if ( ! empty( $opts[ 'modules' ] ) && is_array( $opts[ 'modules' ] ) ) {
356
357 /*
358 * Check for Open Graph.
359 */
360 if ( array_key_exists( 'opengraph', $opts[ 'modules' ] ) && $opts[ 'modules' ][ 'opengraph' ] !== -10 ) {
361
362 // translators: Please ignore - translation uses a different text domain.
363 $label_transl = '<strong>' . __( 'Open Graph Integrator', 'seo-ultimate' ) . '</strong>';
364 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=seo' );
365 $settings_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
366 // translators: Please ignore - translation uses a different text domain.
367 __( 'Modules', 'seo-ultimate' ) . '</a>';
368
369 if ( $this->p->debug->enabled ) {
370
371 $this->p->debug->log( $this->log_pre . 'seo ultimate opengraph module is enabled' );
372 }
373
374 $notice_msg = __( 'Please disable the %1$s module in the %2$s settings.', 'wpsso' );
375 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
376 $notice_key = 'seo-ultimate-opengraph-module-enabled';
377
378 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
379 }
380 }
381 }
382
383 /*
384 * Squirrly SEO.
385 */
386 private function conflict_check_squirrlyseo() {
387
388 if ( empty( $this->p->avail[ 'seo' ][ 'squirrlyseo' ] ) ) {
389
390 return;
391 }
392
393 $plugin_name = __( 'Squirrly SEO', 'wpsso' );
394
395 $opts = json_decode( get_option( 'sq_options' ), $assoc = true );
396
397 /*
398 * Check for Open Graph and X (Twitter) Cards.
399 */
400 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=sq_seosettings&tab=social' );
401
402 $settings_link = '<a href="' . $settings_url . '">' .
403 // translators: Please ignore - translation uses a different text domain.
404 __( 'Squirrly', 'squirrly-seo' ) . ' &gt; ' .
405 // translators: Please ignore - translation uses a different text domain.
406 __( 'SEO Settings', 'squirrly-seo' ) . ' &gt; ' .
407 // translators: Please ignore - translation uses a different text domain.
408 __( 'Social Media', 'squirrly-seo' ) . '</a>';
409
410 foreach ( array(
411 // translators: Please ignore - translation uses a different text domain.
412 'sq_auto_facebook' => '<strong>' . __( 'Activate Open Graph', 'squirrly-seo' ) . '</strong>',
413 // translators: Please ignore - translation uses a different text domain.
414 'sq_auto_twitter' => '<strong>' . __( 'Activate Twitter Card', 'squirrly-seo' ) . '</strong>',
415 ) as $opt_key => $label_transl ) {
416
417 if ( ! empty( $opts[ $opt_key ] ) ) {
418
419 if ( $this->p->debug->enabled ) {
420
421 $this->p->debug->log( $this->log_pre . 'squirrly seo ' . $opt_key . ' option is enabled' );
422 }
423
424 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
425 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
426 $notice_key = 'squirrly-seo-' . $opt_key . '-option-enabled';
427
428 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
429 }
430 }
431
432 /*
433 * Check for Knowledge Graph.
434 */
435 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=sq_seosettings&tab=jsonld' );
436
437 $settings_link = '<a href="' . $settings_url . '">' .
438 // translators: Please ignore - translation uses a different text domain.
439 __( 'Squirrly', 'squirrly-seo' ) . ' &gt; ' .
440 // translators: Please ignore - translation uses a different text domain.
441 __( 'SEO Settings', 'squirrly-seo' ) . ' &gt; ' .
442 // translators: Please ignore - translation uses a different text domain.
443 __( 'JSON LD', 'squirrly-seo' ) . '</a>';
444
445 foreach ( array(
446 // translators: Please ignore - translation uses a different text domain.
447 'sq_auto_jsonld' => '<strong>' . __( 'Activate JSON-LD', 'squirrly-seo' ) . '</strong>',
448 ) as $opt_key => $label_transl ) {
449
450 if ( ! empty( $opts[ $opt_key ] ) ) {
451
452 if ( $this->p->debug->enabled ) {
453
454 $this->p->debug->log( $this->log_pre . 'squirrly seo ' . $opt_key . ' option is enabled' );
455 }
456
457 $notice_msg = __( 'Please disable the %1$s option in the %2$s metabox.', 'wpsso' );
458 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
459 $notice_key = 'squirrly-seo-' . $opt_key . '-option-enabled';
460
461 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
462 }
463 }
464 }
465
466 /*
467 * WP Meta SEO.
468 */
469 private function conflict_check_wpmetaseo() {
470
471 if ( empty( $this->p->avail[ 'seo' ][ 'wpmetaseo' ] ) ) {
472
473 return;
474 }
475
476 $plugin_name = __( 'WP Meta SEO', 'wpsso' );
477
478 $opts = get_option( '_metaseo_settings' );
479
480 if ( empty( $opts ) ) { // Plugin settings not yet saved.
481
482 if ( function_exists( 'wpmsGetDefaultSettings' ) ) {
483
484 $opts = wpmsGetDefaultSettings();
485 }
486 }
487
488 /*
489 * Check for Open Graph and X (Twitter) Cards.
490 */
491 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=metaseo_settings#social' );
492 $settings_link = '<a href="' . $settings_url . '">' . $plugin_name . ' &gt; ' .
493 // translators: Please ignore - translation uses a different text domain.
494 __( 'Settings', 'wp-meta-seo' ) . ' &gt; ' .
495 // translators: Please ignore - translation uses a different text domain.
496 __( 'Social', 'wp-meta-seo' ) . '</a>';
497
498 foreach ( array(
499 // translators: Please ignore - translation uses a different text domain.
500 'metaseo_showfacebook' => '<strong>' . __( 'Facebook profile URL', 'wp-meta-seo' ) . '</strong>',
501 // translators: Please ignore - translation uses a different text domain.
502 'metaseo_showfbappid' => '<strong>' . __( 'Facebook App ID', 'wp-meta-seo' ) . '</strong>',
503 // translators: Please ignore - translation uses a different text domain.
504 'metaseo_showtwitter' => '<strong>' . __( 'Twitter Username', 'wp-meta-seo' ) . '</strong>',
505 ) as $opt_key => $label_transl ) {
506
507 if ( ! empty( $opts[ $opt_key ] ) ) {
508
509 if ( $this->p->debug->enabled ) {
510
511 $this->p->debug->log( $this->log_pre . 'wpmetaseo ' . $opt_key . ' option is not empty' );
512 }
513
514 $notice_msg = __( 'Please remove the %1$s option value in the %2$s settings.', 'wpsso' );
515 $notice_msg= sprintf( $notice_msg, $label_transl, $settings_link );
516 $notice_key = 'wpmetaseo-' . $opt_key . '-option-not-empty';
517
518 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
519 }
520 }
521
522 if ( ! isset( $opts[ 'metaseo_showsocial' ] ) || ! empty( $opts[ 'metaseo_showsocial' ] ) ) {
523
524 // translators: Please ignore - translation uses a different text domain.
525 $label_transl = '<strong>' . __( 'Social sharing block', 'wp-meta-seo' ) . '</strong>';
526
527 if ( $this->p->debug->enabled ) {
528
529 $this->p->debug->log( $this->log_pre . 'wpmetaseo metaseo_showsocial option is enabled' );
530 }
531
532 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
533 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
534 $notice_key = 'wpmetaseo-showsocial-option-enabled';
535
536 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
537 }
538 }
539
540 /*
541 * Yoast SEO.
542 */
543 private function conflict_check_wpseo() {
544
545 if ( empty( $this->p->avail[ 'seo' ][ 'wpseo' ] ) ) {
546
547 return;
548 }
549
550 $plugin_name = __( 'Yoast SEO', 'wpsso' );
551
552 /*
553 * Check for minimum supported version.
554 */
555 $min_version = '14.0';
556
557 if ( ! defined( 'WPSEO_VERSION' ) || version_compare( WPSEO_VERSION, $min_version, '<' ) ) {
558
559 $notice_msg = __( 'The %1$s plugin is too old - please update the %1$s plugin to version %2$s or newer.', 'wpsso' );
560 $notice_msg = sprintf( $notice_msg, $plugin_name, $min_version );
561 $notice_key = 'wpseo-version-' . WPSEO_VERSION . '-too-old';
562
563 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
564
565 return;
566 }
567
568 $opts = get_option( 'wpseo' );
569 $opts_social = get_option( 'wpseo_social' );
570
571 /*
572 * Check for Open Graph.
573 */
574 if ( ! empty( $opts_social[ 'opengraph' ] ) ) {
575
576 if ( version_compare( WPSEO_VERSION, '20.0', '>=' ) ) {
577
578 // translators: Please ignore - translation uses a different text domain.
579 $label_transl = '<strong>' . __( 'Open Graph data', 'wordpress-seo' ) . '</strong>';
580 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_page_settings#/site-features' );
581 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
582 // translators: Please ignore - translation uses a different text domain.
583 __( 'Settings', 'wordpress-seo' ) . ' &gt; ' .
584 // translators: Please ignore - translation uses a different text domain.
585 __( 'Site features', 'wordpress-seo' ) . ' &gt; ' .
586 // translators: Please ignore - translation uses a different text domain.
587 __( 'Social sharing', 'wordpress-seo' ) . '</a>';
588
589 } else {
590
591 // translators: Please ignore - translation uses a different text domain.
592 $label_transl = '<strong>' . __( 'Add Open Graph meta data', 'wordpress-seo' ) . '</strong>';
593 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_social#top#facebook' );
594 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
595 // translators: Please ignore - translation uses a different text domain.
596 __( 'Social', 'wordpress-seo' ) . ' &gt; ' .
597 // translators: Please ignore - translation uses a different text domain.
598 __( 'Facebook', 'wordpress-seo' ) . '</a>';
599 }
600
601 if ( $this->p->debug->enabled ) {
602
603 $this->p->debug->log( $this->log_pre . 'wpseo opengraph option is enabled' );
604 }
605
606 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
607 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
608 $notice_key = 'wpseo-opengraph-option-enabled';
609
610 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
611 }
612
613 /*
614 * Check for X (Twitter) Cards.
615 */
616 if ( ! empty( $opts_social[ 'twitter' ] ) ) {
617
618 if ( version_compare( WPSEO_VERSION, '20.0', '>=' ) ) {
619
620 // translators: Please ignore - translation uses a different text domain.
621 $label_transl = '<strong>' . __( 'X card data', 'wordpress-seo' ) . '</strong>';
622 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_page_settings#/site-features' );
623 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
624 // translators: Please ignore - translation uses a different text domain.
625 __( 'Settings', 'wordpress-seo' ) . ' &gt; ' .
626 // translators: Please ignore - translation uses a different text domain.
627 __( 'Site features', 'wordpress-seo' ) . ' &gt; ' .
628 // translators: Please ignore - translation uses a different text domain.
629 __( 'Social sharing', 'wordpress-seo' ) . '</a>';
630
631 } else {
632
633 // translators: Please ignore - translation uses a different text domain.
634 $label_transl = '<strong>' . __( 'Add Twitter Card meta data', 'wordpress-seo' ) . '</strong>';
635 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_social#top#twitterbox' );
636 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
637 // translators: Please ignore - translation uses a different text domain.
638 __( 'Social', 'wordpress-seo' ) . ' &gt; ' .
639 // translators: Please ignore - translation uses a different text domain.
640 __( 'Twitter', 'wordpress-seo' ) . '</a>';
641 }
642
643 if ( $this->p->debug->enabled ) {
644
645 $this->p->debug->log( $this->log_pre . 'wpseo twitter option is enabled' );
646 }
647
648 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
649 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
650 $notice_key = 'wpseo-twitter-option-enabled';
651
652 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
653 }
654
655 /*
656 * Check for Slack.
657 */
658 if ( ! empty( $opts[ 'enable_enhanced_slack_sharing' ] ) ) {
659
660 if ( version_compare( WPSEO_VERSION, '20.0', '>=' ) ) {
661
662 // translators: Please ignore - translation uses a different text domain.
663 $label_transl = '<strong>' . __( 'Slack sharing', 'wordpress-seo' ) . '</strong>';
664 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_page_settings#/site-features' );
665 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
666 // translators: Please ignore - translation uses a different text domain.
667 __( 'Settings', 'wordpress-seo' ) . ' &gt; ' .
668 // translators: Please ignore - translation uses a different text domain.
669 __( 'Site features', 'wordpress-seo' ) . ' &gt; ' .
670 // translators: Please ignore - translation uses a different text domain.
671 __( 'Social sharing', 'wordpress-seo' ) . '</a>';
672
673 } else {
674
675 // translators: Please ignore - translation uses a different text domain.
676 $label_transl = '<strong>' . __( 'Enhanced Slack sharing', 'wordpress-seo' ) . '</strong>';
677 $settings_url = get_admin_url( $blog_id = null, 'admin.php?page=wpseo_dashboard#top#features' );
678 $settings_link = '<a href="' . $settings_url . '" onclick="window.location.reload();">' . $plugin_name . ' &gt; ' .
679 // translators: Please ignore - translation uses a different text domain.
680 __( 'General', 'wordpress-seo' ) . ' &gt; ' .
681 // translators: Please ignore - translation uses a different text domain.
682 __( 'Features', 'wordpress-seo' ) . '</a>';
683 }
684
685 if ( $this->p->debug->enabled ) {
686
687 $this->p->debug->log( $this->log_pre . 'wpseo slack option is enabled' );
688 }
689
690 $notice_msg = __( 'Please disable the %1$s option in the %2$s settings.', 'wpsso' );
691 $notice_msg = sprintf( $notice_msg, $label_transl, $settings_link );
692 $notice_key = 'wpseo-slack-option-enabled';
693
694 $this->p->notice->err( $this->notice_pre . $notice_msg, null, $notice_key );
695 }
696 }
697
698 /*
699 * Yoast WooCommerce SEO.
700 */
701 private function conflict_check_wpseo_wc() {
702
703 if ( empty( $this->p->avail[ 'seo' ][ 'wpseo-wc' ] ) ) {
704
705 return;
706
707 } elseif ( empty( $this->p->avail[ 'p' ][ 'schema' ] ) ) {
708
709 return;
710 }
711
712 $pkg_info = $this->p->util->get_pkg_info(); // Uses a local cache.
713 $wpseo_wc_label = 'Yoast WooCommerce SEO';
714 $plugins_url = is_multisite() ? network_admin_url( 'plugins.php', null ) : get_admin_url( $blog_id = null, 'plugins.php' );
715 $plugins_url = add_query_arg( array( 's' => 'yoast seo' ), $plugins_url );
716
717 $notice_msg = sprintf( __( 'The %1$s plugin provides much better Schema markup for WooCommerce products than the %2$s plugin.', 'wpsso' ), $pkg_info[ 'wpsso' ][ 'short' ], $wpseo_wc_label ) . ' ';
718
719 $notice_msg .= sprintf( __( 'There is absolutely no advantage in continuing to use the %1$s plugin.', 'wpsso' ), $wpseo_wc_label ) . ' ';
720
721 $notice_msg .= sprintf( __( 'To avoid adding incorrect and confusing Schema markup to your webpages, <a href="%1$s">please deactivate the %2$s plugin immediately</a>.' ), $plugins_url, $wpseo_wc_label );
722
723 $notice_key = 'deactivate-wpseo-woocommerce';
724
725 $this->p->notice->err( $notice_msg, null, $notice_key );
726 }
727 }
728 }
729