PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.5
YayMail – WooCommerce Email Customizer v4.4.5
4.4.6 4.4.5 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 All 57 releases
← All changes | yaymail.php +29 -13 4.4.2 → 4.4.5 View file →
@@ -2,9 +2,9 @@
2 2 /**
3 3 * Plugin Name: YayMail - WooCommerce Email Customizer
4 4 * Plugin URI: https://yaycommerce.com/yaymail-woocommerce-email-customizer/
5 5 * Description: Create awesome transactional emails with a drag and drop email builder
6 - * Version: 4.4.2
6 + * Version: 4.4.5
7 7 * Author: YayCommerce
8 8 * Author URI: https://yaycommerce.com
9 9 * License: GPLv2 or later
10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -9,12 +9,12 @@
9 9 * License: GPLv2 or later
10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11 11 * Text Domain: yaymail
12 12 * Requires at least: 4.7
13 - * Tested up to: 7.0
13 + * Tested up to: 7.1
14 14 * Requires PHP: 5.4
15 15 * WC requires at least: 3.0.0
16 - * WC tested up to: 10.7.0
16 + * WC tested up to: 11.1.2
17 17 * Domain Path: /i18n/languages/
18 18 *
19 19 * @package YayMail
20 20 */
@@ -31,9 +31,9 @@
31 31 define( 'YAYMAIL_DEBUG', false );
32 32 }
33 33
34 34 if ( ! defined( 'YAYMAIL_VERSION' ) ) {
35 - define( 'YAYMAIL_VERSION', '4.4.2' );
35 + define( 'YAYMAIL_VERSION', '4.4.5' );
36 36 }
37 37
38 38 if ( ! defined( 'YAYMAIL_PLUGIN_URL' ) ) {
39 39 define( 'YAYMAIL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -58,8 +58,14 @@
58 58 if ( ! defined( 'YAYMAIL_MENU_PRIORITY' ) ) {
59 59 define( 'YAYMAIL_MENU_PRIORITY', 100 );
60 60 }
61 61
62 +// Lite customizer JS expects a single { global_header_elements, global_footer_elements }
63 +// object, not the multi-language array used by pro. SettingsPage gates on this flag.
64 +if ( ! defined( 'YAYMAIL_LITE_LEGACY_GHF_SHAPE' ) ) {
65 + define( 'YAYMAIL_LITE_LEGACY_GHF_SHAPE', true );
66 +}
67 +
62 68 $yaymail_has_required_deps = true;
63 69 if ( function_exists( 'YayMail\\init' ) ) {
64 70 require_once plugin_dir_path( __FILE__ ) . 'templates/fallbacks/fallback-exists.php';
65 71 $yaymail_has_required_deps = false;
@@ -106,13 +112,13 @@
106 112 // Check if yay-wp-pro active
107 113 if ( ! function_exists( 'is_plugin_active' ) ) {
108 114 require_once ABSPATH . 'wp-admin/includes/plugin.php';
109 115 }
110 - $yaymail_wp_pro_plugin_file = 'yay-wp-email-customizer-pro/yay-wp-email-customizer.php';
116 + $yaymail_wp_pro_plugin_file = 'yaymagic-email-builder-pro/yaymagic-email-builder.php';
111 117 $yaymail_wp_pro_active = is_plugin_active( $yaymail_wp_pro_plugin_file ) || is_plugin_active_for_network( $yaymail_wp_pro_plugin_file );
112 118
113 - if ( $yaymail_wp_pro_active ) {
114 - $core_file = YAYMAIL_WP_PLUGIN_PATH . 'src/' . $relative_path;
119 + if ( $yaymail_wp_pro_active && defined( 'YAYWP_PLUGIN_PATH' ) ) {
120 + $core_file = YAYWP_PLUGIN_PATH . 'src/' . $relative_path;
115 121 }
116 122
117 123 if ( file_exists( $core_file ) ) {
118 124 require $core_file;
@@ -120,13 +126,18 @@
120 126 },
121 127 true,
122 128 true
123 129 );
130 +
131 +// Declare this platform so shared core reads platform-specific values from the
132 +// registry instead of detecting the platform inline. Registered after the core
133 +// autoloader above so PlatformRegistry/PlatformInterface resolve, and before Initialize.
134 +\YayMail\Platform\PlatformRegistry::register( new \YayMail\Platform\YaymailPlatform() );
135 +
124 136 /**
125 137 * Initialize constants
126 138 */
127 139 Constants\ConstantsHandler::get_instance();
128 -// Notices\NoticeWPMail::get_instance();
129 140
130 141 if ( ! function_exists( 'install_yaymail_admin_notice' ) ) {
131 142 function install_yaymail_admin_notice() {
132 143 ?>
@@ -134,12 +145,12 @@
134 145 <p>
135 146 <?php
136 147 // translators: %s: search WooCommerce plugin link
137 148 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>' );
138 - ?>
149 + ?>
139 150 </p>
140 151 </div>
141 -<?php
152 + <?php
142 153 }
143 154 }
144 155
145 156 if ( ! function_exists( 'YayMail\\init' ) ) {
@@ -163,11 +174,16 @@
163 174 function yaymail_enable_compatible_hpos() {
164 175 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
165 176 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
166 177
167 - // Set compatible for addon
168 - $plugins = get_plugins();
169 - foreach ( array_keys( $plugins ) as $key ) {
178 + // Set compatible for active addons. Read the active-plugin options instead of
179 + // scanning the plugin directory: this hook fires on every request and that scans and
180 + // parses every plugin header on disk.
181 + $active_plugins = array_merge(
182 + (array) get_option( 'active_plugins', [] ),
183 + array_keys( (array) get_site_option( 'active_sitewide_plugins', [] ) )
184 + );
185 + foreach ( $active_plugins as $key ) {
170 186 $is_yaymail_addon = strpos( $key, 'yaymail-addon' ) !== false || strpos( $key, 'email-customizer' ) !== false;
171 187 if ( $is_yaymail_addon ) {
172 188 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', $key, true );
173 189 }