| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Fired during plugin activation |
| 5 |
* |
| 6 |
* @package Tableberg |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Tableberg; |
| 10 |
|
| 11 |
use Tableberg\Utils\Utils; |
| 12 |
|
| 13 |
/** |
| 14 |
* Fired during plugin activation. |
| 15 |
* |
| 16 |
* This class defines all code necessary to run during the plugin's activation. |
| 17 |
* |
| 18 |
* @since 1.0.2 |
| 19 |
* @package Tableberg |
| 20 |
* @author Imtiaz Rayhan <imtiazrayhan@gmail.com> |
| 21 |
*/ |
| 22 |
class Activator |
| 23 |
{ |
| 24 |
public static function activate() |
| 25 |
{ |
| 26 |
|
| 27 |
set_transient('_welcome_redirect_tableberg', true, 60); |
| 28 |
|
| 29 |
$individual_control = get_option('tableberg_individual_control', false); |
| 30 |
$block_properties = get_option('tableberg_block_properties', false); |
| 31 |
$global_control = get_option('tableberg_global_control', false); |
| 32 |
|
| 33 |
if (!$global_control) { |
| 34 |
update_option('tableberg_global_control', Utils::global_control()); |
| 35 |
} |
| 36 |
if (!$individual_control) { |
| 37 |
update_option('tableberg_individual_control', Utils::individual_control()); |
| 38 |
} |
| 39 |
if (!$block_properties) { |
| 40 |
update_option('tableberg_block_properties', Utils::default_block_properties()); |
| 41 |
} |
| 42 |
|
| 43 |
update_option('tableberg_version', Constants::plugin_version()); |
| 44 |
|
| 45 |
update_option('tableberg_installDate', date('Y-m-d h:i:s')); |
| 46 |
add_option('tableberg_review_notify', 'no'); |
| 47 |
} |
| 48 |
} |
| 49 |
|