ajax
2 years ago
capabilities
1 year ago
endpoints
2 years ago
exceptions
3 months ago
filters
3 months ago
formatter
1 year ago
google_search_console
3 months ago
import
3 months ago
listeners
8 years ago
menu
3 months ago
metabox
3 months ago
notifiers
3 months ago
pages
3 months ago
roles
3 months ago
services
3 months ago
statistics
3 months ago
taxonomy
3 months ago
tracking
3 months ago
views
3 months ago
watchers
3 months ago
admin-settings-changed-listener.php
2 years ago
ajax.php
3 months ago
class-admin-asset-analysis-worker-location.php
3 months ago
class-admin-asset-dev-server-location.php
3 months ago
class-admin-asset-location.php
8 years ago
class-admin-asset-manager.php
3 months ago
class-admin-asset-seo-location.php
4 years ago
class-admin-editor-specific-replace-vars.php
3 months ago
class-admin-gutenberg-compatibility-notification.php
3 months ago
class-admin-help-panel.php
3 months ago
class-admin-init.php
3 months ago
class-admin-recommended-replace-vars.php
2 years ago
class-admin-user-profile.php
7 months ago
class-admin-utils.php
3 months ago
class-admin.php
3 months ago
class-asset.php
1 year ago
class-bulk-description-editor-list-table.php
3 months ago
class-bulk-editor-list-table.php
3 months ago
class-bulk-title-editor-list-table.php
3 months ago
class-collector.php
1 year ago
class-config.php
3 months ago
class-database-proxy.php
3 months ago
class-export.php
3 months ago
class-expose-shortlinks.php
7 months ago
class-gutenberg-compatibility.php
1 month ago
class-meta-columns.php
3 months ago
class-my-yoast-proxy.php
3 months ago
class-option-tab.php
4 years ago
class-option-tabs-formatter.php
3 months ago
class-option-tabs.php
2 years ago
class-paper-presenter.php
5 years ago
class-plugin-availability.php
3 months ago
class-plugin-conflict.php
2 years ago
class-premium-popup.php
1 year ago
class-premium-upsell-admin-block.php
3 months ago
class-primary-term-admin.php
3 months ago
class-product-upsell-notice.php
3 months ago
class-remote-request.php
2 years ago
class-schema-person-upgrade-notification.php
3 months ago
class-suggested-plugins.php
3 months ago
class-wincher-dashboard-widget.php
3 months ago
class-yoast-columns.php
3 months ago
class-yoast-dashboard-widget.php
3 months ago
class-yoast-form.php
3 months ago
class-yoast-input-validation.php
3 months ago
class-yoast-network-admin.php
3 months ago
class-yoast-network-settings-api.php
3 months ago
class-yoast-notification-center.php
3 months ago
class-yoast-notification.php
3 months ago
class-yoast-notifications.php
3 months ago
class-yoast-plugin-conflict.php
3 months ago
index.php
10 years ago
interface-collection.php
7 years ago
interface-installable.php
8 years ago
class-plugin-conflict.php
95 lines
| 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<string, array<string>> |
| 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 = self::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 | * @return void |
| 52 | */ |
| 53 | public static function hook_check_for_plugin_conflicts( $plugin = false ) { |
| 54 | // The instance of the plugin. |
| 55 | $instance = self::get_instance(); |
| 56 | |
| 57 | // Only add the plugin as an active plugin if $plugin isn't false. |
| 58 | if ( $plugin && is_string( $plugin ) ) { |
| 59 | $instance->add_active_plugin( $instance->find_plugin_category( $plugin ), $plugin ); |
| 60 | } |
| 61 | |
| 62 | $plugin_sections = []; |
| 63 | |
| 64 | // Only check for open graph problems when they are enabled. |
| 65 | if ( WPSEO_Options::get( 'opengraph' ) ) { |
| 66 | /* translators: %1$s expands to Yoast SEO, %2$s: 'Facebook' plugin name of possibly conflicting plugin with regard to creating OpenGraph output. */ |
| 67 | $plugin_sections['open_graph'] = __( 'Both %1$s and %2$s create Open Graph output, which might make Facebook, X, LinkedIn and other social networks use the wrong texts and images when your pages are being shared.', 'wordpress-seo' ) |
| 68 | . '<br/><br/>' |
| 69 | . '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_page_settings#/site-features#card-wpseo_social-opengraph' ) . '">' |
| 70 | /* translators: %1$s expands to Yoast SEO. */ |
| 71 | . sprintf( __( 'Configure %1$s\'s Open Graph settings', 'wordpress-seo' ), 'Yoast SEO' ) |
| 72 | . '</a>'; |
| 73 | } |
| 74 | |
| 75 | // Only check for XML conflicts if sitemaps are enabled. |
| 76 | if ( WPSEO_Options::get( 'enable_xml_sitemap' ) ) { |
| 77 | /* 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. */ |
| 78 | $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' ) |
| 79 | . '<br/><br/>' |
| 80 | . '<a class="button" href="' . admin_url( 'admin.php?page=wpseo_page_settings#/site-features#card-wpseo-enable_xml_sitemap' ) . '">' |
| 81 | /* translators: %1$s expands to Yoast SEO. */ |
| 82 | . sprintf( __( 'Toggle %1$s\'s XML Sitemap', 'wordpress-seo' ), 'Yoast SEO' ) |
| 83 | . '</a>'; |
| 84 | } |
| 85 | |
| 86 | /* 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. */ |
| 87 | $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' ); |
| 88 | |
| 89 | /* 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. */ |
| 90 | $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' ); |
| 91 | |
| 92 | $instance->check_plugin_conflicts( $plugin_sections ); |
| 93 | } |
| 94 | } |
| 95 |