| 1 |
<?php |
| 2 |
/** |
| 3 |
* The onboard model class. |
| 4 |
* |
| 5 |
* @package WP_Defender\Model |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WP_Defender\Model; |
| 9 |
|
| 10 |
/** |
| 11 |
* Class Onboard. |
| 12 |
* |
| 13 |
* Provides methods to check if the site is newly created. |
| 14 |
*/ |
| 15 |
class Onboard { |
| 16 |
/** |
| 17 |
* Checks if the site is newly created. |
| 18 |
* |
| 19 |
* @return bool Returns true if the site is newly created, false otherwise. |
| 20 |
*/ |
| 21 |
public static function maybe_show_onboarding(): bool { |
| 22 |
// First we need to check if the site is newly create. |
| 23 |
if ( ! is_multisite() ) { |
| 24 |
$res = get_option( 'wp_defender_shown_activator' ); |
| 25 |
} else { |
| 26 |
$res = get_site_option( 'wp_defender_shown_activator' ); |
| 27 |
} |
| 28 |
// Get '1' for direct SQL request if Onboarding was already. |
| 29 |
if ( empty( $res ) ) { |
| 30 |
return true; |
| 31 |
} |
| 32 |
|
| 33 |
return false; |
| 34 |
} |
| 35 |
} |
| 36 |
|