Creative Mail – Easier WordPress & WooCommerce Email Marketing - Version 1.1.8

Version Description

Download this release

Release Info

Developer constantcontact
Plugin Icon 128x128 Creative Mail – Easier WordPress & WooCommerce Email Marketing
Version 1.1.8
Comparing to
See all releases

Code changes from version 1.1.7 to 1.1.8

CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
  Changelog
2
  =========
3
 
 
 
 
4
  #### 1.1.7 - October 5 2020
5
  - Add support for Elementor forms.
6
 
1
  Changelog
2
  =========
3
 
4
+ #### 1.1.8 - October 8 2020
5
+ - Fixes an issue that could cause a crash for some users.
6
+
7
  #### 1.1.7 - October 5 2020
8
  - Add support for Elementor forms.
9
 
README.md CHANGED
@@ -3,7 +3,7 @@ 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.5
6
- Stable tag: 1.1.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
@@ -88,6 +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.1.7 - Add support for Elementor forms.
92
  * 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.
93
  * 1.1.5 - Fixes an issue where order notification emails would not always go out.
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.5
6
+ Stable tag: 1.1.8
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.1.8 - Fixes an issue that could cause a crash for some users.
92
  * 1.1.7 - Add support for Elementor forms.
93
  * 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.
94
  * 1.1.5 - Fixes an issue where order notification emails would not always go out.
assets/js/footer_rating.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery( 'a.ce4wp-rating-link' ).click( function() {
2
+ jQuery.post( 'admin-ajax.php', { action: 'woocommerce_ce4wp_rated' } );
3
+ jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
4
+ });
creative-mail-plugin.php CHANGED
@@ -6,7 +6,7 @@ use CreativeMail\CreativeMail;
6
  * Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
7
  * 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.
8
  * Author: Constant Contact
9
- * Version: 1.1.7
10
  * Author URI: https://www.constantcontact.com
11
  */
12
 
@@ -22,7 +22,7 @@ function _load_ce4wp_plugin()
22
  define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
23
  define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
24
  define('CE4WP_PLUGIN_FILE', __FILE__);
25
- define('CE4WP_PLUGIN_VERSION', '1.1.7');
26
  define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
27
  define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
28
  define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
@@ -39,7 +39,7 @@ function _load_ce4wp_plugin()
39
  define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
40
  define('CE4WP_APP_URL', 'https://app.creativemail.com/');
41
  define('CE4WP_ENVIRONMENT', 'PRODUCTION');
42
- define('CE4WP_BUILD_NUMBER', '644');
43
  define('CE4WP_BATCH_SIZE', 500);
44
  define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
45
  define('CE4WP_WC_API_CONSUMER_KEY', 'ce4wp_woocommerce_consumer_key');
6
  * Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
7
  * 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.
8
  * Author: Constant Contact
9
+ * Version: 1.1.8
10
  * Author URI: https://www.constantcontact.com
11
  */
12
 
22
  define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
23
  define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
24
  define('CE4WP_PLUGIN_FILE', __FILE__);
25
+ define('CE4WP_PLUGIN_VERSION', '1.1.8');
26
  define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
27
  define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
28
  define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
39
  define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
40
  define('CE4WP_APP_URL', 'https://app.creativemail.com/');
41
  define('CE4WP_ENVIRONMENT', 'PRODUCTION');
42
+ define('CE4WP_BUILD_NUMBER', '659');
43
  define('CE4WP_BATCH_SIZE', 500);
44
  define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
45
  define('CE4WP_WC_API_CONSUMER_KEY', 'ce4wp_woocommerce_consumer_key');
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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.5
6
- Stable tag: 1.1.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
@@ -93,6 +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.1.7 - Add support for Elementor forms.
97
  * 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.
98
  * 1.1.5 - Fixes an issue where order notification emails would not always go out.
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.5
6
+ Stable tag: 1.1.8
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.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.
src/managers/admin-manager.php CHANGED
@@ -57,28 +57,28 @@ class AdminManager
57
  add_filter('admin_footer_text', array( $this, 'admin_footer_text' ), 1);
58
  add_action('wp_ajax_woocommerce_ce4wp_rated', array( $this, 'mark_as_rated' ));
59
  }
60
-
61
  function add_admin_notice_review()
62
  {
63
-
64
  $install_date = get_option('ce4wp_install_date');
65
  if (!$install_date) {
66
  return false;
67
  }
68
-
69
  $install_date = date_create($install_date);
70
  $date_now = date_create(date('Y-m-d G:i:s'));
71
  $date_diff = date_diff($install_date, $date_now);
72
-
73
  if ($date_diff->format("%d") < 7 ) {
74
-
75
  return false;
76
  }
77
-
78
  if (! get_option('ce4wp_ignore_review_notice') ) {
79
-
80
  echo '<div class="updated"><p>';
81
-
82
  printf(
83
  __('Awesome, you\'ve been using <a href="admin.php?page=creativemail">Creative Mail</a> for more than 1 week. May we ask you to give it a 5-star rating on WordPress? | <a href="%2$s" target="_blank">Ok, you deserved it</a> | <a href="%1$s">I already did</a> | <a href="%1$s">No, not good enough</a>', 'ce4wp'), '?ce4wp-ignore-notice=0',
84
  'https://wordpress.org/plugins/creative-mail-by-constant-contact/'
@@ -86,26 +86,21 @@ class AdminManager
86
  echo "</p></div>";
87
  }
88
  }
89
-
90
  public function ignore_review_notice()
91
  {
92
  if (isset($_GET['ce4wp-ignore-notice']) && '0' == $_GET['ce4wp-ignore-notice'] ) {
93
  update_option('ce4wp_ignore_review_notice', 'true');
94
  }
95
  }
96
-
97
  public function mark_as_rated()
98
  {
99
-
100
- if (! current_user_can('manage_woocommerce') ) {
101
- wp_die(-1);
102
- }
103
-
104
  update_option('ce4wp_admin_footer_text_rated', 1);
105
-
106
  wp_die();
107
  }
108
-
109
  /**
110
  * Changes the admin footer text on admin pages.
111
  *
@@ -114,36 +109,30 @@ class AdminManager
114
  */
115
  public function admin_footer_text( $footer_text )
116
  {
117
-
118
- if (! current_user_can('manage_woocommerce') ) {
119
- return $footer_text;
120
- }
121
-
122
- $screen = get_current_screen();
123
-
124
- if (! empty($screen)
125
- && ('toplevel_page_creativemail' === $screen->id || 'creative-mail_page_creativemail_settings' === $screen->id )
126
- && ! get_option('ce4wp_admin_footer_text_rated')
127
- ) {
128
  $footer_text = sprintf(
129
  esc_html__('If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'ce4wp'),
130
  sprintf('<strong>%s</strong>', esc_html__('Creative Mail', 'ce4wp')),
131
  '<a href="https://wordpress.org/plugins/creative-mail-by-constant-contact/#reviews?rate=5#new-post" target="_blank" class="ce4wp-rating-link" data-rated="' . esc_attr__('Thank You', 'ce4wp') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
132
  );
133
-
134
- wc_enqueue_js(
135
- "
136
- jQuery( 'a.ce4wp-rating-link' ).click( function() {
137
- jQuery.post( '" . WC()->ajax_url() . "', { action: 'woocommerce_ce4wp_rated' } );
138
- jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
139
- });
140
- "
141
- );
142
  }
143
-
144
  return $footer_text;
145
  }
146
-
 
 
 
 
 
 
 
 
 
 
 
 
147
  /**
148
  * Redirects the user after plugin activation.
149
  */
@@ -166,6 +155,11 @@ class AdminManager
166
  wp_enqueue_style('ce4wp_admin');
167
  wp_enqueue_style('ce4wp-font-poppins', 'https://fonts.googleapis.com/css?family=Poppins:400,500');
168
  wp_enqueue_script('wp-api');
 
 
 
 
 
169
  }
170
 
171
  /**
@@ -233,7 +227,7 @@ class AdminManager
233
  $this->dashboard_url = $sso_link;
234
  }
235
  }
236
- catch(Exception $ex) {
237
  }
238
 
239
  include CE4WP_PLUGIN_DIR . 'src/views/dashboard.php';
@@ -260,7 +254,7 @@ class AdminManager
260
  try {
261
  return SsoHelper::generate_sso_link($instance_id, $instance_api_key, $connected_account_id);
262
  }
263
- catch(Exception $ex) {
264
  }
265
  }
266
 
57
  add_filter('admin_footer_text', array( $this, 'admin_footer_text' ), 1);
58
  add_action('wp_ajax_woocommerce_ce4wp_rated', array( $this, 'mark_as_rated' ));
59
  }
60
+
61
  function add_admin_notice_review()
62
  {
63
+
64
  $install_date = get_option('ce4wp_install_date');
65
  if (!$install_date) {
66
  return false;
67
  }
68
+
69
  $install_date = date_create($install_date);
70
  $date_now = date_create(date('Y-m-d G:i:s'));
71
  $date_diff = date_diff($install_date, $date_now);
72
+
73
  if ($date_diff->format("%d") < 7 ) {
74
+
75
  return false;
76
  }
77
+
78
  if (! get_option('ce4wp_ignore_review_notice') ) {
79
+
80
  echo '<div class="updated"><p>';
81
+
82
  printf(
83
  __('Awesome, you\'ve been using <a href="admin.php?page=creativemail">Creative Mail</a> for more than 1 week. May we ask you to give it a 5-star rating on WordPress? | <a href="%2$s" target="_blank">Ok, you deserved it</a> | <a href="%1$s">I already did</a> | <a href="%1$s">No, not good enough</a>', 'ce4wp'), '?ce4wp-ignore-notice=0',
84
  'https://wordpress.org/plugins/creative-mail-by-constant-contact/'
86
  echo "</p></div>";
87
  }
88
  }
89
+
90
  public function ignore_review_notice()
91
  {
92
  if (isset($_GET['ce4wp-ignore-notice']) && '0' == $_GET['ce4wp-ignore-notice'] ) {
93
  update_option('ce4wp_ignore_review_notice', 'true');
94
  }
95
  }
96
+
97
  public function mark_as_rated()
98
  {
 
 
 
 
 
99
  update_option('ce4wp_admin_footer_text_rated', 1);
100
+
101
  wp_die();
102
  }
103
+
104
  /**
105
  * Changes the admin footer text on admin pages.
106
  *
109
  */
110
  public function admin_footer_text( $footer_text )
111
  {
112
+ if ($this->is_cm_screen_and_show_footer())
113
+ {
 
 
 
 
 
 
 
 
 
114
  $footer_text = sprintf(
115
  esc_html__('If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'ce4wp'),
116
  sprintf('<strong>%s</strong>', esc_html__('Creative Mail', 'ce4wp')),
117
  '<a href="https://wordpress.org/plugins/creative-mail-by-constant-contact/#reviews?rate=5#new-post" target="_blank" class="ce4wp-rating-link" data-rated="' . esc_attr__('Thank You', 'ce4wp') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
118
  );
 
 
 
 
 
 
 
 
 
119
  }
120
+
121
  return $footer_text;
122
  }
123
+
124
+ function is_cm_screen_and_show_footer() {
125
+ $screen = get_current_screen();
126
+
127
+ if (! empty($screen)
128
+ && ('toplevel_page_creativemail' === $screen->id || 'creative-mail_page_creativemail_settings' === $screen->id )
129
+ && ! get_option('ce4wp_admin_footer_text_rated')
130
+ ) {
131
+ return true;
132
+ }
133
+ return false;
134
+ }
135
+
136
  /**
137
  * Redirects the user after plugin activation.
138
  */
155
  wp_enqueue_style('ce4wp_admin');
156
  wp_enqueue_style('ce4wp-font-poppins', 'https://fonts.googleapis.com/css?family=Poppins:400,500');
157
  wp_enqueue_script('wp-api');
158
+
159
+ if ($this->is_cm_screen_and_show_footer())
160
+ {
161
+ wp_enqueue_script('ce4wp_admin_footer_rating', CE4WP_PLUGIN_URL . 'assets/js/footer_rating.js', null, CE4WP_PLUGIN_VERSION, true);
162
+ }
163
  }
164
 
165
  /**
227
  $this->dashboard_url = $sso_link;
228
  }
229
  }
230
+ catch(Exception $ex) {
231
  }
232
 
233
  include CE4WP_PLUGIN_DIR . 'src/views/dashboard.php';
254
  try {
255
  return SsoHelper::generate_sso_link($instance_id, $instance_api_key, $connected_account_id);
256
  }
257
+ catch(Exception $ex) {
258
  }
259
  }
260
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit0b2d56d34d8e06197d46233b4a9b58b3::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitbaa72cca84048005f7a1e1870d6a4754::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit0b2d56d34d8e06197d46233b4a9b58b3
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit0b2d56d34d8e06197d46233b4a9b58b3
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit0b2d56d34d8e06197d46233b4a9b58b3', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit0b2d56d34d8e06197d46233b4a9b58b3', '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\ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3::getInitializer($loader));
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 ComposerAutoloaderInitbaa72cca84048005f7a1e1870d6a4754
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitbaa72cca84048005f7a1e1870d6a4754', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitbaa72cca84048005f7a1e1870d6a4754', '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\ComposerStaticInitbaa72cca84048005f7a1e1870d6a4754::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 ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'F' =>
@@ -122,9 +122,9 @@ class ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3
122
  public static function getInitializer(ClassLoader $loader)
123
  {
124
  return \Closure::bind(function () use ($loader) {
125
- $loader->prefixLengthsPsr4 = ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3::$prefixLengthsPsr4;
126
- $loader->prefixDirsPsr4 = ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3::$prefixDirsPsr4;
127
- $loader->classMap = ComposerStaticInit0b2d56d34d8e06197d46233b4a9b58b3::$classMap;
128
 
129
  }, null, ClassLoader::class);
130
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitbaa72cca84048005f7a1e1870d6a4754
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'F' =>
122
  public static function getInitializer(ClassLoader $loader)
123
  {
124
  return \Closure::bind(function () use ($loader) {
125
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbaa72cca84048005f7a1e1870d6a4754::$prefixLengthsPsr4;
126
+ $loader->prefixDirsPsr4 = ComposerStaticInitbaa72cca84048005f7a1e1870d6a4754::$prefixDirsPsr4;
127
+ $loader->classMap = ComposerStaticInitbaa72cca84048005f7a1e1870d6a4754::$classMap;
128
 
129
  }, null, ClassLoader::class);
130
  }