| @@ -1,31 +1,28 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Hostinger; |
| 4 | 4 | |
| 5 | +use Hostinger\DefaultOptions; | |
| 6 | + | |
| 5 | 7 | defined( 'ABSPATH' ) || exit; |
| 6 | 8 | |
| 7 | 9 | class Activator { |
| 8 | - public const INSTALLATION_OPTION_NAME = 'hts_new_installation'; | |
| 9 | - /** | |
| 10 | - * @return void | |
| 11 | - */ | |
| 12 | - public static function activate(): void { | |
| 13 | - $options = new DefaultOptions(); | |
| 14 | - $options->add_options(); | |
| 15 | 10 | |
| 16 | - self::update_installation_state_on_activation(); | |
| 17 | - } | |
| 11 | + public static function activate(): void { | |
| 12 | + $options = new DefaultOptions(); | |
| 13 | + $options->add_options(); | |
| 18 | 14 | |
| 19 | - /** | |
| 20 | - * Saves installation state. | |
| 21 | - * | |
| 22 | - * @return void | |
| 23 | - */ | |
| 24 | - public static function update_installation_state_on_activation(): void { | |
| 25 | - $installation_state = get_option( self::INSTALLATION_OPTION_NAME, false ); | |
| 15 | + self::update_installation_state_on_activation(); | |
| 16 | + } | |
| 26 | 17 | |
| 27 | - if ( $installation_state !== 'old' ) { | |
| 28 | - add_option( self::INSTALLATION_OPTION_NAME, 'new' ); | |
| 29 | - } | |
| 30 | - } | |
| 18 | + /** | |
| 19 | + * Saves installation state. | |
| 20 | + */ | |
| 21 | + public static function update_installation_state_on_activation(): void { | |
| 22 | + $installation_state = get_option( 'hts_new_installation', false ); | |
| 23 | + | |
| 24 | + if ( $installation_state !== 'old' ) { | |
| 25 | + add_option( 'hts_new_installation', 'new' ); | |
| 26 | + } | |
| 27 | + } | |
| 31 | 28 | } |