Email Subscribers & Newsletters - Version 3.5.16

Version Description

(14.11.2018) =

  • Fix: spam subscription issue.
  • Fix: Visitors were not able to subscribe.
Download this release

Release Info

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

Code changes from version 3.5.15 to 3.5.16

changelog.txt CHANGED
@@ -4,546 +4,6 @@ Author : Icegram
4
  Author URI : https://www.icegram.com/
5
  License : GPLv3
6
 
7
- ***********************************************************Version 3.5.15***********************************************************
8
-
9
- * Fix: Extra field shown for forms on RTL sites
10
-
11
- ***********************************************************Version 3.5.14***********************************************************
12
-
13
- * Fix: Improve prevention of spam signups
14
-
15
- ***********************************************************Version 3.5.13***********************************************************
16
-
17
- * Fix: “Oops, an unexpected error occurred” while subscribing
18
- * Update: Added shortcode support in email templates [learn more](https://www.icegram.com/documentation/why-some-shortcodes-are-not-working-in-email-templates)
19
-
20
- ***********************************************************Version 3.5.12***********************************************************
21
-
22
- * Fix: Invalid unsubscribe link
23
- * Update: Use string instead of constant for Text Domain.
24
-
25
- ***********************************************************Version 3.5.11***********************************************************
26
-
27
- * Fix: Send test newsletter to "Test" group on update
28
-
29
- ***********************************************************Version 3.5.10***********************************************************
30
-
31
- * Fix: Prevent spam signups
32
-
33
- ***********************************************************Version 3.5.9************************************************************
34
-
35
- * Fix: Opt-In Confirmation and Unsubscribe link not working after server migration.
36
-
37
- ***********************************************************Version 3.5.8************************************************************
38
-
39
- * Update: Added "Test Email" functionality to confirm email deliverability.
40
-
41
- ***********************************************************Version 3.5.7************************************************************
42
-
43
- * Fix: Post notification sent to multiple times.
44
- * Update: POT file
45
- * Localization: Made all translation files up-to-date with latest POT file
46
-
47
- ***********************************************************Version 3.5.6************************************************************
48
-
49
- * Update: POT file
50
- * Localization: Made all translation files up-to-date with latest POT file
51
-
52
- ***********************************************************Version 3.5.5************************************************************
53
-
54
- * Enhancement : Improved onboarding
55
- * Fix: "Notice: get_currentuserinfo is deprecated"
56
- * Fix: Import CSV not working if list contains only one record
57
-
58
- ***********************************************************Version 3.5.4************************************************************
59
-
60
- * New: Added option to disable cron email sent to Admin
61
- * Fix: 'Optimize Table & Delete Records' button not deleting any reports
62
- * Fix: 'In Queue' notice showing multiple times on Reports tab
63
- * Update: Sent Report email will be now sent only if sending email immediately
64
- * Update: POT file
65
- * Localization: Made all translation files up-to-date with latest POT file
66
-
67
- ***********************************************************Version 3.5.3************************************************************
68
-
69
- * Fix: Notices on Subscribers -> Sync page (Illegal string offset ‘es_registered’ & ‘es_registered_group’)
70
- * Update: Use of $wpdb->prepare for direct queries to the database
71
- * Update: Text improvements while creating/editing post notification
72
- * Update: POT file
73
- * Localization: Translation for Swedish (sv_SE) language updated (Thanks to Rune Svennelid)
74
- * Localization: Made all translation files up-to-date with latest POT file
75
-
76
- ***********************************************************Version 3.5.2************************************************************
77
-
78
- * Update: Show list of available keywords based on template type while editing a template
79
- * Update: Increased 'maxlength' for name and email field in the subscription form
80
- * Update: Single subscription form for widget, shortcode and php code
81
- * Update: Added text domain for missing texts
82
- * Update: POT file
83
- * Localization: Translation for Polish (pl_PL) language updated (Thanks to Witold)
84
- * Localization: Translation for German Deutsch (de_DE) language updated (Thanks to Zero & Markus Buschmann)
85
- * Localization: Made all translation files up-to-date with latest POT file
86
-
87
- ***********************************************************Version 3.5.1************************************************************
88
-
89
- * Update: Privacy Policy page link on Help & Info page
90
- * Update: POT file
91
- * Localization: Made all translation files up-to-date with latest POT file
92
- * Localization: Translation for Lithuanian (lt_LT) language removed
93
- * Tweak: Notice for admin on Reports page if Cron job is 'In Queue'
94
-
95
- ***********************************************************Version 3.5.0************************************************************
96
-
97
- * New: [GDPR] Provision for consent checkbox in the subscription form [Steps to enable it](https://www.icegram.com/documentation/es-gdpr-how-to-enable-consent-checkbox-in-the-subscription-form/)
98
- * New: Keyword {{POSTEXCERPT}} for showing Post Excerpt in Post Notification emails
99
- * Fix: Missing santization in preview template (Thanks to Chris Liu)
100
- * Update: Doc links in plugin on Help & Info page
101
- * Update: POT file
102
- * Localization: Translation for German Deutsch (de_DE) language updated (Thanks to Markus Buschmann)
103
- * Localization: Translation for Italian (it_IT) language updated (Thanks to Roberto Pavesi)
104
- * Localization: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
105
- * Localization: Translation for Polish (pl_PL) language updated (Thanks to Witold)
106
- * Localization: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
107
- * Localization: Made all translation files up-to-date with latest POT file
108
- * Localization: Translation for Czech (cs_CZ) language removed
109
-
110
- ***********************************************************Version 3.4.12************************************************************
111
-
112
- * Fix: Some users getting 'Invalid email address' for valid email address during form submission
113
- * Fix: Empty email field not showing validation errors during form submission
114
- * Update: Make email field required in the subscribe form
115
- * Update: Remove extra error notices
116
- * Update: POT file
117
- * Localization: Translation for German Deutsch (de_DE) language updated (Thanks to Markus Buschmann)
118
- * Localization: Made all translation files up-to-date with latest POT file
119
-
120
- ***********************************************************Version 3.4.11************************************************************
121
-
122
- * Fix: Special characters in the post title showing as html entities when using {{POSTTITLE}} keyword [due to `get_the_title($post)`]
123
- * Fix: 'Oops.. Unexpected error occurred 0.' in Email Subscribers - Group Selector form when subscriber status is unconfirmed or unsubscribed
124
-
125
- ************************************************************Version 3.4.10************************************************************
126
-
127
- * New: Improvements in the subscribe form
128
- * New: Improvements in the form submission process
129
- * Fix: Prevent spam signups
130
- * Update: POT file
131
- * Localization: Made all translation files up-to-date with latest POT file
132
-
133
- ************************************************************Version 3.4.9************************************************************
134
-
135
- * New: Show Viewed email count from total sent emails in Delivery Reports
136
- * New: Use `get_the_title($post)` for getting post title to make it extendable
137
- * New: Inform users that default post notifications are enabled by default
138
- * Fix: Prevent spam signups
139
- * Fix: Double header MIME Type and X-Mailer in wp_mail() causing email to bounce in some cases
140
- * Update: Text improvements in unsubscribe link (New users only)
141
- * Update: Show upgrade notice for Pro plugin only if Pro plugin is not activated
142
- * Update: POT file
143
- * Localization: Translation for Polish (pl_PL) language updated (Thanks to Witold)
144
- * Localization: Translation for German Deutsch (de_DE) language updated (Thanks to Markus Buschmann)
145
- * Localization: Made all other translation files up-to-date with latest POT file
146
-
147
- ************************************************************Version 3.4.8************************************************************
148
-
149
- * Fix: Security vulnerability (Thanks to Dominykas Gelucevicius from [ThreatPress Security](https://profiles.wordpress.org/threatpress))
150
- * Update: Only site administrator will be able to export list of subscribers
151
- * Update: POT file
152
- * Localization: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
153
- * Localization: Made all other translation files up-to-date with latest POT file
154
- * Tweak: Doc link addition for newsletter keywords while creating/updating a template
155
-
156
- ************************************************************Version 3.4.7************************************************************
157
-
158
- * Fix: Empty email with only unsubscribe links sent to subscribers
159
- * Fix: Remove usage of rawurlencode() to prevent broken subscribe & unsubscribe links
160
- * Update: Removed the functionality to subscribe emails with special characters
161
- * Update: Change in logic for updating subscribers information in subscribers dashboard
162
- * Update: POT file
163
- * Localization: Translation for Italian (it_IT) language added (Thanks to Roberto Pavesi)
164
- * Localization: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
165
- * Localization: Translation for Polish (pl_PL) language updated (Thanks to Witold)
166
- * Localization: Made all other translation files up-to-date with latest POT file
167
-
168
- ************************************************************Version 3.4.6************************************************************
169
-
170
- * Fix: Fatal error while accessing subscribers export screen
171
-
172
- ************************************************************Version 3.4.5************************************************************
173
-
174
- * Fix: Not throwing 'Invalid Email' error for sanitized emails
175
- * Fix: Showing 'Resend Confirmation' for confirmed emails
176
- * Fix: '\n' showing in alert notice
177
- * Update: Use term 'Templates' instead of 'Compose' in plugin
178
- * Update: Code cleanup
179
- * Update: POT file
180
- * Localization: Made all translation files up-to-date with latest POT file
181
-
182
- ************************************************************Version 3.4.4************************************************************
183
-
184
- * New: Introducing [Email Subscribers Pro](https://www.icegram.com/email-subscribers-pricing/)
185
- * Update: Change in logic for showing subscribers in subscribers dashboard
186
-
187
- ************************************************************Version 3.4.3************************************************************
188
-
189
- * Fix: Templates showing up in frontend search results
190
- * Update: Documentation links on Help & Info page
191
- * Update: POT file
192
- * Localization: Made all translation files up-to-date with latest POT file
193
-
194
- ************************************************************Version 3.4.2************************************************************
195
-
196
- * Fix: User roles not working
197
- * Fix: Viewed Status in Reports not updating after an email is opened
198
- * Fix: Preview Template button not redirecting to correct page while previewing
199
- * Update: Keyword structure display for Name & Email in preview
200
- * Update: Thumbnail image on Templates
201
- * Update: POT file
202
- * Localization: Made all translation files up-to-date with latest POT file
203
- * Localization: Translation for Portuguese-Brazil (pt_BR) language added (Thanks to Marcelo de Meneses Guedes)
204
-
205
- ************************************************************Version 3.4.1************************************************************
206
-
207
- * Fix: Fatal error: Can’t use function return value in write context
208
-
209
- ************************************************************Version 3.4.0************************************************************
210
-
211
- * New: Old keyword structure ###KEYWORD### converted to {{KEYWORD}}
212
- * New: 2 new keywords - {{NAME}} & {{EMAIL}} - for Newsletter
213
- * New: Improved the UI for Compose and renamed it to Templates
214
- * New: Replace the keyword with actual content from last blog post while previewing Post Notification
215
- * New: You can set featured thumbnail for the Templates
216
- * Update: Footer text
217
- * Update: POT file
218
- * Localization: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
219
- * Localization: Translation for Catalan (ca) language updated (Thanks to Jordi Jorda)
220
- * Localization: Translation for Polish (pl_PL) language updated (Thanks to Witold)
221
- * Localization: Translation for Spanish (es_ES) language updated (Thanks to Fernando Pérez)
222
-
223
- ************************************************************Version 3.3.7************************************************************
224
-
225
- * Fix: Keywords ###NAME### and ###EMAIL### not showing correct details while sending post notifications emails (in HTML type only)
226
-
227
- ************************************************************Version 3.3.6************************************************************
228
-
229
- * New: Allow emails with special characters to get subscribed
230
- * New: Show groups in dropdown while creating subscribe form via widget
231
- * New: Show Preview button above the WordPress editor at the time of editing a composed Newletter / Post Notification
232
- * Fix: Extra line breaks (`<br>` tags) removed when sending HTML emails
233
- * Fix: Remove hardcoded ENGINE while creating default tables for new users
234
- * Fix: Remove hardcoded Collation while creating default tables for new users
235
- * Update: Only one line break while auto inserting unsubscribe link in the emails
236
- * Update: Improvements in logic to create default tables on first activation
237
- * Update: Email preview page after an email is composed or sent
238
- * Update: Show Preview in new column on Compose screen with a search dashicon
239
- * Update: Footer text
240
- * Update: POT file
241
- * Update: Translation for French (fr_FR) language updated (Thanks to Serge)
242
- * Update: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
243
- * Update: Translation for Norwegian (nb_NO) language added (Thanks to Helge Rosseboe)
244
-
245
- ************************************************************Version 3.3.5************************************************************
246
-
247
- * New: UI & structure for Help & Info page
248
- * Fix: Some users were getting error - Cannot modify header information – headers already sent - when publishing/accessing a post
249
- * Fix: Unable to select Opt In type from Settings
250
- * Fix: In-built translations were not loading
251
- * Fix: CSS getting included in all admin pages
252
- * Fix: Missing `</span>` tag on Help & Info menu
253
- * Fix: Enable to translate 'Add Subscription Form' FAQ on Help & Info page
254
- * Update: Improvement in logic to get post author name for keyword ###POSTAUTHOR###
255
- * Update: Improved default content for welcome email
256
- * Update: Do not include ###GROUP### name by default in welcome email. Admin can add ###GROUP### name manually using keyword (New users only)
257
- * Update: Text improvement at few places
258
- * Update: POT file
259
- * Tweak: Show Cron menu before User Roles menu in Email Subscribers -> Settings for better accessibility
260
- * Tweak: Use email dashicon instead of mail image for Email Subscribers menu
261
- * Tweak: Use search dashicon instead of preview image for Reports menu
262
- * Tweak: Use no dashicon instead of delete image for Reports menu
263
-
264
- ************************************************************Version 3.3.4************************************************************
265
-
266
- * New: Keyword ###POSTAUTHOR### to display Post Author name in Post Notification emails
267
- * New: Improvements in default settings and the email content created on first install of plugin (New users only)
268
- * New: Display Blog Name in FROM name instead of Admin (New users only)
269
- * Update: POT file
270
- * Update: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
271
- * Tweak: Do not highlight 'Reports' menu in Grey color
272
- * Tweak: Documentation links
273
-
274
- ************************************************************Version 3.3.3************************************************************
275
-
276
- * Fix: Settings used to get reset to default values when upgraded to a version higher than version 3.3
277
-
278
- ************************************************************Version 3.3.2************************************************************
279
-
280
- * New: Improvements in default Post Notification & Newsletter templates created on first install of plugin (New users only)
281
- * Update: Mention while creating emails (under Compose) that Available Keywords are for Post Notifications only
282
- * Update: POT file
283
- * New: Translation for Norwegian (nb_NO) language added (Thanks to Helge Rosseboe)
284
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
285
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
286
- * Update: Translation for Hungarian (hu_HU) language updated (Thanks to Zsolt Edelényi)
287
- * Update: Translation for Swedish (sv_SE) language updated (Thanks to Rune Svennelid)
288
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
289
- * Update: Translation for French (fr_FR) language updated (Thanks to Serge)
290
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
291
-
292
- ************************************************************Version 3.3.1************************************************************
293
-
294
- * New: Admin can now include user subscribed group name in the Welcome Email (Email Subscribers v3.3.1+)
295
- * Update: Documentation links
296
- * Update: POT file
297
- * Update: Translation for French (fr_FR) language updated (Thanks to Serge)
298
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
299
- * Update: Translation for German (de_DE) language updated (Thanks to Markus Buschmann)
300
-
301
- ************************************************************Version 3.3************************************************************
302
-
303
- * New: Merged Roles and Cron menu into Settings
304
- * New: Tab structure for Settings
305
- * Fix: Javacript error on saving composed email template
306
- * Update: Moved settings data from custom table to WordPress options table
307
- * Update: Do not allow to assign roles for Help & Info and Settings menu
308
- * Update: Text correction at few places
309
- * Update: POT file
310
-
311
- ************************************************************Version 3.2.11************************************************************
312
-
313
- * Fix: Export filters was not generating correct data
314
- * Update: POT file
315
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Martin)
316
- * Tweak: Do not show confirm notice while exporting subscribers
317
-
318
- ************************************************************Version 3.2.10************************************************************
319
-
320
- * New: Admin can now include user subscribed group name in the Welcome Email (Email Subscribers v3.2.10+)
321
- * New: Show recently subscribed subscribers on top of the Subscribers page
322
- * New: Show submission time of subscribers on Subscribers page
323
- * New: Show count of total & active subscribers on Subscribers page (for admin view only)
324
- * New: Now you can export list of all & inactive subscribers
325
- * Fix: Custom attribute in the subscribe form was throwing error with HTML validator
326
- * Update: Increase the count of viewing the number of subscribers on Subscribers page
327
- * Update: Increased limit of Display All subscribers
328
- * Update: POT file
329
- * New: Translation for German (de_DE) language added (Thanks to Markus Buschmann)
330
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
331
- * Update: Translation for Hungarian (hu_HU) language updated (Thanks to Zsolt Edelényi)
332
- * Update: Translation for Catalan (ca) language updated (Thanks to Jordi Jorda)
333
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
334
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
335
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
336
-
337
- ************************************************************Version 3.2.9************************************************************
338
-
339
- * New: Use [Icegram](https://wordpress.org/plugins/icegram/) to increase Subscribers list
340
- * Fix: Multiple subscribe forms were not working on same page
341
- * Update: Form submission process
342
- * Update: POT file
343
- * Update: Translation for Hungarian (hu_HU) language updated (Thanks to Zsolt Edelényi)
344
-
345
- ************************************************************Version 3.2.8************************************************************
346
-
347
- * New: Added label tags to subscribe form
348
- * New: Show success / error messages below subscribe form instead of above
349
- * Fix: Single Opt In was sometimes giving 'Please try after some time' error
350
- * Fix: Re-subscribing same subscriber was not giving 'Email Address already exists' error incase of Single Opt In
351
- * Fix: Name field was not clearing on successful sign up from subscribe form
352
- * Fix: Show 'sent reports time' in site's timezone instead of UTC
353
- * Fix: Show only active (Confirmed & Single Opt In) subscribers while exporting subscribers list
354
- * Fix: Made few strings translatable
355
- * Update: Security check in files
356
- * Update: Code improvements when using $wpdb->prefix for queries
357
- * Update: Text correction & improvements
358
- * Update: POT file
359
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
360
- * Update: Translation for Catalan (ca) language updated (Thanks to Jordi Jorda)
361
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Martin)
362
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
363
-
364
- ************************************************************Version 3.2.7************************************************************
365
-
366
- * Fix: Special characters in the post category name was not saving while creating Post Notifications
367
- * Fix: Post Notification emails were not sent for post categories with special characters in the category name
368
- * Fix: Multiple confirmation emails were sent when a subscriber subscribed to more than one group
369
- * Fix: esc_attr when sanitizing input fields submitted via form
370
- * Update: Renamed a few terms in Compose & Reports page for better accessibility
371
- * Update: Text correction & improvements
372
- * Update: POT file
373
- * New: Translation for Swedish (sv_SE) language added (Thanks to Rune Svennelid)
374
- * New: Translation for Hungarian (hu_HU) language added (Thanks to Zsolt Edelényi)
375
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
376
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
377
- * Update: Translation for French (fr_FR) language updated (Thanks to Serge)
378
- * Update: Translation for Catalan (ca) language updated (Thanks to Jordi Jorda)
379
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Martin)
380
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
381
- * Update: Translation for Russian (ru_RU) language removed
382
- * Tweak: Don't show Database id of subscribers on Delivery Report page
383
-
384
- ************************************************************Version 3.2.6************************************************************
385
-
386
- * New: WordPress 4.7.1 compatible
387
- * New: Changed terminologies of admin menus for better accessibility
388
- * Fix: Sanitize input fields while submitting subscribe form - Thanks to [Callibrator Pentester](http://hackholics.com/)
389
- * Fix: Made all admin success notices to be dismissible
390
- * Update: UI improvements
391
- * Update: Text correction & improvements
392
- * Update: POT file
393
-
394
- ************************************************************Version 3.2.5************************************************************
395
-
396
- * New: Added action 'es_message_head' for developers to insert custom CSS into subscribe and unsubscribe message
397
- * Fix: Exporting subscribers was giving 'Unexpected url submit has been detected' error
398
- * New: Translation for Catalan (ca) language added (Thanks to Jordi)
399
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Tomas & Martin)
400
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
401
- * Update: Translation for Lithuanian (lt_LT) language updated (Thanks to Andrius)
402
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
403
- * Update: Translation for Dutch (nl_NL) language removed
404
- * Update: Translation for Serbian (sr_RS) language removed
405
-
406
- ************************************************************Version 3.2.4************************************************************
407
-
408
- * New: Bulk update Subscribers Status
409
- * Fix: Single Opt In subscribers also showing Resend Confirmation link on Subscribers page
410
- * Fix: Incorrect documentation links
411
- * Update: Tested upto WordPress 4.7
412
- * Update: POT file
413
- * Update: Translation for Czech (cs_CZ) language updated (inside plugin & on translate.wordpress.org) (Thanks to Tomas & Martin)
414
- * Tweak: Show only one notice while deleting subscribers
415
-
416
- ************************************************************Version 3.2.3************************************************************
417
-
418
- * New: New contributor name has been added
419
- * Update: Documentation links
420
- * Update: POT file
421
- * New: Translation for Lithuanian (lt_LT) language added (Thanks to Andrius)
422
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Martin)
423
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
424
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
425
-
426
- ************************************************************Version 3.2.2************************************************************
427
-
428
- * Fix: Illegal string offset 'es_registered' when syncing existing WordPress Subscribers
429
- * Fix: Confirmation text for static newsletters on Send Mail page
430
- * New: Translation for French (fr_FR) language added (Thanks to Serge)
431
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
432
-
433
- ************************************************************Version 3.2.1************************************************************
434
-
435
- * Fix: Optimize Table & Delete Records button not working
436
- * Update: Translation for German (de_DE) language removed
437
- * Update: Translation for Ukrainian (uk) language removed
438
-
439
- ************************************************************Version 3.2************************************************************
440
-
441
- * New: Show the recipients count while sending static newsletters from Send Mail page
442
- * New: Show Submission Date of subscribers on View Subscribers page
443
- * New: Improved UI for Admin pages (Subscribers, Compose, Notification, Send Mail, Roles)
444
- * New: Improved UI & Revised FAQ links for Help & Info page
445
- * Fix: Security Check Failed error while sending static newsletters from Send Mail page
446
- * Fix: Apostrophe in FROM name contains backslash escape character in emails
447
- * Fix: Unable to update Subscribers group while editing Notification
448
- * Fix: Failed to delete buffer while exporting the Subscriber list
449
- * Fix: Use wp_get_referer() instead of $_SERVER['HTTP_REFERER'] while exporting email addresses ($_SERVER['HTTP_REFERER'] was not set on some servers)
450
- * Fix: Presence of two content-type in email header was resulting in emails to bounce back in some cases
451
- * Fix: Success notice was not visible when admin was saving / updating Roles
452
- * Fix: Uncaught TypeError: Cannot read property 'es_email_mail' of undefined in Admin Roles page while updating Roles
453
- * Fix: Made few strings translatable
454
- * Update: Added pagination links on top in Sent Mail and Delivery Report page
455
- * Update: Show 15 reports of emails sent on one page of Sent Mail page
456
- * Update: Show 100 entries of subscribers on one page of Delivery Report page
457
- * Update: Changed the confirmation text shown after subscriber successfully subscribes for Double Opt-In
458
- * Update: Made text correction & improvements in many places
459
- * Update: Removed A-Z & 0-9 listings from View Subscriber & Send Mail page
460
- * Update: Removed listing all subscribers emails on Send Mail page
461
- * Update: Removed showing Database Id on View Subscribers page
462
- * Update: Removed comments sync option from Sync Email page
463
- * Update: Removed unnecessary view-group.js, roles.js & settings.js files
464
- * Update: POT file
465
- * Update: Translation for Czech (cs_CZ) language updated (Thanks to Martin)
466
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
467
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
468
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
469
- * Update: Translation for Russian (ru_RU) language updated (Thanks to Grishin Alexander)
470
- * Update: Translation for Dutch (nl_NL) language updated (Thanks to Maurice)
471
- * Update: Code Indentation & Code Improvements
472
-
473
- ************************************************************Version 3.1.5************************************************************
474
-
475
- * New: Changed Notification Layout
476
- * New: Created Check,Uncheck All Buttons while selecting categories on the Notification page
477
- * New: Translation for Czech (cs_CZ) language added (Thanks to Martin)
478
- * Fix: Subscribers subscribing via [Rainmaker](https://wordpress.org/plugins/icegram-rainmaker/) were not receving confirmation emails
479
- * Fix: Made few strings translatable
480
- * Update: Text correction in few places
481
- * Update: POT file
482
- * Update: Translation for Spanish (es_ES) language updated (Thanks to David Bravo)
483
- * Update: Translation for Russian (ru_RU) language updated (Thanks to Grishin Alexander)
484
- * Update: Translation for Polish (pl_PL) language updated (Thanks to Witold)
485
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUÇ)
486
- * Update: Translation for Tamil (ta) language deleted
487
- * Update: Code Indentation & Code Improvements
488
- * Tweak: Added div class for the subscribe, unsubscribe messages shown via emails
489
-
490
- ************************************************************Version 3.1.4************************************************************
491
-
492
- * New: Use [Rainmaker](https://wordpress.org/plugins/icegram-rainmaker/) form to collect Subscribers
493
- * New: Setting to select featured image size when using ###POSTIMAGE### shortlink
494
- * New: Translation for Spanish (es_ES) language added (Thanks to bohemme)
495
- * Fix: Made few strings translatable
496
- * Fix: Incorrect text domain in few places
497
- * Update: Revised FAQ links in Help & Info page inside plugin
498
- * Update: POT file
499
- * Update: Translation for Russian (ru_RU) language updated (Thanks to Alexander)
500
- * Update: Translation for Turkish (tr_TR) language updated (Thanks to Erkan ORUC)
501
- * Update: Text correction in few places
502
- * Update: Code Indentation
503
- * Update: Code improvements when using wp_enqueue_script
504
- * Tweak: Do not allow admin to edit sample cron job url from Cron Mail Settings
505
- * Tweak: CSS changes in Help & Info page inside plugin
506
-
507
- ************************************************************Version 3.1.3************************************************************
508
-
509
- * New: Added form tag to subscribe form
510
- * Fix: Added missing charset to meta tag
511
- * Update: Moved javascripts to footer
512
- * Update: Translation for Serbian (sr_RS) language updated (Thanks to Ogi Djuraskovic)
513
- * Update: POT file
514
-
515
- ************************************************************Version 3.1.2************************************************************
516
-
517
- * New: You can now include Unsubscribe link in Welcome Email (Email Subscribers v3.1.2+)
518
- * New: Welcome Page on activating Email Subscribers
519
- * Fix: Shortcode not showing error messages upon user subscription
520
- * Fix: Show full sized featured image when using ###POSTIMAGE### shortlink
521
- * Fix: Can't edit settings in admin panel if SSL is enabled
522
- * Update: Revised the FAQ's in Help & Info page inside plugin
523
- * Update: Text correction in few places
524
- * Update: POT file
525
- * Tweak: Do not allow admin to edit Subscribe, Unsubscribe link in admin settings
526
-
527
- ************************************************************Version 3.1.1************************************************************
528
-
529
- * Fix: call_user_func_array() expects parameter 1 to be a valid callback, function 'es_admin_option' not found or invalid function name
530
- * Fix: Incorrect plugin name in admin dashboard
531
- * Fix: Warnings in console on submitting subscription form in Chrome
532
- * Update: Revised Help & Info page inside plugin
533
- * Update: Added translation for missing texts
534
- * Update: POT file
535
- * Tweak: Minor tweaks
536
-
537
- ************************************************************Version 3.1************************************************************
538
-
539
- * New: Scripts and styles are now localized and can be translated
540
- * Fix: Subscribe button not visible correctly in Chrome
541
- * Update: Added POT file
542
-
543
- ************************************************************Version 3.0.1************************************************************
544
-
545
- * New contributor name has been added successfully.
546
-
547
  ************************************************************Version 3.0************************************************************
548
 
549
  * Tested upto 4.4
4
  Author URI : https://www.icegram.com/
5
  License : GPLv3
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ************************************************************Version 3.0************************************************************
8
 
9
  * Tested upto 4.4
classes/es-helpers.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
+ class es_cls_helpers {
9
+
10
+ static function getUserIP() {
11
+
12
+ // Get real visitor IP behind CloudFlare network
13
+ if ( isset( $_SERVER["HTTP_CF_CONNECTING_IP"] ) ) {
14
+ $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
15
+ $_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
16
+ }
17
+
18
+ $client = @$_SERVER['HTTP_CLIENT_IP'];
19
+ $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
20
+ $remote = $_SERVER['REMOTE_ADDR'];
21
+
22
+ if ( filter_var( $client, FILTER_VALIDATE_IP ) ) {
23
+ $ip = $client;
24
+ } elseif ( filter_var( $forward, FILTER_VALIDATE_IP ) ) {
25
+ $ip = $forward;
26
+ } else {
27
+ $ip = $remote;
28
+ }
29
+
30
+ return $ip;
31
+ }
32
+ }
classes/es-register.php CHANGED
@@ -93,7 +93,7 @@ class es_cls_registerhook {
93
  es_cls_default::es_subscriber_default();
94
  es_cls_default::es_template_default();
95
  update_option( 'ig_es_sample_data_imported', 'yes' );
96
-
97
  //current version and date on activation
98
  $es_plugin_meta_data = get_plugin_data( WP_PLUGIN_DIR . '/email-subscribers/email-subscribers.php' );
99
  $es_current_version = $es_plugin_meta_data['Version'];
@@ -201,7 +201,7 @@ class es_cls_registerhook {
201
  add_submenu_page( 'es-view-subscribers', __( 'Settings', 'email-subscribers' ),
202
  __( 'Settings', 'email-subscribers' ), 'manage_options', 'es-settings', array( 'es_cls_intermediate', 'es_settings' ) );
203
 
204
- add_submenu_page( 'es-view-subscribers', __( 'Tools', 'email-subscribers' ),
205
  __( 'Tools', 'email-subscribers' ), 'manage_options', 'es-tools', array( 'es_cls_intermediate', 'es_tools' ) );
206
 
207
  add_submenu_page( 'es-view-subscribers', __( 'Reports', 'email-subscribers' ),
@@ -217,84 +217,89 @@ class es_cls_registerhook {
217
  }
218
 
219
  //upsale functions
220
- public static function add_readymade_template_link(){
221
  global $post, $pagenow;
222
  $screen = get_current_screen();
223
- if ( $screen->id === 'edit-es_template' ) {
224
- ?>
225
- <script type="text/javascript">
226
- jQuery(document).ready( function($){
227
- jQuery(".page-title-action").after("<span class='es_upsale' >Save time using beautiful readymade templates <a href='https://www.icegram.com/documentation/how-ready-made-template-in-in-email-subscribers-look/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale' target='_blank'>Checkout here</a></span>");
228
- });
229
- </script>
230
- <?php
231
- }
232
- if ( in_array( $screen->id, array( 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail' ), true ) ) {
233
- ?>
234
- <span class="es_upsale" ><?php _e( 'Save time using beautiful readymade templates <a href="https://www.icegram.com/documentation/how-ready-made-template-in-in-email-subscribers-look/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Checkout here</a>', 'email-subscribers' ) ?></span>
235
- <?php
236
- }
237
 
238
  }
239
 
240
- public static function add_test_send_newsletter_link(){
241
  echo "<span>Test Newsletter Emails Before Sending</span>";
242
  }
243
- public static function add_captcha_link(){
 
244
  ?>
245
- <tr class="es-admin active-settings">
246
- <td class="es_upsale"><?php _e('Enable captcha to protect list from bot attacks <a href="https://www.icegram.com/documentation/es-how-to-add-captcha-in-subscribe-form-of-email-subscribers/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>', 'email-subscribers' )?></td>
247
- </tr>
248
  <?php
249
  }
250
 
251
- public static function add_optin_optout_link(){
252
  echo '<tr class="es-signup-confirmation hidden"><td><span class="es_upsale">Customize confirmation and unsubscribe page <a href="https://www.icegram.com/documentation/how-to-change-simple-unsubscribe-confirmation-message-with-some-beautiful-design-page/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a></span></td></tr>';
253
  }
254
 
255
- public static function add_cron_service(){
256
  $screen = get_current_screen();
257
- if ( $screen->id === 'email-subscribers_page_es-settings' ) {
258
- ?>
259
- <tr class="es-cron hidden"><td><span class="es_upsale"><?php _e('Set automatic cron service <a href="https://www.icegram.com/documentation/how-to-enable-automatic-cron-in-es/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>')?></span></td></tr>
 
 
260
  <?php
261
- }elseif( in_array( $screen->id, array( 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail' ), true ) ){
262
- ?>
263
- <span class="es_upsale"><?php _e('Set automatic cron service <a href="https://www.icegram.com/documentation/how-to-enable-automatic-cron-in-es/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>')?></span>
264
  <?php
265
  }
266
  }
267
 
268
- public static function add_spam_score_utm_link(){
269
  global $post, $pagenow;
270
- if ($post->post_type !== 'es_template') return;
 
 
271
  if ( $pagenow !== 'post-new.php' ) {
272
- ?>
273
- <script>
274
- jQuery('#submitdiv').after('<div class="es_upsale">Track email leads in Google using UTM tracking <a href="https://www.icegram.com/documentation/how-to-add-utm-parameters-to-email?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale">Learn how</a></div>');
275
- </script>
276
- <?php
277
  }
278
  }
279
-
280
  public static function es_load_scripts() {
281
  $screen = get_current_screen();
282
  if ( in_array( $screen->id, array( 'toplevel_page_es-view-subscribers', 'es_template', 'edit-es_template', 'email-subscribers_page_es-notification', 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail', 'email-subscribers_page_es-settings', 'email-subscribers_page_es-sentmail' ), true ) ) {
283
  ?>
284
- <style type="text/css">
285
- .es_tmpl_select{
286
- width: 50%;
287
- }
288
-
289
- .es_upsale{
290
- margin-left: 2px;
291
- vertical-align: text-bottom;
292
- color: green;
293
- background: #fbfbcd;
294
- padding: 2px;
295
- border: 1px dashed;
296
- }
297
- </style>
298
  <?php
299
  }
300
  if ( ! empty( $_GET['page'] ) ) {
@@ -366,14 +371,16 @@ class es_cls_registerhook {
366
  wp_register_script( 'es-widget-page', ES_URL . 'widget/es-widget-page.js', array( 'jquery' ), '', true );
367
  wp_enqueue_script( 'es-widget-page' );
368
  $es_select_params = array(
369
- 'es_email_notice' => _x( 'Please enter email address', 'widget-page-enhanced-select', 'email-subscribers' ),
370
- 'es_success_message' => _x( 'Successfully Subscribed.', 'widget-page-enhanced-select', 'email-subscribers' ),
371
- 'es_success_notice' => _x( 'Your subscription was successful! Kindly check your mailbox and confirm your subscription. If you don\'t see the email within a few minutes, check the spam/junk folder.', 'widget-page-enhanced-select', 'email-subscribers' ),
372
- 'es_email_exists' => _x( 'Email Address already exists!', 'widget-page-enhanced-select', 'email-subscribers' ),
373
- 'es_error' => _x( 'Oops.. Unexpected error occurred.', 'widget-page-enhanced-select', 'email-subscribers' ),
374
- 'es_invalid_email' => _x( 'Invalid email address', 'widget-page-enhanced-select', 'email-subscribers' ),
375
- 'es_try_later' => _x( 'Please try after some time', 'widget-page-enhanced-select', 'email-subscribers' ),
376
- 'es_ajax_url' => admin_url( 'admin-ajax.php' ),
 
 
377
  );
378
  wp_localize_script( 'es-widget-page', 'es_widget_page_notices', $es_select_params );
379
 
@@ -453,6 +460,10 @@ class es_cls_registerhook {
453
  if ( get_option( 'current_sa_email_subscribers_db_version' ) === '3.3.6' ) {
454
  es_cls_registerhook::es_upgrade_database_for_3_4_0();
455
  }
 
 
 
 
456
  }
457
 
458
  /**
@@ -789,6 +800,30 @@ class es_cls_registerhook {
789
 
790
  }
791
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  // Function to show any notices in admin section
793
  public static function es_add_admin_notices() {
794
 
@@ -798,28 +833,28 @@ class es_cls_registerhook {
798
  }
799
 
800
  // Show if - more than 2 post notifications or Newsletters sent OR more than 10 subscribers
801
- $total_subscribers = es_cls_dbquery::es_view_subscriber_count( 0 );
802
- $total_email_sent = es_cls_sentmail::es_sentmail_count( $id = 0 );
803
- $es_star_review = get_option( 'es_star_review_email_subscribers' );
804
- $es_rating_text = array();
805
  $es_rating_text['star_review'] = __( 'If you like <strong>Email Subscribers</strong>, please consider leaving us a <a target="_blank" href="https://wordpress.org/support/plugin/email-subscribers/reviews/?filter=5#new-post">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. A huge thank you from the team in advance!', 'email-subscribers' );
806
  $es_rating_text['help_review'] = __( 'If you like <strong>Email Subscribers</strong>, tell us more about your experience and leave us <a target="_blank" href="https://wordpress.org/support/plugin/email-subscribers/reviews/?filter=5#new-post">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. A huge thank you from the team in advance!', 'email-subscribers' );
807
-
808
  if ( ( $total_subscribers >= 10 || $total_email_sent > 2 ) && $es_star_review != 'no' ) {
809
- $key = array_rand($es_rating_text);
810
- $es_rating_text = $es_rating_text[$key];
811
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">' . $es_rating_text . ' <a style="float:right" class="es-admin-btn es-admin-btn-secondary" href="?dismiss_admin_notice=1&option_name=es_star_review">' . __( 'No, I don\'t like it', 'email-subscribers' ) . '</a></p></div>';
812
  }
813
 
814
  //halloween 2018 :start
815
- $timezone_format = _x('Y-m-d', 'timezone date format');
816
- $ig_current_date = strtotime(date_i18n($timezone_format));
817
- $ig_offer_start = strtotime("2018-10-30");
818
- $ig_offer_end = strtotime("2018-11-2");
819
- if(($ig_current_date >= $ig_offer_start) && ($ig_current_date <= $ig_offer_end)) {
820
- include_once('es-offer.php');
821
- }
822
- //halloween 2018 :end
823
  }
824
 
825
  // Function to dismiss any admin notice
@@ -827,10 +862,10 @@ class es_cls_registerhook {
827
  if ( isset( $_GET['dismiss_admin_notice'] ) && $_GET['dismiss_admin_notice'] == '1' && isset( $_GET['option_name'] ) ) {
828
  $option_name = sanitize_text_field( $_GET['option_name'] );
829
  update_option( $option_name . '_email_subscribers', 'no' );
830
- if($option_name === 'es_offer_halloween_done_2018'){
831
- header("Location: https://www.icegram.com/latest-valid-coupons-discounts-offers-deals/?utm_source=in_app&utm_medium=es_banner&utm_campaign=halloween_2018");
832
- exit();
833
- }else{
834
  $referer = wp_get_referer();
835
  wp_safe_redirect( $referer );
836
  exit();
@@ -1043,8 +1078,8 @@ class es_cls_registerhook {
1043
  if ( isset( $GLOBALS['wp_embed'] ) ) {
1044
  $content = $GLOBALS['wp_embed']->autoembed( $content );
1045
  }
1046
- $content = wpautop( $content );
1047
- $content = do_shortcode( shortcode_unautop( $content ) );
1048
  $data['content'] = $content;
1049
  $data['tmpl_id'] = $tmpl_id;
1050
  $data = apply_filters( 'es_after_process_template_body', $data );
@@ -1169,24 +1204,28 @@ class es_cls_registerhook {
1169
  </div>
1170
  <?php if ( $es_name != "YES" ) { ?>
1171
  <input type="hidden" id="es_txt_name" name="es_txt_name" value="">
1172
- <?php }
1173
- $es_req_style = (!is_rtl()) ? 'position:absolute; left: -5000px' : 'position:absolute; right: -5000px' ;
 
 
 
1174
  ?>
1175
- <div style="<?php echo $es_req_style ?>"><input type="text" name="es_required_field" class="es_required_field" tabindex="-1" autocomplete="off"/></div>
1176
  <input type="hidden" id="es_txt_group" name="es_txt_group" value="<?php echo $es_group; ?>">
1177
- <?php $nonce = wp_create_nonce( 'es-subscribe' ); ?>
1178
  <input type="hidden" name="es-subscribe" id="es-subscribe" value="<?php echo $nonce; ?>"/>
 
1179
  </form>
1180
  <?php do_action( 'es_after_form' ) ?>
1181
  </div>
1182
- <?php return $es_form = ob_get_clean();
1183
 
1184
  }
1185
 
1186
- public static function es_add_home_url($es_url, $qs){
1187
- $qs = !empty($es_url) ? "?".parse_url($es_url, PHP_URL_QUERY) : $qs ;
1188
- $home_url = home_url('/');
1189
- $es_url = $home_url . $qs;
 
1190
  return $es_url;
1191
  }
1192
 
93
  es_cls_default::es_subscriber_default();
94
  es_cls_default::es_template_default();
95
  update_option( 'ig_es_sample_data_imported', 'yes' );
96
+
97
  //current version and date on activation
98
  $es_plugin_meta_data = get_plugin_data( WP_PLUGIN_DIR . '/email-subscribers/email-subscribers.php' );
99
  $es_current_version = $es_plugin_meta_data['Version'];
201
  add_submenu_page( 'es-view-subscribers', __( 'Settings', 'email-subscribers' ),
202
  __( 'Settings', 'email-subscribers' ), 'manage_options', 'es-settings', array( 'es_cls_intermediate', 'es_settings' ) );
203
 
204
+ add_submenu_page( 'es-view-subscribers', __( 'Tools', 'email-subscribers' ),
205
  __( 'Tools', 'email-subscribers' ), 'manage_options', 'es-tools', array( 'es_cls_intermediate', 'es_tools' ) );
206
 
207
  add_submenu_page( 'es-view-subscribers', __( 'Reports', 'email-subscribers' ),
217
  }
218
 
219
  //upsale functions
220
+ public static function add_readymade_template_link() {
221
  global $post, $pagenow;
222
  $screen = get_current_screen();
223
+ if ( $screen->id === 'edit-es_template' ) {
224
+ ?>
225
+ <script type="text/javascript">
226
+ jQuery(document).ready(function ($) {
227
+ jQuery(".page-title-action").after("<span class='es_upsale' >Save time using beautiful readymade templates <a href='https://www.icegram.com/documentation/how-ready-made-template-in-in-email-subscribers-look/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale' target='_blank'>Checkout here</a></span>");
228
+ });
229
+ </script>
230
+ <?php
231
+ }
232
+ if ( in_array( $screen->id, array( 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail' ), true ) ) {
233
+ ?>
234
+ <span class="es_upsale"><?php _e( 'Save time using beautiful readymade templates <a href="https://www.icegram.com/documentation/how-ready-made-template-in-in-email-subscribers-look/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Checkout here</a>', 'email-subscribers' ) ?></span>
235
+ <?php
236
+ }
237
 
238
  }
239
 
240
+ public static function add_test_send_newsletter_link() {
241
  echo "<span>Test Newsletter Emails Before Sending</span>";
242
  }
243
+
244
+ public static function add_captcha_link() {
245
  ?>
246
+ <tr class="es-admin active-settings">
247
+ <td class="es_upsale"><?php _e( 'Enable captcha to protect list from bot attacks <a href="https://www.icegram.com/documentation/es-how-to-add-captcha-in-subscribe-form-of-email-subscribers/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>', 'email-subscribers' ) ?></td>
248
+ </tr>
249
  <?php
250
  }
251
 
252
+ public static function add_optin_optout_link() {
253
  echo '<tr class="es-signup-confirmation hidden"><td><span class="es_upsale">Customize confirmation and unsubscribe page <a href="https://www.icegram.com/documentation/how-to-change-simple-unsubscribe-confirmation-message-with-some-beautiful-design-page/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a></span></td></tr>';
254
  }
255
 
256
+ public static function add_cron_service() {
257
  $screen = get_current_screen();
258
+ if ( $screen->id === 'email-subscribers_page_es-settings' ) {
259
+ ?>
260
+ <tr class="es-cron hidden">
261
+ <td><span class="es_upsale"><?php _e( 'Set automatic cron service <a href="https://www.icegram.com/documentation/how-to-enable-automatic-cron-in-es/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>' ) ?></span></td>
262
+ </tr>
263
  <?php
264
+ } elseif ( in_array( $screen->id, array( 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail' ), true ) ) {
265
+ ?>
266
+ <span class="es_upsale"><?php _e( 'Set automatic cron service <a href="https://www.icegram.com/documentation/how-to-enable-automatic-cron-in-es/?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale" target="_blank">Lean more</a>' ) ?></span>
267
  <?php
268
  }
269
  }
270
 
271
+ public static function add_spam_score_utm_link() {
272
  global $post, $pagenow;
273
+ if ( $post->post_type !== 'es_template' ) {
274
+ return;
275
+ }
276
  if ( $pagenow !== 'post-new.php' ) {
277
+ ?>
278
+ <script>
279
+ jQuery('#submitdiv').after('<div class="es_upsale">Track email leads in Google using UTM tracking <a href="https://www.icegram.com/documentation/how-to-add-utm-parameters-to-email?utm_source=es&utm_medium=in_app&utm_campaign=es_upsale">Learn how</a></div>');
280
+ </script>
281
+ <?php
282
  }
283
  }
284
+
285
  public static function es_load_scripts() {
286
  $screen = get_current_screen();
287
  if ( in_array( $screen->id, array( 'toplevel_page_es-view-subscribers', 'es_template', 'edit-es_template', 'email-subscribers_page_es-notification', 'email-subscribers_page_es-notification', 'email-subscribers_page_es-sendemail', 'email-subscribers_page_es-settings', 'email-subscribers_page_es-sentmail' ), true ) ) {
288
  ?>
289
+ <style type="text/css">
290
+ .es_tmpl_select {
291
+ width: 50%;
292
+ }
293
+
294
+ .es_upsale {
295
+ margin-left: 2px;
296
+ vertical-align: text-bottom;
297
+ color: green;
298
+ background: #fbfbcd;
299
+ padding: 2px;
300
+ border: 1px dashed;
301
+ }
302
+ </style>
303
  <?php
304
  }
305
  if ( ! empty( $_GET['page'] ) ) {
371
  wp_register_script( 'es-widget-page', ES_URL . 'widget/es-widget-page.js', array( 'jquery' ), '', true );
372
  wp_enqueue_script( 'es-widget-page' );
373
  $es_select_params = array(
374
+ 'es_email_notice' => _x( 'Please enter email address', 'widget-page-enhanced-select', 'email-subscribers' ),
375
+ 'es_rate_limit_notice' => _x( 'You need to wait for sometime before subscribing again', 'widget-page-enhanced-select', 'email-subscribers' ),
376
+ 'es_success_message' => _x( 'Successfully Subscribed.', 'widget-page-enhanced-select', 'email-subscribers' ),
377
+ 'es_success_notice' => _x( 'Your subscription was successful! Kindly check your mailbox and confirm your subscription. If you don\'t see the email within a few minutes, check the spam/junk folder.', 'widget-page-enhanced-select', 'email-subscribers' ),
378
+ 'es_email_exists' => _x( 'Email Address already exists!', 'widget-page-enhanced-select', 'email-subscribers' ),
379
+ 'es_error' => _x( 'Oops.. Unexpected error occurred.', 'widget-page-enhanced-select', 'email-subscribers' ),
380
+ 'es_invalid_email' => _x( 'Invalid email address', 'widget-page-enhanced-select', 'email-subscribers' ),
381
+ 'es_try_later' => _x( 'Please try after some time', 'widget-page-enhanced-select', 'email-subscribers' ),
382
+ 'es_ajax_url' => admin_url( 'admin-ajax.php' ),
383
+
384
  );
385
  wp_localize_script( 'es-widget-page', 'es_widget_page_notices', $es_select_params );
386
 
460
  if ( get_option( 'current_sa_email_subscribers_db_version' ) === '3.3.6' ) {
461
  es_cls_registerhook::es_upgrade_database_for_3_4_0();
462
  }
463
+
464
+ if ( get_option( 'current_sa_email_subscribers_db_version' ) === '3.4.0' ) {
465
+ es_cls_registerhook::es_upgrade_database_for_3_5_16();
466
+ }
467
  }
468
 
469
  /**
800
 
801
  }
802
 
803
+ /**
804
+ * Add es_subscriber_ips table to handle rate limit.
805
+ * ES version 3.5.16 onwards
806
+ */
807
+ public static function es_upgrade_database_for_3_5_16() {
808
+
809
+ global $wpdb;
810
+
811
+ $charset_collate = $wpdb->get_charset_collate();
812
+ $es_subscriber_ips_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}es_subscriber_ips (
813
+ ip varchar(45) NOT NULL,
814
+ created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
815
+ PRIMARY KEY (created_on, ip),
816
+ KEY ip (ip)
817
+ ) $charset_collate";
818
+
819
+
820
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
821
+ dbDelta( $es_subscriber_ips_table );
822
+
823
+ update_option( 'current_sa_email_subscribers_db_version', '3.5.16' );
824
+ }
825
+
826
+
827
  // Function to show any notices in admin section
828
  public static function es_add_admin_notices() {
829
 
833
  }
834
 
835
  // Show if - more than 2 post notifications or Newsletters sent OR more than 10 subscribers
836
+ $total_subscribers = es_cls_dbquery::es_view_subscriber_count( 0 );
837
+ $total_email_sent = es_cls_sentmail::es_sentmail_count( $id = 0 );
838
+ $es_star_review = get_option( 'es_star_review_email_subscribers' );
839
+ $es_rating_text = array();
840
  $es_rating_text['star_review'] = __( 'If you like <strong>Email Subscribers</strong>, please consider leaving us a <a target="_blank" href="https://wordpress.org/support/plugin/email-subscribers/reviews/?filter=5#new-post">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. A huge thank you from the team in advance!', 'email-subscribers' );
841
  $es_rating_text['help_review'] = __( 'If you like <strong>Email Subscribers</strong>, tell us more about your experience and leave us <a target="_blank" href="https://wordpress.org/support/plugin/email-subscribers/reviews/?filter=5#new-post">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. A huge thank you from the team in advance!', 'email-subscribers' );
842
+
843
  if ( ( $total_subscribers >= 10 || $total_email_sent > 2 ) && $es_star_review != 'no' ) {
844
+ $key = array_rand( $es_rating_text );
845
+ $es_rating_text = $es_rating_text[ $key ];
846
  echo '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">' . $es_rating_text . ' <a style="float:right" class="es-admin-btn es-admin-btn-secondary" href="?dismiss_admin_notice=1&option_name=es_star_review">' . __( 'No, I don\'t like it', 'email-subscribers' ) . '</a></p></div>';
847
  }
848
 
849
  //halloween 2018 :start
850
+ $timezone_format = _x( 'Y-m-d', 'timezone date format' );
851
+ $ig_current_date = strtotime( date_i18n( $timezone_format ) );
852
+ $ig_offer_start = strtotime( "2018-10-30" );
853
+ $ig_offer_end = strtotime( "2018-11-2" );
854
+ if ( ( $ig_current_date >= $ig_offer_start ) && ( $ig_current_date <= $ig_offer_end ) ) {
855
+ include_once( 'es-offer.php' );
856
+ }
857
+ //halloween 2018 :end
858
  }
859
 
860
  // Function to dismiss any admin notice
862
  if ( isset( $_GET['dismiss_admin_notice'] ) && $_GET['dismiss_admin_notice'] == '1' && isset( $_GET['option_name'] ) ) {
863
  $option_name = sanitize_text_field( $_GET['option_name'] );
864
  update_option( $option_name . '_email_subscribers', 'no' );
865
+ if ( $option_name === 'es_offer_halloween_done_2018' ) {
866
+ header( "Location: https://www.icegram.com/latest-valid-coupons-discounts-offers-deals/?utm_source=in_app&utm_medium=es_banner&utm_campaign=halloween_2018" );
867
+ exit();
868
+ } else {
869
  $referer = wp_get_referer();
870
  wp_safe_redirect( $referer );
871
  exit();
1078
  if ( isset( $GLOBALS['wp_embed'] ) ) {
1079
  $content = $GLOBALS['wp_embed']->autoembed( $content );
1080
  }
1081
+ $content = wpautop( $content );
1082
+ $content = do_shortcode( shortcode_unautop( $content ) );
1083
  $data['content'] = $content;
1084
  $data['tmpl_id'] = $tmpl_id;
1085
  $data = apply_filters( 'es_after_process_template_body', $data );
1204
  </div>
1205
  <?php if ( $es_name != "YES" ) { ?>
1206
  <input type="hidden" id="es_txt_name" name="es_txt_name" value="">
1207
+ <?php
1208
+ }
1209
+
1210
+ $hp_style = "position:absolute;top:-99999px;" . ( is_rtl() ? 'right' : 'left' ) . ":-99999px;z-index:-99;";
1211
+
1212
  ?>
 
1213
  <input type="hidden" id="es_txt_group" name="es_txt_group" value="<?php echo $es_group; ?>">
1214
+ <?php $nonce = wp_create_nonce( 'es-subscribe' ); ?>
1215
  <input type="hidden" name="es-subscribe" id="es-subscribe" value="<?php echo $nonce; ?>"/>
1216
+ <label style="<?php echo $hp_style; ?>"><input type="text" name="es_hp_<?php echo wp_create_nonce('es_hp'); ?>" class="es_required_field" tabindex="-1" autocomplete="off"/></label>
1217
  </form>
1218
  <?php do_action( 'es_after_form' ) ?>
1219
  </div>
1220
+ <?php return $es_form = ob_get_clean();
1221
 
1222
  }
1223
 
1224
+ public static function es_add_home_url( $es_url, $qs ) {
1225
+ $qs = ! empty( $es_url ) ? "?" . parse_url( $es_url, PHP_URL_QUERY ) : $qs;
1226
+ $home_url = home_url( '/' );
1227
+ $es_url = $home_url . $qs;
1228
+
1229
  return $es_url;
1230
  }
1231
 
classes/es-stater.php CHANGED
@@ -4,12 +4,14 @@
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');
10
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-common.php');
11
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-sendmail.php');
12
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-loadwidget.php');
 
13
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_notification.php');
14
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_subscriber.php');
15
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_settings.php');
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
+ require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-helpers.php');
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');
11
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-common.php');
12
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-sendmail.php');
13
  require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-loadwidget.php');
14
+ require_once(ES_DIR.'classes'.DIRECTORY_SEPARATOR.'es-subscription-throttling.php');
15
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_notification.php');
16
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_subscriber.php');
17
  require_once(ES_DIR.'query'.DIRECTORY_SEPARATOR.'db_settings.php');
classes/es-subscription-throttling.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
+ class es_cls_subscription_throttaling {
9
+
10
+ static function throttle() {
11
+
12
+ global $wpdb;
13
+
14
+ if ( ! is_user_logged_in() ) {
15
+
16
+ $subscriber_ip = es_cls_helpers::getUserIP();
17
+
18
+ if ( ! empty( $subscriber_ip ) ) {
19
+
20
+ $query = "SELECT count(*) as count from {$wpdb->prefix}es_subscriber_ips WHERE ip = %s AND ( `created_on` >= NOW() - INTERVAL %s SECOND )";
21
+ $results = $wpdb->get_col( $wpdb->prepare( $query, $subscriber_ip, DAY_IN_SECONDS ) );
22
+
23
+ $subscribers = array_shift( $results );
24
+
25
+ if ( $subscribers > 0 ) {
26
+ $timeout = MINUTE_IN_SECONDS * pow( 2, $subscribers - 1 );
27
+
28
+ $query = "SELECT count(*) as count from {$wpdb->prefix}es_subscriber_ips WHERE ip = %s AND ( `created_on` >= NOW() - INTERVAL %s SECOND ) LIMIT 1";
29
+ $results = $wpdb->get_col( $wpdb->prepare( $query, $subscriber_ip, $timeout ) );
30
+
31
+ $subscribers = array_shift( $results );
32
+
33
+ if ( ! empty( $subscribers ) ) {
34
+ return $timeout;
35
+ }
36
+ }
37
+
38
+ // Add IP Address.
39
+ $query = "INSERT INTO {$wpdb->prefix}es_subscriber_ips (`ip`) VALUES (%s)";
40
+ $insert = $wpdb->query( $wpdb->prepare( $query, $subscriber_ip ) );
41
+
42
+ // Delete older entries
43
+ $query = "DELETE FROM {$wpdb->prefix}es_subscriber_ips WHERE (`created_on` < NOW() - INTERVAL %s SECOND )";
44
+ $delete = $wpdb->query( $wpdb->prepare( $query, DAY_IN_SECONDS ) );
45
+ }
46
+ }
47
+
48
+ return false;
49
+ }
50
+
51
+ }
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.15
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.16
7
  * Author: Icegram
8
  * Author URI: https://www.icegram.com/
9
  * Requires at least: 3.9
job/es-optin.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
 
8
  if( (isset($_GET['es'])) && ($_GET['es'] == "optin") ) {
9
  $es_page_request = $_GET['es'];
10
-
11
  $blogname = get_option('blogname');
12
  $noerror = true;
13
  $home_url = home_url('/');
@@ -56,17 +56,17 @@ if( (isset($_GET['es'])) && ($_GET['es'] == "optin") ) {
56
  $message = esc_html(stripslashes($es_c_message2));
57
  }
58
  if($message == "") {
59
- $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers' );
60
  }
61
  } else {
62
- $message = __( 'This email address has already been confirmed.', 'email-subscribers' );
63
  }
64
  echo $message;
65
  } else {
66
  $message = esc_html(stripslashes($es_c_message2));
67
  $message = str_replace("\r\n", "<br />", $message);
68
  if($message == "") {
69
- $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers' );
70
  }
71
  echo $message;
72
  }
7
 
8
  if( (isset($_GET['es'])) && ($_GET['es'] == "optin") ) {
9
  $es_page_request = $_GET['es'];
10
+
11
  $blogname = get_option('blogname');
12
  $noerror = true;
13
  $home_url = home_url('/');
56
  $message = esc_html(stripslashes($es_c_message2));
57
  }
58
  if($message == "") {
59
+ $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', ES_TDOMAIN );
60
  }
61
  } else {
62
+ $message = __( 'This email address has already been confirmed.', ES_TDOMAIN );
63
  }
64
  echo $message;
65
  } else {
66
  $message = esc_html(stripslashes($es_c_message2));
67
  $message = str_replace("\r\n", "<br />", $message);
68
  if($message == "") {
69
+ $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', ES_TDOMAIN );
70
  }
71
  echo $message;
72
  }
job/es-subscribe.php CHANGED
@@ -4,107 +4,116 @@
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
- if ( !class_exists( 'es_cls_job_subscribe' ) ) {
8
  class es_cls_job_subscribe {
9
 
10
  public function __construct( $isActionsNeeded ) {
11
- if ( defined( 'DOING_AJAX' ) && (true === DOING_AJAX) && (true === $isActionsNeeded) ) {
12
  add_action( 'wp_ajax_es_add_subscriber', array( $this, 'es_add_subscriber' ), 10 );
13
  add_action( 'wp_ajax_nopriv_es_add_subscriber', array( $this, 'es_add_subscriber' ), 10 );
14
  }
15
  }
16
- public static function getInstance( $isActionsNeeded = true){
17
- static $es_cls_job_subscribe_obj = null;
18
- if (null === $es_cls_job_subscribe_obj) {
19
- $es_cls_job_subscribe_obj = new es_cls_job_subscribe($isActionsNeeded);
20
- }
21
- return $es_cls_job_subscribe_obj;
 
 
22
  }
23
 
24
 
25
- public function es_add_subscriber( ) {
 
26
  $es_response = $this->es_add_subscribers_db();
27
- echo json_encode($es_response);
28
  die();
29
  }
30
 
31
- public function es_add_subscribers_db(){
32
  $es_response = array();
 
33
  //honey-pot validation
34
- if(!empty($_POST['es_required_field'])){
 
 
35
  $es_response['error'] = 'unexpected-error';
36
  return $es_response;
37
-
38
  }
 
39
  //block address list
40
- $es_disposable_list = array('\.ru');
41
- if(preg_match('/('.implode('|', $es_disposable_list).')$/i', trim($_POST['esfpx_es_txt_email']))){
42
  $es_response['error'] = 'unexpected-error';
43
- $echoAble=json_encode($es_response);
 
44
  return $es_response;
45
  }
46
 
47
  if ( ( isset( $_POST['es'] ) ) && ( 'subscribe' === $_POST['es'] ) && !empty( $_POST['esfpx_es-subscribe'] ) ) {
48
 
49
- foreach ($_POST as $key => $value) {
50
- $new_key = str_replace('_pg', '', $key);
51
- $_POST[$new_key] = $value;
52
  }
53
 
54
- $es_subscriber_name = isset( $_POST['esfpx_es_txt_name'] ) ? trim($_POST['esfpx_es_txt_name']) : '';
55
- $es_subscriber_email = isset( $_POST['esfpx_es_txt_email'] ) ? trim($_POST['esfpx_es_txt_email']) : '';
56
- $es_subscriber_group = isset( $_POST['esfpx_es_txt_group'] ) ? trim($_POST['esfpx_es_txt_group']) : '';
57
- $es_nonce = $_POST['esfpx_es-subscribe'];
58
 
59
  $subscriber_form = array(
60
- 'es_email_name' => '',
61
- 'es_email_mail' => '',
62
- 'es_email_group' => '',
63
- 'es_email_status' => '',
64
- 'es_nonce' => ''
65
- );
66
-
67
- if( $es_subscriber_group == '' ) {
68
  $es_subscriber_group = 'Public';
69
  }
70
 
71
  if ( $es_subscriber_email != '' ) {
72
- if ( !filter_var( $es_subscriber_email, FILTER_VALIDATE_EMAIL ) ) {
73
  $es_response['error'] = 'invalid-email';
74
  } else {
75
  $action = '';
76
  global $wpdb;
77
 
78
- $subscriber_form['es_email_name'] = $es_subscriber_name;
79
- $subscriber_form['es_email_mail'] = $es_subscriber_email;
80
  $subscriber_form['es_email_group'] = $es_subscriber_group;
81
- $subscriber_form['es_nonce'] = $es_nonce;
82
 
83
  $es_optintype = get_option( 'ig_es_optintype' );
84
 
85
- if( $es_optintype == "Double Opt In" ) {
86
  $subscriber_form['es_email_status'] = "Unconfirmed";
87
  } else {
88
  $subscriber_form['es_email_status'] = "Single Opt In";
89
  }
90
  //validate lead
91
- $action = es_cls_dbquery::es_view_subscriber_widget($subscriber_form);
92
- if( $action == "sus" ) {
93
- $subscribers = es_cls_dbquery::es_view_subscriber_one($es_subscriber_email,$es_subscriber_group);
94
- if( $es_optintype == "Double Opt In" ) {
95
- es_cls_sendmail::es_sendmail("optin", $template = 0, $subscribers, "optin", 0);
96
  $es_response['success'] = 'subscribed-pending-doubleoptin';
97
  } else {
98
  $es_c_usermailoption = get_option( 'ig_es_welcomeemail' );
99
  if ( $es_c_usermailoption == "YES" ) {
100
- es_cls_sendmail::es_sendmail("welcome", $template = 0, $subscribers, "welcome", 0);
101
  }
102
  $es_response['success'] = 'subscribed-successfully';
103
- }
104
- } elseif( $action == "ext" ) {
105
  $es_response['success'] = 'already-exist';
106
- } elseif( $action == "invalid" ) {
107
  $es_response['error'] = 'invalid-email';
 
 
108
  }
109
  }
110
  } else {
@@ -112,10 +121,11 @@ if ( !class_exists( 'es_cls_job_subscribe' ) ) {
112
  }
113
  } else {
114
  $es_response['error'] = 'unexpected-error-1';
115
- }
116
-
117
  return $es_response;
118
  }
119
  }
 
120
  $es_cls_job_subscribe_obj = es_cls_job_subscribe::getInstance(true);
121
  }
4
  if ( ! defined( 'ABSPATH' ) ) {
5
  exit;
6
  }
7
+ if ( ! class_exists( 'es_cls_job_subscribe' ) ) {
8
  class es_cls_job_subscribe {
9
 
10
  public function __construct( $isActionsNeeded ) {
11
+ if ( defined( 'DOING_AJAX' ) && ( true === DOING_AJAX ) && ( true === $isActionsNeeded ) ) {
12
  add_action( 'wp_ajax_es_add_subscriber', array( $this, 'es_add_subscriber' ), 10 );
13
  add_action( 'wp_ajax_nopriv_es_add_subscriber', array( $this, 'es_add_subscriber' ), 10 );
14
  }
15
  }
16
+
17
+ public static function getInstance( $isActionsNeeded = true ) {
18
+ static $es_cls_job_subscribe_obj = null;
19
+ if ( null === $es_cls_job_subscribe_obj ) {
20
+ $es_cls_job_subscribe_obj = new es_cls_job_subscribe( $isActionsNeeded );
21
+ }
22
+
23
+ return $es_cls_job_subscribe_obj;
24
  }
25
 
26
 
27
+ public function es_add_subscriber() {
28
+
29
  $es_response = $this->es_add_subscribers_db();
30
+ echo json_encode( $es_response );
31
  die();
32
  }
33
 
34
+ public function es_add_subscribers_db() {
35
  $es_response = array();
36
+
37
  //honey-pot validation
38
+
39
+ $hp_key = "esfpx_es_hp_" . wp_create_nonce('es_hp');
40
+ if ( !isset( $_POST[$hp_key] ) || !empty( $_POST[$hp_key] ) ) {
41
  $es_response['error'] = 'unexpected-error';
42
  return $es_response;
 
43
  }
44
+
45
  //block address list
46
+ $es_disposable_list = array( '\.ru' );
47
+ if ( preg_match( '/(' . implode( '|', $es_disposable_list ) . ')$/i', trim( $_POST['esfpx_es_txt_email'] ) ) ) {
48
  $es_response['error'] = 'unexpected-error';
49
+ $echoAble = json_encode( $es_response );
50
+
51
  return $es_response;
52
  }
53
 
54
  if ( ( isset( $_POST['es'] ) ) && ( 'subscribe' === $_POST['es'] ) && !empty( $_POST['esfpx_es-subscribe'] ) ) {
55
 
56
+ foreach ( $_POST as $key => $value ) {
57
+ $new_key = str_replace( '_pg', '', $key );
58
+ $_POST[ $new_key ] = $value;
59
  }
60
 
61
+ $es_subscriber_name = isset( $_POST['esfpx_es_txt_name'] ) ? trim( $_POST['esfpx_es_txt_name'] ) : '';
62
+ $es_subscriber_email = isset( $_POST['esfpx_es_txt_email'] ) ? trim( $_POST['esfpx_es_txt_email'] ) : '';
63
+ $es_subscriber_group = isset( $_POST['esfpx_es_txt_group'] ) ? trim( $_POST['esfpx_es_txt_group'] ) : '';
64
+ $es_nonce = $_POST['esfpx_es-subscribe'];
65
 
66
  $subscriber_form = array(
67
+ 'es_email_name' => '',
68
+ 'es_email_mail' => '',
69
+ 'es_email_group' => '',
70
+ 'es_email_status' => '',
71
+ 'es_nonce' => ''
72
+ );
73
+
74
+ if ( $es_subscriber_group == '' ) {
75
  $es_subscriber_group = 'Public';
76
  }
77
 
78
  if ( $es_subscriber_email != '' ) {
79
+ if ( ! filter_var( $es_subscriber_email, FILTER_VALIDATE_EMAIL ) ) {
80
  $es_response['error'] = 'invalid-email';
81
  } else {
82
  $action = '';
83
  global $wpdb;
84
 
85
+ $subscriber_form['es_email_name'] = $es_subscriber_name;
86
+ $subscriber_form['es_email_mail'] = $es_subscriber_email;
87
  $subscriber_form['es_email_group'] = $es_subscriber_group;
88
+ $subscriber_form['es_nonce'] = $es_nonce;
89
 
90
  $es_optintype = get_option( 'ig_es_optintype' );
91
 
92
+ if ( $es_optintype == "Double Opt In" ) {
93
  $subscriber_form['es_email_status'] = "Unconfirmed";
94
  } else {
95
  $subscriber_form['es_email_status'] = "Single Opt In";
96
  }
97
  //validate lead
98
+ $action = es_cls_dbquery::es_view_subscriber_widget( $subscriber_form );
99
+ if ( $action == "sus" ) {
100
+ $subscribers = es_cls_dbquery::es_view_subscriber_one( $es_subscriber_email, $es_subscriber_group );
101
+ if ( $es_optintype == "Double Opt In" ) {
102
+ es_cls_sendmail::es_sendmail( "optin", $template = 0, $subscribers, "optin", 0 );
103
  $es_response['success'] = 'subscribed-pending-doubleoptin';
104
  } else {
105
  $es_c_usermailoption = get_option( 'ig_es_welcomeemail' );
106
  if ( $es_c_usermailoption == "YES" ) {
107
+ es_cls_sendmail::es_sendmail( "welcome", $template = 0, $subscribers, "welcome", 0 );
108
  }
109
  $es_response['success'] = 'subscribed-successfully';
110
+ }
111
+ } elseif ( $action == "ext" ) {
112
  $es_response['success'] = 'already-exist';
113
+ } elseif ( $action == "invalid" ) {
114
  $es_response['error'] = 'invalid-email';
115
+ } elseif($action == "rate-limit") {
116
+ $es_response['error'] = 'rate-limit';
117
  }
118
  }
119
  } else {
121
  }
122
  } else {
123
  $es_response['error'] = 'unexpected-error-1';
124
+ }
125
+
126
  return $es_response;
127
  }
128
  }
129
+
130
  $es_cls_job_subscribe_obj = es_cls_job_subscribe::getInstance(true);
131
  }
job/es-unsubscribe.php CHANGED
@@ -52,14 +52,14 @@ if( (isset($_GET['es'])) && ($_GET['es'] == "unsubscribe") ) {
52
  $message = esc_html(stripslashes($es_c_message2));
53
  }
54
  if($message == "") {
55
- $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers' );
56
  }
57
  echo $message;
58
  } else {
59
  $message = esc_html(stripslashes($es_c_message2));
60
  $message = str_replace("\r\n", "<br />", $message);
61
  if($message == "") {
62
- $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', 'email-subscribers' );
63
  }
64
  echo $message;
65
  }
52
  $message = esc_html(stripslashes($es_c_message2));
53
  }
54
  if($message == "") {
55
+ $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', ES_TDOMAIN );
56
  }
57
  echo $message;
58
  } else {
59
  $message = esc_html(stripslashes($es_c_message2));
60
  $message = str_replace("\r\n", "<br />", $message);
61
  if($message == "") {
62
+ $message = __( 'Oops.. We are getting some technical error. Please try again or contact admin.', ES_TDOMAIN );
63
  }
64
  echo $message;
65
  }
query/db_default.php CHANGED
@@ -200,7 +200,7 @@ class es_cls_default {
200
  $form["es_email_name"] = "Admin";
201
  $form["es_email_group"] = "Test";
202
  $form["es_email_status"] = "Confirmed";
203
- es_cls_dbquery::es_view_subscriber_ins($form, "insert");
204
  if('sus' === $res){
205
  update_option( 'ig_es_default_subscriber_imported', 'yes' );
206
  }
200
  $form["es_email_name"] = "Admin";
201
  $form["es_email_group"] = "Test";
202
  $form["es_email_status"] = "Confirmed";
203
+ $res = es_cls_dbquery::es_view_subscriber_ins($form, "insert");
204
  if('sus' === $res){
205
  update_option( 'ig_es_default_subscriber_imported', 'yes' );
206
  }
query/db_subscriber.php CHANGED
@@ -138,6 +138,14 @@ class es_cls_dbquery {
138
  if ( $result > 0 ) {
139
  return "ext";
140
  } else {
 
 
 
 
 
 
 
 
141
  $data['guid'] = es_cls_common::es_generate_guid(60);
142
  $sql = $wpdb->prepare( "INSERT INTO {$wpdb->prefix}es_emaillist
143
  (es_email_name, es_email_mail, es_email_status, es_email_created, es_email_viewcount, es_email_group, es_email_guid) VALUES(%s, %s, %s, %s, %d, %s, %s)",
@@ -171,9 +179,11 @@ class es_cls_dbquery {
171
  return "sus";
172
  }
173
  } elseif( $action == "update" ) {
 
174
  $sSql = $wpdb->prepare( "SELECT *
175
  FROM {$wpdb->prefix}es_emaillist
176
  WHERE es_email_mail = %s AND es_email_group = %s AND es_email_id != %d", $data["es_email_mail"], trim($data["es_email_group"]), $data["es_email_id"] );
 
177
  $result = $wpdb->get_var($sSql);
178
  if ( $result > 0 ) {
179
  return "ext";
@@ -294,7 +304,7 @@ class es_cls_dbquery {
294
  $es_result = $wpdb->get_results( $check_if_subscriber_exists, ARRAY_A );
295
 
296
  if ( !empty( $es_result ) && count( $es_result ) > 0 ) {
297
- if( $es_result[0]['es_email_status'] == "Confirmed" || $es_result[0]['es_email_status'] == "Single Opt In" ) {
298
  return "ext";
299
  } else {
300
  $action = "";
@@ -309,6 +319,7 @@ class es_cls_dbquery {
309
  } elseif ( array_key_exists( 'es_af_nonce', $data ) ) {
310
  $form['es_af_nonce'] = $data['es_af_nonce'];
311
  }
 
312
  $action = es_cls_dbquery::es_view_subscriber_ins($form, $action = "update");
313
  return $action;
314
  }
138
  if ( $result > 0 ) {
139
  return "ext";
140
  } else {
141
+
142
+ // Restrict too many requests
143
+ $timeout = es_cls_subscription_throttaling::throttle();
144
+
145
+ if($timeout > 0) {
146
+ return 'rate-limit';
147
+ }
148
+
149
  $data['guid'] = es_cls_common::es_generate_guid(60);
150
  $sql = $wpdb->prepare( "INSERT INTO {$wpdb->prefix}es_emaillist
151
  (es_email_name, es_email_mail, es_email_status, es_email_created, es_email_viewcount, es_email_group, es_email_guid) VALUES(%s, %s, %s, %s, %d, %s, %s)",
179
  return "sus";
180
  }
181
  } elseif( $action == "update" ) {
182
+
183
  $sSql = $wpdb->prepare( "SELECT *
184
  FROM {$wpdb->prefix}es_emaillist
185
  WHERE es_email_mail = %s AND es_email_group = %s AND es_email_id != %d", $data["es_email_mail"], trim($data["es_email_group"]), $data["es_email_id"] );
186
+
187
  $result = $wpdb->get_var($sSql);
188
  if ( $result > 0 ) {
189
  return "ext";
304
  $es_result = $wpdb->get_results( $check_if_subscriber_exists, ARRAY_A );
305
 
306
  if ( !empty( $es_result ) && count( $es_result ) > 0 ) {
307
+ if( $es_result[0]['es_email_status'] == "Unconfirmed" || $es_result[0]['es_email_status'] == "Confirmed" || $es_result[0]['es_email_status'] == "Single Opt In" ) {
308
  return "ext";
309
  } else {
310
  $action = "";
319
  } elseif ( array_key_exists( 'es_af_nonce', $data ) ) {
320
  $form['es_af_nonce'] = $data['es_af_nonce'];
321
  }
322
+
323
  $action = es_cls_dbquery::es_view_subscriber_ins($form, $action = "update");
324
  return $action;
325
  }
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.15
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
@@ -342,7 +342,13 @@ Use our free plugin [Email Subscribers - Group Selector](https://wordpress.org/p
342
 
343
  == Changelog ==
344
 
 
 
 
 
 
345
  = 3.5.15 (25.10.2018) =
 
346
  * Fix: Extra field shown for forms on RTL sites
347
 
348
  = 3.5.14 (15.10.2018) =
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.16
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses
11
 
342
 
343
  == Changelog ==
344
 
345
+ = 3.5.16 (14.11.2018) =
346
+
347
+ * Fix: spam subscription issue.
348
+ * Fix: Visitors were not able to subscribe.
349
+
350
  = 3.5.15 (25.10.2018) =
351
+
352
  * Fix: Extra field shown for forms on RTL sites
353
 
354
  = 3.5.14 (15.10.2018) =
widget/es-widget-page.js CHANGED
@@ -64,7 +64,9 @@ ES.prototype = {
64
  } else if ( response && response.success === 'already-exist' ) {
65
  es_msg_text = es_widget_page_notices.es_email_exists;
66
  } else if ( response && response.error === 'no-email-address' ) {
67
- es_msg_text = es_widget_page_notices.es_email_notice;
 
 
68
  } else if( response.success && response.success === 'subscribed-pending-doubleoptin' ) {
69
  es_msg_text = es_widget_page_notices.es_success_notice;
70
  jQuery(form)[0].reset();
64
  } else if ( response && response.success === 'already-exist' ) {
65
  es_msg_text = es_widget_page_notices.es_email_exists;
66
  } else if ( response && response.error === 'no-email-address' ) {
67
+ es_msg_text = es_widget_page_notices.es_email_notice;
68
+ } else if ( response && response.error === 'rate-limit' ) {
69
+ es_msg_text = es_widget_page_notices.es_rate_limit_notice;
70
  } else if( response.success && response.success === 'subscribed-pending-doubleoptin' ) {
71
  es_msg_text = es_widget_page_notices.es_success_notice;
72
  jQuery(form)[0].reset();