PluginProbe
MailerLite – WooCommerce integration / 3.1.27
MailerLite – WooCommerce integration v3.1.27
3.1.27 3.1.25 3.1.26 3.1.24 3.1.23 3.1.22 3.1.21 3.1.20 3.1.19 3.1.18 3.1.17 3.1.16 3.1.15 1.8.7 1.8.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 All 148 releases
woo-mailerlite / includes / WooMailerLiteActivator.php

WooMailerLiteActivator.php in MailerLite – WooCommerce integration 3.1.27, at includes/WooMailerLiteActivator.php

40 lines 979 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fired during plugin activation.
4 *
5 * This class defines all code necessary to run during the plugin's activation.
6 *
7 * @since 1.0.0
8 * @package WooMailerlite
9 */
10 class WooMailerLiteActivator {
11
12 /**
13 * Short Description. (use period)
14 *
15 * Long Description.
16 *
17 * @since 1.0.0
18 */
19 public static function activate()
20 {
21 WooMailerLiteMigration::migrate();
22 WooMailerLiteOptions::update('initial_sync', false);
23
24 if (WooMailerLiteOptions::get('shopId')) {
25 try {
26 WooMailerLiteApi::client()->toggleShop(home_url(), 1);
27 } catch (Throwable $th) {
28 WooMailerLiteLog()->error('WooMailerLiteActivator::activate toggleShop failed', [
29 'error' => $th->getMessage(),
30 ]);
31 }
32 }
33 }
34
35 public static function deactivate()
36 {
37 update_option('woo_mailerlite', ['activated' => false]);
38 }
39 }
40