| @@ -1,27 +1,32 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace Booktics; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * Activation class | |
| 7 | - * | |
| 8 | - * @package Booktics | |
| 9 | - */ | |
| 10 | -class Activate { | |
| 11 | - /** | |
| 12 | - * Activation hook | |
| 13 | - * | |
| 14 | - * @return void | |
| 15 | - */ | |
| 16 | - public static function handle(): void { | |
| 17 | - Installer::run(); | |
| 18 | - self::set_default_options(); | |
| 19 | - } | |
| 20 | - | |
| 21 | - private static function set_default_options(): void { | |
| 22 | - if ( function_exists( 'booktics_update_option' ) ) { | |
| 23 | - booktics_update_option( 'appointment_status', 'pending' ); | |
| 24 | - booktics_update_option( 'appointment_statuses_for_blocked_slot', array( 'pending', 'approved' ) ); | |
| 25 | - } | |
| 26 | - } | |
| 27 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace Booktics; | |
| 4 | + | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit; | |
| 7 | +} | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * Activation class | |
| 11 | + * | |
| 12 | + * @package Booktics | |
| 13 | + */ | |
| 14 | +class Activate { | |
| 15 | + /** | |
| 16 | + * Activation hook | |
| 17 | + * | |
| 18 | + * @return void | |
| 19 | + */ | |
| 20 | + public static function handle(): void { | |
| 21 | + Installer::run(); | |
| 22 | + self::set_default_options(); | |
| 23 | + } | |
| 24 | + | |
| 25 | + private static function set_default_options(): void { | |
| 26 | + if ( function_exists( 'booktics_update_option' ) ) { | |
| 27 | + booktics_update_option( 'appointment_status', 'pending' ); | |
| 28 | + booktics_update_option( 'appointment_statuses_for_blocked_slot', array( 'pending', 'approved' ) ); | |
| 29 | + booktics_update_option( 'pending_reservation_timeout', 10 ); | |
| 30 | + } | |
| 31 | + } | |
| 32 | +} | |