| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
class Hostinger_Activator { |
| 6 |
|
| 7 |
public static function activate(): void { |
| 8 |
require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-default-options.php'; |
| 9 |
$options = new Hostinger_Default_Options(); |
| 10 |
$options->add_options(); |
| 11 |
|
| 12 |
self::update_installation_state_on_activation(); |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Saves installation state. |
| 17 |
*/ |
| 18 |
public static function update_installation_state_on_activation(): void { |
| 19 |
$installation_state = get_option( 'hts_new_installation', false ); |
| 20 |
|
| 21 |
if ( $installation_state !== 'old' ) { |
| 22 |
add_option( 'hts_new_installation', 'new' ); |
| 23 |
} |
| 24 |
} |
| 25 |
} |
| 26 |
|