| @@ -20,10 +20,10 @@ | ||
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Feature data for the last active "What's new" modal. |
| 23 | 23 | */ |
| 24 | - public const FEATURE_SLUG = 'wd_show_feature_bot_protection'; | |
| 25 | - public const FEATURE_VERSION = '5.4.0'; | |
| 24 | + public const FEATURE_SLUG = 'wd_show_feature_redesign'; | |
| 25 | + public const FEATURE_VERSION = '6.0.0'; | |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Get modals that are displayed on the Dashboard page. |
| 29 | 29 | * |
| @@ -38,13 +38,8 @@ | ||
| 38 | 38 | $current_user = wp_get_current_user(); |
| 39 | 39 | |
| 40 | 40 | return array( |
| 41 | 41 | 'show_welcome_modal' => $is_displayed, |
| 42 | - 'welcome_modal' => array( | |
| 43 | - 'user_name' => esc_html( $current_user->display_name ), | |
| 44 | - 'banner_1x' => defender_asset_url( '/assets/img/modal/welcome-modal.png' ), | |
| 45 | - 'banner_2x' => defender_asset_url( '/assets/img/modal/[email protected]' ), | |
| 46 | - ), | |
| 47 | 42 | ); |
| 48 | 43 | } |
| 49 | 44 | |
| 50 | 45 | /** |
| @@ -79,10 +74,10 @@ | ||
| 79 | 74 | 'vers' => '2.4.0', |
| 80 | 75 | ), |
| 81 | 76 | // The latest feature. |
| 82 | 77 | array( |
| 83 | - 'slug' => 'wd_show_feature_session_protection', | |
| 84 | - 'vers' => '5.2.0', | |
| 78 | + 'slug' => 'wd_show_feature_turnstile', | |
| 79 | + 'vers' => '5.7.0', | |
| 85 | 80 | ), |
| 86 | 81 | // The current feature. |
| 87 | 82 | array( |
| 88 | 83 | 'slug' => self::FEATURE_SLUG, |
| @@ -106,8 +101,21 @@ | ||
| 106 | 101 | * @return string |
| 107 | 102 | */ |
| 108 | 103 | private function additional_text(): string { |
| 109 | 104 | return ''; |
| 105 | + } | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * Enable the welcome modal only when the installed plugin version matches the exact | |
| 109 | + * release the modal belongs to, so it does not re-appear on later patches/minors | |
| 110 | + * (e.g. 6.0.1, 6.1) that share the same DB version. | |
| 111 | + * | |
| 112 | + * @return void | |
| 113 | + */ | |
| 114 | + public static function maybe_enable_welcome_modal(): void { | |
| 115 | + if ( defined( 'DEFENDER_VERSION' ) && version_compare( DEFENDER_VERSION, self::FEATURE_VERSION, '==' ) ) { | |
| 116 | + update_site_option( self::FEATURE_SLUG, true ); | |
| 117 | + } | |
| 110 | 118 | } |
| 111 | 119 | |
| 112 | 120 | /** |
| 113 | 121 | * Delete welcome modal key. |