diff --git a/projects/packages/my-jetpack/_inc/components/product-cards-section/protect-card/use-protect-tooltip-copy.ts b/projects/packages/my-jetpack/_inc/components/product-cards-section/protect-card/use-protect-tooltip-copy.ts index d79132a0945d9..7f007be806433 100644 --- a/projects/packages/my-jetpack/_inc/components/product-cards-section/protect-card/use-protect-tooltip-copy.ts +++ b/projects/packages/my-jetpack/_inc/components/product-cards-section/protect-card/use-protect-tooltip-copy.ts @@ -49,6 +49,7 @@ export function useProtectTooltipCopy(): TooltipContent { jetpack_waf_automatic_rules: isAutoFirewallEnabled, blocked_logins: blockedLoginsCount, brute_force_protection: hasBruteForceProtection, + waf_supported: wafSupported, } = wafData || {}; const pluginsCount = fromScanPlugins.length || Object.keys( plugins ).length; @@ -249,18 +250,23 @@ export function useProtectTooltipCopy(): TooltipContent { hasProtectPaidPlan && ! isAutoFirewallEnabled ? { title: __( 'Auto-Firewall: Inactive', 'jetpack-my-jetpack' ), - text: createInterpolateElement( - __( - 'You have Auto-Firewall disabled, visit your Protect firewall settings to activate.', - 'jetpack-my-jetpack' - ), - { - a: createElement( 'a', { - href: settingsLink, - onClick: trackFirewallSettingsLinkClick, - } ), - } - ), + text: wafSupported + ? createInterpolateElement( + __( + 'You have Auto-Firewall disabled, visit your Protect firewall settings to activate.', + 'jetpack-my-jetpack' + ), + { + a: createElement( 'a', { + href: settingsLink, + onClick: trackFirewallSettingsLinkClick, + } ), + } + ) + : __( + 'Auto-Firewall is disabled as your hosting provider already includes a built-in firewall with similar rules for your site.', + 'jetpack-my-jetpack' + ), } : { title: __( 'Auto-Firewall: Inactive', 'jetpack-my-jetpack' ), diff --git a/projects/packages/my-jetpack/global.d.ts b/projects/packages/my-jetpack/global.d.ts index cc0373cc75204..7d34848716473 100644 --- a/projects/packages/my-jetpack/global.d.ts +++ b/projects/packages/my-jetpack/global.d.ts @@ -286,6 +286,7 @@ interface Window { jetpack_waf_share_data: '1' | ''; jetpack_waf_share_debug_data: boolean; standalone_mode: boolean; + waf_supported: boolean; }; }; videopress: { diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php index ca643051fbe32..1a871e3f76e13 100644 --- a/projects/packages/my-jetpack/src/class-initializer.php +++ b/projects/packages/my-jetpack/src/class-initializer.php @@ -236,9 +236,12 @@ public static function enqueue_scripts() { $scan_data = Products\Protect::get_protect_data(); self::update_historically_active_jetpack_modules(); - $waf_config = array(); + $waf_config = array(); + $waf_supported = false; + if ( class_exists( 'Automattic\Jetpack\Waf\Waf_Runner' ) ) { - $waf_config = Waf_Runner::get_config(); + $waf_config = Waf_Runner::get_config(); + $waf_supported = Waf_Runner::is_supported_environment(); } wp_localize_script( @@ -297,6 +300,9 @@ public static function enqueue_scripts() { 'scanData' => $scan_data, 'wafConfig' => array_merge( $waf_config, + array( + 'waf_supported' => $waf_supported, + ), array( 'blocked_logins' => (int) get_site_option( 'jetpack_protect_blocked_attempts', 0 ) ) ), ),