Email Subscribers & Newsletters - Version 4.1.5

Version Description

(20.06.2019) = * Update: Added "Opt-In Type" column in exported contacts lists * Update: Allow to send broadcast only if contacts are available in list * Fix: "Select the list" error

Download this release

Release Info

Developer Icegram
Plugin Icon 128x128 Email Subscribers & Newsletters
Version 4.1.5
Comparing to
See all releases

Code changes from version 4.1.4 to 4.1.5

admin/class-email-subscribers-admin.php CHANGED
@@ -370,12 +370,12 @@ class Email_Subscribers_Admin {
370
 
371
  public static function es_feedback() {
372
  $star_rating_dismiss = get_option( 'ig_es_dismiss_star_notice', 'no' );
373
- $star_rating_done = get_option( 'ig_es_star_notice_done', 'no' );
374
  // Show if - more than 2 post notifications or Newsletters sent OR more than 10 subscribers
375
- $total_contacts = ES_DB_Contacts::count_active_subscribers_by_list_id();
376
- $total_email_sent = ES_DB_Mailing_Queue::get_notifications_count();
377
 
378
- if ( ( $total_contacts >= 10 || $total_email_sent > 2 ) && 'yes' !== $star_rating_dismiss && 'yes' !== $star_rating_done ) {
379
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">If you like <strong>Email Subscribers</strong>, please consider leaving us a <a target="_blank" href="?es_dismiss_admin_notice=1&option_name=star_notice_done"><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span></a> rating. A huge thank you from Icegram in advance! <a style="float:right" class="es-admin-btn es-admin-btn-secondary" href="?es_dismiss_admin_notice=1&option_name=dismiss_star_notice">No, I don\'t like it</a></p></div>';
380
  }
381
  }
@@ -458,14 +458,15 @@ class Email_Subscribers_Admin {
458
  public function count_contacts_by_list() {
459
 
460
  $list_id = ! empty( $_POST['list_id'] ) ? (int) $_POST['list_id'] : 0;
 
461
 
462
  if ( $list_id == 0 ) {
463
  return 0;
464
  }
465
 
466
- $total_count = ES_DB_Lists_Contacts::get_total_count_by_list( $list_id, 'all' );
467
 
468
- die(json_encode(array('total' => $total_count)));
469
  }
470
 
471
  }
370
 
371
  public static function es_feedback() {
372
  $star_rating_dismiss = get_option( 'ig_es_dismiss_star_notice', 'no' );
373
+ $star_rating_done = get_option( 'ig_es_star_notice_done', 'no' );
374
  // Show if - more than 2 post notifications or Newsletters sent OR more than 10 subscribers
375
+ $total_contacts = ES_DB_Contacts::count_active_subscribers_by_list_id();
376
+ $total_email_sent = ES_DB_Mailing_Queue::get_notifications_count();
377
 
378
+ if ( ( $total_contacts >= 10 || $total_email_sent > 2 ) && 'yes' !== $star_rating_dismiss && 'yes' !== $star_rating_done ) {
379
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">If you like <strong>Email Subscribers</strong>, please consider leaving us a <a target="_blank" href="?es_dismiss_admin_notice=1&option_name=star_notice_done"><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span><span>&#9733;</span></a> rating. A huge thank you from Icegram in advance! <a style="float:right" class="es-admin-btn es-admin-btn-secondary" href="?es_dismiss_admin_notice=1&option_name=dismiss_star_notice">No, I don\'t like it</a></p></div>';
380
  }
381
  }
458
  public function count_contacts_by_list() {
459
 
460
  $list_id = ! empty( $_POST['list_id'] ) ? (int) $_POST['list_id'] : 0;
461
+ $status = ! empty( $_POST['status'] ) ? $_POST['status'] : 'all';
462
 
463
  if ( $list_id == 0 ) {
464
  return 0;
465
  }
466
 
467
+ $total_count = ES_DB_Lists_Contacts::get_total_count_by_list( $list_id, $status );
468
 
469
+ die( json_encode( array( 'total' => $total_count ) ) );
470
  }
471
 
472
  }
admin/css/email-subscribers-admin.css CHANGED
@@ -1189,4 +1189,25 @@ div.es .last {
1189
  .email-subscribers_page_es_pricing #wpwrap #wpcontent {
1190
  background-color: #f1f1f1;
1191
  }
1192
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1189
  .email-subscribers_page_es_pricing #wpwrap #wpcontent {
1190
  background-color: #f1f1f1;
1191
  }
1192
+ .es-floting-button{
1193
+ width: 10em;
1194
+ padding: 0.5em;
1195
+ text-align: center;
1196
+ margin: 0px 1em !important;
1197
+ float: right;
1198
+ /*background: #03a025;*/
1199
+ background: #00a0d2;
1200
+ color: white;
1201
+ border: none;
1202
+ font-size: 1.3em;
1203
+ }
1204
+ .es-floting-button a{
1205
+ text-decoration: none;
1206
+ color: inherit;
1207
+ }
1208
+ .es-floting-button:hover{
1209
+ background: #FFF;
1210
+ /*color: #03a025;*/
1211
+ color: #00a0d2;
1212
+ font-weight: bold;
1213
+ }
admin/images/email-subscribers-pricing.png CHANGED
Binary file
admin/js/email-subscribers-admin.js CHANGED
@@ -138,8 +138,8 @@
138
  });
139
 
140
 
141
- var _href = $('#ig_es_export_link_select_list').attr("href");
142
  // Select List ID for Export
 
143
  $('#ig_es_export_list_dropdown').change(function () {
144
  var selected_list_id = $(this).val();
145
 
@@ -165,10 +165,45 @@
165
  });
166
 
167
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  });
169
 
170
 
171
- // Get the element with id="defaultOpen" and click on it
172
 
173
 
174
  })(jQuery);
138
  });
139
 
140
 
 
141
  // Select List ID for Export
142
+ var _href = $('#ig_es_export_link_select_list').attr("href");
143
  $('#ig_es_export_list_dropdown').change(function () {
144
  var selected_list_id = $(this).val();
145
 
165
  });
166
 
167
  });
168
+
169
+ // Broadcast Setttings
170
+ // Get count by list
171
+ $('#ig_es_send_broadcast_button').attr("disabled", true);
172
+ $('#ig_es_broadcast_list_ids').change(function(){
173
+ var selected_list_id = $(this).val();
174
+
175
+ // Update total count in lists
176
+ var params = {
177
+ action: 'count_contacts_by_list',
178
+ list_id: selected_list_id,
179
+ status: 'subscribed'
180
+ };
181
+
182
+ $.ajax({
183
+ method: 'POST',
184
+ url: ajaxurl,
185
+ async: false,
186
+ data: params,
187
+ success: function (response) {
188
+ if (response !== '') {
189
+ response = JSON.parse(response);
190
+ if(response.hasOwnProperty('total')) {
191
+ var total = response.total;
192
+ $('#ig_es_total_contacts').text(response.total);
193
+ if(total == 0 ) {
194
+ $('#ig_es_send_broadcast_button').attr("disabled", true);
195
+ } else {
196
+ $('#ig_es_send_broadcast_button').attr("disabled", false);
197
+ }
198
+ }
199
+ }
200
+ }
201
+ });
202
+ });
203
  });
204
 
205
 
206
+
207
 
208
 
209
  })(jQuery);
email-subscribers.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: Email Subscribers & Newsletters
4
  * Plugin URI: https://www.icegram.com/
5
  * Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
6
- * Version: 4.1.4
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
10
- * Tested up to: 5.2.1
11
  * Text Domain: email-subscribers
12
  * Domain Path: /languages/
13
  * License: GPLv3
@@ -24,7 +24,7 @@ if ( ! defined( 'WPINC' ) ) {
24
  * Define constants
25
  */
26
  define( 'ES_PLUGIN_DIR', dirname( __FILE__ ) );
27
- define( 'ES_PLUGIN_VERSION', '4.1.4' );
28
  define( 'ES_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
29
 
30
  if ( ! defined( 'ES_PLUGIN_FILE' ) ) {
3
  * Plugin Name: Email Subscribers & Newsletters
4
  * Plugin URI: https://www.icegram.com/
5
  * Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
6
+ * Version: 4.1.5
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
10
+ * Tested up to: 5.2.2
11
  * Text Domain: email-subscribers
12
  * Domain Path: /languages/
13
  * License: GPLv3
24
  * Define constants
25
  */
26
  define( 'ES_PLUGIN_DIR', dirname( __FILE__ ) );
27
+ define( 'ES_PLUGIN_VERSION', '4.1.5' );
28
  define( 'ES_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) );
29
 
30
  if ( ! defined( 'ES_PLUGIN_FILE' ) ) {
includes/admin/class-es-export-subscribers.php CHANGED
@@ -85,6 +85,7 @@ class Export_Subscribers {
85
  'all' => __( 'All Contacts', 'email-subscribers' ),
86
  'subscribed' => __( 'Subscribed Contacts', 'email-subscribers' ),
87
  'unsubscribed' => __( 'Unsubscribed Contacts', 'email-subscribers' ),
 
88
  'unconfirmed' => __( 'Unconfirmed Contacts', 'email-subscribers' ),
89
  'select_list' => $list_dropdown_html
90
  );
@@ -166,6 +167,10 @@ class Export_Subscribers {
166
  $sql = $wpdb->prepare( "SELECT COUNT(email) FROM " . IG_CONTACTS_TABLE . " WHERE status = %s", 'unsubscribed' );
167
  break;
168
 
 
 
 
 
169
  case 'unconfirmed':
170
  $sql = $wpdb->prepare( "SELECT count(contact_id) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE status = %s", 'unconfirmed' );
171
  break;
@@ -239,6 +244,8 @@ class Export_Subscribers {
239
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'subscribed' );
240
  } elseif ( 'unsubscribed' === $status ) {
241
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'unsubscribed' );
 
 
242
  } elseif ( 'unconfirmed' === $status ) {
243
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'unconfirmed' );
244
  } elseif ( 'select_list' === $status ) {
@@ -261,8 +268,9 @@ class Export_Subscribers {
261
  }
262
 
263
  $contact_list_map[ $result['contact_id'] ][] = array(
264
- 'status' => $result['status'],
265
- 'list_id' => $result['list_id']
 
266
  );
267
  }
268
 
@@ -282,6 +290,7 @@ class Export_Subscribers {
282
  __( 'Email', 'email-subscribers' ),
283
  __( 'List', 'email-subscribers' ),
284
  __( 'Status', 'email-subscribers' ),
 
285
  __( 'Created On', 'email-subscribers' )
286
  );
287
 
@@ -300,6 +309,7 @@ class Export_Subscribers {
300
  foreach ( $contact_list_map[ $contact_id ] as $list_details ) {
301
  $data['list'] = $lists_id_name_map[ $list_details['list_id'] ];
302
  $data['status'] = ucfirst( $list_details['status'] );
 
303
  $data['created_at'] = $subscriber['created_at'];
304
  $csv_output .= '"' . implode( '", "', $data ) . '"';
305
  $csv_output .= "\n";
85
  'all' => __( 'All Contacts', 'email-subscribers' ),
86
  'subscribed' => __( 'Subscribed Contacts', 'email-subscribers' ),
87
  'unsubscribed' => __( 'Unsubscribed Contacts', 'email-subscribers' ),
88
+ //'confirmed' => __( 'Confirmed Contacts', 'email-subscribers' ),
89
  'unconfirmed' => __( 'Unconfirmed Contacts', 'email-subscribers' ),
90
  'select_list' => $list_dropdown_html
91
  );
167
  $sql = $wpdb->prepare( "SELECT COUNT(email) FROM " . IG_CONTACTS_TABLE . " WHERE status = %s", 'unsubscribed' );
168
  break;
169
 
170
+ case 'confirmed':
171
+ $sql = $wpdb->prepare( "SELECT COUNT(*) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE status = %s AND optin_type = %d", 'subscribed', IG_DOUBLE_OPTIN );
172
+ break;
173
+
174
  case 'unconfirmed':
175
  $sql = $wpdb->prepare( "SELECT count(contact_id) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE status = %s", 'unconfirmed' );
176
  break;
244
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'subscribed' );
245
  } elseif ( 'unsubscribed' === $status ) {
246
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'unsubscribed' );
247
+ } elseif ( 'confirmed' === $status ) {
248
+ $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s AND optin_type = %d ", 'subscribed', IG_DOUBLE_OPTIN );
249
  } elseif ( 'unconfirmed' === $status ) {
250
  $query = $wpdb->prepare( "SELECT * FROM {$contact_lists_table} WHERE status = %s", 'unconfirmed' );
251
  } elseif ( 'select_list' === $status ) {
268
  }
269
 
270
  $contact_list_map[ $result['contact_id'] ][] = array(
271
+ 'status' => $result['status'],
272
+ 'list_id' => $result['list_id'],
273
+ 'optin_type' => $result['optin_type']
274
  );
275
  }
276
 
290
  __( 'Email', 'email-subscribers' ),
291
  __( 'List', 'email-subscribers' ),
292
  __( 'Status', 'email-subscribers' ),
293
+ __( 'Opt-In Type', 'email-subscribers' ),
294
  __( 'Created On', 'email-subscribers' )
295
  );
296
 
309
  foreach ( $contact_list_map[ $contact_id ] as $list_details ) {
310
  $data['list'] = $lists_id_name_map[ $list_details['list_id'] ];
311
  $data['status'] = ucfirst( $list_details['status'] );
312
+ $data['optin_type'] = ($list_details['optin_type'] == 1) ? 'Single Opt-In' : 'Double Opt-In';
313
  $data['created_at'] = $subscriber['created_at'];
314
  $csv_output .= '"' . implode( '", "', $data ) . '"';
315
  $csv_output .= "\n";
includes/admin/class-es-lists-table.php CHANGED
@@ -362,7 +362,7 @@ class ES_Lists_Table extends WP_List_Table {
362
 
363
  switch ( $column_name ) {
364
  case 'active_contacts':
365
- $count = ES_DB_Lists_Contacts::get_total_count_by_list( $item['id'], 'active' );
366
  if ( $count > 0 ) {
367
  $url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=subscribed&filter_by_list_id=' . $item['id'] );
368
  $count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
362
 
363
  switch ( $column_name ) {
364
  case 'active_contacts':
365
+ $count = ES_DB_Lists_Contacts::get_total_count_by_list( $item['id'], 'subscribed' );
366
  if ( $count > 0 ) {
367
  $url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=subscribed&filter_by_list_id=' . $item['id'] );
368
  $count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
includes/admin/class-es-newsletters.php CHANGED
@@ -39,8 +39,8 @@ class ES_Newsletters {
39
  if ( 'submitted' === $submitted ) {
40
 
41
  // $email_sent_type = __('Active', 'email-subscribers');
42
- $list_id = Email_Subscribers::get_request( 'list_ids' );
43
- $template_id = Email_Subscribers::get_request( 'base_template_id' );
44
 
45
  if ( empty( $template_id ) ) {
46
  $message = __( 'Please select template.', 'email-subscribers' );
@@ -48,44 +48,46 @@ class ES_Newsletters {
48
  } elseif ( empty( $list_id ) ) {
49
  $message = __( 'Please select list.', 'email-subscribers' );
50
  ES_Common::show_message( $message, 'error' );
51
- }
52
 
53
- $data = array(
54
- 'base_template_id' => $template_id,
55
- 'list_ids' => $list_id,
56
- 'status' => 1
57
- );
58
 
59
- self::es_send_email_callback( $data );
60
 
61
- $reports_url = admin_url( 'admin.php?page=es_reports' );
62
- $message = __( sprintf( 'A new broadcast has been created successfully! Contacts from selected list will be notified within an hour. Want to notify now? <a href="%s" target="_blank">Click here</a>', $reports_url ), 'email-subscribers' );
63
 
64
- ES_Common::show_message( $message, 'success' );
65
 
66
- // **************** Quick Feedback - Start ********************
67
- global $ig_es_feedback;
68
 
69
- if ( ! $ig_es_feedback->can_show_feedback_widget() ) {
70
- return;
71
- }
72
 
73
- $event = 'broadcast.created';
74
- if ( ! $ig_es_feedback->is_event_transient_set( $ig_es_feedback->event_prefix . $event ) ) {
75
-
76
- $params = array(
77
- 'type' => 'emoji',
78
- 'event' => $event,
79
- 'title' => "How's your experience sending broadcast?",
80
- 'position' => 'top-end',
81
- 'width' => 300,
82
- 'delay' => 2, // seconds
83
- 'confirmButtonText' => __( 'Send', 'email-subscribers' )
84
- );
85
 
86
- ES_Common::render_feedback_widget( $params );
 
 
87
  }
88
- // **************** Quick Feedback - End ********************
89
  }
90
 
91
  $this->prepare_newsletter_settings_form();
@@ -105,7 +107,7 @@ class ES_Newsletters {
105
  <?php settings_fields( 'es_newsletters_settings' ); ?>
106
  <?php do_settings_sections( 'newsletters_settings' ); ?>
107
  <div class="email-newsletters">
108
- <input type="submit" id="" name="es_send_email" value="<?php _e( 'Send Broadcast', 'email-subscribers' ) ?>" class="button button-primary">
109
  <input type="hidden" name="submitted" value="submitted">
110
  </div>
111
  </form>
@@ -141,7 +143,7 @@ class ES_Newsletters {
141
 
142
  $fields = array(
143
  array(
144
- 'uid' => 'base_template_id',
145
  'label' => __( 'Select Template', 'email-subscribers' ),
146
  'section' => 'newsletters_settings',
147
  'type' => 'select',
@@ -153,7 +155,7 @@ class ES_Newsletters {
153
  ),
154
 
155
  array(
156
- 'uid' => 'list_ids',
157
  'label' => __( 'Select List', 'email-subscribers' ),
158
  'section' => 'newsletters_settings',
159
  'type' => 'select',
@@ -163,6 +165,14 @@ class ES_Newsletters {
163
  'supplemental' => __( 'Contacts from the selected list will be notified.', 'email-subscribers' ),
164
  'default' => ''
165
  ),
 
 
 
 
 
 
 
 
166
  );
167
  $fields = apply_filters( 'email_newsletter_settings_fields', $fields );
168
  foreach ( $fields as $field ) {
@@ -174,7 +184,7 @@ class ES_Newsletters {
174
 
175
  public function field_callback( $arguments ) {
176
  $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
177
- if ( ! $value ) { // If no value exists
178
  $value = $arguments['default']; // Set to our default
179
  }
180
 
@@ -183,6 +193,11 @@ class ES_Newsletters {
183
  case 'text': // If it is a text field
184
  printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
185
  break;
 
 
 
 
 
186
  case 'email':
187
  printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
188
  break;
@@ -201,22 +216,21 @@ class ES_Newsletters {
201
  }
202
 
203
  // If there is help text
204
- if ( $helper = $arguments['helper'] ) {
205
- printf( '<span class="helper"> %s</span>', $helper ); // Show it
206
  }
207
 
208
  // If there is supplemental text
209
- if ( $supplimental = $arguments['supplemental'] ) {
210
- printf( '<p class="description">%s</p>', $supplimental ); // Show it
211
  }
 
212
  }
213
 
214
  public static function es_send_email_callback( $data ) {
215
- global $wpdb;
216
 
217
- $template_id = ! empty( $data['base_template_id'] ) ? $data['base_template_id'] : '';
218
- $send_type = ! empty( $data['status'] ) ? $data['status'] : '';
219
- $list_id = ! empty( $data['list_ids'] ) ? $data['list_ids'] : '';
220
 
221
  $data['type'] = 'newsletter';
222
  $data['name'] = get_the_title( $template_id );
39
  if ( 'submitted' === $submitted ) {
40
 
41
  // $email_sent_type = __('Active', 'email-subscribers');
42
+ $list_id = Email_Subscribers::get_request( 'ig_es_broadcast_list_ids' );
43
+ $template_id = Email_Subscribers::get_request( 'ig_es_broadcast_base_template_id' );
44
 
45
  if ( empty( $template_id ) ) {
46
  $message = __( 'Please select template.', 'email-subscribers' );
48
  } elseif ( empty( $list_id ) ) {
49
  $message = __( 'Please select list.', 'email-subscribers' );
50
  ES_Common::show_message( $message, 'error' );
51
+ } else {
52
 
53
+ $data = array(
54
+ 'ig_es_broadcast_base_template_id' => $template_id,
55
+ 'ig_es_broadcast_list_ids' => $list_id,
56
+ 'status' => 1
57
+ );
58
 
59
+ self::es_send_email_callback( $data );
60
 
61
+ $reports_url = admin_url( 'admin.php?page=es_reports' );
62
+ $message = __( sprintf( 'A new broadcast has been created successfully! Contacts from selected list will be notified within an hour. Want to notify now? <a href="%s" target="_blank">Click here</a>', $reports_url ), 'email-subscribers' );
63
 
64
+ ES_Common::show_message( $message, 'success' );
65
 
66
+ // **************** Quick Feedback - Start ********************
67
+ global $ig_es_feedback;
68
 
69
+ if ( ! $ig_es_feedback->can_show_feedback_widget() ) {
70
+ return;
71
+ }
72
 
73
+ $event = 'broadcast.created';
74
+ if ( ! $ig_es_feedback->is_event_transient_set( $ig_es_feedback->event_prefix . $event ) ) {
75
+
76
+ $params = array(
77
+ 'type' => 'emoji',
78
+ 'event' => $event,
79
+ 'title' => "How's your experience sending broadcast?",
80
+ 'position' => 'top-end',
81
+ 'width' => 300,
82
+ 'delay' => 2, // seconds
83
+ 'confirmButtonText' => __( 'Send', 'email-subscribers' )
84
+ );
85
 
86
+ ES_Common::render_feedback_widget( $params );
87
+ }
88
+ // **************** Quick Feedback - End ********************
89
  }
90
+
91
  }
92
 
93
  $this->prepare_newsletter_settings_form();
107
  <?php settings_fields( 'es_newsletters_settings' ); ?>
108
  <?php do_settings_sections( 'newsletters_settings' ); ?>
109
  <div class="email-newsletters">
110
+ <input type="submit" id="ig_es_send_broadcast_button" name="es_send_email" value="<?php _e( 'Send Broadcast', 'email-subscribers' ) ?>" class="button button-primary">
111
  <input type="hidden" name="submitted" value="submitted">
112
  </div>
113
  </form>
143
 
144
  $fields = array(
145
  array(
146
+ 'uid' => 'ig_es_broadcast_base_template_id',
147
  'label' => __( 'Select Template', 'email-subscribers' ),
148
  'section' => 'newsletters_settings',
149
  'type' => 'select',
155
  ),
156
 
157
  array(
158
+ 'uid' => 'ig_es_broadcast_list_ids',
159
  'label' => __( 'Select List', 'email-subscribers' ),
160
  'section' => 'newsletters_settings',
161
  'type' => 'select',
165
  'supplemental' => __( 'Contacts from the selected list will be notified.', 'email-subscribers' ),
166
  'default' => ''
167
  ),
168
+
169
+ array(
170
+ 'uid' => 'ig_es_total_contacts',
171
+ 'label' => __( 'Total Contacts', 'email-subscribers' ),
172
+ 'section' => 'newsletters_settings',
173
+ 'type' => 'label',
174
+ 'default' => 0
175
+ ),
176
  );
177
  $fields = apply_filters( 'email_newsletter_settings_fields', $fields );
178
  foreach ( $fields as $field ) {
184
 
185
  public function field_callback( $arguments ) {
186
  $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
187
+ if ( ! $value && isset( $arguments['default'] ) ) { // If no value exists
188
  $value = $arguments['default']; // Set to our default
189
  }
190
 
193
  case 'text': // If it is a text field
194
  printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
195
  break;
196
+
197
+ case 'label': // If it is a text field
198
+ printf( '<p id="%1$s">%2$s</p>', $arguments['uid'], $value );
199
+ break;
200
+
201
  case 'email':
202
  printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
203
  break;
216
  }
217
 
218
  // If there is help text
219
+ if ( isset( $arguments['helper'] ) ) {
220
+ printf( '<span class="helper"> %s</span>', $arguments['helper'] ); // Show it
221
  }
222
 
223
  // If there is supplemental text
224
+ if ( isset( $arguments['supplemental'] ) ) {
225
+ printf( '<p class="description">%s</p>', $arguments['supplemental'] ); // Show it
226
  }
227
+
228
  }
229
 
230
  public static function es_send_email_callback( $data ) {
 
231
 
232
+ $template_id = ! empty( $data['ig_es_broadcast_base_template_id'] ) ? $data['ig_es_broadcast_base_template_id'] : '';
233
+ $list_id = ! empty( $data['ig_es_broadcast_list_ids'] ) ? $data['ig_es_broadcast_list_ids'] : '';
 
234
 
235
  $data['type'] = 'newsletter';
236
  $data['name'] = get_the_title( $template_id );
includes/class-email-subscribers.php CHANGED
@@ -91,9 +91,9 @@ class Email_Subscribers {
91
  $this->define_admin_hooks();
92
  $this->define_public_hooks();
93
 
94
- $ig_es_tracker = 'IG_Tracker_V_1_0_3';
95
  if ( is_admin() ) {
96
- $ig_es_feedback = new IG_Feedback_V_1_0_3( 'Email Subscribers', 'email-subscribers', 'ig_es', 'esfree.', false );
97
  $ig_es_feedback->render_deactivate_feedback();
98
  }
99
 
@@ -143,6 +143,12 @@ class Email_Subscribers {
143
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">' . $es_upgrade_text . '</p></div>';
144
  }
145
  }
 
 
 
 
 
 
146
  //cron notice
147
  $notice_option = get_option( 'ig_es_wp_cron_notice' );
148
 
@@ -340,8 +346,8 @@ class Email_Subscribers {
340
  'includes/pro-features.php',
341
 
342
  // Feedback
343
- 'includes/feedback/class-ig-tracker-v-1-0-3.php',
344
- 'includes/feedback/class-ig-feedback-v-1-0-3.php',
345
  'includes/feedback.php'
346
  );
347
 
91
  $this->define_admin_hooks();
92
  $this->define_public_hooks();
93
 
94
+ $ig_es_tracker = 'IG_Tracker_V_1_0_4';
95
  if ( is_admin() ) {
96
+ $ig_es_feedback = new IG_Feedback_V_1_0_4( 'Email Subscribers', 'email-subscribers', 'ig_es', 'esfree.', false );
97
  $ig_es_feedback->render_deactivate_feedback();
98
  }
99
 
143
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">' . $es_upgrade_text . '</p></div>';
144
  }
145
  }
146
+ $es_premium = 'email-subscribers-premium/email-subscribers-premium.php';
147
+ $all_plugins = $ig_es_tracker::get_plugins();
148
+ //get pro button
149
+ if ( ! in_array( $es_premium, $all_plugins ) && is_admin() && ! in_array( $screen_id, array('toplevel_page_es_dashboard'), true ) ) {
150
+ echo "<div class='notice es-floting-button'><i class='dashicons dashicons-es dashicons-awards'></i><a href='https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=go_starter_floating_button&utm_campaign=es_upsale' target='_blank'>" .__('Get Starter Now!', 'email-subscribers') ."</a></div>";
151
+ }
152
  //cron notice
153
  $notice_option = get_option( 'ig_es_wp_cron_notice' );
154
 
346
  'includes/pro-features.php',
347
 
348
  // Feedback
349
+ 'includes/feedback/class-ig-tracker-v-1-0-4.php',
350
+ 'includes/feedback/class-ig-feedback-v-1-0-4.php',
351
  'includes/feedback.php'
352
  );
353
 
includes/class-es-install.php CHANGED
@@ -377,7 +377,7 @@ class ES_Install {
377
  'ig_es_unsubscribe_link' => array( 'default' => $unsublink, 'old_option' => 'ig_es_unsublink' ),
378
  'ig_es_optin_link' => array( 'default' => $optinlink, 'old_option' => 'ig_es_optinlink' ),
379
  'ig_es_unsubscribe_link_content' => array( 'default' => $unsubscribe_link_content, 'old_option' => 'ig_es_unsubcontent' ),
380
- 'ig_es_email_type' => array( 'default' => 'wp_mail_html', 'old_option' => 'ig_es_emailtype', 'action' => 'convert_space_to_underscore' ),
381
  'ig_es_notify_admin' => array( 'default' => 'no', 'old_option' => 'ig_es_notifyadmin', 'action' => 'convert_space_to_underscore' ),
382
  'ig_es_optin_type' => array( 'default' => 'double_opt_in', 'old_option' => 'ig_es_optintype', 'action' => 'convert_space_to_underscore' ),
383
  'ig_es_subscription_error_messsage' => array( 'default' => $subscription_error_messsage, 'old_option' => 'ig_es_suberror' ),
@@ -618,8 +618,8 @@ class ES_Install {
618
  * - Send Email.
619
  */
620
 
621
- $admin_name = ES_Common::get_ig_option( 'admin_name' );
622
- $admin_email = ES_Common::get_ig_option( 'admin_email' );
623
 
624
  // Create Default Template
625
  $sample = '<strong style="color: #990000">What can you achieve using Email Subscribers?</strong><p>Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.';
@@ -662,8 +662,8 @@ class ES_Install {
662
  $data['slug'] = sanitize_title( $title );
663
  $data['name'] = $title;
664
  $data['type'] = 'newsletter';
665
- $data['from_email'] = $data['reply_to_email'] = $admin_email;
666
- $data['from_name'] = $data['reply_to_name'] = $admin_name;
667
  $data['list_ids'] = $list_id;
668
  $data['base_template_id'] = $post_id;
669
  $data['status'] = 1;
@@ -701,8 +701,8 @@ class ES_Install {
701
 
702
  // Newsletter Send
703
 
704
- $email_template = ES_Common::convert_es_templates( $sample, $admin_name, $admin_email, $email_created );
705
- $response = ES_Mailer::send( $admin_email, $title, $email_template );
706
  if ( ! empty( $response ) && $response['status'] === 'SUCCESS' ) {
707
  //update sent details
708
  $emails = ES_DB_Sending_Queue::get_emails_to_be_sent_by_hash( $guid, 5 );
@@ -724,8 +724,8 @@ class ES_Install {
724
 
725
  public static function create_and_send_default_post_notification() {
726
 
727
- $admin_name = ES_Common::get_ig_option( 'admin_name' );
728
- $admin_email = ES_Common::get_ig_option( 'admin_email' );
729
 
730
  $content = "Hello {{NAME}},\r\n\r\n";
731
  $content .= "We have published a new blog article on our website : {{POSTTITLE}}\r\n";
@@ -774,8 +774,8 @@ class ES_Install {
774
  $data['slug'] = sanitize_title( $title );
775
  $data['name'] = $title;
776
  $data['type'] = 'post_notification';
777
- $data['from_email'] = $data['reply_to_email'] = $admin_email;
778
- $data['from_name'] = $data['reply_to_name'] = $admin_name;
779
  $data['categories'] = $categories_str;
780
  $data['list_ids'] = $list_id;
781
  $data['base_template_id'] = $post_id;
@@ -823,8 +823,8 @@ class ES_Install {
823
  $email_created = time();
824
 
825
  // Post Notification Send Send
826
- $email_template = ES_Common::convert_es_templates( $content, $admin_name, $admin_email, $email_created );
827
- $response = ES_Mailer::send( $admin_email, $title, $email_template );
828
  if ( ! empty( $response ) && $response['status'] === 'SUCCESS' ) {
829
  //update sent details
830
  $emails = ES_DB_Sending_Queue::get_emails_to_be_sent_by_hash( $guid, 5 );
@@ -884,8 +884,8 @@ class ES_Install {
884
  'params' => array(
885
  'label' => 'Lists',
886
  'show' => false,
887
- 'required' => false,
888
- 'values' => $list_id
889
  ),
890
 
891
  'position' => 3
@@ -906,7 +906,7 @@ class ES_Install {
906
  );
907
 
908
  $settings = array(
909
- 'lists' => $list_id,
910
  'desc' => ''
911
  );
912
 
377
  'ig_es_unsubscribe_link' => array( 'default' => $unsublink, 'old_option' => 'ig_es_unsublink' ),
378
  'ig_es_optin_link' => array( 'default' => $optinlink, 'old_option' => 'ig_es_optinlink' ),
379
  'ig_es_unsubscribe_link_content' => array( 'default' => $unsubscribe_link_content, 'old_option' => 'ig_es_unsubcontent' ),
380
+ 'ig_es_email_type' => array( 'default' => 'wp_html_mail', 'old_option' => 'ig_es_emailtype', 'action' => 'convert_space_to_underscore' ),
381
  'ig_es_notify_admin' => array( 'default' => 'no', 'old_option' => 'ig_es_notifyadmin', 'action' => 'convert_space_to_underscore' ),
382
  'ig_es_optin_type' => array( 'default' => 'double_opt_in', 'old_option' => 'ig_es_optintype', 'action' => 'convert_space_to_underscore' ),
383
  'ig_es_subscription_error_messsage' => array( 'default' => $subscription_error_messsage, 'old_option' => 'ig_es_suberror' ),
618
  * - Send Email.
619
  */
620
 
621
+ $from_name = ES_Common::get_ig_option( 'from_name' );
622
+ $from_email = ES_Common::get_ig_option( 'from_email' );
623
 
624
  // Create Default Template
625
  $sample = '<strong style="color: #990000">What can you achieve using Email Subscribers?</strong><p>Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.';
662
  $data['slug'] = sanitize_title( $title );
663
  $data['name'] = $title;
664
  $data['type'] = 'newsletter';
665
+ $data['from_email'] = $data['reply_to_email'] = $from_email;
666
+ $data['from_name'] = $data['reply_to_name'] = $from_name;
667
  $data['list_ids'] = $list_id;
668
  $data['base_template_id'] = $post_id;
669
  $data['status'] = 1;
701
 
702
  // Newsletter Send
703
 
704
+ $email_template = ES_Common::convert_es_templates( $sample, $from_name, $from_email, $email_created );
705
+ $response = ES_Mailer::send( $from_email, $title, $email_template );
706
  if ( ! empty( $response ) && $response['status'] === 'SUCCESS' ) {
707
  //update sent details
708
  $emails = ES_DB_Sending_Queue::get_emails_to_be_sent_by_hash( $guid, 5 );
724
 
725
  public static function create_and_send_default_post_notification() {
726
 
727
+ $from_name = ES_Common::get_ig_option( 'from_name' );
728
+ $from_email = ES_Common::get_ig_option( 'from_email' );
729
 
730
  $content = "Hello {{NAME}},\r\n\r\n";
731
  $content .= "We have published a new blog article on our website : {{POSTTITLE}}\r\n";
774
  $data['slug'] = sanitize_title( $title );
775
  $data['name'] = $title;
776
  $data['type'] = 'post_notification';
777
+ $data['from_email'] = $data['reply_to_email'] = $from_name;
778
+ $data['from_name'] = $data['reply_to_name'] = $from_email;
779
  $data['categories'] = $categories_str;
780
  $data['list_ids'] = $list_id;
781
  $data['base_template_id'] = $post_id;
823
  $email_created = time();
824
 
825
  // Post Notification Send Send
826
+ $email_template = ES_Common::convert_es_templates( $content, $from_name, $from_email, $email_created );
827
+ $response = ES_Mailer::send( $from_email, $title, $email_template );
828
  if ( ! empty( $response ) && $response['status'] === 'SUCCESS' ) {
829
  //update sent details
830
  $emails = ES_DB_Sending_Queue::get_emails_to_be_sent_by_hash( $guid, 5 );
884
  'params' => array(
885
  'label' => 'Lists',
886
  'show' => false,
887
+ 'required' => true,
888
+ 'values' => array($list_id)
889
  ),
890
 
891
  'position' => 3
906
  );
907
 
908
  $settings = array(
909
+ 'lists' => array($list_id),
910
  'desc' => ''
911
  );
912
 
includes/db/class-es-db-lists-contacts.php CHANGED
@@ -27,12 +27,12 @@ class ES_DB_Lists_Contacts {
27
  global $wpdb;
28
  $query = "SELECT list_id FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $id";
29
 
30
- if(!empty($status)) {
31
  $query .= " AND status = %s";
32
- $query = $wpdb->prepare($query, $status);
33
  }
34
 
35
- $res = $wpdb->get_col( $query );
36
 
37
  return $res;
38
  }
@@ -45,24 +45,25 @@ class ES_DB_Lists_Contacts {
45
  return $res;
46
  }
47
 
48
- public static function get_list_contact_status_map( $id ){
49
  global $wpdb;
50
  $query = "SELECT list_id, status FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $id";
51
  $res = $wpdb->get_results( $query, ARRAY_A );
52
  foreach ( $res as $list ) {
53
  $lists_contact_status_map[ $list['list_id'] ] = $list['status'];
54
  }
 
55
  return $lists_contact_status_map;
56
  }
57
 
58
  public static function update_list_contacts( $contact_id, $list_ids ) {
59
  global $wpdb;
60
- $query = "DELETE FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $contact_id";
61
- $res = $wpdb->get_results( $query );
62
  $optin_type_option = get_option( 'ig_es_optin_type', true );
63
 
64
  $optin_type = 1;
65
- if(in_array($optin_type_option, array('double_opt_in', 'double_optin'))) {
66
  $optin_type = 2;
67
  }
68
 
@@ -91,8 +92,8 @@ class ES_DB_Lists_Contacts {
91
  public static function delete_contacts_from_list( $list_id, $contact_ids ) {
92
  global $wpdb;
93
  $contact_ids = implode( ',', $contact_ids );
94
- $query = "DELETE FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = $list_id AND contact_id IN ($contact_ids)";
95
- $res = $wpdb->get_results( $query );
96
 
97
  return $res;
98
  }
@@ -127,7 +128,7 @@ class ES_DB_Lists_Contacts {
127
  } elseif ( $contact['status'] === 'Unconfirmed' ) {
128
  $optin_type = IG_DOUBLE_OPTIN;
129
  $status = 'Unconfirmed';
130
- } elseif($contact['status'] === 'Unsubscribed') {
131
  $optin_type = IG_DOUBLE_OPTIN;
132
  $status = 'unsubscribed';
133
  }
@@ -180,13 +181,19 @@ class ES_DB_Lists_Contacts {
180
 
181
  }
182
 
183
- public static function get_total_count_by_list( $list_id, $status = 'active' ) {
184
  global $wpdb;
185
 
186
- if ( 'active' === $status ) {
187
- $sql = "SELECT count(*) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d AND status = 'subscribed'";
 
 
 
 
 
 
188
  } else {
189
- $sql = "SELECT count(*) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d";
190
  }
191
 
192
  $total_count = $wpdb->get_var( $wpdb->prepare( $sql, $list_id ) );
27
  global $wpdb;
28
  $query = "SELECT list_id FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $id";
29
 
30
+ if ( ! empty( $status ) ) {
31
  $query .= " AND status = %s";
32
+ $query = $wpdb->prepare( $query, $status );
33
  }
34
 
35
+ $res = $wpdb->get_col( $query );
36
 
37
  return $res;
38
  }
45
  return $res;
46
  }
47
 
48
+ public static function get_list_contact_status_map( $id ) {
49
  global $wpdb;
50
  $query = "SELECT list_id, status FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $id";
51
  $res = $wpdb->get_results( $query, ARRAY_A );
52
  foreach ( $res as $list ) {
53
  $lists_contact_status_map[ $list['list_id'] ] = $list['status'];
54
  }
55
+
56
  return $lists_contact_status_map;
57
  }
58
 
59
  public static function update_list_contacts( $contact_id, $list_ids ) {
60
  global $wpdb;
61
+ $query = "DELETE FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE contact_id = $contact_id";
62
+ $res = $wpdb->get_results( $query );
63
  $optin_type_option = get_option( 'ig_es_optin_type', true );
64
 
65
  $optin_type = 1;
66
+ if ( in_array( $optin_type_option, array( 'double_opt_in', 'double_optin' ) ) ) {
67
  $optin_type = 2;
68
  }
69
 
92
  public static function delete_contacts_from_list( $list_id, $contact_ids ) {
93
  global $wpdb;
94
  $contact_ids = implode( ',', $contact_ids );
95
+ $query = "DELETE FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = $list_id AND contact_id IN ($contact_ids)";
96
+ $res = $wpdb->get_results( $query );
97
 
98
  return $res;
99
  }
128
  } elseif ( $contact['status'] === 'Unconfirmed' ) {
129
  $optin_type = IG_DOUBLE_OPTIN;
130
  $status = 'Unconfirmed';
131
+ } elseif ( $contact['status'] === 'Unsubscribed' ) {
132
  $optin_type = IG_DOUBLE_OPTIN;
133
  $status = 'unsubscribed';
134
  }
181
 
182
  }
183
 
184
+ public static function get_total_count_by_list( $list_id, $status = 'subscribed' ) {
185
  global $wpdb;
186
 
187
+ if ( 'subscribed' === $status ) {
188
+ $sql = "SELECT count(DISTINCT(contact_id)) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d AND status = 'subscribed'";
189
+ } elseif ( 'unsubscribed' === $status ) {
190
+ $sql = "SELECT count(DISTINCT(contact_id)) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d AND status = 'unsubscribed'";
191
+ } elseif ( 'confirmed' === $status ) {
192
+ $sql = "SELECT count(DISTINCT(contact_id)) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d AND status = 'subscribed' AND optin_type = 2 ";
193
+ } elseif ( 'unconfirmed' === $status ) {
194
+ $sql = "SELECT count(DISTINCT(contact_id)) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d AND status = 'unconfirmed'";
195
  } else {
196
+ $sql = "SELECT count(DISTINCT(contact_id)) FROM " . IG_LISTS_CONTACTS_TABLE . " WHERE list_id = %d";
197
  }
198
 
199
  $total_count = $wpdb->get_var( $wpdb->prepare( $sql, $list_id ) );
includes/feedback.php CHANGED
@@ -119,10 +119,10 @@ function ig_es_render_general_feedback_widget() {
119
  'event' => $event,
120
  'title' => "Have feedback or question for us?",
121
  'position' => 'center',
122
- 'width' => 600,
123
  'force' => true,
124
  'confirmButtonText' => __( 'Send', 'email-subscribers' ),
125
- 'consent_text' => __( sprintf( 'By clicking on send button you are agree to our <a href="%s" target="_blank">Privacy Policy</a>', "https://www.icegram.com/privacy-policy/" ), 'email-subscribers' ),
126
  'email' => get_option( 'admin_email' ),
127
  'name' => ''
128
  );
119
  'event' => $event,
120
  'title' => "Have feedback or question for us?",
121
  'position' => 'center',
122
+ 'width' => 700,
123
  'force' => true,
124
  'confirmButtonText' => __( 'Send', 'email-subscribers' ),
125
+ 'consent_text' => __( 'Allow Email Subscribers to track plugin usage. We guarantee no sensitive data is collected.', 'email-subscribers' ),
126
  'email' => get_option( 'admin_email' ),
127
  'name' => ''
128
  );
includes/feedback/{class-ig-feedback-v-1-0-3.php → class-ig-feedback-v-1-0-4.php} RENAMED
@@ -5,7 +5,7 @@
5
  * The IG Feedback class adds functionality to get quick interactive feedback from users.
6
  * There are different types of feedabck widget like Stars, Emoji, Thubms Up/ Down, Number etc.
7
  *
8
- * @class IG_Feedback_V_1_0_2
9
  * @package feedback
10
  * @copyright Copyright (c) 2019, Icegram
11
  * @license https://opensource.org/licenses/gpl-license GNU Public License
@@ -15,7 +15,7 @@
15
 
16
  defined( 'ABSPATH' ) || exit;
17
 
18
- if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
19
  /**
20
  * Icegram Deactivation Survey.
21
  *
@@ -27,7 +27,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
27
  * @license GPL-2.0+
28
  * @copyright Copyright (c) 2019
29
  */
30
- class IG_Feedback_V_1_0_3 {
31
 
32
  /**
33
  * The API URL where we will send feedback data.
@@ -157,8 +157,11 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
157
  *
158
  * @param array $params
159
  *
 
 
160
  * @since 1.0.3
161
  */
 
162
  public function prepare_widget_params( $params = array() ) {
163
 
164
  $default_params = array(
@@ -374,8 +377,8 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
374
 
375
  /**
376
  * Render General Feedback Sidebar Button Widget
377
- *
378
- * @since 1.0.3
379
  */
380
  public function render_general_feedback( $params = array() ) {
381
 
@@ -399,7 +402,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
399
  <textarea name="feedback_data[details]" id="ig-feedback-data-message"></textarea>
400
  </p>
401
  <p>
402
- <input type="checkbox" name="feedback_data[collect_system_info]" id="ig-feedback-data-consent"/><?php echo $params['consent_text']; ?>
403
  </p>
404
  </form>
405
 
@@ -450,7 +453,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
450
 
451
  function validateEmail(email) {
452
  var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
453
- if( !emailReg.test( email ) ) {
454
  return false;
455
  } else {
456
  return true;
@@ -482,14 +485,6 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
482
  },
483
  onOpen: () => {
484
 
485
- Swal.disableButtons();
486
- $('#ig-feedback-data-consent').on('click', function () {
487
- if ($(this).attr('checked') === 'checked') {
488
- Swal.enableButtons();
489
- } else {
490
- Swal.disableButtons();
491
- }
492
- });
493
 
494
  },
495
  preConfirm: () => {
@@ -499,29 +494,28 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
499
  var message = $('#ig-feedback-data-message').val();
500
  var consent = $('#ig-feedback-data-consent').attr('checked');
501
 
502
- if (consent !== 'checked') {
503
- Swal.showValidationMessage('Please give your consent');
504
- return;
505
- }
506
 
507
- if(email !== '' && !validateEmail(email)) {
508
  Swal.showValidationMessage('Please enter valid email');
509
  return;
510
- }
511
 
512
  if (message === '') {
513
  Swal.showValidationMessage('Please enter your message');
514
  return;
515
  }
516
 
517
-
 
 
 
518
 
519
  var meta = {
520
  name: name,
521
  email: email
522
  };
523
 
524
- return doSend(message, meta, true);
525
  }
526
  },
527
 
@@ -582,7 +576,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
582
  return;
583
  }
584
 
585
- $title = 'Why are you deactivating Email Subscribers?';
586
  $slug = sanitize_title( $title );
587
  $event = $this->event_prefix . 'plugin.deactivation';
588
 
@@ -1003,7 +997,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_0_3' ) ) {
1003
  $plugin_abbr = ! empty( $data['misc']['plugin_abbr'] ) ? $data['misc']['plugin_abbr'] : 'ig_feedback';
1004
  $is_dev_mode = ! empty( $data['misc']['is_dev_mode'] ) ? $data['misc']['is_dev_mode'] : false;
1005
  $set_transient = ! empty( $data['misc']['set_transient'] ) ? $data['misc']['set_transient'] : false;
1006
- $system_info = ! empty( $data['misc']['system_info'] ) ? $data['misc']['system_info'] : false;
1007
  $meta_info = ! empty( $data['misc']['meta_info'] ) ? $data['misc']['meta_info'] : array();
1008
 
1009
  unset( $data['misc'] );
5
  * The IG Feedback class adds functionality to get quick interactive feedback from users.
6
  * There are different types of feedabck widget like Stars, Emoji, Thubms Up/ Down, Number etc.
7
  *
8
+ * @class IG_Feedback_V_1_0_4
9
  * @package feedback
10
  * @copyright Copyright (c) 2019, Icegram
11
  * @license https://opensource.org/licenses/gpl-license GNU Public License
15
 
16
  defined( 'ABSPATH' ) || exit;
17
 
18
+ if ( ! class_exists( 'IG_Feedback_V_1_0_4' ) ) {
19
  /**
20
  * Icegram Deactivation Survey.
21
  *
27
  * @license GPL-2.0+
28
  * @copyright Copyright (c) 2019
29
  */
30
+ class IG_Feedback_V_1_0_4 {
31
 
32
  /**
33
  * The API URL where we will send feedback data.
157
  *
158
  * @param array $params
159
  *
160
+ * @return array
161
+ *
162
  * @since 1.0.3
163
  */
164
+
165
  public function prepare_widget_params( $params = array() ) {
166
 
167
  $default_params = array(
377
 
378
  /**
379
  * Render General Feedback Sidebar Button Widget
380
+ *
381
+ * @since 1.0.3
382
  */
383
  public function render_general_feedback( $params = array() ) {
384
 
402
  <textarea name="feedback_data[details]" id="ig-feedback-data-message"></textarea>
403
  </p>
404
  <p>
405
+ <input type="checkbox" name="feedback_data[collect_system_info]" checked="checked" id="ig-feedback-data-consent"/><?php echo $params['consent_text']; ?>
406
  </p>
407
  </form>
408
 
453
 
454
  function validateEmail(email) {
455
  var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
456
+ if (!emailReg.test(email)) {
457
  return false;
458
  } else {
459
  return true;
485
  },
486
  onOpen: () => {
487
 
 
 
 
 
 
 
 
 
488
 
489
  },
490
  preConfirm: () => {
494
  var message = $('#ig-feedback-data-message').val();
495
  var consent = $('#ig-feedback-data-consent').attr('checked');
496
 
 
 
 
 
497
 
498
+ if (email !== '' && !validateEmail(email)) {
499
  Swal.showValidationMessage('Please enter valid email');
500
  return;
501
+ }
502
 
503
  if (message === '') {
504
  Swal.showValidationMessage('Please enter your message');
505
  return;
506
  }
507
 
508
+ var system_info = false;
509
+ if (consent === 'checked') {
510
+ system_info = true;
511
+ }
512
 
513
  var meta = {
514
  name: name,
515
  email: email
516
  };
517
 
518
+ return doSend(message, meta, system_info);
519
  }
520
  },
521
 
576
  return;
577
  }
578
 
579
+ $title = 'Why are you deactivating ' . $this->name . '?';
580
  $slug = sanitize_title( $title );
581
  $event = $this->event_prefix . 'plugin.deactivation';
582
 
997
  $plugin_abbr = ! empty( $data['misc']['plugin_abbr'] ) ? $data['misc']['plugin_abbr'] : 'ig_feedback';
998
  $is_dev_mode = ! empty( $data['misc']['is_dev_mode'] ) ? $data['misc']['is_dev_mode'] : false;
999
  $set_transient = ! empty( $data['misc']['set_transient'] ) ? $data['misc']['set_transient'] : false;
1000
+ $system_info = ( isset( $data['misc']['system_info'] ) && $data['misc']['system_info'] === 'true' ) ? true : false;
1001
  $meta_info = ! empty( $data['misc']['meta_info'] ) ? $data['misc']['meta_info'] : array();
1002
 
1003
  unset( $data['misc'] );
includes/feedback/{class-ig-tracker-v-1-0-3.php → class-ig-tracker-v-1-0-4.php} RENAMED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- if ( ! class_exists( 'IG_Tracker_V_1_0_3' ) ) {
8
 
9
  /**
10
  * Icegram tracker.
@@ -14,7 +14,7 @@ if ( ! class_exists( 'IG_Tracker_V_1_0_3' ) ) {
14
  *
15
  * @since 1.0.0
16
  */
17
- class IG_Tracker_V_1_0_3 {
18
 
19
  /**
20
  * Get Active, Inactive or all plugins info
@@ -193,4 +193,4 @@ if ( ! class_exists( 'IG_Tracker_V_1_0_3' ) ) {
193
  return $wp_info;
194
  }
195
  }
196
- }
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ if ( ! class_exists( 'IG_Tracker_V_1_0_4' ) ) {
8
 
9
  /**
10
  * Icegram tracker.
14
  *
15
  * @since 1.0.0
16
  */
17
+ class IG_Tracker_V_1_0_4 {
18
 
19
  /**
20
  * Get Active, Inactive or all plugins info
193
  return $wp_info;
194
  }
195
  }
196
+ }
includes/pro-features.php CHANGED
@@ -22,7 +22,7 @@ function ig_es_add_upsale( $fields ) {
22
  'id' => 'ig_es_blocked_domains',
23
  'type' => 'html',
24
  'name' => '',
25
- 'html' => '<div class="es-upsale-image" style=""><a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=es_security_settings&utm_campaign=es_upsale#blockspam"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-captcha-2.png' . '"/></a></div>'
26
  );
27
  $fields['security_settings'] = array_merge( $fields['security_settings'], $field_security );
28
 
@@ -30,7 +30,7 @@ function ig_es_add_upsale( $fields ) {
30
  $field_smtp['es_upsale_smtp'] = array(
31
  'id' => 'ig_es_blocked_domains',
32
  'type' => 'html',
33
- 'name' => '<div class="es-smtp-label" style=""><a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=es_smtp&utm_campaign=es_upsale#delivery"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-smtp-label.png' . '"/></a></div>',
34
  'html' => '<div class="es-upsale-image es-smtp-image" style=""><a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=es_smtp&utm_campaign=es_upsale"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-smtp.png' . '"/></a></div>'
35
  );
36
  $fields['email_sending'] = array_merge( $fields['email_sending'], $field_smtp );
@@ -110,7 +110,7 @@ function ig_es_add_comments_tab_settings( $tab_options ) {
110
  $content = ob_get_clean();
111
 
112
  ?>
113
- <a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=es_comment_upsale&utm_campaign=es_upsale#sync_comment_users">
114
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/es-comments.png' ?> "/>
115
  </a>
116
  <?php
@@ -137,7 +137,7 @@ function ig_es_add_woocommerce_tab_settings( $tab_options ) {
137
  </div>
138
  <?php $content = ob_get_clean(); ?>
139
 
140
- <a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=woocommerce_sync&utm_campaign=es_upsale#sync_woocommerce_customers">
141
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/woocommerce-sync.png' ?> "/>
142
  </a>
143
 
@@ -168,7 +168,7 @@ function ig_es_add_cf7_tab_settings( $tab_options ) {
168
  </div>
169
  <?php $content = ob_get_clean(); ?>
170
 
171
- <a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=cf7_sync&utm_campaign=es_upsale#sync_cf7_subscribers">
172
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/cf7-sync.png' ?> "/>
173
  </a>
174
 
22
  'id' => 'ig_es_blocked_domains',
23
  'type' => 'html',
24
  'name' => '',
25
+ 'html' => '<div class="es-upsale-image" style=""><a target="_blank" href="https://www.icegram.com/managed-blacklists-captcha/?utm_source=in_app&utm_medium=es_security_settings&utm_campaign=es_upsale#blockspam"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-captcha-2.png' . '"/></a></div>'
26
  );
27
  $fields['security_settings'] = array_merge( $fields['security_settings'], $field_security );
28
 
30
  $field_smtp['es_upsale_smtp'] = array(
31
  'id' => 'ig_es_blocked_domains',
32
  'type' => 'html',
33
+ 'name' => '<div class="es-smtp-label" style=""><a target="_blank" href="https://www.icegram.com/solid-email-delivery/?utm_source=in_app&utm_medium=es_smtp&utm_campaign=es_upsale#delivery"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-smtp-label.png' . '"/></a></div>',
34
  'html' => '<div class="es-upsale-image es-smtp-image" style=""><a target="_blank" href="https://www.icegram.com/email-subscribers-starter/?utm_source=in_app&utm_medium=es_smtp&utm_campaign=es_upsale"><img src="' . EMAIL_SUBSCRIBERS_URL . '/admin/images/es-smtp.png' . '"/></a></div>'
35
  );
36
  $fields['email_sending'] = array_merge( $fields['email_sending'], $field_smtp );
110
  $content = ob_get_clean();
111
 
112
  ?>
113
+ <a target="_blank" href="https://www.icegram.com/quickly-add-people-to-your-mailing-list-whenever-someone-post-a-comment/?utm_source=in_app&utm_medium=es_comment_upsale&utm_campaign=es_upsale#sync_comment_users">
114
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/es-comments.png' ?> "/>
115
  </a>
116
  <?php
137
  </div>
138
  <?php $content = ob_get_clean(); ?>
139
 
140
+ <a target="_blank" href="https://www.icegram.com/quickly-add-customers-to-your-mailing-list/?utm_source=in_app&utm_medium=woocommerce_sync&utm_campaign=es_upsale#sync_woocommerce_customers">
141
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/woocommerce-sync.png' ?> "/>
142
  </a>
143
 
168
  </div>
169
  <?php $content = ob_get_clean(); ?>
170
 
171
+ <a target="_blank" href="https://www.icegram.com/add-people-to-your-mailing-list-whenever-they-submit-any-of-the-contact-form-7-form/?utm_source=in_app&utm_medium=cf7_sync&utm_campaign=es_upsale#sync_cf7_subscribers">
172
  <img src=" <?php echo EMAIL_SUBSCRIBERS_URL . '/admin/images/cf7-sync.png' ?> "/>
173
  </a>
174
 
public/css/email-subscribers-public.css CHANGED
@@ -49,6 +49,6 @@
49
  margin-bottom: 0.6em;
50
  }
51
 
52
- .ig-es-form-list-selection tr {
53
- border-bottom: none;
54
- }
49
  margin-bottom: 0.6em;
50
  }
51
 
52
+ .ig-es-form-list-selection, .ig-es-form-list-selection td, .ig-es-form-list-selection tr {
53
+ border: none;
54
+ }
public/partials/class-es-shortcode.php CHANGED
@@ -201,14 +201,14 @@ class ES_Shortcode {
201
 
202
  </form>
203
 
204
- <span class="es_subscription_message success" id="es_subscription_message_<?php echo $unique_id; ?>"></span>
205
  </div>
206
 
207
  <?php
208
  }
209
 
210
  public static function prepare_lists_checkboxes( $lists, $list_ids = array(), $columns = 3, $selected_lists = array(), $contact_id = 0 ) {
211
- $lists_html = '<div><br /><p><b>' . __('Select List(s)', 'email-subscribers') .'*</b></p><table class="ig-es-form-list-selection"><tr>';
212
  $i = 0;
213
  foreach ( $lists as $list_id => $list_name ) {
214
  if ( $i != 0 && ( $i % $columns ) === 0 ) {
201
 
202
  </form>
203
 
204
+ <span class="es_subscription_message" id="es_subscription_message_<?php echo $unique_id; ?>"></span>
205
  </div>
206
 
207
  <?php
208
  }
209
 
210
  public static function prepare_lists_checkboxes( $lists, $list_ids = array(), $columns = 3, $selected_lists = array(), $contact_id = 0 ) {
211
+ $lists_html = '<div><p><b>' . __('Select List(s)', 'email-subscribers') .'*</b></p><table class="ig-es-form-list-selection"><tr>';
212
  $i = 0;
213
  foreach ( $lists as $list_id => $list_name ) {
214
  if ( $i != 0 && ( $i % $columns ) === 0 ) {
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Author URI: https://www.icegram.com/
5
  Tags: subscription, newsletter, email marketing, post notification, email newsletter form, email signup, email widget, newsletter signup, subscribe, subscription form, bulk emails, signup form, list builder, lead generation, welcome email, contacts
6
  Requires at least: 3.9
7
- Tested up to: 5.2.1
8
- Stable tag: 4.1.4
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
@@ -304,6 +304,10 @@ Use our free plugin [Email Subscribers - Group Selector](https://wordpress.org/p
304
  9. Admin page - Settings Tab 4 - Security Settings
305
 
306
  == Changelog ==
 
 
 
 
307
 
308
  = 4.1.4 (13.06.2019) =
309
  * New: Added First Name, Last Name in exported csv file
4
  Author URI: https://www.icegram.com/
5
  Tags: subscription, newsletter, email marketing, post notification, email newsletter form, email signup, email widget, newsletter signup, subscribe, subscription form, bulk emails, signup form, list builder, lead generation, welcome email, contacts
6
  Requires at least: 3.9
7
+ Tested up to: 5.2.2
8
+ Stable tag: 4.1.5
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
304
  9. Admin page - Settings Tab 4 - Security Settings
305
 
306
  == Changelog ==
307
+ = 4.1.5 (20.06.2019) =
308
+ * Update: Added "Opt-In Type" column in exported contacts lists
309
+ * Update: Allow to send broadcast only if contacts are available in list
310
+ * Fix: "Select the list" error
311
 
312
  = 4.1.4 (13.06.2019) =
313
  * New: Added First Name, Last Name in exported csv file