Version Description
- 2017-11-20 =
- Added support for ReCaptcha to protect subscription forms from automated abuse
- Fixed editor sidebar missing if a theme uses wp_enqueue_media() function on WP 4.9
Download this release
Release Info
Developer | wysija |
Plugin | MailPoet Newsletters (Previous) |
Version | 2.8 |
Comparing to | |
See all releases |
Code changes from version 2.7.15.1 to 2.8
- controllers/ajax/subscribers.php +1 -0
- controllers/front/subscribers.php +1 -0
- core/base.php +6 -1
- helpers/back.php +10 -1
- helpers/conflicts.php +10 -0
- helpers/form_engine.php +15 -0
- helpers/user.php +36 -0
- index.php +1 -1
- js/admin-config-settings.js +1 -1
- languages/wysija-newsletters-ca.mo +0 -0
- languages/wysija-newsletters-pl_PL.mo +0 -0
- models/config.php +3 -0
- readme.txt +6 -2
- tools/templates/form/web/widgets/submit.html +1 -0
- views/back/campaigns.php +10 -0
- views/back/config.php +20 -0
- views/front/widget_nl.php +19 -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 |
if(!$helperUser->throttleRepeatedSubscriptions($data))return false;
|
40 |
if($helperUser->addSubscriber($data)) {
|
41 |
$helperUser->storeSubscriberIP();
|
36 |
|
37 |
$helperUser=WYSIJA::get('user','helper');
|
38 |
if(!$helperUser->checkData($data))return false;
|
39 |
+
if(!$helperUser->verifyCaptcha($data))return false;
|
40 |
if(!$helperUser->throttleRepeatedSubscriptions($data))return false;
|
41 |
if($helperUser->addSubscriber($data)) {
|
42 |
$helperUser->storeSubscriberIP();
|
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 |
if(!$helperUser->throttleRepeatedSubscriptions()) return false;
|
46 |
|
47 |
if($helperUser->addSubscriber($data)) {
|
42 |
|
43 |
$helperUser=WYSIJA::get('user','helper');
|
44 |
if(!$helperUser->checkData($data))return false;
|
45 |
+
if(!$helperUser->verifyCaptcha($data))return false;
|
46 |
if(!$helperUser->throttleRepeatedSubscriptions()) return false;
|
47 |
|
48 |
if($helperUser->addSubscriber($data)) {
|
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.
|
23 |
|
24 |
function __construct(){}
|
25 |
|
@@ -362,6 +362,11 @@ class WYSIJA_help extends WYSIJA_object{
|
|
362 |
wp_register_script('wysija-admin-ajax-proto', WYSIJA_URL.'js/admin-ajax-proto.js',array(),WYSIJA::get_version());
|
363 |
wp_register_script( 'mailpoet-global', WYSIJA_URL.'js/admin-global.js', array( 'jquery', 'underscore' ), WYSIJA::get_version() );
|
364 |
|
|
|
|
|
|
|
|
|
|
|
365 |
if(defined('WYSIJA_SIDE') && WYSIJA_SIDE=='front') wp_enqueue_style('validate-engine-css');
|
366 |
|
367 |
}
|
19 |
* Static variable holding core MailPoet's version
|
20 |
* @var array
|
21 |
*/
|
22 |
+
static $version = '2.8';
|
23 |
|
24 |
function __construct(){}
|
25 |
|
362 |
wp_register_script('wysija-admin-ajax-proto', WYSIJA_URL.'js/admin-ajax-proto.js',array(),WYSIJA::get_version());
|
363 |
wp_register_script( 'mailpoet-global', WYSIJA_URL.'js/admin-global.js', array( 'jquery', 'underscore' ), WYSIJA::get_version() );
|
364 |
|
365 |
+
$helperUser=WYSIJA::get('user','helper');
|
366 |
+
if($helperUser->isCaptchaEnabled()) {
|
367 |
+
wp_register_script( 'wysija-recaptcha', 'https://www.google.com/recaptcha/api.js' );
|
368 |
+
}
|
369 |
+
|
370 |
if(defined('WYSIJA_SIDE') && WYSIJA_SIDE=='front') wp_enqueue_style('validate-engine-css');
|
371 |
|
372 |
}
|
helpers/back.php
CHANGED
@@ -291,6 +291,13 @@ class WYSIJA_help_back extends WYSIJA_help{
|
|
291 |
$helperConflicts=WYSIJA::get('conflicts','helper');
|
292 |
$helperConflicts->resolve($conflictingPlugins);
|
293 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
|
296 |
/**
|
@@ -342,8 +349,10 @@ class WYSIJA_help_back extends WYSIJA_help{
|
|
342 |
$truelinkhelp = '<p>'.str_replace($finds,$replace,$linkcontent).'</p>';
|
343 |
$truelinkhelp .= '<p>'.__('MailPoet Version: ',WYSIJA).'<strong>'.WYSIJA::get_version().'</strong></p>';
|
344 |
|
|
|
|
|
345 |
$this->menus=array(
|
346 |
-
'campaigns'=>array('title'=>'MailPoet'.
|
347 |
'subscribers'=>array('title'=>__('Subscribers',WYSIJA)), // if the key "subscribers" is changed, please change in the filter "wysija_menus" as well.
|
348 |
'config'=>array('title'=>__('Settings',WYSIJA)),
|
349 |
'premium'=>array('title'=>__('Premium',WYSIJA)),
|
291 |
$helperConflicts=WYSIJA::get('conflicts','helper');
|
292 |
$helperConflicts->resolve($conflictingPlugins);
|
293 |
}
|
294 |
+
|
295 |
+
// WP 4.9 script conflicts
|
296 |
+
global $wp_version;
|
297 |
+
if(version_compare( $wp_version, '4.9', '>=' )) {
|
298 |
+
$helperConflicts=WYSIJA::get('conflicts','helper');
|
299 |
+
$helperConflicts->resolveScriptConflicts();
|
300 |
+
}
|
301 |
}
|
302 |
|
303 |
/**
|
349 |
$truelinkhelp = '<p>'.str_replace($finds,$replace,$linkcontent).'</p>';
|
350 |
$truelinkhelp .= '<p>'.__('MailPoet Version: ',WYSIJA).'<strong>'.WYSIJA::get_version().'</strong></p>';
|
351 |
|
352 |
+
$red_dot = is_plugin_active('mailpoet/mailpoet.php') ? '' : ' <span class="update-plugins"><span class="update-count">1</span></span>';
|
353 |
+
|
354 |
$this->menus=array(
|
355 |
+
'campaigns'=>array('title'=>'MailPoet'. $red_dot),
|
356 |
'subscribers'=>array('title'=>__('Subscribers',WYSIJA)), // if the key "subscribers" is changed, please change in the filter "wysija_menus" as well.
|
357 |
'config'=>array('title'=>__('Settings',WYSIJA)),
|
358 |
'premium'=>array('title'=>__('Premium',WYSIJA)),
|
helpers/conflicts.php
CHANGED
@@ -104,4 +104,14 @@ class WYSIJA_help_conflicts extends WYSIJA_object{
|
|
104 |
}
|
105 |
}
|
106 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
104 |
}
|
105 |
}
|
106 |
}
|
107 |
+
|
108 |
+
function resolveScriptConflicts() {
|
109 |
+
// WP 4.9 mediaelement scripts conflicts with the MP2 editor
|
110 |
+
$dequeue_scripts = function () {
|
111 |
+
wp_dequeue_script('media-editor');
|
112 |
+
wp_dequeue_script('media-audiovideo');
|
113 |
+
wp_dequeue_script('mce-view');
|
114 |
+
};
|
115 |
+
add_action('wp_enqueue_media', $dequeue_scripts, PHP_INT_MAX);
|
116 |
+
}
|
117 |
}
|
helpers/form_engine.php
CHANGED
@@ -713,6 +713,9 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
|
|
713 |
$helper_render_engine = WYSIJA::get('render_engine', 'helper');
|
714 |
$helper_render_engine->setTemplatePath(WYSIJA_EDITOR_TOOLS);
|
715 |
|
|
|
|
|
|
|
716 |
$blocks = $this->get_data('body');
|
717 |
|
718 |
if(empty($blocks)) return '';
|
@@ -731,6 +734,11 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
|
|
731 |
}
|
732 |
}
|
733 |
|
|
|
|
|
|
|
|
|
|
|
734 |
// set field name 'prefix' depending whether it's a custom field or not
|
735 |
if($this->is_custom_field($block)) {
|
736 |
$field_prefix = 'wysija[field]';
|
@@ -808,6 +816,8 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
|
|
808 |
$helper_toolbox = WYSIJA::get('toolbox','helper');
|
809 |
$wp_language_code = $helper_toolbox->get_language_code();
|
810 |
|
|
|
|
|
811 |
$wysija_version = WYSIJA::get_version();
|
812 |
$scripts_to_include = '<!--START Scripts : this is the script part you can add to the header of your theme-->'."\n";
|
813 |
$scripts_to_include .= '<script type="text/javascript" src="'.includes_url().'js/jquery/jquery.js'.'?ver='.$wysija_version.'"></script>'."\n";
|
@@ -824,6 +834,11 @@ class WYSIJA_help_form_engine extends WYSIJA_object {
|
|
824 |
/* ]]> */
|
825 |
</script>';
|
826 |
$scripts_to_include .= '<script type="text/javascript" src="'.WYSIJA_URL.'js/front-subscribers.js?ver='.$wysija_version.'"></script>'."\n";
|
|
|
|
|
|
|
|
|
|
|
827 |
$scripts_to_include .= '<!--END Scripts-->'."\n"."\n";
|
828 |
|
829 |
//enqueue the scripts
|
713 |
$helper_render_engine = WYSIJA::get('render_engine', 'helper');
|
714 |
$helper_render_engine->setTemplatePath(WYSIJA_EDITOR_TOOLS);
|
715 |
|
716 |
+
$model_config = WYSIJA::get('config','model');
|
717 |
+
$helperUser = WYSIJA::get('user','helper');
|
718 |
+
|
719 |
$blocks = $this->get_data('body');
|
720 |
|
721 |
if(empty($blocks)) return '';
|
734 |
}
|
735 |
}
|
736 |
|
737 |
+
// special case for a submit button
|
738 |
+
if($block['type'] === 'submit' && $helperUser->isCaptchaEnabled()) {
|
739 |
+
$block['params']['recaptcha_key'] = htmlspecialchars($model_config->getValue('recaptcha_key'));
|
740 |
+
}
|
741 |
+
|
742 |
// set field name 'prefix' depending whether it's a custom field or not
|
743 |
if($this->is_custom_field($block)) {
|
744 |
$field_prefix = 'wysija[field]';
|
816 |
$helper_toolbox = WYSIJA::get('toolbox','helper');
|
817 |
$wp_language_code = $helper_toolbox->get_language_code();
|
818 |
|
819 |
+
$helperUser=WYSIJA::get('user','helper');
|
820 |
+
|
821 |
$wysija_version = WYSIJA::get_version();
|
822 |
$scripts_to_include = '<!--START Scripts : this is the script part you can add to the header of your theme-->'."\n";
|
823 |
$scripts_to_include .= '<script type="text/javascript" src="'.includes_url().'js/jquery/jquery.js'.'?ver='.$wysija_version.'"></script>'."\n";
|
834 |
/* ]]> */
|
835 |
</script>';
|
836 |
$scripts_to_include .= '<script type="text/javascript" src="'.WYSIJA_URL.'js/front-subscribers.js?ver='.$wysija_version.'"></script>'."\n";
|
837 |
+
|
838 |
+
if($helperUser->isCaptchaEnabled()) {
|
839 |
+
$scripts_to_include .= '<script type="text/javascript" src="https://www.google.com/recaptcha/api.js"></script>'."\n";
|
840 |
+
}
|
841 |
+
|
842 |
$scripts_to_include .= '<!--END Scripts-->'."\n"."\n";
|
843 |
|
844 |
//enqueue the scripts
|
helpers/user.php
CHANGED
@@ -102,8 +102,44 @@ class WYSIJA_help_user extends WYSIJA_object {
|
|
102 |
}
|
103 |
}
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
|
|
106 |
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
|
109 |
/**
|
102 |
}
|
103 |
}
|
104 |
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
|
108 |
+
function isCaptchaEnabled() {
|
109 |
+
$config = WYSIJA::get('config', 'model');
|
110 |
+
return $config->getValue('recaptcha');
|
111 |
+
}
|
112 |
+
|
113 |
+
function verifyCaptcha($data) {
|
114 |
+
$config = WYSIJA::get('config', 'model');
|
115 |
|
116 |
+
if(!$this->isCaptchaEnabled()) {
|
117 |
return true;
|
118 |
+
}
|
119 |
+
|
120 |
+
if(isset($data['g-recaptcha-response'])) {
|
121 |
+
$response = json_decode(
|
122 |
+
wp_remote_retrieve_body(
|
123 |
+
wp_remote_post(
|
124 |
+
'https://www.google.com/recaptcha/api/siteverify',
|
125 |
+
array(
|
126 |
+
'body' => array(
|
127 |
+
'secret' => $config->getValue('recaptcha_secret'),
|
128 |
+
'response' => $data['g-recaptcha-response']
|
129 |
+
)
|
130 |
+
)
|
131 |
+
)
|
132 |
+
),
|
133 |
+
true
|
134 |
+
);
|
135 |
+
|
136 |
+
if(!empty($response["success"])) {
|
137 |
+
return true;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
|
141 |
+
$this->error( __( 'Please enter CAPTCHA correctly.' , WYSIJA ) , true);
|
142 |
+
return false;
|
143 |
}
|
144 |
|
145 |
/**
|
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 |
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.8
|
7 |
Author: MailPoet
|
8 |
Author URI: http://www.mailpoet.com/
|
9 |
License: GPLv2 or later
|
js/admin-config-settings.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function t(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function n(){switch(e("#sending-method-smtp").attr("checked")&&(e('#smtp-port, #smtp-secure, #smtp-login, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show(),e("label[for='smtp-password']").html(wysija_translations.password),a()),e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==y&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#sending-method-smtp").is(":checked")?e("#restapipossible").show():e("#restapipossible").hide();break;case"mailpoet.com":e('#smtp-port, #smtp-secure, #smtp-login, label[for="smtp-auth-"]').parent().parent().hide(),e("label[for='smtp-password']").html(wysija_translations.api);break;case"sparkpost.com":e('#smtp-port, #smtp-secure, #smtp-login, label[for="smtp-auth-"]').parent().parent().hide(),e("label[for='smtp-password']").html(wysija_translations.api);break;case"":""==y&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""));break;default:e("#sending-method-smtp").is(":checked")&&e('#smtp-port, #smtp-secure, #smtp-login, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show()}""==y&&e("#smtp-secure").change(),e("#smtp-rest").trigger("change")}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?(e('#smtp-port, #smtp-secure, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().hide(),e(".choice-no-restapi").hide()):(e('#smtp-port, #smtp-secure, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show(),e(".choice-no-restapi").show()))}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),t=e("#sending-emails-each"),n=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(t.val(),n)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function l(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var t="";return i.result.result&&(t='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(t):e("#bounce-connector").after(t),!0},e.WYSIJA_SEND(),!1}function d(){return wysijaAJAX.task="bounce_process",wysijaAJAX._wpnonce=wysijanonces.config.bounce_process,wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function u(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function p(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==b&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==b&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==b&&e("#ms-smtp-secure").change()}function g(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function f(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function w(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var y=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){t(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(n),e("input.mailpoet-delivery-method").on("change",n),e("#smtp-rest").on("change",a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(l),e(document).on("click",".bounce-submit",function(){return d(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var t=trim(e(this).val());""!==t&&t==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:void e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled")}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,t){var n,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof t&&(t=!0),a.each(function(i,t){var n=e(t);r[n.attr("id")]=n}),n=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),n.removeClass("hidden"),t&&(window.location.hash="inner-tab-"+c),n.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,t){var n,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof t&&(t=!0),a.each(function(i,t){var n=e(t);r[n.attr("id")]=n}),n=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),n.removeClass("hidden"),t&&(window.location.hash="tab-"+c),n.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var t=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+t.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),n(),a(),t(null),i(),e(".subscribers-count-list").change(u),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var b=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){f()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){w()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(p),e("input.mailpoet-delivery-method").on("change",p),e("#ms-smtp-rest").change(g),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var t="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return t?(wysijaAJAX.task="send_test_mail_ms",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail_ms):(wysijaAJAX.task="send_test_mail",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail),wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){e("#smtp-host").keyup(),w(),f(),p(),g()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var t=i.mailpoet,n=t.fn={};n.getSendingMethod=function(){return t.$.sending_method instanceof jQuery||(t.$.sending_method=e('input[name="wysija[config][sending_method]"]')),t.$.sending_method.filter(":checked").val()},n.isGoodFromAddress=function(e){var t=e.split("@")[1];return"undefined"==typeof t||""===t?!1:t.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},n.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var t=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(t.$.from_email=e("#from_email"),t.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return t.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(t.fn.isGoodFromAddress(t.$.from_email.val()))return t.$.from_email.data("message","").tooltip("hide");if("gmail"===t.fn.getSendingMethod())return t.$.from_email.data("message","").tooltip("hide");var e="";return e=t.fn.isGmailAddress(t.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,t.$.from_email.is(":visible")?t.$.from_email.data("message",e).tooltip("show"):t.$.from_email.tooltip("hide")},keyup:function(){t.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),t.$.panels=e(".wysija-panel"),t.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){t.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var t=i.mailpoet;e(document).on({ready:function(){t.$.geeky=e(".mailpoet-geeky-toggle"),t.$.geeky.data("l18n",{hide:t.$.geeky.data("hide"),show:t.$.geeky.text()}),t.$.geeky_rows=e(".super-advanced"),t.$.geeky.on({click:function(i){i.preventDefault();var n=t.$.geeky.data("l18n");t.$.geeky.hasClass("is_toggled")?(t.$.geeky.removeClass("is_toggled").text(n.hide),t.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(t.$.geeky.addClass("is_toggled").text(n.show),t.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?t.$.geeky.trigger("click"):t.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
|
1 |
+
jQuery(function(e){function i(){e("#manage_subscriptions").attr("checked")?e(".manage_subscriptions").fadeIn():e(".manage_subscriptions").fadeOut()}function t(i){null===i?e.each(e(".page_select"),function(){e("#"+e(this).attr("id")+"-links-"+e(this).val()).fadeIn()}):(id_section="#"+e(i).attr("id")+"-links",e(id_section+" span").hide(),e(id_section+"-"+e(i).val()).fadeIn())}function n(){switch(e("#sending-method-smtp").attr("checked")&&(e('#smtp-port, #smtp-secure, #smtp-login, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show(),e("label[for='smtp-password']").html(wysija_translations.password),a()),e("#restapipossible").hide(),e("#smtp-host").val()){case"smtp.gmail.com":""==y&&(e("#smtp-port").val("465"),e("#smtp-secure").val("ssl"),e("#smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#sending-method-smtp").is(":checked")?e("#restapipossible").show():e("#restapipossible").hide();break;case"mailpoet.com":e('#smtp-port, #smtp-secure, #smtp-login, label[for="smtp-auth-"]').parent().parent().hide(),e("label[for='smtp-password']").html(wysija_translations.api);break;case"sparkpost.com":e('#smtp-port, #smtp-secure, #smtp-login, label[for="smtp-auth-"]').parent().parent().hide(),e("label[for='smtp-password']").html(wysija_translations.api);break;case"":""==y&&(e("#smtp-port").val("25"),e("#smtp-secure").val("0"),e("#smtp-login").val(""));break;default:e("#sending-method-smtp").is(":checked")&&e('#smtp-port, #smtp-secure, #smtp-login, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show()}""==y&&e("#smtp-secure").change(),e("#smtp-rest").trigger("change")}function a(){"smtp"==e('input[name="wysija[config][sending_method]"]:checked').val()&&("none"!=e("#restapipossible").css("display")&&e("#smtp-rest").attr("checked")?(e('#smtp-port, #smtp-secure, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().hide(),e(".choice-no-restapi").hide()):(e('#smtp-port, #smtp-secure, #smtp-auth-1, label[for="smtp-auth-"]').parent().parent().show(),e(".choice-no-restapi").show()))}function s(){1===parseInt(e('input[name="wysija[config][confirm_dbleoptin]"]:checked').attr("value"))?e(".confirmemail").fadeIn():e(".confirmemail").fadeOut()}function o(){var i=e(".mailpoet-frequency_warning"),t=e("#sending-emails-each"),n=["one_min","two_min","five_min","ten_min"];-1!==e.inArray(t.val(),n)?i.removeClass("hidden"):i.addClass("hidden")}function c(){return"gmail"==e('input[name="wysija[config][sending_method]"]:checked').val()}function r(){c()?e('select[name="wysija[config][sending_emails_each]"] option[value="hourly"]').length>0&&(e("#sending-emails-number").val("20"),e('select[name="wysija[config][sending_emails_each]"]').val("hourly"),e("#sending-emails-number").attr("readonly","readonly"),e('select[name="wysija[config][sending_emails_each]"]').attr("disabled","disabled")):(e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled"),e("#sending-emails-number").removeAttr("readonly"))}function d(){return wysijaAJAX.task="bounce_connect",wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.bounceconnect,wysijaAJAX.dataType="json",wysijaAJAXcallback.onSuccess=function(i){var t="";return i.result.result&&(t='<a class="bounce-submit button-secondary" href2="admin.php?page=wysija_campaigns&action=test_bounce">'+wysijatrans.processbounce+"</a>"),displaychange?e(".allmsgs.ui-dialog-content.ui-widget-content").append(t):e("#bounce-connector").after(t),!0},e.WYSIJA_SEND(),!1}function l(){return wysijaAJAX.task="bounce_process",wysijaAJAX._wpnonce=wysijanonces.config.bounce_process,wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.processbounceT,wysijaAJAX.dataType="html",e(".allmsgs").dialog(),e.WYSIJA_SEND(),!1}function m(){"undefined"!=typeof this?e.each(e(".activateInput"),function(){h(this)}):h(this)}function h(i){e(i).attr("checked")?e("#"+e(i).attr("id")+"_linkname").fadeIn():e("#"+e(i).attr("id")+"_linkname").fadeOut()}function p(){subscribersCountList=[],e(".subscribers-count-list").each(function(){e(this).is(":checked")&&subscribersCountList.push(e(this).val())}),shortCode="[",shortCode+="wysija_subscribers_count",subscribersCountList.length>0&&(shortCode+=' list_id="'+subscribersCountList.join()+'" '),shortCode+="]",e(".subscribers-count-shortcode").val(shortCode)}function u(){switch(e("#ms-restapipossible").hide(),e("#ms-smtp-host").val()){case"smtp.gmail.com":""==b&&(e("#ms-smtp-port").val("465"),e("#ms-smtp-secure").val("ssl"),e("#ms-smtp-login").val("your_username@gmail.com"));break;case"smtp.sendgrid.net":e("#ms-restapipossible").show();break;case"":""==b&&(e("#ms-smtp-port").val("25"),e("#ms-smtp-secure").val("0"),e("#ms-smtp-login").val(""))}""==b&&e("#ms-smtp-secure").change()}function g(){"smtp"==e('input[name="wysija[config][ms_sending_method]"]:checked').val()&&("none"!=e("#ms-restapipossible").css("display")&&e("#ms-smtp-rest").attr("checked")?e(".ms-choice-no-restapi").hide():e(".ms-choice-no-restapi").show())}function f(){-1!==e.inArray(e("#ms-sending-emails-each").val(),["one_min","two_min","five_min","ten_min"])?e(".ms-choice-under15").show():e(".ms-choice-under15").hide()}function w(){"one-for-all"==e('input[name="wysija[config][ms_sending_config]"]:checked').val()?e(".choice-one-for-all").show():e(".choice-one-for-all").hide()}var y=e("#smtp-login").val();e(".hidechoice").hide(),e(".choice-sending-method-"+e('input[name="wysija[config][sending_method]"]:checked').val()).show(),e('input[name="wysija[config][sending_method]"]').change(function(){e(".hidechoice").hide(),e(".choice-sending-method-"+this.value).show(),r()}),e("#sending-emails-each").change(function(){o()}),e("#linksendingmethod").click(function(){e("#tabs").tabs("select",e(this).attr("href"))}),e("#mainmenu li a").click(function(){e("#redirecttab").val(e(this).attr("href"))}),e('input[name="wysija[config][confirm_dbleoptin]"]').change(s),e("#confirm_dbleoptin-1").click(function(){return confirm(wysijatrans.doubleoptinon)}),e("#confirm_dbleoptin-0").click(function(){return confirm(wysijatrans.doubleoptinoff)}),e('input[name="wysija[config][sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][sending_emails_site_method]"]:checked').val()?e("#p-sending-emails-site-method-sendmail-path").show():e("#p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][sending_emails_site_method]"]').change(),e(".page_select").change(function(){t(this)}),e("#manage_subscriptions").change(function(){i()}),e("#smtp-host").keyup(n),e("input.mailpoet-delivery-method").on("change",n),e("#smtp-rest").on("change",a),e("#button-regenerate-dkim").click(function(){return e("#sending-emails-site-method-phpmail").attr("checked","checked"),e("#dkim_regenerate").val("regenerate"),e("#wysija-settings").submit(),!1}),e("#bounce-connector").click(d),e(document).on("click",".bounce-submit",function(){return l(),e(".allmsgs").dialog("close"),tb_show(wysijatrans.processbounceT,e(this).attr("href2")+"&KeepThis=true&TB_iframe=true&height=400&width=600",null),tb_showIframe(),!1}),e(".forwardto").change(function(){e(this).attr("checked")?e("#"+e(this).attr("id")+"_input").show():e("#"+e(this).attr("id")+"_input").hide()}),e.each(e(".hideifnovalue"),function(){""==e(this).find("input").val()&&e(this).hide()}),e("#wysija-settings").submit(function(){var i=!1;return e(".bounce-forward-email").each(function(){var t=trim(e(this).val());""!==t&&t==e("#bounce_email").val()&&(e('#wysija-tabs a[href="#bounce"]').trigger("click"),e('#wysija-innertabs a[href="#actions"]').trigger("click"),e(this).css("border","1px solid #CC0000"),e("#bounce-msg-error").addClass("error"),e("#bounce-msg-error").html(wysijatrans.errorbounceforward),i=!0)}),i?!1:void e('select[name="wysija[config][sending_emails_each]"]').removeAttr("disabled")}),e("#bounce-process-auto").attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide(),e("#bounce-process-auto").change(function(){e(this).attr("checked")?e("#bounce-frequency").show():e("#bounce-frequency").hide()}),e(".activateInput").change(m),e(document).on("click","#wysija-innertabs .nav-tab",function(i,t){var n,a=e(".wysija-innerpanel"),s=e("#wysija-innertabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof t&&(t=!0),a.each(function(i,t){var n=e(t);r[n.attr("id")]=n}),n=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),n.removeClass("hidden"),t&&(window.location.hash="inner-tab-"+c),n.trigger("shown.innertab.mailpoet"),!1}),e(document).on("click","#wysija-tabs .nav-tab",function(i,t){var n,a=e(".wysija-panel"),s=e("#wysija-tabs").children(".nav-tab"),o=e(this),c=o.attr("href").replace("#",""),r={};return"undefined"==typeof t&&(t=!0),a.each(function(i,t){var n=e(t);r[n.attr("id")]=n}),n=r[c],s.removeClass("nav-tab-active"),o.addClass("nav-tab-active"),a.not(".hidden").addClass("hidden"),n.removeClass("hidden"),t&&(window.location.hash="tab-"+c),n.trigger("shown.tab.mailpoet"),!1}),e(document).on("click","#tip-send-with",function(i){e('.nav-tab[href="#sendingmethod"]').trigger("click"),i.preventDefault()}),e(window).load(function(){if(window.location.hash.length>0){var i=window.location.hash.replace("tab-","");e('#wysija-tabs .nav-tab[href="'+i+'"]').trigger("click")}else e("#wysija-tabs .nav-tab").first().trigger("click",!1);if(1===window.location.hash.indexOf("inner-tab")){var t=e('#wysija-innertabs .nav-tab[href="'+window.location.hash.replace("inner-tab-","")+'"]').trigger("click");e('#wysija-tabs .nav-tab[href="#'+t.parents(".wysija-panel").attr("id")+'"]').trigger("click",!1)}else e("#wysija-innertabs .nav-tab-active").trigger("click",!1)}),e(document).ready(function(){r(),o(),s(),m(),n(),a(),t(null),i(),e(".subscribers-count-list").change(p),e("#analytics-0").is(":checked")&&e("#advanced .industry").hide(),e("#analytics-1").change(function(){"1"==e(this).val()&&e("#advanced .industry").show()}),e("#analytics-0").change(function(){"0"==e(this).val()&&e("#advanced .industry").hide()}),e("#recaptcha-0").is(":checked")&&e("#advanced .recaptcha").hide(),e("#recaptcha-1").change(function(){"1"==e(this).val()&&e("#advanced .recaptcha").show()}),e("#recaptcha-0").change(function(){"0"==e(this).val()&&e("#advanced .recaptcha").hide()}),e("#"+getURLParameter("scroll_to")).length>0&&(e("html,body").animate({scrollTop:e("#"+getURLParameter("scroll_to")).offset().top-e("#wpadminbar").height()},500),e("#"+getURLParameter("scroll_to")).css({"background-color":"#f8fcff","font-size":"16px","font-weight":"bold"}))}),e("#dkimpub, #domainrecord, .subscribers-count-shortcode").click(function(){this.select()});var b=e("#ms-smtp-login").val();e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+e('input[name="wysija[config][ms_sending_method]"]:checked').val()).show(),e('input[name="wysija[config][ms_sending_method]"]').change(function(){e(".ms-hidechoice").hide(),e(".ms-choice-sending-method-"+this.value).show()}),e("#ms-sending-emails-each").change(function(){f()}),e('input[name="wysija[config][ms_sending_config]"]').change(function(){w()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(function(){"sendmail"==e('input[name="wysija[config][ms_sending_emails_site_method]"]:checked').val()?e("#ms_p-sending-emails-site-method-sendmail-path").show():e("#ms_p-sending-emails-site-method-sendmail-path").hide()}),e('input[name="wysija[config][ms_sending_emails_site_method]"]').change(),e("#ms-smtp-host").keyup(u),e("input.mailpoet-delivery-method").on("change",u),e("#ms-smtp-rest").change(g),e.each(e(".hideifnovalue"),function(){""===e(this).find("input").val()&&e(this).hide()}),e("table.capabilities_form .view_all").click(function(){e("table.capabilities_form tr.hidden").removeClass("hidden"),objTr=e(this).parents("tr")[0],e(objTr).remove()}),e(".mailpoet-test-delivery").on({click:function(i){i.preventDefault();var t="network"===e(".mailpoet-delivery-method:checked").val()||e(this).data("multisite");return t?(wysijaAJAX.task="send_test_mail_ms",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail_ms):(wysijaAJAX.task="send_test_mail",wysijaAJAX._wpnonce=wysijanonces.config.send_test_mail),wysijaAJAX.data=e("form").serializeArray(),wysijaAJAX.popTitle=wysijatrans.testemail,wysijaAJAX.dataType="json",e.WYSIJA_SEND(),!1}}),e(document).ready(function(){e("#smtp-host").keyup(),w(),f(),u(),g()})}),window.mailpoet="object"==typeof window.mailpoet?window.mailpoet:{$:{}},function(e,i){"use strict";var t=i.mailpoet,n=t.fn={};n.getSendingMethod=function(){return t.$.sending_method instanceof jQuery||(t.$.sending_method=e('input[name="wysija[config][sending_method]"]')),t.$.sending_method.filter(":checked").val()},n.isGoodFromAddress=function(e){var t=e.split("@")[1];return"undefined"==typeof t||""===t?!1:t.toLowerCase()!==i.location.host.toLowerCase()?!1:!0},n.isGmailAddress=function(e){var i=e.split("@")[1];return"undefined"==typeof i||""===i?!1:"gmail.com"!==i.toLowerCase()?!1:!0}}(jQuery,window),function(e,i){"use strict";var t=i.mailpoet;e(document).ready(function(){"object"==typeof e.fn.tooltip&&(t.$.from_email=e("#from_email"),t.$.from_email.tooltip({animation:!0,placement:"bottom",trigger:"manual",html:!0,title:function(){return t.$.from_email.data("message")}}).on({"verifyEmail.mailpoet":function(){if(t.fn.isGoodFromAddress(t.$.from_email.val()))return t.$.from_email.data("message","").tooltip("hide");if("gmail"===t.fn.getSendingMethod())return t.$.from_email.data("message","").tooltip("hide");var e="";return e=t.fn.isGmailAddress(t.$.from_email.val())?mpEmailCheck.gmailText:mpEmailCheck.text,t.$.from_email.is(":visible")?t.$.from_email.data("message",e).tooltip("show"):t.$.from_email.tooltip("hide")},keyup:function(){t.$.from_email.trigger("verifyEmail.mailpoet")}}).trigger("verifyEmail.mailpoet"),t.$.panels=e(".wysija-panel"),t.$.panels.filter("#basics").on({"shown.tab.mailpoet":function(){t.$.from_email.trigger("verifyEmail.mailpoet")}}))})}(jQuery,window),function(e,i){"use strict";var t=i.mailpoet;e(document).on({ready:function(){t.$.geeky=e(".mailpoet-geeky-toggle"),t.$.geeky.data("l18n",{hide:t.$.geeky.data("hide"),show:t.$.geeky.text()}),t.$.geeky_rows=e(".super-advanced"),t.$.geeky.on({click:function(i){i.preventDefault();var n=t.$.geeky.data("l18n");t.$.geeky.hasClass("is_toggled")?(t.$.geeky.removeClass("is_toggled").text(n.hide),t.$.geeky_rows.removeClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",1)):(t.$.geeky.addClass("is_toggled").text(n.show),t.$.geeky_rows.addClass("hidden"),void 0!==i.originalEvent&&e.cookie("geeky_option",0))}}),1==e.cookie("geeky_option")?t.$.geeky.trigger("click"):t.$.geeky_rows.addClass("hidden")}})}(jQuery,window);
|
languages/wysija-newsletters-ca.mo
CHANGED
Binary file
|
languages/wysija-newsletters-pl_PL.mo
CHANGED
Binary file
|
models/config.php
CHANGED
@@ -62,6 +62,9 @@ class WYSIJA_model_config extends WYSIJA_object{
|
|
62 |
'analytics' => 0,
|
63 |
'send_analytics_now' => 0,
|
64 |
'industry' => 'other',
|
|
|
|
|
|
|
65 |
'manage_subscriptions' => false,
|
66 |
'editor_fullarticle' => false,
|
67 |
'allow_no_js' => true,
|
62 |
'analytics' => 0,
|
63 |
'send_analytics_now' => 0,
|
64 |
'industry' => 'other',
|
65 |
+
'recaptcha' => false,
|
66 |
+
'recaptcha_key' => '',
|
67 |
+
'recaptcha_secret' => '',
|
68 |
'manage_subscriptions' => false,
|
69 |
'editor_fullarticle' => false,
|
70 |
'allow_no_js' => true,
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
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.
|
6 |
-
Stable tag: 2.
|
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,10 @@ Our [support site](https://www.mailpoet.com/support) has plenty of articles and
|
|
113 |
|
114 |
== Changelog ==
|
115 |
|
|
|
|
|
|
|
|
|
116 |
= 2.7.15.1 - 2017-11-02 =
|
117 |
* Improved IP throttling to work independently of subscribers table (for robustness)
|
118 |
|
2 |
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.9
|
6 |
+
Stable tag: 2.8
|
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.8 - 2017-11-20 =
|
117 |
+
* Added support for ReCaptcha to protect subscription forms from automated abuse
|
118 |
+
* Fixed editor sidebar missing if a theme uses wp_enqueue_media() function on WP 4.9
|
119 |
+
|
120 |
= 2.7.15.1 - 2017-11-02 =
|
121 |
* Improved IP throttling to work independently of subscribers table (for robustness)
|
122 |
|
tools/templates/form/web/widgets/submit.html
CHANGED
@@ -1 +1,2 @@
|
|
|
|
1 |
<input class="wysija-submit wysija-submit-field" type="submit" value="{#params.label}" />
|
1 |
+
{if #params.recaptcha_key}<div class="g-recaptcha" data-sitekey="{#params.recaptcha_key}" data-size="compact"></div>{/if}
|
2 |
<input class="wysija-submit wysija-submit-field" type="submit" value="{#params.label}" />
|
views/back/campaigns.php
CHANGED
@@ -2887,6 +2887,16 @@ $this->replace_link_shortcode(
|
|
2887 |
|
2888 |
<h1><?php echo sprintf(__('You\'ve updated to %1$s', WYSIJA), '<span class="version">MailPoet '.WYSIJA::get_version())."</span>"; ?></h1>
|
2889 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2890 |
<div class="about-text"><?php echo $data['abouttext'] ?></div>
|
2891 |
<?php
|
2892 |
foreach ($data['sections'] as $section) {
|
2887 |
|
2888 |
<h1><?php echo sprintf(__('You\'ve updated to %1$s', WYSIJA), '<span class="version">MailPoet '.WYSIJA::get_version())."</span>"; ?></h1>
|
2889 |
|
2890 |
+
<div class="error"><p><?php
|
2891 |
+
echo $this->replace_link_shortcode(
|
2892 |
+
$this->replace_link_shortcode(
|
2893 |
+
__('Having spam issues with MailPoet 2 subscription forms? Upgrade to [link]MailPoet 3[/link] or [link]enable Captcha[/link].', WYSIJA),
|
2894 |
+
admin_url('plugin-install.php?s=mailpoet&tab=search&type=author')
|
2895 |
+
),
|
2896 |
+
admin_url('admin.php?page=wysija_config#tab-advanced')
|
2897 |
+
);
|
2898 |
+
?></p></div>
|
2899 |
+
|
2900 |
<div class="about-text"><?php echo $data['abouttext'] ?></div>
|
2901 |
<?php
|
2902 |
foreach ($data['sections'] as $section) {
|
views/back/config.php
CHANGED
@@ -1202,6 +1202,26 @@ class WYSIJA_view_back_config extends WYSIJA_view_back {
|
|
1202 |
'label' => __('Industry', WYSIJA),
|
1203 |
'desc' => __('Select your industry.', WYSIJA) );
|
1204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
$super_advanced_fields ['subscribers_count'] = array(
|
1206 |
'type' => 'subscribers_count',
|
1207 |
'label' => __('Shortcode to display total number of subscribers', WYSIJA),
|
1202 |
'label' => __('Industry', WYSIJA),
|
1203 |
'desc' => __('Select your industry.', WYSIJA) );
|
1204 |
|
1205 |
+
$advanced_fields ['recaptcha'] = array(
|
1206 |
+
'type' => 'radio',
|
1207 |
+
'values' => array( true => __('Yes', WYSIJA), false => __('No', WYSIJA) ),
|
1208 |
+
'label' => __('Enable reCAPTCHA', WYSIJA),
|
1209 |
+
'desc' => __('Use reCAPTCHA to protect MailPoet subscription forms. [link]Sign up for an API key pair here[/link].', WYSIJA),
|
1210 |
+
'link' => '<a target="_blank" href="https://www.google.com/recaptcha/admin">'
|
1211 |
+
);
|
1212 |
+
|
1213 |
+
$advanced_fields ['recaptcha_key'] = array(
|
1214 |
+
'rowclass' => 'recaptcha',
|
1215 |
+
'type' => 'input',
|
1216 |
+
'label' => __('reCAPTCHA site key', WYSIJA),
|
1217 |
+
'desc' => __('Used in the HTML code your site serves to users.', WYSIJA) );
|
1218 |
+
|
1219 |
+
$advanced_fields ['recaptcha_secret'] = array(
|
1220 |
+
'rowclass' => 'recaptcha',
|
1221 |
+
'type' => 'input',
|
1222 |
+
'label' => __('reCAPTCHA secret key', WYSIJA),
|
1223 |
+
'desc' => __('Used for communication between your site and Google. Be sure to keep it a secret.', WYSIJA) );
|
1224 |
+
|
1225 |
$super_advanced_fields ['subscribers_count'] = array(
|
1226 |
'type' => 'subscribers_count',
|
1227 |
'label' => __('Shortcode to display total number of subscribers', WYSIJA),
|
views/front/widget_nl.php
CHANGED
@@ -74,6 +74,11 @@ class WYSIJA_view_front_widget_nl extends WYSIJA_view_front {
|
|
74 |
wp_print_scripts('wysija-front-subscribers');
|
75 |
wp_print_scripts('jquery-ui-datepicker');
|
76 |
|
|
|
|
|
|
|
|
|
|
|
77 |
$scripts_html .= ob_get_contents();
|
78 |
ob_end_clean();
|
79 |
|
@@ -102,10 +107,17 @@ class WYSIJA_view_front_widget_nl extends WYSIJA_view_front {
|
|
102 |
|
103 |
function display($title='',$params,$echo=true,$iframe=false){
|
104 |
|
|
|
|
|
105 |
if ( ! $iframe ){
|
106 |
wp_enqueue_script( 'wysija-validator-lang' );
|
107 |
wp_enqueue_script( 'wysija-validator' );
|
108 |
wp_enqueue_script( 'wysija-front-subscribers' );
|
|
|
|
|
|
|
|
|
|
|
109 |
wp_enqueue_style( 'validate-engine-css' );
|
110 |
}
|
111 |
$data = '';
|
@@ -212,8 +224,14 @@ class WYSIJA_view_front_widget_nl extends WYSIJA_view_front {
|
|
212 |
$list_fields_hidden='<input type="hidden" name="wysija[user_list][list_ids]" value="'.$list_exploded.'" />';
|
213 |
}
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
$submit_value = (!empty($params['submit'])) ? $params['submit'] : __('Submit', WYSIJA);
|
216 |
-
$submitbutton=$list_fields.'<input type="submit" '.$disabled_submit.' class="wysija-submit wysija-submit-field" name="submit" value="'.esc_attr($submit_value).'"/>';
|
217 |
$dataCf=$this->customFields($params,$form_id_real,$submitbutton);
|
218 |
|
219 |
if($dataCf){
|
74 |
wp_print_scripts('wysija-front-subscribers');
|
75 |
wp_print_scripts('jquery-ui-datepicker');
|
76 |
|
77 |
+
$helperUser=WYSIJA::get('user','helper');
|
78 |
+
if($helperUser->isCaptchaEnabled()) {
|
79 |
+
wp_print_scripts( 'wysija-recaptcha' );
|
80 |
+
}
|
81 |
+
|
82 |
$scripts_html .= ob_get_contents();
|
83 |
ob_end_clean();
|
84 |
|
107 |
|
108 |
function display($title='',$params,$echo=true,$iframe=false){
|
109 |
|
110 |
+
$helperUser=WYSIJA::get('user','helper');
|
111 |
+
|
112 |
if ( ! $iframe ){
|
113 |
wp_enqueue_script( 'wysija-validator-lang' );
|
114 |
wp_enqueue_script( 'wysija-validator' );
|
115 |
wp_enqueue_script( 'wysija-front-subscribers' );
|
116 |
+
|
117 |
+
if($helperUser->isCaptchaEnabled()) {
|
118 |
+
wp_enqueue_script( 'wysija-recaptcha' );
|
119 |
+
}
|
120 |
+
|
121 |
wp_enqueue_style( 'validate-engine-css' );
|
122 |
}
|
123 |
$data = '';
|
224 |
$list_fields_hidden='<input type="hidden" name="wysija[user_list][list_ids]" value="'.$list_exploded.'" />';
|
225 |
}
|
226 |
|
227 |
+
$captcha_field = '';
|
228 |
+
if($helperUser->isCaptchaEnabled()) {
|
229 |
+
$captcha_key = htmlspecialchars($model_config->getValue('recaptcha_key'));
|
230 |
+
$captcha_field = '<div class="g-recaptcha" data-sitekey="'.$captcha_key.'" data-size="compact"></div>';
|
231 |
+
}
|
232 |
+
|
233 |
$submit_value = (!empty($params['submit'])) ? $params['submit'] : __('Submit', WYSIJA);
|
234 |
+
$submitbutton=$list_fields.$captcha_field.'<input type="submit" '.$disabled_submit.' class="wysija-submit wysija-submit-field" name="submit" value="'.esc_attr($submit_value).'"/>';
|
235 |
$dataCf=$this->customFields($params,$form_id_real,$submitbutton);
|
236 |
|
237 |
if($dataCf){
|