PluginProbe
MailerLite – WooCommerce integration / 3.1.19
MailerLite – WooCommerce integration v3.1.19
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 2.1.0 All 147 releases
woo-mailerlite / woo-mailerlite.php

woo-mailerlite.php in MailerLite – WooCommerce integration 3.1.19, at woo-mailerlite.php

104 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The plugin bootstrap file
5 *
6 * This file is read by WordPress to generate the plugin information in the plugin
7 * admin area. This file also includes all of the dependencies used by the plugin,
8 * registers the activation and deactivation functions, and defines a function
9 * that starts the plugin.
10 *
11 * @since 1.0.0
12 * @package woo-mailerlite
13 *
14 * @wordpress-plugin
15 * Plugin Name: MailerLite - WooCommerce integration
16 * Plugin URI: https://mailerlite.com
17 * Description: Official MailerLite integration for WooCommerce. Track sales and campaign ROI, import products details, automate emails based on purchases and seamlessly add your customers to your email marketing lists via WooCommerce's checkout process.
18 * Version: 3.1.19
19 * Author: MailerLite
20 * Author URI: https://mailerlite.com
21 * License: GPL-2.0+
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23 * Requires Plugins: woocommerce
24 * Text Domain: woo-mailerlite
25 * Domain Path: /languages
26 */
27
28
29 if ( ! defined( 'WPINC' ) ) {
30 die;
31 }
32
33 if (!isset($woo_mailerlite_autoload) || $woo_mailerlite_autoload === false) {
34 include_once __DIR__ . "/bootstrap.php";
35 }
36
37 /**
38 * Currently plugin version.
39 * Start at version 1.0.0 and use SemVer - https://semver.org
40 * Update when you release new versions.
41 */
42 define( 'WOO_MAILERLITE_VERSION', '3.1.19' );
43
44 define('WOO_MAILERLITE_ASYNC_JOBS', false);
45
46 define('WOO_MAILERLITE_DIR', plugin_dir_path(__FILE__));
47
48 /**
49 * The code that runs during plugin activation.
50 * This action is documented in includes/class-woo-mailerlite-activator.php
51 */
52 register_activation_hook( __FILE__, 'activate_woo_mailerlite');
53
54 /**
55 * The code that runs during plugin deactivation.
56 * This action is documented in includes/class-woo-mailerlite-deactivator.php
57 */
58 register_deactivation_hook( __FILE__, 'deactivate_woo_mailerlite' );
59
60 /**
61 * The main function responsible for returning the one true WooMailerLite
62 * instance to functions everywhere
63 * @return WooMailerLite The one true WooMailerLite
64 *
65 * @since 1.0.0
66 */
67 add_action('plugins_loaded', 'run_woo_mailerlite', 12);
68 add_action('woocommerce_blocks_loaded', function () {
69 if (class_exists('\Automattic\WooCommerce\Blocks\Package') &&
70 interface_exists('\Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface')) {
71 add_action(
72 'woocommerce_blocks_checkout_block_registration',
73 function ($integration_registry) {
74 try {
75 $integration_registry->register(new WooMailerLiteBlocksIntegration());
76 } catch (Exception $e) {
77 WooMailerLiteLog()->error('woocommerce_blocks_loaded', ['error' => $e->getMessage(), 'trace' => $e->getTraceAsString()]);
78 }
79 }
80 );
81
82 add_filter(
83 '__experimental_woocommerce_blocks_add_data_attributes_to_block',
84 function ($allowed_blocks) {
85 $allowed_blocks[] = 'mailerlite-block/woo-mailerlite';
86
87 return $allowed_blocks;
88 },
89 );
90 }
91 });
92 add_action( 'before_woocommerce_init', function() {
93 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
94 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
95 }
96 });
97
98 add_filter('auto_update_plugin', function ($update, $item) {
99 if (isset($item->plugin) && $item->plugin === 'woo-mailerlite/woo-mailerlite.php') {
100 return WooMailerLiteOptions::get('settings.autoUpdatePlugin');
101 }
102 return $update;
103 }, 10, 2);
104