Version Description
Download this release
Release Info
Developer | constantcontact |
Plugin | Creative Mail – Easier WordPress & WooCommerce Email Marketing |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.2.3
- CHANGELOG.md +4 -0
- README.md +4 -19
- assets/js/feedback_notice.js +13 -5
- creative-mail-plugin.php +4 -3
- readme.txt +4 -19
- src/helpers/OptionsHelper.php +23 -0
- src/managers/AdminManager.php +3 -1
- src/managers/ApiManager.php +20 -5
- src/modules/FeedbackNoticeModule.php +16 -2
- src/modules/contacts/Handlers/BaseContactFormPluginHandler.php +0 -5
- src/modules/contacts/Handlers/CalderaPluginHandler.php +3 -3
- src/modules/contacts/Handlers/ContactFormSevenPluginHandler.php +8 -8
- src/modules/contacts/Handlers/ElementorPluginHandler.php +3 -3
- src/modules/contacts/Handlers/GravityFormsPluginHandler.php +4 -4
- src/modules/contacts/Handlers/JetpackPluginHandler.php +15 -6
- src/modules/contacts/Handlers/NewsLetterContactFormPluginHandler.php +7 -7
- src/modules/contacts/Handlers/NinjaFormsPluginHandler.php +6 -6
- src/modules/contacts/Handlers/WooCommercePluginHandler.php +9 -7
- src/modules/contacts/Handlers/WpFormsPluginHandler.php +3 -3
- src/views/admin-feedback-notice/few-contacts.php +1 -1
- src/views/admin-feedback-notice/many-contacts.php +1 -1
- src/views/admin-feedback-notice/sync-disabled.php +1 -1
- src/views/admin-get-started-banner.php +1 -0
- src/views/settings.php +5 -3
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
Changelog
|
2 |
=========
|
3 |
|
|
|
|
|
|
|
|
|
4 |
#### 1.2.2 - November 12 2020
|
5 |
- Introduction of multi step automations.
|
6 |
- Fixes a couple of small issues in the CreativeMail widgets.
|
1 |
Changelog
|
2 |
=========
|
3 |
|
4 |
+
#### 1.2.3 - December 7 2020
|
5 |
+
- Fixes an issue where the banner would show up again after being dismissed.
|
6 |
+
- Support WordPress 5.6
|
7 |
+
|
8 |
#### 1.2.2 - November 12 2020
|
9 |
- Introduction of multi step automations.
|
10 |
- Fixes a couple of small issues in the CreativeMail widgets.
|
README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: Constant Contact
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
@@ -88,22 +88,7 @@ Creative Mail by Constant Contact [Privacy Notice](https://www.endurance.com/pri
|
|
88 |
6. Enhance your brand with logomaker
|
89 |
|
90 |
== Changelog ==
|
|
|
91 |
* 1.2.2 - Introduction of multi step automations and fixes a couple of small issues in the CreativeMail widgets
|
92 |
* 1.2.1 - Fixes an issue where some users would experience an issue where our UI was blocked by pop-up blockers.
|
93 |
-
* 1.2.0 - Context aware notifications, add support for Ninja forms, add support for Caldera forms
|
94 |
-
* 1.1.10 - Fixes an issue where some WooCommerce Notification emails might not be delivered.
|
95 |
-
* 1.1.9 - Fixes an issue that would not allow you to open the dashboard again after you opened it once.
|
96 |
-
* 1.1.8 - Fixes an issue that could cause a crash for some users.
|
97 |
-
* 1.1.7 - Add support for Elementor forms.
|
98 |
-
* 1.1.6 - Add option to refresh the SSO url without reloading the entire page, and add the support for opt-in checkbox in the WooCommerce checkout flow.
|
99 |
-
* 1.1.5 - Fixes an issue where order notification emails would not always go out.
|
100 |
-
* 1.1.4 - Minor improvements
|
101 |
-
* 1.1.3 - Implemented a new design
|
102 |
-
* 1.1.2 - Add support for beta versions of Jetpack
|
103 |
-
* 1.1.1 - Fixes a bug that would cache API responses
|
104 |
-
* 1.1.0 - Added support for WooCommerce emails, WPFormsLite and JetPack Forms
|
105 |
-
* 1.0.4 - Added compatibility with PHP 5.6
|
106 |
-
* 1.0.3 - Small fixes in the plugin readme.
|
107 |
-
* 1.0.2 - Small fixes in the plugin readme.
|
108 |
-
* 1.0.1 - Fixes an issue where the "Let's get started" button needed to be clicked twice in some cases.
|
109 |
-
* 1.0.0 - Initial version of the plugin
|
2 |
Contributors: Constant Contact
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
+
Tested up to: 5.6
|
6 |
+
Stable tag: 1.2.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
88 |
6. Enhance your brand with logomaker
|
89 |
|
90 |
== Changelog ==
|
91 |
+
* 1.2.3 - Fixes an issue where the banner would show up again after being dismissed.
|
92 |
* 1.2.2 - Introduction of multi step automations and fixes a couple of small issues in the CreativeMail widgets
|
93 |
* 1.2.1 - Fixes an issue where some users would experience an issue where our UI was blocked by pop-up blockers.
|
94 |
+
* 1.2.0 - Context aware notifications, add support for Ninja forms, add support for Caldera forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/feedback_notice.js
CHANGED
@@ -5,17 +5,25 @@
|
|
5 |
*/
|
6 |
jQuery(function($){
|
7 |
|
8 |
-
function hideAdminFeedbackNotice () {
|
9 |
-
document.querySelector('#ce4wp-admin-feedback-notice').hidden = true;
|
10 |
-
}
|
11 |
-
|
12 |
window.addEventListener('load', () => {
|
13 |
const parent = document.getElementById('wpbody-content')
|
14 |
const screenMetaLinks = document.getElementById('screen-meta-links')
|
15 |
|
16 |
const notice = document.getElementById('ce4wp-admin-feedback-notice')
|
|
|
|
|
|
|
|
|
|
|
17 |
parent.insertBefore(notice, screenMetaLinks.nextSibling)
|
18 |
notice.hidden = false
|
19 |
});
|
20 |
|
21 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
*/
|
6 |
jQuery(function($){
|
7 |
|
|
|
|
|
|
|
|
|
8 |
window.addEventListener('load', () => {
|
9 |
const parent = document.getElementById('wpbody-content')
|
10 |
const screenMetaLinks = document.getElementById('screen-meta-links')
|
11 |
|
12 |
const notice = document.getElementById('ce4wp-admin-feedback-notice')
|
13 |
+
|
14 |
+
if ([parent, screenMetaLinks, notice].some(element => element == null)) {
|
15 |
+
return
|
16 |
+
}
|
17 |
+
|
18 |
parent.insertBefore(notice, screenMetaLinks.nextSibling)
|
19 |
notice.hidden = false
|
20 |
});
|
21 |
|
22 |
+
});
|
23 |
+
|
24 |
+
function hideAdminFeedbackNotice (banner) {
|
25 |
+
document.querySelector('#ce4wp-admin-feedback-notice').hidden = true
|
26 |
+
|
27 |
+
const { hide_banner_url } = ce4wp_data
|
28 |
+
fetch(`${hide_banner_url}${banner}`, { method: 'POST' })
|
29 |
+
}
|
creative-mail-plugin.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
|
10 |
* Description: Free email marketing designed specifically for WordPress, Jetpack and WooCommerce. Send newsletters, promotions, updates and transactional e-commerce emails. Simple and easy, powered by Constant Contact’s rock solid reliability.
|
11 |
* Author: Constant Contact
|
12 |
-
* Version: 1.2.
|
13 |
* Author URI: https://www.constantcontact.com
|
14 |
*/
|
15 |
use CreativeMail\CreativeMail;
|
@@ -24,7 +24,7 @@ function _load_ce4wp_plugin()
|
|
24 |
define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
|
25 |
define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
|
26 |
define('CE4WP_PLUGIN_FILE', __FILE__);
|
27 |
-
define('CE4WP_PLUGIN_VERSION', '1.2.
|
28 |
define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
|
29 |
define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
|
30 |
define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
|
@@ -41,11 +41,12 @@ function _load_ce4wp_plugin()
|
|
41 |
define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
|
42 |
define('CE4WP_APP_URL', 'https://app.creativemail.com/');
|
43 |
define('CE4WP_ENVIRONMENT', 'PRODUCTION');
|
44 |
-
define('CE4WP_BUILD_NUMBER', '
|
45 |
define('CE4WP_BATCH_SIZE', 500);
|
46 |
define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
|
47 |
define('CE4WP_WC_API_CONSUMER_KEY', 'ce4wp_woocommerce_consumer_key');
|
48 |
define('CE4WP_REFERRED_BY', 'ce4wp_referred_by');
|
|
|
49 |
|
50 |
// Load all the required files
|
51 |
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
9 |
* Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
|
10 |
* Description: Free email marketing designed specifically for WordPress, Jetpack and WooCommerce. Send newsletters, promotions, updates and transactional e-commerce emails. Simple and easy, powered by Constant Contact’s rock solid reliability.
|
11 |
* Author: Constant Contact
|
12 |
+
* Version: 1.2.3
|
13 |
* Author URI: https://www.constantcontact.com
|
14 |
*/
|
15 |
use CreativeMail\CreativeMail;
|
24 |
define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
|
25 |
define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
|
26 |
define('CE4WP_PLUGIN_FILE', __FILE__);
|
27 |
+
define('CE4WP_PLUGIN_VERSION', '1.2.3');
|
28 |
define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
|
29 |
define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
|
30 |
define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
|
41 |
define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
|
42 |
define('CE4WP_APP_URL', 'https://app.creativemail.com/');
|
43 |
define('CE4WP_ENVIRONMENT', 'PRODUCTION');
|
44 |
+
define('CE4WP_BUILD_NUMBER', '847');
|
45 |
define('CE4WP_BATCH_SIZE', 500);
|
46 |
define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
|
47 |
define('CE4WP_WC_API_CONSUMER_KEY', 'ce4wp_woocommerce_consumer_key');
|
48 |
define('CE4WP_REFERRED_BY', 'ce4wp_referred_by');
|
49 |
+
define('CE4WP_HIDE_BANNER', 'ce4wp_hide_banner');
|
50 |
|
51 |
// Load all the required files
|
52 |
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: Constant Contact
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
@@ -93,22 +93,7 @@ Creative Mail by Constant Contact [Privacy Notice](https://www.endurance.com/pri
|
|
93 |
6. Enhance your brand with logomaker
|
94 |
|
95 |
== Changelog ==
|
|
|
96 |
* 1.2.2 - Introduction of multi step automations and fixes a couple of small issues in the CreativeMail widgets
|
97 |
* 1.2.1 - Fixes an issue where some users would experience an issue where our UI was blocked by pop-up blockers.
|
98 |
-
* 1.2.0 - Context aware notifications, add support for Ninja forms, add support for Caldera forms
|
99 |
-
* 1.1.10 - Fixes an issue where some WooCommerce Notification emails might not be delivered.
|
100 |
-
* 1.1.9 - Fixes an issue that would not allow you to open the dashboard again after you opened it once.
|
101 |
-
* 1.1.8 - Fixes an issue that could cause a crash for some users.
|
102 |
-
* 1.1.7 - Add support for Elementor forms.
|
103 |
-
* 1.1.6 - Add option to refresh the SSO url without reloading the entire page, and add the support for opt-in checkbox in the WooCommerce checkout flow.
|
104 |
-
* 1.1.5 - Fixes an issue where order notification emails would not always go out.
|
105 |
-
* 1.1.4 - Minor improvements
|
106 |
-
* 1.1.3 - Implemented a new design
|
107 |
-
* 1.1.2 - Add support for beta versions of Jetpack
|
108 |
-
* 1.1.1 - Fixes a bug that would cache API responses
|
109 |
-
* 1.1.0 - Added support for WooCommerce emails, WPFormsLite and JetPack Forms
|
110 |
-
* 1.0.4 - Added compatibility with PHP 5.6
|
111 |
-
* 1.0.3 - Small fixes in the plugin readme.
|
112 |
-
* 1.0.2 - Small fixes in the plugin readme.
|
113 |
-
* 1.0.1 - Fixes an issue where the "Let's get started" button needed to be clicked twice in some cases.
|
114 |
-
* 1.0.0 - Initial version of the plugin
|
2 |
Contributors: Constant Contact
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
+
Tested up to: 5.6
|
6 |
+
Stable tag: 1.2.3
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
93 |
6. Enhance your brand with logomaker
|
94 |
|
95 |
== Changelog ==
|
96 |
+
* 1.2.3 - Fixes an issue where the banner would show up again after being dismissed.
|
97 |
* 1.2.2 - Introduction of multi step automations and fixes a couple of small issues in the CreativeMail widgets
|
98 |
* 1.2.1 - Fixes an issue where some users would experience an issue where our UI was blocked by pop-up blockers.
|
99 |
+
* 1.2.0 - Context aware notifications, add support for Ninja forms, add support for Caldera forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/helpers/OptionsHelper.php
CHANGED
@@ -353,6 +353,29 @@ class OptionsHelper
|
|
353 |
return get_option(CE4WP_REFERRED_BY, null);
|
354 |
}
|
355 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
/**
|
357 |
* Will clear all the registered options for this plugin.
|
358 |
* Only the Unique Id won't be cleared so that we can restore the link when the plugin is reactivated.
|
353 |
return get_option(CE4WP_REFERRED_BY, null);
|
354 |
}
|
355 |
|
356 |
+
/**
|
357 |
+
* Gets the hide banner option for the given banner.
|
358 |
+
*
|
359 |
+
* @param $banner string
|
360 |
+
*
|
361 |
+
* @return bool
|
362 |
+
*/
|
363 |
+
public static function get_hide_banner($banner)
|
364 |
+
{
|
365 |
+
return get_option(CE4WP_HIDE_BANNER . ':' . $banner, false);
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* Sets the hide banner option for the given banner.
|
370 |
+
*
|
371 |
+
* @param $banner string
|
372 |
+
* @param $hide bool
|
373 |
+
*/
|
374 |
+
public static function set_hide_banner($banner, $hide = true)
|
375 |
+
{
|
376 |
+
update_option(CE4WP_HIDE_BANNER . ':' . $banner, $hide);
|
377 |
+
}
|
378 |
+
|
379 |
/**
|
380 |
* Will clear all the registered options for this plugin.
|
381 |
* Only the Unique Id won't be cleared so that we can restore the link when the plugin is reactivated.
|
src/managers/AdminManager.php
CHANGED
@@ -403,9 +403,11 @@ class AdminManager
|
|
403 |
public function add_admin_get_started_banner()
|
404 |
{
|
405 |
$ce_has_account = OptionsHelper::get_instance_id() != null;
|
|
|
406 |
|
407 |
global $pagenow;
|
408 |
-
if ( $pagenow == 'plugins.php' && !$ce_has_account ) {
|
|
|
409 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-get-started-banner.php';
|
410 |
}
|
411 |
}
|
403 |
public function add_admin_get_started_banner()
|
404 |
{
|
405 |
$ce_has_account = OptionsHelper::get_instance_id() != null;
|
406 |
+
$ce_hide_banner = OptionsHelper::get_hide_banner('get_started');
|
407 |
|
408 |
global $pagenow;
|
409 |
+
if ( $pagenow == 'plugins.php' && !$ce_has_account && !$ce_hide_banner ) {
|
410 |
+
$ce_hide_banner_url = get_rest_url( null, 'creativemail/v1/hide_banner?banner=get_started' );
|
411 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-get-started-banner.php';
|
412 |
}
|
413 |
}
|
src/managers/ApiManager.php
CHANGED
@@ -6,13 +6,12 @@ namespace CreativeMail\Managers;
|
|
6 |
use CreativeMail\CreativeMail;
|
7 |
use CreativeMail\Helpers\OptionsHelper;
|
8 |
use CreativeMail\Modules\Api\Processes\ApiBackgroundProcess;
|
9 |
-
use CreativeMail\Modules\
|
10 |
-
use CreativeMail\Modules\WooCommerce\Models\WCInformationModel;
|
11 |
use CreativeMail\Modules\Blog\Models\BlogInformation;
|
12 |
use CreativeMail\Modules\Blog\Models\BlogPost;
|
13 |
-
use CreativeMail\Modules\
|
|
|
14 |
use WP_Error;
|
15 |
-
use WP_REST_Request;
|
16 |
use WP_REST_Response;
|
17 |
|
18 |
/**
|
@@ -267,7 +266,23 @@ class ApiManager
|
|
267 |
|
268 |
return $this->modify_response(new WP_REST_Response($attachmentData, 200));
|
269 |
}
|
270 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
);
|
272 |
|
273 |
foreach ($routes as $route) {
|
6 |
use CreativeMail\CreativeMail;
|
7 |
use CreativeMail\Helpers\OptionsHelper;
|
8 |
use CreativeMail\Modules\Api\Processes\ApiBackgroundProcess;
|
9 |
+
use CreativeMail\Modules\Blog\Models\BlogAttachment;
|
|
|
10 |
use CreativeMail\Modules\Blog\Models\BlogInformation;
|
11 |
use CreativeMail\Modules\Blog\Models\BlogPost;
|
12 |
+
use CreativeMail\Modules\WooCommerce\Models\WCInformationModel;
|
13 |
+
use CreativeMail\Modules\WooCommerce\Models\WCProductModel;
|
14 |
use WP_Error;
|
|
|
15 |
use WP_REST_Response;
|
16 |
|
17 |
/**
|
266 |
|
267 |
return $this->modify_response(new WP_REST_Response($attachmentData, 200));
|
268 |
}
|
269 |
+
),
|
270 |
+
array (
|
271 |
+
self::ROUTE_PATH => '/hide_banner',
|
272 |
+
self::ROUTE_METHODS => 'POST',
|
273 |
+
self::ROUTE_CALLBACK => function ($request) {
|
274 |
+
$banner = $request->get_param('banner');
|
275 |
+
if (empty($banner)) {
|
276 |
+
return $this->modify_response(new WP_REST_Response('Missing banner param', 400));
|
277 |
+
}
|
278 |
+
|
279 |
+
OptionsHelper::set_hide_banner($banner, true);
|
280 |
+
return $this->modify_response(new WP_REST_Response(null, 204));
|
281 |
+
},
|
282 |
+
self::ROUTE_PERMISSION_CALLBACK => function () {
|
283 |
+
return true;
|
284 |
+
}
|
285 |
+
),
|
286 |
);
|
287 |
|
288 |
foreach ($routes as $route) {
|
src/modules/FeedbackNoticeModule.php
CHANGED
@@ -28,16 +28,22 @@ class FeedbackNoticeModule
|
|
28 |
|
29 |
wp_localize_script('ce4wp_feedback_notice', 'ce4wp_data', array(
|
30 |
'url' => $admin_url,
|
31 |
-
'nonce' => $nonce
|
|
|
32 |
));
|
33 |
wp_enqueue_script('ce4wp_dashboard', CE4WP_PLUGIN_URL.'assets/js/dashboard.js', null,CE4WP_PLUGIN_VERSION);
|
34 |
wp_localize_script('ce4wp_dashboard', 'ce4wp_data', array(
|
35 |
'url' => $admin_url,
|
36 |
-
'nonce' => $nonce
|
|
|
37 |
));
|
38 |
|
39 |
$ce_sync_enabled = $this->integration_manager->is_plugin_active('jetpack') || $this->integration_manager->is_plugin_active('jetpack-beta');
|
40 |
if ( !$ce_sync_enabled ) {
|
|
|
|
|
|
|
|
|
41 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/sync-disabled.php';
|
42 |
return;
|
43 |
}
|
@@ -47,8 +53,16 @@ class FeedbackNoticeModule
|
|
47 |
$ce_number_of_contacts = $contact_metrics['number_of_subscribed_contacts'];
|
48 |
|
49 |
if ( $ce_number_of_contacts < 10 ) {
|
|
|
|
|
|
|
|
|
50 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/few-contacts.php';
|
51 |
} else {
|
|
|
|
|
|
|
|
|
52 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/many-contacts.php';
|
53 |
}
|
54 |
} catch (Exception $exception) {}
|
28 |
|
29 |
wp_localize_script('ce4wp_feedback_notice', 'ce4wp_data', array(
|
30 |
'url' => $admin_url,
|
31 |
+
'nonce' => $nonce,
|
32 |
+
'hide_banner_url' => get_rest_url( null, 'creativemail/v1/hide_banner?banner=' ),
|
33 |
));
|
34 |
wp_enqueue_script('ce4wp_dashboard', CE4WP_PLUGIN_URL.'assets/js/dashboard.js', null,CE4WP_PLUGIN_VERSION);
|
35 |
wp_localize_script('ce4wp_dashboard', 'ce4wp_data', array(
|
36 |
'url' => $admin_url,
|
37 |
+
'nonce' => $nonce,
|
38 |
+
'hide_banner_url' => get_rest_url( null, 'creativemail/v1/hide_banner?banner=' ),
|
39 |
));
|
40 |
|
41 |
$ce_sync_enabled = $this->integration_manager->is_plugin_active('jetpack') || $this->integration_manager->is_plugin_active('jetpack-beta');
|
42 |
if ( !$ce_sync_enabled ) {
|
43 |
+
if (OptionsHelper::get_hide_banner('feedback_notice_sync_disabled')) {
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
|
47 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/sync-disabled.php';
|
48 |
return;
|
49 |
}
|
53 |
$ce_number_of_contacts = $contact_metrics['number_of_subscribed_contacts'];
|
54 |
|
55 |
if ( $ce_number_of_contacts < 10 ) {
|
56 |
+
if (OptionsHelper::get_hide_banner('feedback_notice_few_contacts')) {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
|
60 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/few-contacts.php';
|
61 |
} else {
|
62 |
+
if (OptionsHelper::get_hide_banner('feedback_notice_many_contacts')) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
include CE4WP_PLUGIN_DIR . 'src/views/admin-feedback-notice/many-contacts.php';
|
67 |
}
|
68 |
} catch (Exception $exception) {}
|
src/modules/contacts/Handlers/BaseContactFormPluginHandler.php
CHANGED
@@ -41,11 +41,6 @@ abstract class BaseContactFormPluginHandler
|
|
41 |
$this->contactSyncService->upsertContacts($models);
|
42 |
}
|
43 |
|
44 |
-
protected function isNotNullOrEmpty($value)
|
45 |
-
{
|
46 |
-
return isset($value) && !empty($value);
|
47 |
-
}
|
48 |
-
|
49 |
protected function isNullOrEmpty($value)
|
50 |
{
|
51 |
return !isset($value) && empty($value);
|
41 |
$this->contactSyncService->upsertContacts($models);
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
44 |
protected function isNullOrEmpty($value)
|
45 |
{
|
46 |
return !isset($value) && empty($value);
|
src/modules/contacts/Handlers/CalderaPluginHandler.php
CHANGED
@@ -59,10 +59,10 @@ class CalderaPluginHandler extends BaseContactFormPluginHandler
|
|
59 |
$contactModel->setOptActionBy(OptActionBy::Owner);
|
60 |
$contactModel->setEmail($email);
|
61 |
|
62 |
-
if (
|
63 |
$contactModel->setFirstName($contact->firstname);
|
64 |
}
|
65 |
-
if (
|
66 |
$contactModel->setLastName($contact->lastname);
|
67 |
}
|
68 |
|
@@ -131,7 +131,7 @@ class CalderaPluginHandler extends BaseContactFormPluginHandler
|
|
131 |
|
132 |
//Convert to contactModel
|
133 |
$contactModel = $this->convertToContactModel($contact);
|
134 |
-
if (
|
135 |
array_push($contactsArray, $contactModel);
|
136 |
}
|
137 |
|
59 |
$contactModel->setOptActionBy(OptActionBy::Owner);
|
60 |
$contactModel->setEmail($email);
|
61 |
|
62 |
+
if (!empty($contact->firstname)) {
|
63 |
$contactModel->setFirstName($contact->firstname);
|
64 |
}
|
65 |
+
if (!empty($contact->lastname)) {
|
66 |
$contactModel->setLastName($contact->lastname);
|
67 |
}
|
68 |
|
131 |
|
132 |
//Convert to contactModel
|
133 |
$contactModel = $this->convertToContactModel($contact);
|
134 |
+
if (!empty($contactModel)){
|
135 |
array_push($contactsArray, $contactModel);
|
136 |
}
|
137 |
|
src/modules/contacts/Handlers/ContactFormSevenPluginHandler.php
CHANGED
@@ -32,7 +32,7 @@ class ContactFormSevenPluginHandler extends BaseContactFormPluginHandler
|
|
32 |
foreach ($fieldOptions as $fieldOption) {
|
33 |
if (array_key_exists($fieldOption, $formData)) {
|
34 |
$value = $formData[$fieldOption];
|
35 |
-
if (
|
36 |
return $value;
|
37 |
}
|
38 |
}
|
@@ -48,17 +48,17 @@ class ContactFormSevenPluginHandler extends BaseContactFormPluginHandler
|
|
48 |
$contactModel = new ContactModel();
|
49 |
|
50 |
$email = $this->findValue($contactForm, $this->emailFields);
|
51 |
-
if (
|
52 |
$contactModel->setEmail($email);
|
53 |
}
|
54 |
|
55 |
$firstName = $this->findValue($contactForm, $this->firstnameFields);
|
56 |
-
if (
|
57 |
$contactModel->setFirstName($firstName);
|
58 |
}
|
59 |
|
60 |
$lastName = $this->findValue($contactForm, $this->lastnameFields);
|
61 |
-
if (
|
62 |
$contactModel->setLastName($lastName);
|
63 |
}
|
64 |
|
@@ -115,19 +115,19 @@ class ContactFormSevenPluginHandler extends BaseContactFormPluginHandler
|
|
115 |
$contactModel->setOptOut(false);
|
116 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
117 |
$email = $this->findValueFromDb($form_data, $this->emailFields);
|
118 |
-
if (
|
119 |
$contactModel->setEmail($email);
|
120 |
}
|
121 |
$firstname = $this->findValueFromDb($form_data, $this->firstnameFields);
|
122 |
-
if (
|
123 |
$contactModel->setFirstName($firstname);
|
124 |
}
|
125 |
$lastname = $this->findValueFromDb($form_data, $this->lastnameFields);
|
126 |
-
if (
|
127 |
$contactModel->setLastName($lastname);
|
128 |
}
|
129 |
|
130 |
-
if (
|
131 |
$contactModel->setEventType(CE4WP_CF7_EVENTTYPE);
|
132 |
array_push($contactsArray, $contactModel);
|
133 |
}
|
32 |
foreach ($fieldOptions as $fieldOption) {
|
33 |
if (array_key_exists($fieldOption, $formData)) {
|
34 |
$value = $formData[$fieldOption];
|
35 |
+
if (!empty($value)) {
|
36 |
return $value;
|
37 |
}
|
38 |
}
|
48 |
$contactModel = new ContactModel();
|
49 |
|
50 |
$email = $this->findValue($contactForm, $this->emailFields);
|
51 |
+
if (!empty($email)) {
|
52 |
$contactModel->setEmail($email);
|
53 |
}
|
54 |
|
55 |
$firstName = $this->findValue($contactForm, $this->firstnameFields);
|
56 |
+
if (!empty($firstName)) {
|
57 |
$contactModel->setFirstName($firstName);
|
58 |
}
|
59 |
|
60 |
$lastName = $this->findValue($contactForm, $this->lastnameFields);
|
61 |
+
if (!empty($lastName)) {
|
62 |
$contactModel->setLastName($lastName);
|
63 |
}
|
64 |
|
115 |
$contactModel->setOptOut(false);
|
116 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
117 |
$email = $this->findValueFromDb($form_data, $this->emailFields);
|
118 |
+
if (!empty($email)) {
|
119 |
$contactModel->setEmail($email);
|
120 |
}
|
121 |
$firstname = $this->findValueFromDb($form_data, $this->firstnameFields);
|
122 |
+
if (!empty($firstname)) {
|
123 |
$contactModel->setFirstName($firstname);
|
124 |
}
|
125 |
$lastname = $this->findValueFromDb($form_data, $this->lastnameFields);
|
126 |
+
if (!empty($lastname)) {
|
127 |
$contactModel->setLastName($lastname);
|
128 |
}
|
129 |
|
130 |
+
if (!empty($contactModel->getEmail())) {
|
131 |
$contactModel->setEventType(CE4WP_CF7_EVENTTYPE);
|
132 |
array_push($contactsArray, $contactModel);
|
133 |
}
|
src/modules/contacts/Handlers/ElementorPluginHandler.php
CHANGED
@@ -46,7 +46,7 @@ class ElementorPluginHandler extends BaseContactFormPluginHandler
|
|
46 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
47 |
|
48 |
$email = $contact->email;
|
49 |
-
if (
|
50 |
$contactModel->setEmail($email);
|
51 |
}
|
52 |
|
@@ -54,10 +54,10 @@ class ElementorPluginHandler extends BaseContactFormPluginHandler
|
|
54 |
$firstName = array_shift($values);
|
55 |
$lastName = implode(' ', $values);
|
56 |
|
57 |
-
if (
|
58 |
$contactModel->setFirstName($firstName);
|
59 |
}
|
60 |
-
if (
|
61 |
$contactModel->setLastName($lastName);
|
62 |
}
|
63 |
|
46 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
47 |
|
48 |
$email = $contact->email;
|
49 |
+
if (!empty($email)) {
|
50 |
$contactModel->setEmail($email);
|
51 |
}
|
52 |
|
54 |
$firstName = array_shift($values);
|
55 |
$lastName = implode(' ', $values);
|
56 |
|
57 |
+
if (!empty($firstName)) {
|
58 |
$contactModel->setFirstName($firstName);
|
59 |
}
|
60 |
+
if (!empty($lastName)) {
|
61 |
$contactModel->setLastName($lastName);
|
62 |
}
|
63 |
|
src/modules/contacts/Handlers/GravityFormsPluginHandler.php
CHANGED
@@ -22,7 +22,7 @@ class GravityFormsPluginHandler extends BaseContactFormPluginHandler
|
|
22 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
23 |
|
24 |
$email = $user->email;
|
25 |
-
if (
|
26 |
$contactModel->setEmail($email);
|
27 |
}
|
28 |
|
@@ -30,12 +30,12 @@ class GravityFormsPluginHandler extends BaseContactFormPluginHandler
|
|
30 |
$insertion = $user->name['insertion'];
|
31 |
$lastName = $user->name['lastName'];
|
32 |
|
33 |
-
if (
|
34 |
$contactModel->setFirstName($firstName);
|
35 |
}
|
36 |
|
37 |
-
if (
|
38 |
-
if (
|
39 |
$lastName = implode(' ', [$insertion, $lastName]);
|
40 |
}
|
41 |
$contactModel->setLastName($lastName);
|
22 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
23 |
|
24 |
$email = $user->email;
|
25 |
+
if (!empty($email)) {
|
26 |
$contactModel->setEmail($email);
|
27 |
}
|
28 |
|
30 |
$insertion = $user->name['insertion'];
|
31 |
$lastName = $user->name['lastName'];
|
32 |
|
33 |
+
if (!empty($firstName)) {
|
34 |
$contactModel->setFirstName($firstName);
|
35 |
}
|
36 |
|
37 |
+
if (!empty($lastName)) {
|
38 |
+
if (!empty($insertion)) {
|
39 |
$lastName = implode(' ', [$insertion, $lastName]);
|
40 |
}
|
41 |
$contactModel->setLastName($lastName);
|
src/modules/contacts/Handlers/JetpackPluginHandler.php
CHANGED
@@ -28,7 +28,7 @@ class JetpackPluginHandler extends BaseContactFormPluginHandler
|
|
28 |
}
|
29 |
|
30 |
$email = $contact->email;
|
31 |
-
if (
|
32 |
$contactModel->setEmail($email);
|
33 |
}
|
34 |
|
@@ -36,10 +36,10 @@ class JetpackPluginHandler extends BaseContactFormPluginHandler
|
|
36 |
$firstName = array_shift($values);
|
37 |
$lastName = implode(' ', $values);
|
38 |
|
39 |
-
if (
|
40 |
$contactModel->setFirstName($firstName);
|
41 |
}
|
42 |
-
if (
|
43 |
$contactModel->setLastName($lastName);
|
44 |
}
|
45 |
|
@@ -116,15 +116,24 @@ class JetpackPluginHandler extends BaseContactFormPluginHandler
|
|
116 |
foreach (parse_blocks($feedback->post_content) as $block) {
|
117 |
$feedbackHtml = $block['innerHTML'];
|
118 |
|
|
|
119 |
//extract name, email and consent from submission
|
120 |
preg_match($authorRegex, $feedbackHtml, $authorMatches);
|
121 |
-
$
|
|
|
|
|
122 |
|
|
|
123 |
preg_match($authorMailRegex, $feedbackHtml, $authorEmailMatches);
|
124 |
-
$
|
|
|
|
|
125 |
|
|
|
126 |
preg_match($consentRegex, $feedbackHtml, $consentMatches);
|
127 |
-
$
|
|
|
|
|
128 |
|
129 |
$contact = new \stdClass();
|
130 |
$contact->email = filter_var($authorEmail, FILTER_VALIDATE_EMAIL);
|
28 |
}
|
29 |
|
30 |
$email = $contact->email;
|
31 |
+
if (!empty($email)) {
|
32 |
$contactModel->setEmail($email);
|
33 |
}
|
34 |
|
36 |
$firstName = array_shift($values);
|
37 |
$lastName = implode(' ', $values);
|
38 |
|
39 |
+
if (!empty($firstName)) {
|
40 |
$contactModel->setFirstName($firstName);
|
41 |
}
|
42 |
+
if (!empty($lastName)) {
|
43 |
$contactModel->setLastName($lastName);
|
44 |
}
|
45 |
|
116 |
foreach (parse_blocks($feedback->post_content) as $block) {
|
117 |
$feedbackHtml = $block['innerHTML'];
|
118 |
|
119 |
+
$author = '';
|
120 |
//extract name, email and consent from submission
|
121 |
preg_match($authorRegex, $feedbackHtml, $authorMatches);
|
122 |
+
if (count($authorMatches) > 1) {
|
123 |
+
$author = $authorMatches[1];
|
124 |
+
}
|
125 |
|
126 |
+
$authorEmail = '';
|
127 |
preg_match($authorMailRegex, $feedbackHtml, $authorEmailMatches);
|
128 |
+
if (count($authorEmailMatches) > 1) {
|
129 |
+
$authorEmail = $authorEmailMatches[1];
|
130 |
+
}
|
131 |
|
132 |
+
$consentValue = false;
|
133 |
preg_match($consentRegex, $feedbackHtml, $consentMatches);
|
134 |
+
if (count($consentMatches) > 1) {
|
135 |
+
$consentValue = $consentMatches[1];
|
136 |
+
}
|
137 |
|
138 |
$contact = new \stdClass();
|
139 |
$contact->email = filter_var($authorEmail, FILTER_VALIDATE_EMAIL);
|
src/modules/contacts/Handlers/NewsLetterContactFormPluginHandler.php
CHANGED
@@ -18,17 +18,17 @@ class NewsLetterContactFormPluginHandler extends BaseContactFormPluginHandler
|
|
18 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
19 |
|
20 |
$email = $user->email;
|
21 |
-
if (
|
22 |
$contactModel->setEmail($email);
|
23 |
}
|
24 |
|
25 |
$name = $user->name;
|
26 |
-
if (
|
27 |
$contactModel->setFirstName($name);
|
28 |
}
|
29 |
|
30 |
$surname = $user->surname;
|
31 |
-
if (
|
32 |
$contactModel->setLastName($surname);
|
33 |
}
|
34 |
|
@@ -90,21 +90,21 @@ class NewsLetterContactFormPluginHandler extends BaseContactFormPluginHandler
|
|
90 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
91 |
|
92 |
$email = $contact->email;
|
93 |
-
if (
|
94 |
$contactModel->setEmail($email);
|
95 |
}
|
96 |
|
97 |
$name = $contact->name;
|
98 |
-
if (
|
99 |
$contactModel->setFirstName($name);
|
100 |
}
|
101 |
|
102 |
$surname = $contact->surname;
|
103 |
-
if (
|
104 |
$contactModel->setLastName($surname);
|
105 |
}
|
106 |
|
107 |
-
if (
|
108 |
array_push($backfillArray, $contactModel);
|
109 |
}
|
110 |
}
|
18 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
19 |
|
20 |
$email = $user->email;
|
21 |
+
if (!empty($email)) {
|
22 |
$contactModel->setEmail($email);
|
23 |
}
|
24 |
|
25 |
$name = $user->name;
|
26 |
+
if (!empty($name)) {
|
27 |
$contactModel->setFirstName($name);
|
28 |
}
|
29 |
|
30 |
$surname = $user->surname;
|
31 |
+
if (!empty($surname)) {
|
32 |
$contactModel->setLastName($surname);
|
33 |
}
|
34 |
|
90 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
91 |
|
92 |
$email = $contact->email;
|
93 |
+
if (!empty($email)) {
|
94 |
$contactModel->setEmail($email);
|
95 |
}
|
96 |
|
97 |
$name = $contact->name;
|
98 |
+
if (!empty($name)) {
|
99 |
$contactModel->setFirstName($name);
|
100 |
}
|
101 |
|
102 |
$surname = $contact->surname;
|
103 |
+
if (!empty($surname)) {
|
104 |
$contactModel->setLastName($surname);
|
105 |
}
|
106 |
|
107 |
+
if (!empty($contactModel->getEmail())) {
|
108 |
array_push($backfillArray, $contactModel);
|
109 |
}
|
110 |
}
|
src/modules/contacts/Handlers/NinjaFormsPluginHandler.php
CHANGED
@@ -39,7 +39,7 @@ class NinjaFormsPluginHandler extends BaseContactFormPluginHandler
|
|
39 |
return implode(' ', array($name, $field["value"]));
|
40 |
}
|
41 |
}
|
42 |
-
return
|
43 |
}
|
44 |
|
45 |
public function convertToContactModel($contact)
|
@@ -53,7 +53,7 @@ class NinjaFormsPluginHandler extends BaseContactFormPluginHandler
|
|
53 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
54 |
|
55 |
$email = $contact->email;
|
56 |
-
if (
|
57 |
|
58 |
$contactModel->setEmail($email);
|
59 |
}
|
@@ -61,7 +61,7 @@ class NinjaFormsPluginHandler extends BaseContactFormPluginHandler
|
|
61 |
$name = $contact->name;
|
62 |
$firstName = null;
|
63 |
$lastName = null;
|
64 |
-
if (
|
65 |
$values = explode(' ', $contact->name);
|
66 |
$firstName = array_shift($values);
|
67 |
$lastName = implode(' ', $values);
|
@@ -70,10 +70,10 @@ class NinjaFormsPluginHandler extends BaseContactFormPluginHandler
|
|
70 |
$lastName = isset($contact->lastName) ? $contact->lastName : null;
|
71 |
}
|
72 |
|
73 |
-
if (
|
74 |
$contactModel->setFirstName($firstName);
|
75 |
}
|
76 |
-
if (
|
77 |
$contactModel->setLastName($lastName);
|
78 |
}
|
79 |
|
@@ -168,7 +168,7 @@ class NinjaFormsPluginHandler extends BaseContactFormPluginHandler
|
|
168 |
}
|
169 |
}
|
170 |
}
|
171 |
-
if (
|
172 |
//Convert to contactModel and push to the array
|
173 |
$contactModel = $this->convertToContactModel($contact);
|
174 |
array_push($contactsArray, $contactModel);
|
39 |
return implode(' ', array($name, $field["value"]));
|
40 |
}
|
41 |
}
|
42 |
+
return !empty($name) ? $name : null;
|
43 |
}
|
44 |
|
45 |
public function convertToContactModel($contact)
|
53 |
$contactModel->setOptActionBy(OptActionBy::Visitor);
|
54 |
|
55 |
$email = $contact->email;
|
56 |
+
if (!empty($email)) {
|
57 |
|
58 |
$contactModel->setEmail($email);
|
59 |
}
|
61 |
$name = $contact->name;
|
62 |
$firstName = null;
|
63 |
$lastName = null;
|
64 |
+
if (!empty($name)){
|
65 |
$values = explode(' ', $contact->name);
|
66 |
$firstName = array_shift($values);
|
67 |
$lastName = implode(' ', $values);
|
70 |
$lastName = isset($contact->lastName) ? $contact->lastName : null;
|
71 |
}
|
72 |
|
73 |
+
if (!empty($firstName)) {
|
74 |
$contactModel->setFirstName($firstName);
|
75 |
}
|
76 |
+
if (!empty($lastName)) {
|
77 |
$contactModel->setLastName($lastName);
|
78 |
}
|
79 |
|
168 |
}
|
169 |
}
|
170 |
}
|
171 |
+
if (!empty($contact->email)) {
|
172 |
//Convert to contactModel and push to the array
|
173 |
$contactModel = $this->convertToContactModel($contact);
|
174 |
array_push($contactsArray, $contactModel);
|
src/modules/contacts/Handlers/WooCommercePluginHandler.php
CHANGED
@@ -20,32 +20,34 @@ class WooCommercePluginHandler extends BaseContactFormPluginHandler
|
|
20 |
$products_detail = get_post_meta($orderId);
|
21 |
|
22 |
if (isset($products_detail)) {
|
23 |
-
if (
|
24 |
$contactModel->setFirstName($products_detail["_billing_first_name"][0]);
|
25 |
}
|
26 |
-
if (
|
27 |
$contactModel->setLastName($products_detail["_billing_last_name"][0]);
|
28 |
}
|
29 |
|
30 |
-
if (
|
31 |
$contactModel->setEmail($products_detail["_billing_email"][0]);
|
32 |
}
|
33 |
|
34 |
-
if (
|
35 |
$contactModel->setEventType(CE4WP_WC_EVENTTYPE);
|
36 |
$contactModel->setOptActionBy(2);
|
37 |
$contactModel->setOptIn(false);
|
38 |
$contactModel->setOptOut(false);
|
39 |
}
|
40 |
|
|
|
|
|
41 |
if (array_key_exists('ce_checkout_consent_checkbox', $_POST)) {
|
42 |
$checkbox_value = esc_attr($_POST['ce_checkout_consent_checkbox']);
|
43 |
-
} else if (
|
44 |
$checkbox_value = $products_detail["ce_checkout_consent_checkbox"];
|
45 |
} else if (array_key_exists('ce_checkout_consent', $_POST)) {
|
46 |
// In the database the value is saved as ce_checkout_consent instead of ce_checkout_consent_checkbox
|
47 |
$checkbox_value = esc_attr($_POST['ce_checkout_consent']);
|
48 |
-
} else if (
|
49 |
$checkbox_value = $products_detail["ce_checkout_consent"];
|
50 |
}
|
51 |
|
@@ -118,7 +120,7 @@ class WooCommercePluginHandler extends BaseContactFormPluginHandler
|
|
118 |
|
119 |
$contactModel = $this->convertToContactModel($products_order->ID);
|
120 |
|
121 |
-
if(
|
122 |
array_push($backfillArray, $contactModel);
|
123 |
}
|
124 |
|
20 |
$products_detail = get_post_meta($orderId);
|
21 |
|
22 |
if (isset($products_detail)) {
|
23 |
+
if (!empty($products_detail["_billing_first_name"])) {
|
24 |
$contactModel->setFirstName($products_detail["_billing_first_name"][0]);
|
25 |
}
|
26 |
+
if (!empty($products_detail["_billing_last_name"])) {
|
27 |
$contactModel->setLastName($products_detail["_billing_last_name"][0]);
|
28 |
}
|
29 |
|
30 |
+
if (!empty($products_detail["_billing_email"])) {
|
31 |
$contactModel->setEmail($products_detail["_billing_email"][0]);
|
32 |
}
|
33 |
|
34 |
+
if (!empty($contactModel->getEmail())) {
|
35 |
$contactModel->setEventType(CE4WP_WC_EVENTTYPE);
|
36 |
$contactModel->setOptActionBy(2);
|
37 |
$contactModel->setOptIn(false);
|
38 |
$contactModel->setOptOut(false);
|
39 |
}
|
40 |
|
41 |
+
$checkbox_value = null;
|
42 |
+
|
43 |
if (array_key_exists('ce_checkout_consent_checkbox', $_POST)) {
|
44 |
$checkbox_value = esc_attr($_POST['ce_checkout_consent_checkbox']);
|
45 |
+
} else if (!empty($products_detail["ce_checkout_consent_checkbox"])) {
|
46 |
$checkbox_value = $products_detail["ce_checkout_consent_checkbox"];
|
47 |
} else if (array_key_exists('ce_checkout_consent', $_POST)) {
|
48 |
// In the database the value is saved as ce_checkout_consent instead of ce_checkout_consent_checkbox
|
49 |
$checkbox_value = esc_attr($_POST['ce_checkout_consent']);
|
50 |
+
} else if (!empty($products_detail["ce_checkout_consent"])) {
|
51 |
$checkbox_value = $products_detail["ce_checkout_consent"];
|
52 |
}
|
53 |
|
120 |
|
121 |
$contactModel = $this->convertToContactModel($products_order->ID);
|
122 |
|
123 |
+
if(!empty($contactModel->getEmail())) {
|
124 |
array_push($backfillArray, $contactModel);
|
125 |
}
|
126 |
|
src/modules/contacts/Handlers/WpFormsPluginHandler.php
CHANGED
@@ -44,19 +44,19 @@ class WpFormsPluginHandler extends BaseContactFormPluginHandler
|
|
44 |
|
45 |
$emailField = $this->get_form_type_field($formData, 'email');
|
46 |
if (array_key_exists('value', $emailField)) {
|
47 |
-
if (
|
48 |
$contactModel->setEmail($emailField['value']);
|
49 |
}
|
50 |
}
|
51 |
|
52 |
$nameField = $this->get_form_type_field($formData, 'name');
|
53 |
if (array_key_exists('first', $nameField)) {
|
54 |
-
if (
|
55 |
$contactModel->setFirstName($nameField['first']);
|
56 |
}
|
57 |
}
|
58 |
if (array_key_exists('last', $nameField)) {
|
59 |
-
if (
|
60 |
$contactModel->setLastName($nameField['last']);
|
61 |
}
|
62 |
}
|
44 |
|
45 |
$emailField = $this->get_form_type_field($formData, 'email');
|
46 |
if (array_key_exists('value', $emailField)) {
|
47 |
+
if (!empty($emailField['value'])) {
|
48 |
$contactModel->setEmail($emailField['value']);
|
49 |
}
|
50 |
}
|
51 |
|
52 |
$nameField = $this->get_form_type_field($formData, 'name');
|
53 |
if (array_key_exists('first', $nameField)) {
|
54 |
+
if (!empty($nameField['first'])) {
|
55 |
$contactModel->setFirstName($nameField['first']);
|
56 |
}
|
57 |
}
|
58 |
if (array_key_exists('last', $nameField)) {
|
59 |
+
if (!empty($nameField['last'])) {
|
60 |
$contactModel->setLastName($nameField['last']);
|
61 |
}
|
62 |
}
|
src/views/admin-feedback-notice/few-contacts.php
CHANGED
@@ -7,5 +7,5 @@
|
|
7 |
<p><?= __( 'These contacts are already in Creative Mail, send a quick campaign...', 'ce4wp' ); ?></p>
|
8 |
</section>
|
9 |
<button class="button button-primary" onclick="ce4wpNavigateToDashboard(this, 'd25f690a-217a-4d68-9c58-8693965d4673', undefined, ce4wpWidgetStartCallback, ce4wpWidgetFinishCallback)"><?= __( 'Get started', 'ce4wp' ); ?></button>
|
10 |
-
<span id="close" onclick="hideAdminFeedbackNotice()"></span>
|
11 |
</div>
|
7 |
<p><?= __( 'These contacts are already in Creative Mail, send a quick campaign...', 'ce4wp' ); ?></p>
|
8 |
</section>
|
9 |
<button class="button button-primary" onclick="ce4wpNavigateToDashboard(this, 'd25f690a-217a-4d68-9c58-8693965d4673', undefined, ce4wpWidgetStartCallback, ce4wpWidgetFinishCallback)"><?= __( 'Get started', 'ce4wp' ); ?></button>
|
10 |
+
<span id="close" onclick="hideAdminFeedbackNotice('feedback_notice_few_contacts')"></span>
|
11 |
</div>
|
src/views/admin-feedback-notice/many-contacts.php
CHANGED
@@ -11,5 +11,5 @@
|
|
11 |
</p>
|
12 |
</section>
|
13 |
<button class="button button-primary" onclick="ce4wpNavigateToDashboard(this, 'd25f690a-217a-4d68-9c58-8693965d4673', undefined, ce4wpWidgetStartCallback, ce4wpWidgetFinishCallback)"><?= __( 'Get started', 'ce4wp' ); ?></button>
|
14 |
-
<span id="close" onclick="hideAdminFeedbackNotice()"></span>
|
15 |
</div>
|
11 |
</p>
|
12 |
</section>
|
13 |
<button class="button button-primary" onclick="ce4wpNavigateToDashboard(this, 'd25f690a-217a-4d68-9c58-8693965d4673', undefined, ce4wpWidgetStartCallback, ce4wpWidgetFinishCallback)"><?= __( 'Get started', 'ce4wp' ); ?></button>
|
14 |
+
<span id="close" onclick="hideAdminFeedbackNotice('feedback_notice_many_contacts')"></span>
|
15 |
</div>
|
src/views/admin-feedback-notice/sync-disabled.php
CHANGED
@@ -13,5 +13,5 @@
|
|
13 |
<a href="/wp-admin/admin.php?page=creativemail_settings">
|
14 |
<button class="button button-primary"><?= __( 'Sync my contacts', 'ce4wp' ); ?></button>
|
15 |
</a>
|
16 |
-
<span id="close" onclick="hideAdminFeedbackNotice()"></span>
|
17 |
</div>
|
13 |
<a href="/wp-admin/admin.php?page=creativemail_settings">
|
14 |
<button class="button button-primary"><?= __( 'Sync my contacts', 'ce4wp' ); ?></button>
|
15 |
</a>
|
16 |
+
<span id="close" onclick="hideAdminFeedbackNotice('feedback_notice_sync_disabled')"></span>
|
17 |
</div>
|
src/views/admin-get-started-banner.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<script>
|
2 |
function hideAdminGetStartedBanner () {
|
3 |
document.querySelector('.notice-ce4wp-getting-started').hidden = true;
|
|
|
4 |
}
|
5 |
</script>
|
6 |
|
1 |
<script>
|
2 |
function hideAdminGetStartedBanner () {
|
3 |
document.querySelector('.notice-ce4wp-getting-started').hidden = true;
|
4 |
+
fetch('<?= $ce_hide_banner_url; ?>', { method: 'POST' })
|
5 |
}
|
6 |
</script>
|
7 |
|
src/views/settings.php
CHANGED
@@ -13,9 +13,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
13 |
|
14 |
if($_POST['action'] === 'change_activated_plugins') {
|
15 |
$activated_plugins = array();
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
19 |
}
|
20 |
|
21 |
CreativeMail::get_instance()->get_integration_manager()->set_activated_plugins($activated_plugins);
|
13 |
|
14 |
if($_POST['action'] === 'change_activated_plugins') {
|
15 |
$activated_plugins = array();
|
16 |
+
if (isset($_POST['activated_plugins'])) {
|
17 |
+
$keys = $_POST["activated_plugins"];
|
18 |
+
foreach ($keys as $key) {
|
19 |
+
array_push($activated_plugins, sanitize_key($key));
|
20 |
+
}
|
21 |
}
|
22 |
|
23 |
CreativeMail::get_instance()->get_integration_manager()->set_activated_plugins($activated_plugins);
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit9f5866ac3f3a25f2b6311871ff5ad9ff::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit2c876400832376b323eb9acf717b7788
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit9f5866ac3f3a25f2b6311871ff5ad9ff
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit9f5866ac3f3a25f2b6311871ff5ad9ff', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit9f5866ac3f3a25f2b6311871ff5ad9ff', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit9f5866ac3f3a25f2b6311871ff5ad9ff::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'F' =>
|
@@ -128,9 +128,9 @@ class ComposerStaticInit2c876400832376b323eb9acf717b7788
|
|
128 |
public static function getInitializer(ClassLoader $loader)
|
129 |
{
|
130 |
return \Closure::bind(function () use ($loader) {
|
131 |
-
$loader->prefixLengthsPsr4 =
|
132 |
-
$loader->prefixDirsPsr4 =
|
133 |
-
$loader->classMap =
|
134 |
|
135 |
}, null, ClassLoader::class);
|
136 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit9f5866ac3f3a25f2b6311871ff5ad9ff
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'F' =>
|
128 |
public static function getInitializer(ClassLoader $loader)
|
129 |
{
|
130 |
return \Closure::bind(function () use ($loader) {
|
131 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit9f5866ac3f3a25f2b6311871ff5ad9ff::$prefixLengthsPsr4;
|
132 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit9f5866ac3f3a25f2b6311871ff5ad9ff::$prefixDirsPsr4;
|
133 |
+
$loader->classMap = ComposerStaticInit9f5866ac3f3a25f2b6311871ff5ad9ff::$classMap;
|
134 |
|
135 |
}, null, ClassLoader::class);
|
136 |
}
|