Email Subscribers & Newsletters - Version 3.5.10

Version Description

(17.09.2018) =

  • Fix: Prevent spam signups
Download this release

Release Info

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

Code changes from version 3.5.9 to 3.5.10

changelog.txt CHANGED
@@ -4,6 +4,10 @@ Author : Icegram
4
  Author URI : https://www.icegram.com/
5
  License : GPLv3
6
 
 
 
 
 
7
  ***********************************************************Version 3.5.9************************************************************
8
 
9
  * Fix: Opt-In Confirmation and Unsubscribe link not working after server migration.
4
  Author URI : https://www.icegram.com/
5
  License : GPLv3
6
 
7
+ ***********************************************************Version 3.5.10***********************************************************
8
+
9
+ * Fix: Prevent spam signups
10
+
11
  ***********************************************************Version 3.5.9************************************************************
12
 
13
  * Fix: Opt-In Confirmation and Unsubscribe link not working after server migration.
classes/es-stater.php CHANGED
@@ -4,7 +4,6 @@
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
-
8
  require_once(ES_DIR.'job'.DIRECTORY_SEPARATOR.'es-subscribe.php');
9
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-register.php');
10
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-intermediate.php');
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
 
7
  require_once(ES_DIR.'job'.DIRECTORY_SEPARATOR.'es-subscribe.php');
8
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-register.php');
9
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-intermediate.php');
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: 3.5.9
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
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: 3.5.10
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
job/es-subscribe.php CHANGED
@@ -8,91 +8,92 @@ if ( ! defined( 'ABSPATH' ) ) {
8
  class es_cls_job_subscribe {
9
 
10
  public function __construct() {
11
- add_action( 'wp_ajax_es_add_subscriber', array( $this, 'es_add_subscriber' ) );
12
- add_action( 'wp_ajax_nopriv_es_add_subscriber', array( $this, 'es_add_subscriber' ) );
 
 
13
  }
14
 
15
  public function es_add_subscriber() {
16
 
17
- // check_admin_referer( 'es-subscribe', 'es-subscribe' );
18
-
19
  $es_response = array();
 
 
 
 
20
 
21
- if ( ( isset( $_REQUEST['es'] ) ) && ( $_REQUEST['es'] == 'subscribe' ) && ( isset( $_REQUEST['action'] ) ) && ( $_REQUEST['action'] == 'es_add_subscriber' ) && !empty( $_REQUEST['esfpx_es-subscribe'] ) ) {
22
- $es_subscriber_name = '';
23
- $es_subscriber_email = '';
24
- $es_subscriber_group = '';
25
 
26
- foreach ($_REQUEST as $key => $value) {
27
- $new_key = str_replace('_pg', '', $key);
28
- $_REQUEST[$new_key] = $value;
29
- }
30
 
31
- $es_subscriber_name = isset( $_REQUEST['esfpx_es_txt_name'] ) ? $_REQUEST['esfpx_es_txt_name'] : '';
32
- $es_subscriber_email = isset( $_REQUEST['esfpx_es_txt_email'] ) ? $_REQUEST['esfpx_es_txt_email'] : '';
33
- $es_subscriber_group = isset( $_REQUEST['esfpx_es_txt_group'] ) ? $_REQUEST['esfpx_es_txt_group'] : '';
34
- $es_nonce = $_REQUEST['esfpx_es-subscribe'];
35
-
36
- $es_subscriber_name = trim( $es_subscriber_name );
37
- $es_subscriber_email = trim( $es_subscriber_email );
38
- $es_subscriber_group = trim( $es_subscriber_group );
39
-
40
- $subscriber_form = array(
41
- 'es_email_name' => '',
42
- 'es_email_mail' => '',
43
- 'es_email_group' => '',
44
- 'es_email_status' => '',
45
- 'es_nonce' => ''
46
- );
47
-
48
- if( $es_subscriber_group == '' ) {
49
- $es_subscriber_group = 'Public';
50
- }
51
 
52
- if ( $es_subscriber_email != '' ) {
53
- if ( !filter_var( $es_subscriber_email, FILTER_VALIDATE_EMAIL ) ) {
54
- $es_response['error'] = 'invalid-email';
55
- } else {
56
- $action = '';
57
- global $wpdb;
 
 
 
 
 
 
 
 
 
 
58
 
59
- $subscriber_form['es_email_name'] = $es_subscriber_name;
60
- $subscriber_form['es_email_mail'] = $es_subscriber_email;
61
- $subscriber_form['es_email_group'] = $es_subscriber_group;
62
- $subscriber_form['es_nonce'] = $es_nonce;
 
 
63
 
64
- $es_optintype = get_option( 'ig_es_optintype' );
 
 
 
65
 
66
- if( $es_optintype == "Double Opt In" ) {
67
- $subscriber_form['es_email_status'] = "Unconfirmed";
68
- } else {
69
- $subscriber_form['es_email_status'] = "Single Opt In";
70
- }
71
 
72
- $action = es_cls_dbquery::es_view_subscriber_widget($subscriber_form);
73
- if( $action == "sus" ) {
74
- $subscribers = array();
75
- $subscribers = es_cls_dbquery::es_view_subscriber_one($es_subscriber_email,$es_subscriber_group);
76
  if( $es_optintype == "Double Opt In" ) {
77
- es_cls_sendmail::es_sendmail("optin", $template = 0, $subscribers, "optin", 0);
78
- $es_response['success'] = 'subscribed-pending-doubleoptin';
79
  } else {
80
- $es_c_usermailoption = get_option( 'ig_es_welcomeemail' );
81
- if ( $es_c_usermailoption == "YES" ) {
82
- es_cls_sendmail::es_sendmail("welcome", $template = 0, $subscribers, "welcome", 0);
83
- }
84
- $es_response['success'] = 'subscribed-successfully';
85
- }
86
- } elseif( $action == "ext" ) {
87
- $es_response['success'] = 'already-exist';
88
- } elseif( $action == "invalid" ) {
89
- $es_response['error'] = 'invalid-email';
 
 
 
 
 
 
 
 
 
 
 
90
  }
 
 
91
  }
92
  } else {
93
- $es_response['error'] = 'no-email-address';
94
  }
95
- } else {
96
  $es_response['error'] = 'unexpected-error';
97
  }
98
 
8
  class es_cls_job_subscribe {
9
 
10
  public function __construct() {
11
+ if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX ) {
12
+ add_action( 'wp_ajax_es_add_subscriber', array( $this, 'es_add_subscriber' ) );
13
+ add_action( 'wp_ajax_nopriv_es_add_subscriber', array( $this, 'es_add_subscriber' ) );
14
+ }
15
  }
16
 
17
  public function es_add_subscriber() {
18
 
 
 
19
  $es_response = array();
20
+ $homeurl = home_url();
21
+ $homeurl_host = (!empty($homeurl)) ? parse_url($homeurl, PHP_URL_HOST) : '';
22
+ $referer = wp_get_referer();
23
+ $referer_host = (!empty($referer)) ? parse_url($referer, PHP_URL_HOST) : '';
24
 
25
+ if ( !empty($homeurl_host) && !empty($referer_host) && $referer_host === $homeurl_host) {
 
 
 
26
 
27
+ if ( ( isset( $_REQUEST['es'] ) ) && ( 'subscribe' === $_REQUEST['es'] ) && ( isset( $_REQUEST['action'] ) ) && ( 'es_add_subscriber' === $_REQUEST['action'] ) && !empty( $_REQUEST['esfpx_es-subscribe'] ) ) {
 
 
 
28
 
29
+ foreach ($_REQUEST as $key => $value) {
30
+ $new_key = str_replace('_pg', '', $key);
31
+ $_REQUEST[$new_key] = $value;
32
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
+ $es_subscriber_name = isset( $_REQUEST['esfpx_es_txt_name'] ) ? trim($_REQUEST['esfpx_es_txt_name']) : '';
35
+ $es_subscriber_email = isset( $_REQUEST['esfpx_es_txt_email'] ) ? trim($_REQUEST['esfpx_es_txt_email']) : '';
36
+ $es_subscriber_group = isset( $_REQUEST['esfpx_es_txt_group'] ) ? trim($_REQUEST['esfpx_es_txt_group']) : '';
37
+ $es_nonce = $_REQUEST['esfpx_es-subscribe'];
38
+
39
+ $subscriber_form = array(
40
+ 'es_email_name' => '',
41
+ 'es_email_mail' => '',
42
+ 'es_email_group' => '',
43
+ 'es_email_status' => '',
44
+ 'es_nonce' => ''
45
+ );
46
+
47
+ if( $es_subscriber_group == '' ) {
48
+ $es_subscriber_group = 'Public';
49
+ }
50
 
51
+ if ( $es_subscriber_email != '' ) {
52
+ if ( !filter_var( $es_subscriber_email, FILTER_VALIDATE_EMAIL ) ) {
53
+ $es_response['error'] = 'invalid-email';
54
+ } else {
55
+ $action = '';
56
+ global $wpdb;
57
 
58
+ $subscriber_form['es_email_name'] = $es_subscriber_name;
59
+ $subscriber_form['es_email_mail'] = $es_subscriber_email;
60
+ $subscriber_form['es_email_group'] = $es_subscriber_group;
61
+ $subscriber_form['es_nonce'] = $es_nonce;
62
 
63
+ $es_optintype = get_option( 'ig_es_optintype' );
 
 
 
 
64
 
 
 
 
 
65
  if( $es_optintype == "Double Opt In" ) {
66
+ $subscriber_form['es_email_status'] = "Unconfirmed";
 
67
  } else {
68
+ $subscriber_form['es_email_status'] = "Single Opt In";
69
+ }
70
+
71
+ $action = es_cls_dbquery::es_view_subscriber_widget($subscriber_form);
72
+ if( $action == "sus" ) {
73
+ $subscribers = es_cls_dbquery::es_view_subscriber_one($es_subscriber_email,$es_subscriber_group);
74
+ if( $es_optintype == "Double Opt In" ) {
75
+ es_cls_sendmail::es_sendmail("optin", $template = 0, $subscribers, "optin", 0);
76
+ $es_response['success'] = 'subscribed-pending-doubleoptin';
77
+ } else {
78
+ $es_c_usermailoption = get_option( 'ig_es_welcomeemail' );
79
+ if ( $es_c_usermailoption == "YES" ) {
80
+ es_cls_sendmail::es_sendmail("welcome", $template = 0, $subscribers, "welcome", 0);
81
+ }
82
+ $es_response['success'] = 'subscribed-successfully';
83
+ }
84
+ } elseif( $action == "ext" ) {
85
+ $es_response['success'] = 'already-exist';
86
+ } elseif( $action == "invalid" ) {
87
+ $es_response['error'] = 'invalid-email';
88
+ }
89
  }
90
+ } else {
91
+ $es_response['error'] = 'no-email-address';
92
  }
93
  } else {
94
+ $es_response['error'] = 'unexpected-error';
95
  }
96
+ }else{
97
  $es_response['error'] = 'unexpected-error';
98
  }
99
 
query/db_subscriber.php CHANGED
@@ -284,7 +284,6 @@ class es_cls_dbquery {
284
  }
285
 
286
  public static function es_view_subscriber_widget( $data = array() ) {
287
-
288
  global $wpdb;
289
 
290
  $es_result = array();
@@ -311,7 +310,6 @@ class es_cls_dbquery {
311
  } elseif ( array_key_exists( 'es_af_nonce', $data ) ) {
312
  $form['es_af_nonce'] = $data['es_af_nonce'];
313
  }
314
-
315
  $action = es_cls_dbquery::es_view_subscriber_ins($form, $action = "update");
316
  return $action;
317
  }
284
  }
285
 
286
  public static function es_view_subscriber_widget( $data = array() ) {
 
287
  global $wpdb;
288
 
289
  $es_result = array();
310
  } elseif ( array_key_exists( 'es_af_nonce', $data ) ) {
311
  $form['es_af_nonce'] = $data['es_af_nonce'];
312
  }
 
313
  $action = es_cls_dbquery::es_view_subscriber_ins($form, $action = "update");
314
  return $action;
315
  }
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
6
  Requires at least: 3.9
7
  Tested up to: 4.9.8
8
- Stable tag: 3.5.9
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
@@ -342,6 +342,10 @@ Use our free plugin [Email Subscribers - Group Selector](https://wordpress.org/p
342
 
343
  == Changelog ==
344
 
 
 
 
 
345
  = 3.5.9 (11.09.2018) =
346
 
347
  * Fix: Opt-In Confirmation and Unsubscribe link not working after server migration.
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
6
  Requires at least: 3.9
7
  Tested up to: 4.9.8
8
+ Stable tag: 3.5.10
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
342
 
343
  == Changelog ==
344
 
345
+ = 3.5.10 (17.09.2018) =
346
+
347
+ * Fix: Prevent spam signups
348
+
349
  = 3.5.9 (11.09.2018) =
350
 
351
  * Fix: Opt-In Confirmation and Unsubscribe link not working after server migration.
subscribers/view-subscriber-add.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  'es_email_mail' => '',
23
  'es_nonce' => ''
24
  );
25
-
26
  // Form submitted, check the data
27
  if ( isset($_POST['es_form_submit']) && $_POST['es_form_submit'] == 'yes' && !empty( $_POST['es-subscribe'] ) ) {
28
 
22
  'es_email_mail' => '',
23
  'es_nonce' => ''
24
  );
25
+
26
  // Form submitted, check the data
27
  if ( isset($_POST['es_form_submit']) && $_POST['es_form_submit'] == 'yes' && !empty( $_POST['es-subscribe'] ) ) {
28
 
widget/es-widget-page.js CHANGED
@@ -33,6 +33,7 @@ ES.prototype = {
33
  formData['action'] = 'es_add_subscriber';
34
  var action_url = es_widget_page_notices.es_ajax_url;
35
  jQuery(form).trigger( 'addSubscriber.es', [formData] );
 
36
  jQuery.ajax({
37
  type: 'POST',
38
  url: action_url,
@@ -53,9 +54,11 @@ ES.prototype = {
53
  } else if( response.success && response.success === 'subscribed-pending-doubleoptin' ) {
54
  es_msg_text = es_widget_page_notices.es_success_notice;
55
  jQuery(form)[0].reset();
 
56
  } else if( response && response.success === 'subscribed-successfully' ) {
57
  es_msg_text = es_widget_page_notices.es_success_message;
58
  jQuery(form)[0].reset();
 
59
  }
60
  var esSuccessEvent = {
61
  detail: {
33
  formData['action'] = 'es_add_subscriber';
34
  var action_url = es_widget_page_notices.es_ajax_url;
35
  jQuery(form).trigger( 'addSubscriber.es', [formData] );
36
+ jQuery(form).removeClass('es_form_success');
37
  jQuery.ajax({
38
  type: 'POST',
39
  url: action_url,
54
  } else if( response.success && response.success === 'subscribed-pending-doubleoptin' ) {
55
  es_msg_text = es_widget_page_notices.es_success_notice;
56
  jQuery(form)[0].reset();
57
+ jQuery(form).addClass('es_form_success');
58
  } else if( response && response.success === 'subscribed-successfully' ) {
59
  es_msg_text = es_widget_page_notices.es_success_message;
60
  jQuery(form)[0].reset();
61
+ jQuery(form).addClass('es_form_success');
62
  }
63
  var esSuccessEvent = {
64
  detail: {
widget/es-widget.css CHANGED
@@ -22,4 +22,7 @@
22
  }
23
  .es_lablebox {
24
  padding-bottom: 3px;
 
 
 
25
  }
22
  }
23
  .es_lablebox {
24
  padding-bottom: 3px;
25
+ }
26
+ .es_form_success .es_msg{
27
+ color:#008600;
28
  }