PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.2
YayMail – WooCommerce Email Customizer v3.2.2
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
yaymail / yaymail.php

yaymail.php in YayMail – WooCommerce Email Customizer 3.2.2, at yaymail.php

110 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: YayMail - WooCommerce Email Customizer
4 * Plugin URI: https://yaycommerce.com/yaymail-woocommerce-email-customizer/
5 * Description: Create awesome transactional emails with a drag and drop email builder
6 * Version: 3.2.2
7 * Author: YayCommerce
8 * Author URI: https://yaycommerce.com
9 * Text Domain: yaymail
10 * WC requires at least: 3.0.0
11 * WC tested up to: 7.3.0
12 * Domain Path: /i18n/languages/
13 */
14
15 namespace YayMail;
16
17 use YayMail\License\LicenseHandler;
18
19 defined( 'ABSPATH' ) || exit;
20
21 if ( function_exists( 'YayMail\\init' ) ) {
22 require_once plugin_dir_path( __FILE__ ) . 'includes/Fallback.php';
23 add_action(
24 'admin_init',
25 function() {
26 deactivate_plugins( plugin_basename( __FILE__ ) );
27 }
28 );
29 return;
30 }
31
32 if ( ! defined( 'YAYMAIL_PREFIX' ) ) {
33 define( 'YAYMAIL_PREFIX', 'yaymail' );
34 }
35
36 if ( ! defined( 'YAYMAIL_DEBUG' ) ) {
37 define( 'YAYMAIL_DEBUG', false );
38 }
39
40 if ( ! defined( 'YAYMAIL_VERSION' ) ) {
41 define( 'YAYMAIL_VERSION', '3.2.2' );
42 }
43
44 if ( ! defined( 'YAYMAIL_PLUGIN_URL' ) ) {
45 define( 'YAYMAIL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
46 }
47
48 if ( ! defined( 'YAYMAIL_PLUGIN_PATH' ) ) {
49 define( 'YAYMAIL_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
50 }
51
52 if ( ! defined( 'YAYMAIL_PLUGIN_BASENAME' ) ) {
53 define( 'YAYMAIL_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
54 }
55
56 spl_autoload_register(
57 function ( $class ) {
58 $prefix = __NAMESPACE__;
59 $base_dir = __DIR__ . '/includes';
60
61 $len = strlen( $prefix );
62 if ( strncmp( $prefix, $class, $len ) !== 0 ) {
63 return;
64 }
65
66 $relative_class_name = substr( $class, $len );
67
68 $file = $base_dir . str_replace( '\\', '/', $relative_class_name ) . '.php';
69
70 if ( file_exists( $file ) ) {
71 require $file;
72 }
73 }
74 );
75
76 if ( ! function_exists( 'install_yaymail_admin_notice' ) ) {
77 function install_yaymail_admin_notice() {
78 ?>
79 <div class="error">
80 <p>
81 <?php
82 // translators: %s: search WooCommerce plugin link
83 printf( 'YayMail ' . esc_html__( 'is enabled but not effective. It requires %1$sWooCommerce%2$s in order to work.', 'yaymail' ), '<a href="' . esc_url( admin_url( 'plugin-install.php?s=woocommerce&tab=search&type=term' ) ) . '">', '</a>' );
84 ?>
85 </p>
86 </div>
87 <?php
88 }
89 }
90
91 if ( ! function_exists( 'YayMail\\init' ) ) {
92 function init() {
93 if ( ! function_exists( 'WC' ) ) {
94 add_action( 'admin_notices', 'YayMail\\install_yaymail_admin_notice' );
95 }
96 $LicenseHandler = LicenseHandler::get_instance();
97
98 Plugin::getInstance();
99 I18n::getInstance();
100 Page\Settings::getInstance();
101 MailBuilder\WooTemplate::getInstance();
102 MailBuilder\YaymailElement::getInstance();
103 }
104 }
105
106 add_action( 'plugins_loaded', 'YayMail\\init' );
107
108 register_activation_hook( __FILE__, array( 'YayMail\\Plugin', 'activate' ) );
109 register_deactivation_hook( __FILE__, array( 'YayMail\\Plugin', 'deactivate' ) );
110