Email Subscribers & Newsletters - Version 4.3.4.1

Version Description

Download this release

Release Info

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

Code changes from version 4.3.4 to 4.3.4.1

email-subscribers.php CHANGED
@@ -3,7 +3,7 @@
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.3.4
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
@@ -111,7 +111,7 @@ if ( $is_premium ) {
111
  /* ***************************** Initial Compatibility Work (End) ******************* */
112
 
113
  if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
114
- define( 'ES_PLUGIN_VERSION', '4.3.4' );
115
  }
116
 
117
  // Plugin Folder Path.
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.3.4.1
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
111
  /* ***************************** Initial Compatibility Work (End) ******************* */
112
 
113
  if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
114
+ define( 'ES_PLUGIN_VERSION', '4.3.4.1' );
115
  }
116
 
117
  // Plugin Folder Path.
lite/includes/classes/class-es-campaigns-table.php CHANGED
@@ -41,7 +41,7 @@ class ES_Campaigns_Table extends WP_List_Table {
41
 
42
  $this->db = new ES_DB_Campaigns();
43
 
44
- add_action('ig_es_campaign_deleted', array($this, 'delete_child_campaigns'), 10, 1);
45
  }
46
 
47
  /**
@@ -63,19 +63,22 @@ class ES_Campaigns_Table extends WP_List_Table {
63
  }
64
 
65
  /**
66
- * Delete all child campaigns based on $parent_campaign_id
67
- *
68
  * @param int $parent_campaign_id
69
- *
70
- * @since 4.3.4
71
  */
72
- public function delete_child_campaigns( $parent_campaign_id = 0) {
 
 
73
 
74
- $child_campaign_ids = $this->db->get_campaigns_by_parent_id($parent_campaign_id);
75
 
76
- //Delete All Child Campaigns
77
- $this->db->delete_campaigns($child_campaign_ids);
78
- }
 
79
 
80
  /**
81
  * Render Campaigns table
@@ -350,17 +353,17 @@ class ES_Campaigns_Table extends WP_List_Table {
350
  }
351
 
352
  /**
353
- * Prepare search box
354
- *
355
  * @param string $text
356
  * @param string $input_id
357
- *
358
- * @since 4.0.0
359
- * @since 4.3.4 Added esc_attr()
360
  */
361
- public function search_box( $text = '', $input_id = '') { ?>
362
  <p class="search-box">
363
- <label class="screen-reader-text" for="<?php echo esc_attr($input_id); ?>"><?php echo esc_attr($text); ?>:</label>
364
  <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
365
  <?php submit_button( __( 'Search Campaigns', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
366
  </p>
@@ -422,7 +425,7 @@ class ES_Campaigns_Table extends WP_List_Table {
422
  $ids = ig_es_get_request_data( 'campaigns' );
423
 
424
  if ( is_array( $ids ) && count( $ids ) > 0 ) {
425
- // Delete multiple Campaigns
426
  $this->db->delete_campaigns( $ids );
427
 
428
  $message = __( 'Campaign(s) have been deleted successfully!', 'email-subscribers' );
41
 
42
  $this->db = new ES_DB_Campaigns();
43
 
44
+ add_action( 'ig_es_campaign_deleted', array( $this, 'delete_child_campaigns' ), 10, 1 );
45
  }
46
 
47
  /**
63
  }
64
 
65
  /**
66
+ * Delete all child campaigns based on $parent_campaign_id
67
+ *
68
  * @param int $parent_campaign_id
69
+ *
70
+ * @since 4.3.4
71
  */
72
+ public function delete_child_campaigns( $parent_campaign_id = 0 ) {
73
+
74
+ if ( 0 != $parent_campaign_id ) {
75
 
76
+ $child_campaign_ids = $this->db->get_campaigns_by_parent_id( $parent_campaign_id );
77
 
78
+ //Delete All Child Campaigns
79
+ $this->db->delete_campaigns( $child_campaign_ids );
80
+ }
81
+ }
82
 
83
  /**
84
  * Render Campaigns table
353
  }
354
 
355
  /**
356
+ * Prepare search box
357
+ *
358
  * @param string $text
359
  * @param string $input_id
360
+ *
361
+ * @since 4.0.0
362
+ * @since 4.3.4 Added esc_attr()
363
  */
364
+ public function search_box( $text = '', $input_id = '' ) { ?>
365
  <p class="search-box">
366
+ <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
367
  <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
368
  <?php submit_button( __( 'Search Campaigns', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
369
  </p>
425
  $ids = ig_es_get_request_data( 'campaigns' );
426
 
427
  if ( is_array( $ids ) && count( $ids ) > 0 ) {
428
+ // Delete multiple Campaigns
429
  $this->db->delete_campaigns( $ids );
430
 
431
  $message = __( 'Campaign(s) have been deleted successfully!', 'email-subscribers' );
lite/includes/db/class-es-db-lists-contacts.php CHANGED
@@ -250,9 +250,13 @@ class ES_DB_Lists_Contacts {
250
  $ids = array( $ids );
251
  }
252
 
 
 
 
253
  $ids = implode( ', ', array_map( 'absint', $ids ) );
254
 
255
- $current_date = ig_get_current_date_time();
 
256
  $ig_lists_contact_table = IG_LISTS_CONTACTS_TABLE;
257
 
258
  if ( 'subscribed' === $status ) {
@@ -280,7 +284,7 @@ class ES_DB_Lists_Contacts {
280
  *
281
  * @since 4.1.14
282
  */
283
- public static function is_status_update_required( $ids = array(), $status = '') {
284
  global $wpdb;
285
 
286
  $response = false;
@@ -289,9 +293,11 @@ class ES_DB_Lists_Contacts {
289
  $ids = array( $ids );
290
  }
291
 
 
 
292
  $ig_lists_contact_table = IG_LISTS_CONTACTS_TABLE;
293
 
294
- $ids = implode( ',', array_map( 'absint', $ids ) );
295
 
296
  $sql = "SELECT count(*) as total FROM {$ig_lists_contact_table} WHERE contact_id IN ($ids) && status != %s";
297
  $query = $wpdb->prepare( $sql, array( $status ) );
250
  $ids = array( $ids );
251
  }
252
 
253
+ $ids = esc_sql( $ids );
254
+ $status = esc_sql( $status );
255
+
256
  $ids = implode( ', ', array_map( 'absint', $ids ) );
257
 
258
+ $current_date = ig_get_current_date_time();
259
+
260
  $ig_lists_contact_table = IG_LISTS_CONTACTS_TABLE;
261
 
262
  if ( 'subscribed' === $status ) {
284
  *
285
  * @since 4.1.14
286
  */
287
+ public static function is_status_update_required( $ids = array(), $status = '' ) {
288
  global $wpdb;
289
 
290
  $response = false;
293
  $ids = array( $ids );
294
  }
295
 
296
+ $ids = esc_sql( $ids );
297
+
298
  $ig_lists_contact_table = IG_LISTS_CONTACTS_TABLE;
299
 
300
+ $ids = implode( ', ', array_map( 'absint', $ids ) );
301
 
302
  $sql = "SELECT count(*) as total FROM {$ig_lists_contact_table} WHERE contact_id IN ($ids) && status != %s";
303
  $query = $wpdb->prepare( $sql, array( $status ) );
lite/includes/db/class-es-db-mailing-queue.php CHANGED
@@ -211,7 +211,9 @@ class ES_DB_Mailing_Queue {
211
  public static function delete_notifications( $ids ) {
212
  global $wpdb;
213
 
214
- $ids = implode( ', ', array_map( 'absint', array_map( 'esc_sql', $ids ) ) );
 
 
215
 
216
  $mailing_queue_table = IG_MAILING_QUEUE_TABLE;
217
 
211
  public static function delete_notifications( $ids ) {
212
  global $wpdb;
213
 
214
+ $ids = esc_sql( $ids );
215
+
216
+ $ids = implode( ', ', array_map( 'absint', $ids ) );
217
 
218
  $mailing_queue_table = IG_MAILING_QUEUE_TABLE;
219
 
lite/includes/db/class-es-db-sending-queue.php CHANGED
@@ -424,7 +424,9 @@ class ES_DB_Sending_Queue {
424
  public static function delete_sending_queue_by_mailing_id( $mailing_queue_ids ) {
425
  global $wpdb;
426
 
427
- $mailing_queue_ids = implode( ', ', array_map( 'absint', array_map( 'esc_sql', $mailing_queue_ids ) ) );
 
 
428
 
429
  $sending_queue_table = IG_SENDING_QUEUE_TABLE;
430
 
424
  public static function delete_sending_queue_by_mailing_id( $mailing_queue_ids ) {
425
  global $wpdb;
426
 
427
+ $mailing_queue_ids = esc_sql( $mailing_queue_ids );
428
+
429
+ $mailing_queue_ids = implode( ', ', array_map( 'absint', $mailing_queue_ids ) );
430
 
431
  $sending_queue_table = IG_SENDING_QUEUE_TABLE;
432
 
lite/includes/es-core-functions.php CHANGED
@@ -258,21 +258,22 @@ if ( ! function_exists( 'ig_es_get_ip' ) ) {
258
  function ig_es_get_ip() {
259
 
260
  // Get real visitor IP behind CloudFlare network
261
- if ( isset( $_SERVER["HTTP_CF_CONNECTING_IP"] ) ) {
262
- $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
263
- $_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
264
- }
265
-
266
- $client = @$_SERVER['HTTP_CLIENT_IP'];
267
- $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
268
- $remote = $_SERVER['REMOTE_ADDR'];
269
-
270
- if ( filter_var( $client, FILTER_VALIDATE_IP ) ) {
271
- $ip = $client;
272
- } elseif ( filter_var( $forward, FILTER_VALIDATE_IP ) ) {
273
- $ip = $forward;
 
274
  } else {
275
- $ip = $remote;
276
  }
277
 
278
  return $ip;
258
  function ig_es_get_ip() {
259
 
260
  // Get real visitor IP behind CloudFlare network
261
+ if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
262
+ $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
263
+ } elseif ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) {
264
+ $ip = $_SERVER['HTTP_X_REAL_IP'];
265
+ } elseif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
266
+ $ip = $_SERVER['HTTP_CLIENT_IP'];
267
+ } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
268
+ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
269
+ } elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
270
+ $ip = $_SERVER['HTTP_X_FORWARDED'];
271
+ } elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
272
+ $ip = $_SERVER['HTTP_FORWARDED_FOR'];
273
+ } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
274
+ $ip = $_SERVER['HTTP_FORWARDED'];
275
  } else {
276
+ $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : 'UNKNOWN';
277
  }
278
 
279
  return $ip;
lite/includes/upgrade/es-update-functions.php CHANGED
@@ -1105,11 +1105,12 @@ function ig_es_update_432_db_version() {
1105
  * Delete Campaigns Permanently
1106
  *
1107
  * @since 4.3.4
 
1108
  */
1109
  function ig_es_update_434_permanently_delete_campaigns() {
1110
  global $wpdb;
1111
 
1112
- $query = "DELETE FROM {$wpdb->prefix}ig_campaigns WHERE deleted_at IS NOT NULL";
1113
  $wpdb->query($query);
1114
  }
1115
 
1105
  * Delete Campaigns Permanently
1106
  *
1107
  * @since 4.3.4
1108
+ * @since 4.3.4.1 Added and condition
1109
  */
1110
  function ig_es_update_434_permanently_delete_campaigns() {
1111
  global $wpdb;
1112
 
1113
+ $query = "DELETE FROM {$wpdb->prefix}ig_campaigns WHERE deleted_at IS NOT NULL AND deleted_at != '0000-00-00 00:00:00' ";
1114
  $wpdb->query($query);
1115
  }
1116
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ 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.3
8
- Stable tag: 4.3.4
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
@@ -300,8 +300,13 @@ Refer [here](https://www.icegram.com/documentation/es-faq/).
300
 
301
  == Changelog ==
302
 
 
 
 
 
 
303
  **4.3.4 (28.11.2019)**
304
- * Update: Delete Campaigns Permanently
305
  * Fix: Import issue
306
  * Fix: Multiple email sending issue
307
 
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.3
8
+ Stable tag: 4.3.4.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
300
 
301
  == Changelog ==
302
 
303
+ **4.3.4.1 (29.11.2019)**
304
+ * Fix: Delete Campaigns Permanently issue
305
+ * Fix: Security issues
306
+ * Update: Considered HTTP_X_REAL_IP while getting user IP address
307
+
308
  **4.3.4 (28.11.2019)**
309
+ * Update: Delete Campaigns Permanently which are already deleted before
310
  * Fix: Import issue
311
  * Fix: Multiple email sending issue
312