| 1 |
<?php |
| 2 |
|
| 3 |
namespace Hostinger; |
| 4 |
|
| 5 |
use Hostinger\Helper; |
| 6 |
|
| 7 |
defined( 'ABSPATH' ) || exit; |
| 8 |
|
| 9 |
class DefaultOptions { |
| 10 |
public function add_options(): void { |
| 11 |
foreach ( $this->options() as $key => $option ) { |
| 12 |
update_option( $key, $option ); |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
private function options(): array { |
| 17 |
$options = array( |
| 18 |
'optin_monster_api_activation_redirect_disabled' => 'true', |
| 19 |
'wpforms_activation_redirect' => 'true', |
| 20 |
'aioseo_activation_redirect' => 'false', |
| 21 |
); |
| 22 |
|
| 23 |
if ( Helper::is_plugin_active( 'astra-sites' ) ) { |
| 24 |
$options = array_merge( $options, $this->get_astra_options() ); |
| 25 |
} |
| 26 |
|
| 27 |
return $options; |
| 28 |
} |
| 29 |
|
| 30 |
private function get_astra_options(): array { |
| 31 |
return array( |
| 32 |
'astra_sites_settings' => 'gutenberg', |
| 33 |
'st-elementor-builder-flag' => '1', |
| 34 |
); |
| 35 |
} |
| 36 |
} |
| 37 |
|