57 lines
2.7 KiB
PHP
57 lines
2.7 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Interweb Mozambique E-mail Center
|
|
* Description: Sends the site emails through E-mail Center, with a fallback to the normal sending. Adds newsletter sign-up forms with double confirmation and WooCommerce order emails. Uses only the public API, with your key.
|
|
* Version: 1.0.1
|
|
* Requires at least: 6.0
|
|
* Requires PHP: 7.4
|
|
* Plugin URI: https://git.interweb.co.mz/interweb-mz/wordpress-email-center-plugin
|
|
* Author: Interweb Mozambique
|
|
* Author URI: https://www.interweb.co.mz
|
|
* License: MIT
|
|
* License URI: https://opensource.org/licenses/MIT
|
|
* Text Domain: interweb-mz-email-center
|
|
* Domain Path: /languages
|
|
* WC requires at least: 7.0
|
|
* WC tested up to: 11.3
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
define('INTERWEB_MZ_EMAIL_CENTER_VERSION', '1.0.1');
|
|
define('INTERWEB_MZ_EMAIL_CENTER_FILE', __FILE__);
|
|
define('INTERWEB_MZ_EMAIL_CENTER_DIR', plugin_dir_path(__FILE__));
|
|
define('INTERWEB_MZ_EMAIL_CENTER_URL', plugin_dir_url(__FILE__));
|
|
define('INTERWEB_MZ_EMAIL_CENTER_SLUG', 'interweb-mz-email-center');
|
|
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-i18n.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-brands.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-crypto.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-settings.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-api.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-log.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-mailer.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-subscribe.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-woo.php';
|
|
require_once INTERWEB_MZ_EMAIL_CENTER_DIR . 'includes/class-admin.php';
|
|
|
|
register_activation_hook(__FILE__, array('INTERWEB_MZ_EMAIL_CENTER_Subscribe', 'install'));
|
|
register_deactivation_hook(__FILE__, array('INTERWEB_MZ_EMAIL_CENTER_Subscribe', 'deactivate'));
|
|
|
|
// WooCommerce: this plugin works with the order tables (HPOS) and with the cart and checkout blocks.
|
|
add_action('before_woocommerce_init', function () {
|
|
if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) {
|
|
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', INTERWEB_MZ_EMAIL_CENTER_FILE, true);
|
|
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('cart_checkout_blocks', INTERWEB_MZ_EMAIL_CENTER_FILE, true);
|
|
}
|
|
});
|
|
|
|
INTERWEB_MZ_EMAIL_CENTER_I18n::init();
|
|
INTERWEB_MZ_EMAIL_CENTER_Mailer::init();
|
|
INTERWEB_MZ_EMAIL_CENTER_Subscribe::init();
|
|
INTERWEB_MZ_EMAIL_CENTER_Woo::init();
|
|
if (is_admin()) {
|
|
INTERWEB_MZ_EMAIL_CENTER_Admin::init();
|
|
}
|