MailPoet Newsletters (New) - Version 3.0.0-rc.2.0.1

Version Description

  • 2017-08-30 =
  • Fixed: newsletters with emojis are properly saved and sent on certain hosts. Thanks Alison, Scott and Swann!
  • Fixed: plugin activates on multisite environments;
  • Fixed: subscription forms with list selection field are working now;
  • Fixed: newsletter editor does not require "unsubscribe" link when a third-party sending method is used;
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (New)
Version 3.0.0-rc.2.0.1
Comparing to
See all releases

Code changes from version 3.0.0-rc.2.0.0 to 3.0.0-rc.2.0.1

lang/mailpoet-da_DK.mo CHANGED
Binary file
lang/mailpoet-de_DE.mo CHANGED
Binary file
lang/mailpoet-en_GB.mo CHANGED
Binary file
lang/mailpoet-es_ES.mo CHANGED
Binary file
lang/mailpoet-fa_IR.mo CHANGED
Binary file
lang/mailpoet-fr_CA.mo CHANGED
Binary file
lang/mailpoet-fr_FR.mo CHANGED
Binary file
lang/mailpoet-it_IT.mo CHANGED
Binary file
lang/mailpoet-ja.mo CHANGED
Binary file
lang/mailpoet-nl_NL.mo CHANGED
Binary file
lang/mailpoet-pl_PL.mo CHANGED
Binary file
lang/mailpoet-pt_BR.mo CHANGED
Binary file
lang/mailpoet-pt_PT.mo CHANGED
Binary file
lang/mailpoet-ru_RU.mo CHANGED
Binary file
lang/mailpoet-sv_SE.mo CHANGED
Binary file
lang/mailpoet-tr_TR.mo CHANGED
Binary file
lang/mailpoet.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
- "POT-Creation-Date: 2017-08-29 13:18:15+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -194,8 +194,8 @@ msgstr ""
194
  msgid "You have not specified any settings to be saved."
195
  msgstr ""
196
 
197
- #: lib/API/JSON/v1/Subscribers.php:27 lib/API/JSON/v1/Subscribers.php:153
198
- #: lib/API/JSON/v1/Subscribers.php:169 lib/API/JSON/v1/Subscribers.php:185
199
  #: lib/API/MP/v1/API.php:48
200
  msgid "This subscriber does not exist."
201
  msgstr ""
@@ -208,7 +208,7 @@ msgstr ""
208
  msgid "Please leave the first field empty."
209
  msgstr ""
210
 
211
- #: lib/API/JSON/v1/Subscribers.php:88 views/form/editor.html:57
212
  msgid "Please select a list."
213
  msgstr ""
214
 
@@ -238,11 +238,18 @@ msgstr ""
238
  msgid "This subscriber already exists."
239
  msgstr ""
240
 
241
- #: lib/Config/Hooks.php:149
242
  msgid "MailPoet Newsletter"
243
  msgstr ""
244
 
245
- #: lib/Config/Initializer.php:140
 
 
 
 
 
 
 
246
  msgid "You do not have permission to activate/deactivate MailPoet plugin."
247
  msgstr ""
248
 
@@ -332,83 +339,83 @@ msgstr[1] ""
332
  msgid "Settings imported"
333
  msgstr ""
334
 
335
- #: lib/Config/Menu.php:79 lib/Config/Menu.php:80 views/newsletters.html:23
336
  msgid "Emails"
337
  msgstr ""
338
 
339
- #: lib/Config/Menu.php:104 lib/Newsletter/Shortcodes/ShortcodesHelper.php:33
340
  #: views/newsletter/templates/components/sidebar/styles.hbs:75
341
  #: views/newsletters.html:121
342
  msgid "Newsletter"
343
  msgstr ""
344
 
345
- #: lib/Config/Menu.php:105 views/newsletter/editor.html:228
346
  msgid "Newsletter Editor"
347
  msgstr ""
348
 
349
- #: lib/Config/Menu.php:119 lib/Config/Menu.php:120 views/forms.html:25
350
  msgid "Forms"
351
  msgstr ""
352
 
353
- #: lib/Config/Menu.php:144 lib/Config/Menu.php:145
354
  msgid "Form Editor"
355
  msgstr ""
356
 
357
- #: lib/Config/Menu.php:159 lib/Config/Menu.php:160
358
  #: views/subscribers/subscribers.html:18
359
  msgid "Subscribers"
360
  msgstr ""
361
 
362
- #: lib/Config/Menu.php:184 lib/Config/Menu.php:185
363
  #: views/subscribers/importExport/import.html:7
364
  #: views/subscribers/subscribers.html:94
365
  msgid "Import"
366
  msgstr ""
367
 
368
- #: lib/Config/Menu.php:197 lib/Config/Menu.php:198
369
  #: views/subscribers/importExport/export.html:6
370
  #: views/subscribers/importExport/export.html:96
371
  #: views/subscribers/subscribers.html:95
372
  msgid "Export"
373
  msgstr ""
374
 
375
- #: lib/Config/Menu.php:212 lib/Config/Menu.php:213 views/forms.html:53
376
  #: views/newsletters.html:64 views/newsletters.html:166 views/segments.html:13
377
  #: views/subscribers/subscribers.html:66
378
  msgid "Lists"
379
  msgstr ""
380
 
381
- #: lib/Config/Menu.php:239 lib/Config/Menu.php:240 views/form/editor.html:37
382
  #: views/newsletters.html:65 views/settings.html:6
383
  msgid "Settings"
384
  msgstr ""
385
 
386
- #: lib/Config/Menu.php:253 lib/Config/Menu.php:254 views/help.html:5
387
  msgid "Help"
388
  msgstr ""
389
 
390
- #: lib/Config/Menu.php:267 lib/Config/Menu.php:268 views/settings.html:22
391
  msgid "Premium"
392
  msgstr ""
393
 
394
- #: lib/Config/Menu.php:280 lib/Config/Menu.php:281 views/update.html:16
395
  #: views/welcome.html:16
396
  msgid "Welcome"
397
  msgstr ""
398
 
399
- #: lib/Config/Menu.php:293 lib/Config/Menu.php:294 views/segments.html:43
400
  msgid "Update"
401
  msgstr ""
402
 
403
- #: lib/Config/Menu.php:306
404
  msgid "Migration"
405
  msgstr ""
406
 
407
- #: lib/Config/Menu.php:520
408
  msgid "In any WordPress role"
409
  msgstr ""
410
 
411
- #: lib/Config/Menu.php:596 views/premium.html:41
412
  msgid "MailPoet"
413
  msgstr ""
414
 
@@ -1245,18 +1252,18 @@ msgstr ""
1245
  msgid "Please specify a name."
1246
  msgstr ""
1247
 
1248
- #: lib/Models/CustomField.php:23 lib/Models/Newsletter.php:27
1249
  #: views/form/templates/settings/field_form.hbs:16
1250
  msgid "Please specify a type."
1251
  msgstr ""
1252
 
1253
- #: lib/Models/Form.php:93 lib/Models/Newsletter.php:640
1254
- #: lib/Models/Segment.php:133 lib/Models/Subscriber.php:342
1255
  msgid "All"
1256
  msgstr ""
1257
 
1258
- #: lib/Models/Form.php:98 lib/Models/Newsletter.php:710
1259
- #: lib/Models/Segment.php:138 lib/Models/Subscriber.php:367 views/forms.html:66
1260
  #: views/newsletters.html:77 views/segments.html:50
1261
  #: views/subscribers/subscribers.html:37
1262
  msgid "Trash"
@@ -1266,38 +1273,38 @@ msgstr ""
1266
  msgid "Another record already exists. Please specify a different \"%1$s\"."
1267
  msgstr ""
1268
 
1269
- #: lib/Models/Newsletter.php:391
1270
  msgid "Deleted list"
1271
  msgstr ""
1272
 
1273
- #: lib/Models/Newsletter.php:541 lib/Models/Subscriber.php:278
1274
  #: lib/Subscribers/ImportExport/Export/Export.php:173
1275
  msgid "All Lists"
1276
  msgstr ""
1277
 
1278
- #: lib/Models/Newsletter.php:652
1279
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:12
1280
  msgid "Draft"
1281
  msgstr ""
1282
 
1283
- #: lib/Models/Newsletter.php:660
1284
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:11
1285
  msgid "Scheduled"
1286
  msgstr ""
1287
 
1288
- #: lib/Models/Newsletter.php:668
1289
  msgid "Sending"
1290
  msgstr ""
1291
 
1292
- #: lib/Models/Newsletter.php:676
1293
  msgid "Sent"
1294
  msgstr ""
1295
 
1296
- #: lib/Models/Newsletter.php:690 views/newsletters.html:85
1297
  msgid "Active"
1298
  msgstr ""
1299
 
1300
- #: lib/Models/Newsletter.php:698
1301
  msgid "Not active"
1302
  msgstr ""
1303
 
@@ -1321,7 +1328,7 @@ msgstr ""
1321
  msgid "Not in a List"
1322
  msgstr ""
1323
 
1324
- #: lib/Models/SendingQueue.php:19
1325
  msgid "Rendered newsletter body is invalid!"
1326
  msgstr ""
1327
 
@@ -1353,30 +1360,30 @@ msgstr ""
1353
  msgid "Your email address is invalid!"
1354
  msgstr ""
1355
 
1356
- #: lib/Models/Subscriber.php:188
1357
  msgid "You need to wait before subscribing again."
1358
  msgstr ""
1359
 
1360
- #: lib/Models/Subscriber.php:286
1361
  msgid "Subscribers without a list (%s)"
1362
  msgstr ""
1363
 
1364
- #: lib/Models/Subscriber.php:347 lib/Subscription/Pages.php:301
1365
  #: views/segments.html:30 views/subscribers/subscribers.html:56
1366
  msgid "Subscribed"
1367
  msgstr ""
1368
 
1369
- #: lib/Models/Subscriber.php:352 views/segments.html:31
1370
  #: views/subscribers/subscribers.html:55
1371
  msgid "Unconfirmed"
1372
  msgstr ""
1373
 
1374
- #: lib/Models/Subscriber.php:357 lib/Subscription/Pages.php:309
1375
  #: views/segments.html:32 views/subscribers/subscribers.html:57
1376
  msgid "Unsubscribed"
1377
  msgstr ""
1378
 
1379
- #: lib/Models/Subscriber.php:362 lib/Subscription/Pages.php:317
1380
  #: views/segments.html:33 views/subscribers/subscribers.html:58
1381
  msgid "Bounced"
1382
  msgstr ""
@@ -5183,22 +5190,22 @@ msgctxt "Error code (inside parentheses)"
5183
  msgid "code: %s"
5184
  msgstr ""
5185
 
5186
- #: lib/Config/Menu.php:92
5187
  msgctxt "newsletters per page (screen options)"
5188
  msgid "Number of newsletters per page"
5189
  msgstr ""
5190
 
5191
- #: lib/Config/Menu.php:132
5192
  msgctxt "forms per page (screen options)"
5193
  msgid "Number of forms per page"
5194
  msgstr ""
5195
 
5196
- #: lib/Config/Menu.php:172
5197
  msgctxt "subscribers per page (screen options)"
5198
  msgid "Number of subscribers per page"
5199
  msgstr ""
5200
 
5201
- #: lib/Config/Menu.php:225
5202
  msgctxt "segments per page (screen options)"
5203
  msgid "Number of segments per page"
5204
  msgstr ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
+ "POT-Creation-Date: 2017-08-30 15:49:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
194
  msgid "You have not specified any settings to be saved."
195
  msgstr ""
196
 
197
+ #: lib/API/JSON/v1/Subscribers.php:27 lib/API/JSON/v1/Subscribers.php:154
198
+ #: lib/API/JSON/v1/Subscribers.php:170 lib/API/JSON/v1/Subscribers.php:186
199
  #: lib/API/MP/v1/API.php:48
200
  msgid "This subscriber does not exist."
201
  msgstr ""
208
  msgid "Please leave the first field empty."
209
  msgstr ""
210
 
211
+ #: lib/API/JSON/v1/Subscribers.php:89 views/form/editor.html:57
212
  msgid "Please select a list."
213
  msgstr ""
214
 
238
  msgid "This subscriber already exists."
239
  msgstr ""
240
 
241
+ #: lib/Config/Hooks.php:148
242
  msgid "MailPoet Newsletter"
243
  msgstr ""
244
 
245
+ #: lib/Config/Initializer.php:42
246
+ msgid ""
247
+ "Unable to connect to the database (the database is unable to open a file or "
248
+ "folder), the connection is likely not configured correctly. Please read our "
249
+ "[link] Knowledge Base article [/link] for steps how to resolve it."
250
+ msgstr ""
251
+
252
+ #: lib/Config/Initializer.php:130
253
  msgid "You do not have permission to activate/deactivate MailPoet plugin."
254
  msgstr ""
255
 
339
  msgid "Settings imported"
340
  msgstr ""
341
 
342
+ #: lib/Config/Menu.php:84 lib/Config/Menu.php:85 views/newsletters.html:23
343
  msgid "Emails"
344
  msgstr ""
345
 
346
+ #: lib/Config/Menu.php:109 lib/Newsletter/Shortcodes/ShortcodesHelper.php:33
347
  #: views/newsletter/templates/components/sidebar/styles.hbs:75
348
  #: views/newsletters.html:121
349
  msgid "Newsletter"
350
  msgstr ""
351
 
352
+ #: lib/Config/Menu.php:110 views/newsletter/editor.html:228
353
  msgid "Newsletter Editor"
354
  msgstr ""
355
 
356
+ #: lib/Config/Menu.php:124 lib/Config/Menu.php:125 views/forms.html:25
357
  msgid "Forms"
358
  msgstr ""
359
 
360
+ #: lib/Config/Menu.php:149 lib/Config/Menu.php:150
361
  msgid "Form Editor"
362
  msgstr ""
363
 
364
+ #: lib/Config/Menu.php:164 lib/Config/Menu.php:165
365
  #: views/subscribers/subscribers.html:18
366
  msgid "Subscribers"
367
  msgstr ""
368
 
369
+ #: lib/Config/Menu.php:189 lib/Config/Menu.php:190
370
  #: views/subscribers/importExport/import.html:7
371
  #: views/subscribers/subscribers.html:94
372
  msgid "Import"
373
  msgstr ""
374
 
375
+ #: lib/Config/Menu.php:202 lib/Config/Menu.php:203
376
  #: views/subscribers/importExport/export.html:6
377
  #: views/subscribers/importExport/export.html:96
378
  #: views/subscribers/subscribers.html:95
379
  msgid "Export"
380
  msgstr ""
381
 
382
+ #: lib/Config/Menu.php:217 lib/Config/Menu.php:218 views/forms.html:53
383
  #: views/newsletters.html:64 views/newsletters.html:166 views/segments.html:13
384
  #: views/subscribers/subscribers.html:66
385
  msgid "Lists"
386
  msgstr ""
387
 
388
+ #: lib/Config/Menu.php:244 lib/Config/Menu.php:245 views/form/editor.html:37
389
  #: views/newsletters.html:65 views/settings.html:6
390
  msgid "Settings"
391
  msgstr ""
392
 
393
+ #: lib/Config/Menu.php:258 lib/Config/Menu.php:259 views/help.html:5
394
  msgid "Help"
395
  msgstr ""
396
 
397
+ #: lib/Config/Menu.php:272 lib/Config/Menu.php:273 views/settings.html:22
398
  msgid "Premium"
399
  msgstr ""
400
 
401
+ #: lib/Config/Menu.php:285 lib/Config/Menu.php:286 views/update.html:16
402
  #: views/welcome.html:16
403
  msgid "Welcome"
404
  msgstr ""
405
 
406
+ #: lib/Config/Menu.php:298 lib/Config/Menu.php:299 views/segments.html:43
407
  msgid "Update"
408
  msgstr ""
409
 
410
+ #: lib/Config/Menu.php:311
411
  msgid "Migration"
412
  msgstr ""
413
 
414
+ #: lib/Config/Menu.php:530
415
  msgid "In any WordPress role"
416
  msgstr ""
417
 
418
+ #: lib/Config/Menu.php:607 views/premium.html:41
419
  msgid "MailPoet"
420
  msgstr ""
421
 
1252
  msgid "Please specify a name."
1253
  msgstr ""
1254
 
1255
+ #: lib/Models/CustomField.php:23 lib/Models/Newsletter.php:28
1256
  #: views/form/templates/settings/field_form.hbs:16
1257
  msgid "Please specify a type."
1258
  msgstr ""
1259
 
1260
+ #: lib/Models/Form.php:93 lib/Models/Newsletter.php:645
1261
+ #: lib/Models/Segment.php:133 lib/Models/Subscriber.php:346
1262
  msgid "All"
1263
  msgstr ""
1264
 
1265
+ #: lib/Models/Form.php:98 lib/Models/Newsletter.php:715
1266
+ #: lib/Models/Segment.php:138 lib/Models/Subscriber.php:371 views/forms.html:66
1267
  #: views/newsletters.html:77 views/segments.html:50
1268
  #: views/subscribers/subscribers.html:37
1269
  msgid "Trash"
1273
  msgid "Another record already exists. Please specify a different \"%1$s\"."
1274
  msgstr ""
1275
 
1276
+ #: lib/Models/Newsletter.php:396
1277
  msgid "Deleted list"
1278
  msgstr ""
1279
 
1280
+ #: lib/Models/Newsletter.php:546 lib/Models/Subscriber.php:282
1281
  #: lib/Subscribers/ImportExport/Export/Export.php:173
1282
  msgid "All Lists"
1283
  msgstr ""
1284
 
1285
+ #: lib/Models/Newsletter.php:657
1286
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:12
1287
  msgid "Draft"
1288
  msgstr ""
1289
 
1290
+ #: lib/Models/Newsletter.php:665
1291
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:11
1292
  msgid "Scheduled"
1293
  msgstr ""
1294
 
1295
+ #: lib/Models/Newsletter.php:673
1296
  msgid "Sending"
1297
  msgstr ""
1298
 
1299
+ #: lib/Models/Newsletter.php:681
1300
  msgid "Sent"
1301
  msgstr ""
1302
 
1303
+ #: lib/Models/Newsletter.php:695 views/newsletters.html:85
1304
  msgid "Active"
1305
  msgstr ""
1306
 
1307
+ #: lib/Models/Newsletter.php:703
1308
  msgid "Not active"
1309
  msgstr ""
1310
 
1328
  msgid "Not in a List"
1329
  msgstr ""
1330
 
1331
+ #: lib/Models/SendingQueue.php:21
1332
  msgid "Rendered newsletter body is invalid!"
1333
  msgstr ""
1334
 
1360
  msgid "Your email address is invalid!"
1361
  msgstr ""
1362
 
1363
+ #: lib/Models/Subscriber.php:192
1364
  msgid "You need to wait before subscribing again."
1365
  msgstr ""
1366
 
1367
+ #: lib/Models/Subscriber.php:290
1368
  msgid "Subscribers without a list (%s)"
1369
  msgstr ""
1370
 
1371
+ #: lib/Models/Subscriber.php:351 lib/Subscription/Pages.php:301
1372
  #: views/segments.html:30 views/subscribers/subscribers.html:56
1373
  msgid "Subscribed"
1374
  msgstr ""
1375
 
1376
+ #: lib/Models/Subscriber.php:356 views/segments.html:31
1377
  #: views/subscribers/subscribers.html:55
1378
  msgid "Unconfirmed"
1379
  msgstr ""
1380
 
1381
+ #: lib/Models/Subscriber.php:361 lib/Subscription/Pages.php:309
1382
  #: views/segments.html:32 views/subscribers/subscribers.html:57
1383
  msgid "Unsubscribed"
1384
  msgstr ""
1385
 
1386
+ #: lib/Models/Subscriber.php:366 lib/Subscription/Pages.php:317
1387
  #: views/segments.html:33 views/subscribers/subscribers.html:58
1388
  msgid "Bounced"
1389
  msgstr ""
5190
  msgid "code: %s"
5191
  msgstr ""
5192
 
5193
+ #: lib/Config/Menu.php:97
5194
  msgctxt "newsletters per page (screen options)"
5195
  msgid "Number of newsletters per page"
5196
  msgstr ""
5197
 
5198
+ #: lib/Config/Menu.php:137
5199
  msgctxt "forms per page (screen options)"
5200
  msgid "Number of forms per page"
5201
  msgstr ""
5202
 
5203
+ #: lib/Config/Menu.php:177
5204
  msgctxt "subscribers per page (screen options)"
5205
  msgid "Number of subscribers per page"
5206
  msgstr ""
5207
 
5208
+ #: lib/Config/Menu.php:230
5209
  msgctxt "segments per page (screen options)"
5210
  msgid "Number of segments per page"
5211
  msgstr ""
lib/API/JSON/v1/Subscribers.php CHANGED
@@ -74,6 +74,8 @@ class Subscribers extends APIEndpoint {
74
  ));
75
  }
76
 
 
 
77
  $segment_ids = (!empty($data['segments'])
78
  ? (array)$data['segments']
79
  : array()
@@ -81,7 +83,6 @@ class Subscribers extends APIEndpoint {
81
  $segment_ids = $form->filterSegments($segment_ids);
82
  unset($data['segments']);
83
 
84
- $data = $this->deobfuscateFormPayload($data);
85
 
86
  if(empty($segment_ids)) {
87
  return $this->badRequest(array(
74
  ));
75
  }
76
 
77
+ $data = $this->deobfuscateFormPayload($data);
78
+
79
  $segment_ids = (!empty($data['segments'])
80
  ? (array)$data['segments']
81
  : array()
83
  $segment_ids = $form->filterSegments($segment_ids);
84
  unset($data['segments']);
85
 
 
86
 
87
  if(empty($segment_ids)) {
88
  return $this->badRequest(array(
lib/Config/Hooks.php CHANGED
@@ -1,11 +1,10 @@
1
  <?php
 
2
  namespace MailPoet\Config;
 
3
  use MailPoet\Models\Setting;
4
 
5
  class Hooks {
6
- function __construct() {
7
- }
8
-
9
  function init() {
10
  $this->setupWPUsers();
11
  $this->setupImageSize();
1
  <?php
2
+
3
  namespace MailPoet\Config;
4
+
5
  use MailPoet\Models\Setting;
6
 
7
  class Hooks {
 
 
 
8
  function init() {
9
  $this->setupWPUsers();
10
  $this->setupImageSize();
lib/Config/Initializer.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace MailPoet\Config;
3
 
4
  use MailPoet\API;
@@ -13,18 +14,16 @@ if(!defined('ABSPATH')) exit;
13
  require_once(ABSPATH . 'wp-admin/includes/plugin.php');
14
 
15
  class Initializer {
16
- const UNABLE_TO_CONNECT = 'Unable to connect to the database (the database is unable to open a file or folder), the connection is likely not configured correctly. Please read our [link] Knowledge Base article [/link] for steps how to resolve it.';
17
- const SOLVE_DB_ISSUE_URL = 'http://beta.docs.mailpoet.com/article/200-solving-database-connection-issues';
18
-
19
- protected $plugin_initialized = false;
20
  private $access_control;
 
 
 
21
 
22
  function __construct($params = array(
23
  'file' => '',
24
  'version' => '1.0.0'
25
  )) {
26
  Env::init($params['file'], $params['version']);
27
- $this->access_control = new AccessControl();
28
  }
29
 
30
  function init() {
@@ -40,8 +39,8 @@ class Initializer {
40
  $this->setupDB();
41
  } catch(\Exception $e) {
42
  return WPNotice::displayError(Helpers::replaceLinkTags(
43
- __(self::UNABLE_TO_CONNECT, 'mailpoet'),
44
- self::SOLVE_DB_ISSUE_URL,
45
  array('target' => '_blank')
46
  ));
47
  }
@@ -50,8 +49,8 @@ class Initializer {
50
  register_activation_hook(
51
  Env::$file,
52
  array(
53
- 'MailPoet\Config\Activator',
54
- 'activate'
55
  )
56
  );
57
 
@@ -60,27 +59,20 @@ class Initializer {
60
  'action'
61
  ), 10, 2);
62
 
63
- add_action('admin_init', array(
64
- new DeferredAdminNotices,
65
- 'printAndClean'
66
- ));
67
-
68
- add_action('plugins_loaded', array(
69
- $this,
70
- 'setup'
71
- ));
72
  add_action('init', array(
73
  $this,
74
  'onInit'
75
- ));
76
- add_action('widgets_init', array(
77
- $this,
78
- 'setupWidget'
79
- ));
80
  add_action('wp_loaded', array(
81
  $this,
82
  'setupHooks'
83
  ));
 
 
 
 
 
84
  }
85
 
86
  function checkRequirements() {
@@ -88,47 +80,45 @@ class Initializer {
88
  return $requirements->checkAllRequirements();
89
  }
90
 
 
 
 
 
 
91
  function setupDB() {
92
  $database = new Database();
93
  $database->init();
94
  }
95
 
96
- function setup() {
97
  try {
 
 
98
  $this->maybeDbUpdate();
99
- $this->setupRenderer();
100
  $this->setupInstaller();
101
  $this->setupUpdater();
 
 
 
102
  $this->setupLocalizer();
103
  $this->setupMenu();
104
- $this->setupChangelog();
105
  $this->setupShortcodes();
106
  $this->setupImages();
 
 
107
  $this->setupCronTrigger();
108
  $this->setupConflictResolver();
109
 
110
- $this->plugin_initialized = true;
111
- do_action('mailpoet_initialized', MAILPOET_VERSION);
112
- } catch(\Exception $e) {
113
- $this->handleFailedInitialization($e);
114
- }
115
- }
116
-
117
- function onInit() {
118
- if(!$this->plugin_initialized) {
119
- define('MAILPOET_INITIALIZED', false);
120
- return;
121
- }
122
-
123
- try {
124
  $this->setupJSONAPI();
125
  $this->setupRouter();
126
  $this->setupPages();
 
 
127
  } catch(\Exception $e) {
128
- $this->handleFailedInitialization($e);
129
  }
130
 
131
- define('MAILPOET_INITIALIZED', true);
132
  }
133
 
134
  function maybeDbUpdate() {
@@ -139,28 +129,12 @@ class Initializer {
139
  if(!$this->access_control->validatePermission(AccessControl::PERMISSION_UPDATE_PLUGIN)) {
140
  throw new \Exception(__('You do not have permission to activate/deactivate MailPoet plugin.', 'mailpoet'));
141
  }
142
- $activator = new Activator();
143
- $activator->activate();
144
  }
145
  }
146
 
147
- function setupWidget() {
148
- if(!$this->plugin_initialized) {
149
- return;
150
- }
151
-
152
- try {
153
- $widget = new Widget($this->renderer);
154
- $widget->init();
155
- } catch(\Exception $e) {
156
- $this->handleFailedInitialization($e);
157
- }
158
- }
159
-
160
- function setupRenderer() {
161
- $caching = !WP_DEBUG;
162
- $debugging = WP_DEBUG;
163
- $this->renderer = new Renderer($caching, $debugging);
164
  }
165
 
166
  function setupInstaller() {
@@ -184,6 +158,17 @@ class Initializer {
184
  $updater->init();
185
  }
186
 
 
 
 
 
 
 
 
 
 
 
 
187
  function setupLocalizer() {
188
  $localizer = new Localizer($this->renderer);
189
  $localizer->init();
@@ -194,41 +179,18 @@ class Initializer {
194
  $menu->init();
195
  }
196
 
197
- function setupChangelog() {
198
- $changelog = new Changelog();
199
- $changelog->init();
200
- }
201
-
202
- function setupPages() {
203
- $pages = new \MailPoet\Settings\Pages();
204
- $pages->init();
205
- }
206
-
207
  function setupShortcodes() {
208
  $shortcodes = new Shortcodes();
209
  $shortcodes->init();
210
  }
211
 
212
- function setupHooks() {
213
- if(!$this->plugin_initialized) {
214
- return;
215
- }
216
-
217
- try {
218
- $hooks = new Hooks();
219
- $hooks->init();
220
- } catch(\Exception $e) {
221
- $this->handleFailedInitialization($e);
222
- }
223
- }
224
-
225
- function setupJSONAPI() {
226
- API\API::JSON($this->access_control)->init();
227
  }
228
 
229
- function setupRouter() {
230
- $router = new Router\Router($this->access_control);
231
- $router->init();
232
  }
233
 
234
  function setupCronTrigger() {
@@ -239,20 +201,41 @@ class Initializer {
239
  }
240
  }
241
 
242
- function setupImages() {
243
- add_image_size('mailpoet_newsletter_max', 1320);
244
- }
245
-
246
  function setupConflictResolver() {
247
  $conflict_resolver = new ConflictResolver();
248
  $conflict_resolver->init();
249
  }
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  function handleFailedInitialization($exception) {
252
- // Check if we are able to add pages at this point
253
  if(function_exists('wp_get_current_user')) {
254
  Menu::addErrorPage($this->access_control);
255
  }
256
  return WPNotice::displayError($exception);
257
  }
258
- }
1
  <?php
2
+
3
  namespace MailPoet\Config;
4
 
5
  use MailPoet\API;
14
  require_once(ABSPATH . 'wp-admin/includes/plugin.php');
15
 
16
  class Initializer {
 
 
 
 
17
  private $access_control;
18
+ private $renderer;
19
+
20
+ const INITIALIZED = 'MAILPOET_INITIALIZED';
21
 
22
  function __construct($params = array(
23
  'file' => '',
24
  'version' => '1.0.0'
25
  )) {
26
  Env::init($params['file'], $params['version']);
 
27
  }
28
 
29
  function init() {
39
  $this->setupDB();
40
  } catch(\Exception $e) {
41
  return WPNotice::displayError(Helpers::replaceLinkTags(
42
+ __('Unable to connect to the database (the database is unable to open a file or folder), the connection is likely not configured correctly. Please read our [link] Knowledge Base article [/link] for steps how to resolve it.', 'mailpoet'),
43
+ '//beta.docs.mailpoet.com/article/200-solving-database-connection-issues',
44
  array('target' => '_blank')
45
  ));
46
  }
49
  register_activation_hook(
50
  Env::$file,
51
  array(
52
+ $this,
53
+ 'runActivator'
54
  )
55
  );
56
 
59
  'action'
60
  ), 10, 2);
61
 
 
 
 
 
 
 
 
 
 
62
  add_action('init', array(
63
  $this,
64
  'onInit'
65
+ ), 0);
66
+
 
 
 
67
  add_action('wp_loaded', array(
68
  $this,
69
  'setupHooks'
70
  ));
71
+
72
+ add_action('admin_init', array(
73
+ new DeferredAdminNotices,
74
+ 'printAndClean'
75
+ ));
76
  }
77
 
78
  function checkRequirements() {
80
  return $requirements->checkAllRequirements();
81
  }
82
 
83
+ function runActivator() {
84
+ $activator = new Activator();
85
+ return $activator->activate();
86
+ }
87
+
88
  function setupDB() {
89
  $database = new Database();
90
  $database->init();
91
  }
92
 
93
+ function onInit() {
94
  try {
95
+ $this->setupAccessControl();
96
+
97
  $this->maybeDbUpdate();
 
98
  $this->setupInstaller();
99
  $this->setupUpdater();
100
+
101
+ $this->setupRenderer();
102
+ $this->setupWidget();
103
  $this->setupLocalizer();
104
  $this->setupMenu();
 
105
  $this->setupShortcodes();
106
  $this->setupImages();
107
+
108
+ $this->setupChangelog();
109
  $this->setupCronTrigger();
110
  $this->setupConflictResolver();
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  $this->setupJSONAPI();
113
  $this->setupRouter();
114
  $this->setupPages();
115
+
116
+ do_action('mailpoet_initialized', MAILPOET_VERSION);
117
  } catch(\Exception $e) {
118
+ return $this->handleFailedInitialization($e);
119
  }
120
 
121
+ define(self::INITIALIZED, true);
122
  }
123
 
124
  function maybeDbUpdate() {
129
  if(!$this->access_control->validatePermission(AccessControl::PERMISSION_UPDATE_PLUGIN)) {
130
  throw new \Exception(__('You do not have permission to activate/deactivate MailPoet plugin.', 'mailpoet'));
131
  }
132
+ $this->runActivator();
 
133
  }
134
  }
135
 
136
+ function setupAccessControl() {
137
+ $this->access_control = new AccessControl();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  }
139
 
140
  function setupInstaller() {
158
  $updater->init();
159
  }
160
 
161
+ function setupRenderer() {
162
+ $caching = !WP_DEBUG;
163
+ $debugging = WP_DEBUG;
164
+ $this->renderer = new Renderer($caching, $debugging);
165
+ }
166
+
167
+ function setupWidget() {
168
+ $widget = new Widget($this->renderer);
169
+ $widget->init();
170
+ }
171
+
172
  function setupLocalizer() {
173
  $localizer = new Localizer($this->renderer);
174
  $localizer->init();
179
  $menu->init();
180
  }
181
 
 
 
 
 
 
 
 
 
 
 
182
  function setupShortcodes() {
183
  $shortcodes = new Shortcodes();
184
  $shortcodes->init();
185
  }
186
 
187
+ function setupImages() {
188
+ add_image_size('mailpoet_newsletter_max', 1320);
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
190
 
191
+ function setupChangelog() {
192
+ $changelog = new Changelog();
193
+ $changelog->init();
194
  }
195
 
196
  function setupCronTrigger() {
201
  }
202
  }
203
 
 
 
 
 
204
  function setupConflictResolver() {
205
  $conflict_resolver = new ConflictResolver();
206
  $conflict_resolver->init();
207
  }
208
 
209
+ function setupJSONAPI() {
210
+ $json_api = API\API::JSON($this->access_control);
211
+ $json_api->init();
212
+ }
213
+
214
+ function setupRouter() {
215
+ $router = new Router\Router($this->access_control);
216
+ $router->init();
217
+ }
218
+
219
+ function setupPages() {
220
+ $pages = new \MailPoet\Settings\Pages();
221
+ $pages->init();
222
+ }
223
+
224
+ function setupHooks() {
225
+ if(!defined(self::INITIALIZED)) return;
226
+ try {
227
+ $hooks = new Hooks();
228
+ $hooks->init();
229
+ } catch(\Exception $e) {
230
+ $this->handleFailedInitialization($e);
231
+ }
232
+ }
233
+
234
  function handleFailedInitialization($exception) {
235
+ // check if we are able to add pages at this point
236
  if(function_exists('wp_get_current_user')) {
237
  Menu::addErrorPage($this->access_control);
238
  }
239
  return WPNotice::displayError($exception);
240
  }
241
+ }
lib/Config/Menu.php CHANGED
@@ -59,6 +59,11 @@ class Menu {
59
  if(self::isOnMailPoetAdminPage()) {
60
  do_action('mailpoet_conflict_resolver_styles');
61
  do_action('mailpoet_conflict_resolver_scripts');
 
 
 
 
 
62
  }
63
 
64
  // Main page
@@ -314,6 +319,11 @@ class Menu {
314
  );
315
  }
316
 
 
 
 
 
 
317
  function welcome() {
318
  if((bool)(defined('DOING_AJAX') && DOING_AJAX)) return;
319
 
@@ -541,7 +551,8 @@ class Menu {
541
  'shortcodes' => ShortcodesHelper::getShortcodes(),
542
  'settings' => Setting::getAll(),
543
  'current_wp_user' => Subscriber::getCurrentWPUser(),
544
- 'sub_menu' => self::MAIN_PAGE_SLUG
 
545
  );
546
  wp_enqueue_media();
547
  wp_enqueue_script('tinymce-wplink', includes_url('js/tinymce/plugins/wplink/plugin.js'));
59
  if(self::isOnMailPoetAdminPage()) {
60
  do_action('mailpoet_conflict_resolver_styles');
61
  do_action('mailpoet_conflict_resolver_scripts');
62
+
63
+ if($_REQUEST['page'] === 'mailpoet-newsletter-editor') {
64
+ // Disable WP emojis to not interfere with the newsletter editor emoji handling
65
+ $this->disableWPEmojis();
66
+ }
67
  }
68
 
69
  // Main page
319
  );
320
  }
321
 
322
+ function disableWPEmojis() {
323
+ remove_action('admin_print_scripts', 'print_emoji_detection_script');
324
+ remove_action('admin_print_styles', 'print_emoji_styles');
325
+ }
326
+
327
  function welcome() {
328
  if((bool)(defined('DOING_AJAX') && DOING_AJAX)) return;
329
 
551
  'shortcodes' => ShortcodesHelper::getShortcodes(),
552
  'settings' => Setting::getAll(),
553
  'current_wp_user' => Subscriber::getCurrentWPUser(),
554
+ 'sub_menu' => self::MAIN_PAGE_SLUG,
555
+ 'mss_active' => Bridge::isMPSendingServiceEnabled()
556
  );
557
  wp_enqueue_media();
558
  wp_enqueue_script('tinymce-wplink', includes_url('js/tinymce/plugins/wplink/plugin.js'));
lib/Config/PluginActivatedHook.php CHANGED
@@ -12,7 +12,7 @@ class PluginActivatedHook {
12
  }
13
 
14
  public function action($plugin, $network_wide) {
15
- if($network_wide) {
16
  $this->deferred_admin_notices->addNetworkAdminNotice(__('We noticed that you\'re using an unsupported environment. While MailPoet might work within a MultiSite environment, we don’t support it.', 'mailpoet'));
17
  }
18
  }
12
  }
13
 
14
  public function action($plugin, $network_wide) {
15
+ if($plugin === plugin_basename(Env::$file) && $network_wide) {
16
  $this->deferred_admin_notices->addNetworkAdminNotice(__('We noticed that you\'re using an unsupported environment. While MailPoet might work within a MultiSite environment, we don’t support it.', 'mailpoet'));
17
  }
18
  }
lib/Models/Newsletter.php CHANGED
@@ -4,6 +4,7 @@ use Carbon\Carbon;
4
  use MailPoet\Newsletter\Renderer\Renderer;
5
  use MailPoet\Util\Helpers;
6
  use MailPoet\Util\Security;
 
7
 
8
  if(!defined('ABSPATH')) exit;
9
 
@@ -79,11 +80,15 @@ class Newsletter extends Model {
79
  $this->set_expr('deleted_at', 'NULL');
80
  }
81
 
82
- $this->set('body',
83
- is_array($this->body)
84
- ? json_encode($this->body)
85
- : $this->body
86
- );
 
 
 
 
87
 
88
  $this->set('hash',
89
  ($this->hash)
4
  use MailPoet\Newsletter\Renderer\Renderer;
5
  use MailPoet\Util\Helpers;
6
  use MailPoet\Util\Security;
7
+ use MailPoet\WP\Emoji;
8
 
9
  if(!defined('ABSPATH')) exit;
10
 
80
  $this->set_expr('deleted_at', 'NULL');
81
  }
82
 
83
+ if(isset($this->body)) {
84
+ if(is_array($this->body)) {
85
+ $this->body = json_encode($this->body);
86
+ }
87
+ $this->set(
88
+ 'body',
89
+ Emoji::encodeForUTF8Column(self::$_table, 'body', $this->body)
90
+ );
91
+ }
92
 
93
  $this->set('hash',
94
  ($this->hash)
lib/Models/SendingQueue.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  namespace MailPoet\Models;
3
 
 
 
4
  if(!defined('ABSPATH')) exit;
5
 
6
  class SendingQueue extends Model {
@@ -55,7 +57,10 @@ class SendingQueue extends Model {
55
  $this->set('subscribers', serialize($this->subscribers));
56
  }
57
  if(!is_serialized($this->newsletter_rendered_body) && !is_null($this->newsletter_rendered_body)) {
58
- $this->set('newsletter_rendered_body', serialize($this->newsletter_rendered_body));
 
 
 
59
  }
60
  // set the default priority to medium
61
  if(!$this->priority) {
@@ -81,12 +86,34 @@ class SendingQueue extends Model {
81
  function getNewsletterRenderedBody($type = false) {
82
  $rendered_newsletter = (!is_serialized($this->newsletter_rendered_body)) ?
83
  $this->newsletter_rendered_body :
84
- unserialize($this->newsletter_rendered_body);
85
  return ($type && !empty($rendered_newsletter[$type])) ?
86
  $rendered_newsletter[$type] :
87
  $rendered_newsletter;
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  function isSubscriberProcessed($subscriber_id) {
91
  $subscribers = $this->getSubscribers();
92
  return in_array($subscriber_id, $subscribers['processed']);
1
  <?php
2
  namespace MailPoet\Models;
3
 
4
+ use MailPoet\WP\Emoji;
5
+
6
  if(!defined('ABSPATH')) exit;
7
 
8
  class SendingQueue extends Model {
57
  $this->set('subscribers', serialize($this->subscribers));
58
  }
59
  if(!is_serialized($this->newsletter_rendered_body) && !is_null($this->newsletter_rendered_body)) {
60
+ $this->set(
61
+ 'newsletter_rendered_body',
62
+ serialize($this->encodeEmojisInBody($this->newsletter_rendered_body))
63
+ );
64
  }
65
  // set the default priority to medium
66
  if(!$this->priority) {
86
  function getNewsletterRenderedBody($type = false) {
87
  $rendered_newsletter = (!is_serialized($this->newsletter_rendered_body)) ?
88
  $this->newsletter_rendered_body :
89
+ $this->decodeEmojisInBody(unserialize($this->newsletter_rendered_body));
90
  return ($type && !empty($rendered_newsletter[$type])) ?
91
  $rendered_newsletter[$type] :
92
  $rendered_newsletter;
93
  }
94
 
95
+ function encodeEmojisInBody($newsletter_rendered_body) {
96
+ if(is_array($newsletter_rendered_body)) {
97
+ foreach($newsletter_rendered_body as $key => $value) {
98
+ $newsletter_rendered_body[$key] = Emoji::encodeForUTF8Column(
99
+ self::$_table,
100
+ 'newsletter_rendered_body',
101
+ $value
102
+ );
103
+ }
104
+ }
105
+ return $newsletter_rendered_body;
106
+ }
107
+
108
+ function decodeEmojisInBody($newsletter_rendered_body) {
109
+ if(is_array($newsletter_rendered_body)) {
110
+ foreach($newsletter_rendered_body as $key => $value) {
111
+ $newsletter_rendered_body[$key] = Emoji::decodeEntities($value);
112
+ }
113
+ }
114
+ return $newsletter_rendered_body;
115
+ }
116
+
117
  function isSubscriberProcessed($subscriber_id) {
118
  $subscribers = $this->getSubscribers();
119
  return in_array($subscriber_id, $subscribers['processed']);
lib/Models/Subscriber.php CHANGED
@@ -149,7 +149,11 @@ class Subscriber extends Model {
149
 
150
  static function generateToken($email = null) {
151
  if($email !== null) {
152
- return substr(md5(AUTH_KEY . $email), 0, self::SUBSCRIBER_TOKEN_LENGTH);
 
 
 
 
153
  }
154
  return false;
155
  }
149
 
150
  static function generateToken($email = null) {
151
  if($email !== null) {
152
+ $auth_key = '';
153
+ if(defined('AUTH_KEY')) {
154
+ $auth_key = AUTH_KEY;
155
+ }
156
+ return substr(md5($auth_key . $email), 0, self::SUBSCRIBER_TOKEN_LENGTH);
157
  }
158
  return false;
159
  }
lib/Util/Security.php CHANGED
@@ -22,8 +22,12 @@ class Security {
22
 
23
  static function generateHash($length = false) {
24
  $length = ($length) ? $length : self::HASH_LENGTH;
 
 
 
 
25
  return substr(
26
- md5(AUTH_KEY . self::generateRandomString(64)),
27
  0,
28
  $length
29
  );
22
 
23
  static function generateHash($length = false) {
24
  $length = ($length) ? $length : self::HASH_LENGTH;
25
+ $auth_key = '';
26
+ if(defined('AUTH_KEY')) {
27
+ $auth_key = AUTH_KEY;
28
+ }
29
  return substr(
30
+ md5($auth_key . self::generateRandomString(64)),
31
  0,
32
  $length
33
  );
lib/WP/Emoji.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailPoet\WP;
3
+
4
+ class Emoji {
5
+ static function encodeForUTF8Column($table, $field, $value) {
6
+ global $wpdb;
7
+ $charset = $wpdb->get_col_charset($table, $field);
8
+ if($charset === 'utf8') {
9
+ $value = wp_encode_emoji($value);
10
+ }
11
+ return $value;
12
+ }
13
+
14
+ static function decodeEntities($content) {
15
+ // Based on wp_staticize_emoji()
16
+
17
+ // Loosely match the Emoji Unicode range.
18
+ $regex = '/(&#x[2-3][0-9a-f]{3};|&#x1f[1-6][0-9a-f]{2};)/';
19
+
20
+ $matches = array();
21
+ if(preg_match_all($regex, $content, $matches)) {
22
+ if(!empty($matches[1])) {
23
+ foreach($matches[1] as $emoji) {
24
+ $entity = html_entity_decode($emoji, ENT_COMPAT, 'UTF-8');
25
+ $content = str_replace($emoji, $entity, $content);
26
+ }
27
+ }
28
+ }
29
+
30
+ return $content;
31
+ }
32
+ }
mailpoet.php CHANGED
@@ -4,7 +4,7 @@ if(!defined('ABSPATH')) exit;
4
 
5
  /*
6
  * Plugin Name: MailPoet 3 (new)
7
- * Version: 3.0.0-rc.2.0.0
8
  * Plugin URI: http://www.mailpoet.com
9
  * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10
  * Author: MailPoet
@@ -21,7 +21,7 @@ if(!defined('ABSPATH')) exit;
21
  */
22
 
23
  $mailpoet_plugin = array(
24
- 'version' => '3.0.0-rc.2.0.0',
25
  'filename' => __FILE__,
26
  'path' => dirname(__FILE__),
27
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
4
 
5
  /*
6
  * Plugin Name: MailPoet 3 (new)
7
+ * Version: 3.0.0-rc.2.0.1
8
  * Plugin URI: http://www.mailpoet.com
9
  * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10
  * Author: MailPoet
21
  */
22
 
23
  $mailpoet_plugin = array(
24
+ 'version' => '3.0.0-rc.2.0.1',
25
  'filename' => __FILE__,
26
  'path' => dirname(__FILE__),
27
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: newsletter, email, welcome email, post notification, autoresponder, signup
4
  Requires at least: 4.6
5
  Tested up to: 4.8
6
  Requires PHP: 5.3
7
- Stable tag: 3.0.0-rc.2.0.0
8
  Create and send beautiful emails and newsletters from WordPress.
9
 
10
  == Description ==
@@ -94,6 +94,12 @@ Our [support site](https://beta.docs.mailpoet.com) has plenty of articles. You c
94
 
95
  == Changelog ==
96
 
 
 
 
 
 
 
97
  = 3.0.0-rc.2.0.0 - 2017-08-29 =
98
  * Improved: MailPoet updates on high traffic sites now use less resources;
99
  * Improved: newsletter is saved when "next" button is pressed in newsletter editor;
4
  Requires at least: 4.6
5
  Tested up to: 4.8
6
  Requires PHP: 5.3
7
+ Stable tag: 3.0.0-rc.2.0.1
8
  Create and send beautiful emails and newsletters from WordPress.
9
 
10
  == Description ==
94
 
95
  == Changelog ==
96
 
97
+ = 3.0.0-rc.2.0.1 - 2017-08-30 =
98
+ * Fixed: newsletters with emojis are properly saved and sent on certain hosts. Thanks Alison, Scott and Swann!
99
+ * Fixed: plugin activates on multisite environments;
100
+ * Fixed: subscription forms with list selection field are working now;
101
+ * Fixed: newsletter editor does not require "unsubscribe" link when a third-party sending method is used;
102
+
103
  = 3.0.0-rc.2.0.0 - 2017-08-29 =
104
  * Improved: MailPoet updates on high traffic sites now use less resources;
105
  * Improved: newsletter is saved when "next" button is pressed in newsletter editor;
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf68263c67cbc83aedae2fa54e4dfbd26::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -246,6 +246,7 @@ return array(
246
  'MailPoet\\Util\\pQuery\\Html5Parser' => $baseDir . '/lib/Util/pQuery/pQuery.php',
247
  'MailPoet\\Util\\pQuery\\pQuery' => $baseDir . '/lib/Util/pQuery/pQuery.php',
248
  'MailPoet\\WP\\DateTime' => $baseDir . '/lib/WP/DateTime.php',
 
249
  'MailPoet\\WP\\Hooks' => $baseDir . '/lib/WP/Hooks.php',
250
  'MailPoet\\WP\\Notice' => $baseDir . '/lib/WP/Notice.php',
251
  'MailPoet\\WP\\Posts' => $baseDir . '/lib/WP/Posts.php',
246
  'MailPoet\\Util\\pQuery\\Html5Parser' => $baseDir . '/lib/Util/pQuery/pQuery.php',
247
  'MailPoet\\Util\\pQuery\\pQuery' => $baseDir . '/lib/Util/pQuery/pQuery.php',
248
  'MailPoet\\WP\\DateTime' => $baseDir . '/lib/WP/DateTime.php',
249
+ 'MailPoet\\WP\\Emoji' => $baseDir . '/lib/WP/Emoji.php',
250
  'MailPoet\\WP\\Hooks' => $baseDir . '/lib/WP/Hooks.php',
251
  'MailPoet\\WP\\Notice' => $baseDir . '/lib/WP/Notice.php',
252
  'MailPoet\\WP\\Posts' => $baseDir . '/lib/WP/Posts.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit4e7b78adf8569cf01525fd80978c5d4c
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire4e7b78adf8569cf01525fd80978c5d4c($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire4e7b78adf8569cf01525fd80978c5d4c($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf68263c67cbc83aedae2fa54e4dfbd26
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf68263c67cbc83aedae2fa54e4dfbd26', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf68263c67cbc83aedae2fa54e4dfbd26', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequiref68263c67cbc83aedae2fa54e4dfbd26($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequiref68263c67cbc83aedae2fa54e4dfbd26($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -336,6 +336,7 @@ class ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c
336
  'MailPoet\\Util\\pQuery\\Html5Parser' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
337
  'MailPoet\\Util\\pQuery\\pQuery' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
338
  'MailPoet\\WP\\DateTime' => __DIR__ . '/../..' . '/lib/WP/DateTime.php',
 
339
  'MailPoet\\WP\\Hooks' => __DIR__ . '/../..' . '/lib/WP/Hooks.php',
340
  'MailPoet\\WP\\Notice' => __DIR__ . '/../..' . '/lib/WP/Notice.php',
341
  'MailPoet\\WP\\Posts' => __DIR__ . '/../..' . '/lib/WP/Posts.php',
@@ -834,10 +835,10 @@ class ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c
834
  public static function getInitializer(ClassLoader $loader)
835
  {
836
  return \Closure::bind(function () use ($loader) {
837
- $loader->prefixLengthsPsr4 = ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::$prefixLengthsPsr4;
838
- $loader->prefixDirsPsr4 = ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::$prefixDirsPsr4;
839
- $loader->prefixesPsr0 = ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::$prefixesPsr0;
840
- $loader->classMap = ComposerStaticInit4e7b78adf8569cf01525fd80978c5d4c::$classMap;
841
 
842
  }, null, ClassLoader::class);
843
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
336
  'MailPoet\\Util\\pQuery\\Html5Parser' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
337
  'MailPoet\\Util\\pQuery\\pQuery' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
338
  'MailPoet\\WP\\DateTime' => __DIR__ . '/../..' . '/lib/WP/DateTime.php',
339
+ 'MailPoet\\WP\\Emoji' => __DIR__ . '/../..' . '/lib/WP/Emoji.php',
340
  'MailPoet\\WP\\Hooks' => __DIR__ . '/../..' . '/lib/WP/Hooks.php',
341
  'MailPoet\\WP\\Notice' => __DIR__ . '/../..' . '/lib/WP/Notice.php',
342
  'MailPoet\\WP\\Posts' => __DIR__ . '/../..' . '/lib/WP/Posts.php',
835
  public static function getInitializer(ClassLoader $loader)
836
  {
837
  return \Closure::bind(function () use ($loader) {
838
+ $loader->prefixLengthsPsr4 = ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::$prefixLengthsPsr4;
839
+ $loader->prefixDirsPsr4 = ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::$prefixDirsPsr4;
840
+ $loader->prefixesPsr0 = ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::$prefixesPsr0;
841
+ $loader->classMap = ComposerStaticInitf68263c67cbc83aedae2fa54e4dfbd26::$classMap;
842
 
843
  }, null, ClassLoader::class);
844
  }
views/newsletter/editor.html CHANGED
@@ -1200,7 +1200,7 @@
1200
  height: '768px'
1201
  },
1202
  validation: {
1203
- validateUnsubscribeLinkPresent: true, // TODO: Add validation based on whether Mailpoet MTA is used or not
1204
  },
1205
  urls: {
1206
  send: '<%= admin_url('admin.php?page=mailpoet-newsletters#/send/' ~ (params('id') | intval)) %>',
1200
  height: '768px'
1201
  },
1202
  validation: {
1203
+ validateUnsubscribeLinkPresent: <%= mss_active ? 'true' : 'false' %>,
1204
  },
1205
  urls: {
1206
  send: '<%= admin_url('admin.php?page=mailpoet-newsletters#/send/' ~ (params('id') | intval)) %>',