Version Description
- 2017-09-29 =
- Added throttling of repeated subscriptions from an IP address
Download this release
Release Info
Developer | wysija |
Plugin | MailPoet Newsletters (Previous) |
Version | 2.7.13 |
Comparing to | |
See all releases |
Code changes from version 2.7.12.1 to 2.7.13
- controllers/ajax/subscribers.php +1 -0
- controllers/front/subscribers.php +1 -1
- core/base.php +1 -1
- helpers/user.php +36 -0
- index.php +1 -1
- languages/wysija-newsletters-af.mo +0 -0
- languages/wysija-newsletters-ar.mo +0 -0
- languages/wysija-newsletters-be.mo +0 -0
- languages/wysija-newsletters-bg_BG.mo +0 -0
- languages/wysija-newsletters-bs_BA.mo +0 -0
- languages/wysija-newsletters-ca.mo +0 -0
- languages/wysija-newsletters-ca_ES.mo +0 -0
- languages/wysija-newsletters-cs_CZ.mo +0 -0
- languages/wysija-newsletters-da_DK.mo +0 -0
- languages/wysija-newsletters-de_DE.mo +0 -0
- languages/wysija-newsletters-el.mo +0 -0
- languages/wysija-newsletters-en_AU.mo +0 -0
- languages/wysija-newsletters-es_AR.mo +0 -0
- languages/wysija-newsletters-es_ES.mo +0 -0
- languages/wysija-newsletters-es_MX.mo +0 -0
- languages/wysija-newsletters-et.mo +0 -0
- languages/wysija-newsletters-eu.mo +0 -0
- languages/wysija-newsletters-fa_IR.mo +0 -0
- languages/wysija-newsletters-fi.mo +0 -0
- languages/wysija-newsletters-fr_CA.mo +0 -0
- languages/wysija-newsletters-fr_FR.mo +0 -0
- languages/wysija-newsletters-gl_ES.mo +0 -0
- languages/wysija-newsletters-he_IL.mo +0 -0
- languages/wysija-newsletters-hi_IN.mo +0 -0
- languages/wysija-newsletters-hr_HR.mo +0 -0
- languages/wysija-newsletters-hu_HU.mo +0 -0
- languages/wysija-newsletters-hy_AM.mo +0 -0
- languages/wysija-newsletters-id.mo +0 -0
- languages/wysija-newsletters-is_IS.mo +0 -0
- languages/wysija-newsletters-it_IT.mo +0 -0
- languages/wysija-newsletters-ja.mo +0 -0
- languages/wysija-newsletters-lt_LT.mo +0 -0
- languages/wysija-newsletters-lv.mo +0 -0
- languages/wysija-newsletters-mk_MK.mo +0 -0
- languages/wysija-newsletters-nb_NO.mo +0 -0
- languages/wysija-newsletters-nl_NL.mo +0 -0
- languages/wysija-newsletters-oc.mo +0 -0
- languages/wysija-newsletters-pl_PL.mo +0 -0
- languages/wysija-newsletters-pt_PT.mo +0 -0
- languages/wysija-newsletters-ro_RO.mo +0 -0
- languages/wysija-newsletters-ru_RU.mo +0 -0
- languages/wysija-newsletters-sk_SK.mo +0 -0
- languages/wysija-newsletters-sl_SI.mo +0 -0
- languages/wysija-newsletters-sr_RS.mo +0 -0
- languages/wysija-newsletters-sr_RS@latin.mo +0 -0
- languages/wysija-newsletters-sv_SE.mo +0 -0
- languages/wysija-newsletters-tr_TR.mo +0 -0
- languages/wysija-newsletters-uk.mo +0 -0
- languages/wysija-newsletters-zh_CN.mo +0 -0
- readme.txt +4 -1
controllers/ajax/subscribers.php
CHANGED
@@ -36,6 +36,7 @@ class WYSIJA_control_back_subscribers extends WYSIJA_control_front{
|
|
36 |
|
37 |
$helperUser=WYSIJA::get('user','helper');
|
38 |
if(!$helperUser->checkData($data))return false;
|
|
|
39 |
$helperUser->addSubscriber($data);
|
40 |
|
41 |
return true;
|
36 |
|
37 |
$helperUser=WYSIJA::get('user','helper');
|
38 |
if(!$helperUser->checkData($data))return false;
|
39 |
+
if(!$helperUser->throttleRepeatedSubscriptions($data))return false;
|
40 |
$helperUser->addSubscriber($data);
|
41 |
|
42 |
return true;
|
controllers/front/subscribers.php
CHANGED
@@ -42,6 +42,7 @@ class WYSIJA_control_front_subscribers extends WYSIJA_control_front{
|
|
42 |
|
43 |
$helperUser=WYSIJA::get('user','helper');
|
44 |
if(!$helperUser->checkData($data))return false;
|
|
|
45 |
|
46 |
$helperUser->addSubscriber($data);
|
47 |
|
@@ -138,5 +139,4 @@ class WYSIJA_control_front_subscribers extends WYSIJA_control_front{
|
|
138 |
echo $subscription_form;
|
139 |
exit;
|
140 |
}
|
141 |
-
|
142 |
}
|
42 |
|
43 |
$helperUser=WYSIJA::get('user','helper');
|
44 |
if(!$helperUser->checkData($data))return false;
|
45 |
+
if(!$helperUser->throttleRepeatedSubscriptions()) return false;
|
46 |
|
47 |
$helperUser->addSubscriber($data);
|
48 |
|
139 |
echo $subscription_form;
|
140 |
exit;
|
141 |
}
|
|
|
142 |
}
|
core/base.php
CHANGED
@@ -19,7 +19,7 @@ class WYSIJA_object{
|
|
19 |
* Static variable holding core MailPoet's version
|
20 |
* @var array
|
21 |
*/
|
22 |
-
static $version = '2.7.
|
23 |
|
24 |
function __construct(){}
|
25 |
|
19 |
* Static variable holding core MailPoet's version
|
20 |
* @var array
|
21 |
*/
|
22 |
+
static $version = '2.7.13';
|
23 |
|
24 |
function __construct(){}
|
25 |
|
helpers/user.php
CHANGED
@@ -385,6 +385,42 @@ class WYSIJA_help_user extends WYSIJA_object {
|
|
385 |
return $user_id;
|
386 |
}
|
387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
/**
|
389 |
* send auto nl based on the params passed
|
390 |
* @staticvar type $emails
|
385 |
return $user_id;
|
386 |
}
|
387 |
|
388 |
+
function throttleRepeatedSubscriptions() {
|
389 |
+
$model_user = WYSIJA::get('user', 'model');
|
390 |
+
|
391 |
+
$subscription_limit_enabled = apply_filters('wysija_subscription_limit_enabled', true);
|
392 |
+
|
393 |
+
if ($subscription_limit_enabled && !is_user_logged_in()) {
|
394 |
+
$subscription_limit_window = apply_filters('wysija_subscription_limit_window', DAY_IN_SECONDS);
|
395 |
+
$subscription_limit_base = apply_filters('wysija_subscription_limit_base', MINUTE_IN_SECONDS);
|
396 |
+
|
397 |
+
$subscriber_ip = $this->getIP();
|
398 |
+
if (!empty($subscriber_ip)) {
|
399 |
+
$subscription_count = $model_user->query(
|
400 |
+
'get_row',
|
401 |
+
'SELECT COUNT(*) as row_count FROM ' . $model_user->getSelectTableName() . '
|
402 |
+
WHERE `ip` = "' . $subscriber_ip . '" AND `created_at` >= (UNIX_TIMESTAMP() - ' . (int) $subscription_limit_window . ')'
|
403 |
+
);
|
404 |
+
|
405 |
+
if (isset($subscription_count['row_count']) && $subscription_count['row_count'] > 0) {
|
406 |
+
$timeout = $subscription_limit_base * pow(2, $subscription_count['row_count'] - 1);
|
407 |
+
$existing_user = $model_user->query(
|
408 |
+
'get_row',
|
409 |
+
'SELECT COUNT(*) as row_count
|
410 |
+
FROM ' . $model_user->getSelectTableName() . '
|
411 |
+
WHERE `ip` = "' . $subscriber_ip . '" AND `created_at` >= (UNIX_TIMESTAMP() - ' . (int) $timeout . ') LIMIT 1'
|
412 |
+
);
|
413 |
+
if (!empty($existing_user['row_count'])) {
|
414 |
+
$this->error( sprintf(__( 'You need to wait %s seconds before subscribing again.' , WYSIJA ), $timeout) , true);
|
415 |
+
return false;
|
416 |
+
}
|
417 |
+
}
|
418 |
+
}
|
419 |
+
}
|
420 |
+
|
421 |
+
return true;
|
422 |
+
}
|
423 |
+
|
424 |
/**
|
425 |
* send auto nl based on the params passed
|
426 |
* @staticvar type $emails
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MailPoet 2
|
4 |
Plugin URI: http://www.mailpoet.com/
|
5 |
Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. This version is being replaced by MailPoet 3. Support offered to Premium customers only. Updates are limited to security issues.
|
6 |
-
Version: 2.7.
|
7 |
Author: MailPoet
|
8 |
Author URI: http://www.mailpoet.com/
|
9 |
License: GPLv2 or later
|
3 |
Plugin Name: MailPoet 2
|
4 |
Plugin URI: http://www.mailpoet.com/
|
5 |
Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. This version is being replaced by MailPoet 3. Support offered to Premium customers only. Updates are limited to security issues.
|
6 |
+
Version: 2.7.13
|
7 |
Author: MailPoet
|
8 |
Author URI: http://www.mailpoet.com/
|
9 |
License: GPLv2 or later
|
languages/wysija-newsletters-af.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ar.mo
CHANGED
Binary file
|
languages/wysija-newsletters-be.mo
CHANGED
Binary file
|
languages/wysija-newsletters-bg_BG.mo
CHANGED
Binary file
|
languages/wysija-newsletters-bs_BA.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ca.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ca_ES.mo
CHANGED
Binary file
|
languages/wysija-newsletters-cs_CZ.mo
CHANGED
Binary file
|
languages/wysija-newsletters-da_DK.mo
CHANGED
Binary file
|
languages/wysija-newsletters-de_DE.mo
CHANGED
Binary file
|
languages/wysija-newsletters-el.mo
CHANGED
Binary file
|
languages/wysija-newsletters-en_AU.mo
CHANGED
Binary file
|
languages/wysija-newsletters-es_AR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-es_ES.mo
CHANGED
Binary file
|
languages/wysija-newsletters-es_MX.mo
CHANGED
Binary file
|
languages/wysija-newsletters-et.mo
CHANGED
Binary file
|
languages/wysija-newsletters-eu.mo
CHANGED
Binary file
|
languages/wysija-newsletters-fa_IR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-fi.mo
CHANGED
Binary file
|
languages/wysija-newsletters-fr_CA.mo
CHANGED
Binary file
|
languages/wysija-newsletters-fr_FR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-gl_ES.mo
CHANGED
Binary file
|
languages/wysija-newsletters-he_IL.mo
CHANGED
Binary file
|
languages/wysija-newsletters-hi_IN.mo
CHANGED
Binary file
|
languages/wysija-newsletters-hr_HR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-hu_HU.mo
CHANGED
Binary file
|
languages/wysija-newsletters-hy_AM.mo
CHANGED
Binary file
|
languages/wysija-newsletters-id.mo
CHANGED
Binary file
|
languages/wysija-newsletters-is_IS.mo
CHANGED
Binary file
|
languages/wysija-newsletters-it_IT.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ja.mo
CHANGED
Binary file
|
languages/wysija-newsletters-lt_LT.mo
CHANGED
Binary file
|
languages/wysija-newsletters-lv.mo
CHANGED
Binary file
|
languages/wysija-newsletters-mk_MK.mo
CHANGED
Binary file
|
languages/wysija-newsletters-nb_NO.mo
CHANGED
Binary file
|
languages/wysija-newsletters-nl_NL.mo
CHANGED
Binary file
|
languages/wysija-newsletters-oc.mo
CHANGED
Binary file
|
languages/wysija-newsletters-pl_PL.mo
CHANGED
Binary file
|
languages/wysija-newsletters-pt_PT.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ro_RO.mo
CHANGED
Binary file
|
languages/wysija-newsletters-ru_RU.mo
CHANGED
Binary file
|
languages/wysija-newsletters-sk_SK.mo
CHANGED
Binary file
|
languages/wysija-newsletters-sl_SI.mo
CHANGED
Binary file
|
languages/wysija-newsletters-sr_RS.mo
CHANGED
Binary file
|
languages/wysija-newsletters-sr_RS@latin.mo
CHANGED
Binary file
|
languages/wysija-newsletters-sv_SE.mo
CHANGED
Binary file
|
languages/wysija-newsletters-tr_TR.mo
CHANGED
Binary file
|
languages/wysija-newsletters-uk.mo
CHANGED
Binary file
|
languages/wysija-newsletters-zh_CN.mo
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: wysija
|
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, subscription, SMTP
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.8
|
6 |
-
Stable tag: 2.7.
|
7 |
Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
|
8 |
|
9 |
== Description ==
|
@@ -113,6 +113,9 @@ Our [support site](https://www.mailpoet.com/support) has plenty of articles and
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
116 |
= 2.7.12.1 - 2017-09-19 =
|
117 |
* Update messages in regards to official launch of MailPoet version 3
|
118 |
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, subscription, SMTP
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.8
|
6 |
+
Stable tag: 2.7.13
|
7 |
Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
|
8 |
|
9 |
== Description ==
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 2.7.13 - 2017-09-29 =
|
117 |
+
* Added throttling of repeated subscriptions from an IP address
|
118 |
+
|
119 |
= 2.7.12.1 - 2017-09-19 =
|
120 |
* Update messages in regards to official launch of MailPoet version 3
|
121 |
|