*/ public static function all(): array { $overrides = apply_filters( 'acez_seo_conflict_overrides', array( new RankMathOverride() ) ); return is_array( $overrides ) ? $overrides : array(); } /** * The override matching the currently detected conflicting plugin, if * any exists — null when no other SEO plugin is active, or when one is * active but no override has been built for it yet. */ public static function for_active_conflict(): ?ConflictOverrideInterface { $detected = SeoPluginDetector::detect(); if ( null === $detected ) { return null; } foreach ( self::all() as $override ) { if ( $override instanceof ConflictOverrideInterface && $override->plugin_name() === $detected ) { return $override; } } return null; } /** * True only when the user opted in (SettingsTab's "danger zone" toggle) * AND a verified override exists for whichever plugin is currently * detected — single source of truth shared by ConflictOverrideRunner * (which does the suppressing) and MetaTagsProvider (which decides * whether to print its own OG/Twitter tags). */ public static function is_active( GlobalSettingsRepositoryInterface $global_settings ): bool { if ( null === self::for_active_conflict() ) { return false; } $settings = $global_settings->get(); return (bool) ( $settings['override_seo_conflict'] ?? false ); } }