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

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/admin/class-plugin-conflict.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 * @since   1.7.0
7
 */
8

9
use Yoast\WP\SEO\Config\Conflicting_Plugins;
10

11
/**
12
 * Contains list of conflicting plugins.
13
 */
14
class WPSEO_Plugin_Conflict extends Yoast_Plugin_Conflict {
15

16
        /**
17
         * The plugins must be grouped per section.
18
         *
19
         * It's possible to check for each section if there are conflicting plugin.
20
         *
21
         * NOTE: when changing this array, be sure to update the array in Conflicting_Plugins_Service too.
22
         *
23
         * @var array
24
         */
25
        protected $plugins = [
26
                // The plugin which are writing OG metadata.
27
                'open_graph'   => Conflicting_Plugins::OPEN_GRAPH_PLUGINS,
28
                'xml_sitemaps' => Conflicting_Plugins::XML_SITEMAPS_PLUGINS,
29
                'cloaking'     => Conflicting_Plugins::CLOAKING_PLUGINS,
30
                'seo'          => Conflicting_Plugins::SEO_PLUGINS,
31
        ];
32

33
        /**
34
         * Overrides instance to set with this class as class.
35
         *
36
         * @param string $class_name Optional class name.
37
         *
38
         * @return Yoast_Plugin_Conflict
39
         */
40
        public static function get_instance( $class_name = __CLASS__ ) {
×
41
                return parent::get_instance( $class_name );
×
42
        }
43

44
        /**
45
         * After activating any plugin, this method will be executed by a hook.
46
         *
47
         * If the activated plugin is conflicting with ours a notice will be shown.
48
         *
49
         * @param string|bool $plugin Optional plugin basename to check.
50
         */
51
        public static function hook_check_for_plugin_conflicts( $plugin = false ) {
×
52
                // The instance of the plugin.
53
                $instance = self::get_instance();
×
54

55
                // Only add the plugin as an active plugin if $plugin isn't false.
56
                if ( $plugin && is_string( $plugin ) ) {
×
57
                        $instance->add_active_plugin( $instance->find_plugin_category( $plugin ), $plugin );
×
58
                }
59

60
                $plugin_sections = [];
×
61

62
                // Only check for open graph problems when they are enabled.
63
                if ( WPSEO_Options::get( 'opengraph' ) ) {
×
64
                        /* translators: %1$s expands to Yoast SEO, %2$s: 'Facebook' plugin name of possibly conflicting plugin with regard to creating OpenGraph output. */
65
                        $plugin_sections['open_graph'] = __( 'Both %1$s and %2$s create Open Graph output, which might make Facebook, Twitter, LinkedIn and other social networks use the wrong texts and images when your pages are being shared.', 'wordpress-seo' )
×
66
                                . '<br/><br/>'
×
67
                                . '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_page_settings#/site-features#card-wpseo_social-opengraph' ) . '">'
×
68
                                /* translators: %1$s expands to Yoast SEO. */
69
                                . sprintf( __( 'Configure %1$s\'s Open Graph settings', 'wordpress-seo' ), 'Yoast SEO' )
×
70
                                . '</a>';
×
71
                }
72

73
                // Only check for XML conflicts if sitemaps are enabled.
74
                if ( WPSEO_Options::get( 'enable_xml_sitemap' ) ) {
×
75
                        /* translators: %1$s expands to Yoast SEO, %2$s: 'Google XML Sitemaps' plugin name of possibly conflicting plugin with regard to the creation of sitemaps. */
76
                        $plugin_sections['xml_sitemaps'] = __( 'Both %1$s and %2$s can create XML sitemaps. Having two XML sitemaps is not beneficial for search engines and might slow down your site.', 'wordpress-seo' )
×
77
                                . '<br/><br/>'
×
78
                                . '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_page_settings#/site-features#card-wpseo-enable_xml_sitemap' ) . '">'
×
79
                                /* translators: %1$s expands to Yoast SEO. */
80
                                . sprintf( __( 'Toggle %1$s\'s XML Sitemap', 'wordpress-seo' ), 'Yoast SEO' )
×
81
                                . '</a>';
×
82
                }
83

84
                /* translators: %2$s expands to 'RS Head Cleaner' plugin name of possibly conflicting plugin with regard to differentiating output between search engines and normal users. */
85
                $plugin_sections['cloaking'] = __( 'The plugin %2$s changes your site\'s output and in doing that differentiates between search engines and normal users, a process that\'s called cloaking. We highly recommend that you disable it.', 'wordpress-seo' );
×
86

87
                /* translators: %1$s expands to Yoast SEO, %2$s: 'SEO' plugin name of possibly conflicting plugin with regard to the creation of duplicate SEO meta. */
88
                $plugin_sections['seo'] = __( 'Both %1$s and %2$s manage the SEO of your site. Running two SEO plugins at the same time is detrimental.', 'wordpress-seo' );
×
89

90
                $instance->check_plugin_conflicts( $plugin_sections );
×
91
        }
92
}
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

© 2025 Coveralls, Inc