| @@ -2,10 +2,24 @@ | ||
| 2 | 2 | |
| 3 | 3 | defined( 'ABSPATH' ) || exit; |
| 4 | 4 | |
| 5 | 5 | class Hostinger_Activator { |
| 6 | + | |
| 6 | 7 | public static function activate(): void { |
| 7 | 8 | require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-default-options.php'; |
| 8 | 9 | $options = new Hostinger_Default_Options(); |
| 9 | 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 | + } | |
| 10 | 24 | } |
| 11 | 25 | } |