Version Description
- Escape fix
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 4.5.2 |
Comparing to | |
See all releases |
Code changes from version 4.5.1 to 4.5.2
- includes/controls.php +70 -61
- plugin.php +2 -2
- readme.txt +9 -5
includes/controls.php
CHANGED
@@ -364,7 +364,7 @@ class NewsletterControls {
|
|
364 |
|
365 |
function button_reset($data = '') {
|
366 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'reset\';if (!confirm(\'';
|
367 |
-
echo esc_attr(__('Proceed?', 'newsletter'));
|
368 |
echo '\')) return false;">';
|
369 |
//echo '<i class="fa fa-times"></i> ';
|
370 |
echo esc_html(__('Reset', 'newsletter'));
|
@@ -385,7 +385,7 @@ class NewsletterControls {
|
|
385 |
*/
|
386 |
function button_copy($data = '') {
|
387 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'copy\';if (!confirm(\'';
|
388 |
-
echo esc_attr(__('Proceed?', 'newsletter'));
|
389 |
echo '\')) return false;">';
|
390 |
echo '<i class="fa fa-copy"></i> ';
|
391 |
echo esc_html(__('Copy', 'newsletter'));
|
@@ -398,7 +398,7 @@ class NewsletterControls {
|
|
398 |
*/
|
399 |
function button_delete($data = '') {
|
400 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'delete\';if (!confirm(\'';
|
401 |
-
echo esc_attr(__('Proceed?', 'newsletter'));
|
402 |
echo '\')) return false;">';
|
403 |
echo '<i class="fa fa-times"></i> ';
|
404 |
echo esc_html(__('Delete', 'newsletter'));
|
@@ -411,20 +411,20 @@ class NewsletterControls {
|
|
411 |
} else {
|
412 |
echo '<input class="button-primary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
|
413 |
}
|
414 |
-
}
|
415 |
|
416 |
function button_confirm($action, $label, $message = '', $data = '') {
|
417 |
if (empty($message)) {
|
418 |
echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
|
419 |
} else {
|
420 |
echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';if (confirm(\'' .
|
421 |
-
|
422 |
}
|
423 |
}
|
424 |
|
425 |
function editor($name, $rows = 5, $cols = 75) {
|
426 |
echo '<textarea class="visual" name="options[' . $name . ']" style="width: 100%" wrap="off" rows="' . $rows . '">';
|
427 |
-
echo
|
428 |
echo '</textarea>';
|
429 |
}
|
430 |
|
@@ -439,14 +439,14 @@ class NewsletterControls {
|
|
439 |
function textarea($name, $width = '100%', $height = '50') {
|
440 |
$value = $this->get_value($name);
|
441 |
echo '<textarea class="dynamic" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . '">';
|
442 |
-
echo
|
443 |
echo '</textarea>';
|
444 |
}
|
445 |
|
446 |
function textarea_fixed($name, $width = '100%', $height = '200') {
|
447 |
$value = $this->get_value($name);
|
448 |
echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
|
449 |
-
echo
|
450 |
echo '</textarea>';
|
451 |
}
|
452 |
|
@@ -457,7 +457,7 @@ class NewsletterControls {
|
|
457 |
echo '<br><br>';
|
458 |
echo '<div style="position: relative">';
|
459 |
echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
|
460 |
-
echo
|
461 |
echo '</textarea>';
|
462 |
echo '<iframe id="options-' . $name . '-iframe" class="newsletter-textarea-preview" style="background-color: #fff; width: ' . $width . '; height: ' . $height . 'px; position: absolute; top: 0; left: 0; z-index: 10000; display: none"></iframe>';
|
463 |
echo '</div>';
|
@@ -468,9 +468,9 @@ class NewsletterControls {
|
|
468 |
$this->disabled($prefix . '_disabled');
|
469 |
echo '<br>';
|
470 |
}
|
471 |
-
|
472 |
$this->text($prefix . '_subject', 90, 'Subject');
|
473 |
-
|
474 |
if ($editor == 'wordpress') {
|
475 |
$this->wp_editor($prefix . '_message');
|
476 |
} else if ($editor == 'textarea') {
|
@@ -481,29 +481,35 @@ class NewsletterControls {
|
|
481 |
}
|
482 |
|
483 |
function checkbox($name, $label = '') {
|
484 |
-
if ($label != '')
|
485 |
echo '<label>';
|
|
|
486 |
echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . ']" value="1"';
|
487 |
-
if (!empty($this->data[$name]))
|
488 |
echo ' checked="checked"';
|
489 |
-
|
490 |
-
|
|
|
491 |
echo ' ' . $label . '</label>';
|
|
|
492 |
}
|
493 |
|
494 |
function checkbox2($name, $label = '') {
|
495 |
-
if ($label != '')
|
496 |
echo '<label>';
|
|
|
497 |
echo '<input type="checkbox" id="' . $name . '" onchange="document.getElementById(\'' . $name . '_hidden\').value=this.checked?\'1\':\'0\'"';
|
498 |
-
if (!empty($this->data[$name]))
|
499 |
echo ' checked="checked"';
|
500 |
-
|
501 |
-
|
|
|
502 |
echo ' ' . $label . '</label>';
|
|
|
503 |
echo '<input type="hidden" id="' . $name . '_hidden" name="options[' . $name . ']" value="';
|
504 |
|
505 |
echo empty($this->data[$name]) ? '0' : '1';
|
506 |
-
echo '"
|
507 |
}
|
508 |
|
509 |
function radio($name, $value, $label = '') {
|
@@ -526,12 +532,14 @@ class NewsletterControls {
|
|
526 |
* the key $name an array containig the passed value.
|
527 |
*/
|
528 |
function checkbox_group($name, $value, $label = '') {
|
529 |
-
echo '<label><input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . $value . '"';
|
530 |
-
if (is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false)
|
531 |
-
echo ' checked
|
|
|
532 |
echo '/>';
|
533 |
-
if ($label != '')
|
534 |
echo $label;
|
|
|
535 |
echo '</label>';
|
536 |
}
|
537 |
|
@@ -582,8 +590,9 @@ class NewsletterControls {
|
|
582 |
echo '<div class="newsletter-preferences-group">';
|
583 |
|
584 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
585 |
-
if (empty($options_profile['list_' . $i]))
|
586 |
continue;
|
|
|
587 |
echo '<div class="newsletter-preferences-item">';
|
588 |
$this->checkbox2($name . '_' . $i, esc_html($options_profile['list_' . $i]));
|
589 |
echo '</div>';
|
@@ -606,10 +615,11 @@ class NewsletterControls {
|
|
606 |
|
607 |
echo '<div class="newsletter-preferences-group">';
|
608 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
609 |
-
if (empty($options_profile['list_' . $i]))
|
610 |
continue;
|
|
|
611 |
echo '<div class="newsletter-preferences-item">';
|
612 |
-
$this->checkbox_group($name, $i, '(' . $i . ') ' .
|
613 |
echo '</div>';
|
614 |
}
|
615 |
echo '<div style="clear: both"></div>';
|
@@ -627,13 +637,14 @@ class NewsletterControls {
|
|
627 |
|
628 |
echo '<div class="newsletter-preferences-group">';
|
629 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
630 |
-
if (empty($options_profile['list_' . $i]))
|
631 |
continue;
|
|
|
632 |
|
633 |
echo '<div class="newsletter-preferences-item">';
|
634 |
|
635 |
$this->select($name . '_' . $i, array(0 => 'Any', 1 => 'Yes', 2 => 'No'));
|
636 |
-
echo '(' . $i . ') ' .
|
637 |
|
638 |
echo '</div>';
|
639 |
}
|
@@ -642,7 +653,9 @@ class NewsletterControls {
|
|
642 |
echo '</div>';
|
643 |
}
|
644 |
|
645 |
-
/**
|
|
|
|
|
646 |
function preferences_select($name = 'preference') {
|
647 |
$options_profile = get_option('newsletter_profile');
|
648 |
|
@@ -662,8 +675,9 @@ class NewsletterControls {
|
|
662 |
echo '<select id="' . $name . '_month" onchange="' . $onchange . '">';
|
663 |
for ($i = 0; $i < 12; $i++) {
|
664 |
echo '<option value="' . $i . '"';
|
665 |
-
if ($month - 1 == $i)
|
666 |
echo ' selected';
|
|
|
667 |
echo '>' . date('F', mktime(0, 0, 0, $i + 1, 1, 2000)) . '</option>';
|
668 |
}
|
669 |
echo '</select>';
|
@@ -671,8 +685,9 @@ class NewsletterControls {
|
|
671 |
echo '<select id="' . $name . '_day" onchange="' . $onchange . '">';
|
672 |
for ($i = 1; $i <= 31; $i++) {
|
673 |
echo '<option value="' . $i . '"';
|
674 |
-
if ($day == $i)
|
675 |
echo ' selected';
|
|
|
676 |
echo '>' . $i . '</option>';
|
677 |
}
|
678 |
echo '</select>';
|
@@ -680,13 +695,17 @@ class NewsletterControls {
|
|
680 |
echo '<select id="' . $name . '_year" onchange="' . $onchange . '">';
|
681 |
for ($i = 2011; $i <= 2021; $i++) {
|
682 |
echo '<option value="' . $i . '"';
|
683 |
-
if ($year == $i)
|
684 |
echo ' selected';
|
|
|
685 |
echo '>' . $i . '</option>';
|
686 |
}
|
687 |
echo '</select>';
|
688 |
}
|
689 |
|
|
|
|
|
|
|
690 |
function datetime($name) {
|
691 |
echo '<input type="hidden" name="fields[' . $name . ']" value="datetime">';
|
692 |
$time = $this->data[$name] + get_option('gmt_offset') * 3600;
|
@@ -698,8 +717,9 @@ class NewsletterControls {
|
|
698 |
echo '<select name="' . $name . '_month">';
|
699 |
for ($i = 1; $i <= 12; $i++) {
|
700 |
echo '<option value="' . $i . '"';
|
701 |
-
if ($month == $i)
|
702 |
echo ' selected';
|
|
|
703 |
echo '>' . date('F', mktime(0, 0, 0, $i, 1, 2000)) . '</option>';
|
704 |
}
|
705 |
echo '</select>';
|
@@ -707,8 +727,9 @@ class NewsletterControls {
|
|
707 |
echo '<select name="' . $name . '_day">';
|
708 |
for ($i = 1; $i <= 31; $i++) {
|
709 |
echo '<option value="' . $i . '"';
|
710 |
-
if ($day == $i)
|
711 |
echo ' selected';
|
|
|
712 |
echo '>' . $i . '</option>';
|
713 |
}
|
714 |
echo '</select>';
|
@@ -716,8 +737,9 @@ class NewsletterControls {
|
|
716 |
echo '<select name="' . $name . '_year">';
|
717 |
for ($i = 2011; $i <= 2021; $i++) {
|
718 |
echo '<option value="' . $i . '"';
|
719 |
-
if ($year == $i)
|
720 |
echo ' selected';
|
|
|
721 |
echo '>' . $i . '</option>';
|
722 |
}
|
723 |
echo '</select>';
|
@@ -725,8 +747,9 @@ class NewsletterControls {
|
|
725 |
echo '<select name="' . $name . '_hour">';
|
726 |
for ($i = 0; $i <= 23; $i++) {
|
727 |
echo '<option value="' . $i . '"';
|
728 |
-
if ($hour == $i)
|
729 |
echo ' selected';
|
|
|
730 |
echo '>' . $i . ':00</option>';
|
731 |
}
|
732 |
echo '</select>';
|
@@ -747,8 +770,9 @@ class NewsletterControls {
|
|
747 |
|
748 |
function init($options = array()) {
|
749 |
$cookie_name = 'newsletter_tab';
|
750 |
-
if (isset($options['cookie_name']))
|
751 |
$cookie_name = $options['cookie_name'];
|
|
|
752 |
echo '<script type="text/javascript">
|
753 |
jQuery(document).ready(function(){
|
754 |
jQuery("textarea.dynamic").focus(function() {
|
@@ -803,24 +827,15 @@ class NewsletterControls {
|
|
803 |
}
|
804 |
|
805 |
function update_option($name, $data = null) {
|
806 |
-
if ($data == null)
|
807 |
$data = $this->data;
|
|
|
808 |
update_option($name, $data);
|
809 |
if (isset($data['log_level'])) {
|
810 |
update_option($name . '_log_level', $data['log_level']);
|
811 |
}
|
812 |
}
|
813 |
|
814 |
-
// function button_link($action, $url, $anchor) {
|
815 |
-
// if (strpos($url, '?') !== false) $url .= $url . '&';
|
816 |
-
// else $url .= $url . '?';
|
817 |
-
// $url .= 'act=' . $action;
|
818 |
-
//
|
819 |
-
// $url .= '&_wpnonce=' . wp_create_nonce();
|
820 |
-
//
|
821 |
-
// echo '<a class="button" href="' . $url . '">' . $anchor . '</a>';
|
822 |
-
// }
|
823 |
-
|
824 |
function js_redirect($url) {
|
825 |
echo '<script>';
|
826 |
echo 'location.href="' . $url . '"';
|
@@ -847,8 +862,9 @@ class NewsletterControls {
|
|
847 |
echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
|
848 |
for ($i = 8; $i < 50; $i++) {
|
849 |
echo '<option value="' . $i . '"';
|
850 |
-
if ($value == $i)
|
851 |
echo ' selected';
|
|
|
852 |
echo '>' . $i . '</option>';
|
853 |
}
|
854 |
echo '</select> px';
|
@@ -860,8 +876,9 @@ class NewsletterControls {
|
|
860 |
echo 'width <select id="options-' . $name . '-width" name="options[' . $name . '_width]">';
|
861 |
for ($i = 0; $i < 10; $i++) {
|
862 |
echo '<option value="' . $i . '"';
|
863 |
-
if ($value == $i)
|
864 |
echo ' selected';
|
|
|
865 |
echo '>' . $i . '</option>';
|
866 |
}
|
867 |
echo '</select> px ';
|
@@ -875,8 +892,9 @@ class NewsletterControls {
|
|
875 |
echo ' radius <select id="options-' . $name . '-radius" name="options[' . $name . '_radius]">';
|
876 |
for ($i = 0; $i < 10; $i++) {
|
877 |
echo '<option value="' . $i . '"';
|
878 |
-
if ($value == $i)
|
879 |
echo ' selected';
|
|
|
880 |
echo '>' . $i . '</option>';
|
881 |
}
|
882 |
echo '</select> px';
|
@@ -902,15 +920,6 @@ class NewsletterControls {
|
|
902 |
|
903 |
function media_input($option, $name, $label) {
|
904 |
|
905 |
-
// if (empty($option)) {
|
906 |
-
// $option = $this->currentoption;
|
907 |
-
// }
|
908 |
-
// $options = $this->get_option($option);
|
909 |
-
// $val = '';
|
910 |
-
// if (isset($options[$var])) {
|
911 |
-
// $val = $options[$var];
|
912 |
-
// }
|
913 |
-
|
914 |
if (!empty($label)) {
|
915 |
$output = '<label class="select" for="tnp_' . $name . '">' . $label . ':</label>';
|
916 |
}
|
364 |
|
365 |
function button_reset($data = '') {
|
366 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'reset\';if (!confirm(\'';
|
367 |
+
echo esc_attr(esc_js(__('Proceed?', 'newsletter')));
|
368 |
echo '\')) return false;">';
|
369 |
//echo '<i class="fa fa-times"></i> ';
|
370 |
echo esc_html(__('Reset', 'newsletter'));
|
385 |
*/
|
386 |
function button_copy($data = '') {
|
387 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'copy\';if (!confirm(\'';
|
388 |
+
echo esc_attr(esc_js(__('Proceed?', 'newsletter')));
|
389 |
echo '\')) return false;">';
|
390 |
echo '<i class="fa fa-copy"></i> ';
|
391 |
echo esc_html(__('Copy', 'newsletter'));
|
398 |
*/
|
399 |
function button_delete($data = '') {
|
400 |
echo '<button class="button-secondary" onclick="this.form.btn.value=\'' . esc_attr($data) . '\';this.form.act.value=\'delete\';if (!confirm(\'';
|
401 |
+
echo esc_attr(esc_js(__('Proceed?', 'newsletter')));
|
402 |
echo '\')) return false;">';
|
403 |
echo '<i class="fa fa-times"></i> ';
|
404 |
echo esc_html(__('Delete', 'newsletter'));
|
411 |
} else {
|
412 |
echo '<input class="button-primary" type="button" value="' . $label . '" onclick="this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
|
413 |
}
|
414 |
+
}
|
415 |
|
416 |
function button_confirm($action, $label, $message = '', $data = '') {
|
417 |
if (empty($message)) {
|
418 |
echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';this.form.submit()"/>';
|
419 |
} else {
|
420 |
echo '<input class="button-secondary" type="button" value="' . $label . '" onclick="this.form.btn.value=\'' . $data . '\';this.form.act.value=\'' . $action . '\';if (confirm(\'' .
|
421 |
+
esc_attr(esc_js($message)) . '\')) this.form.submit()"/>';
|
422 |
}
|
423 |
}
|
424 |
|
425 |
function editor($name, $rows = 5, $cols = 75) {
|
426 |
echo '<textarea class="visual" name="options[' . $name . ']" style="width: 100%" wrap="off" rows="' . $rows . '">';
|
427 |
+
echo esc_html($this->get_value($name));
|
428 |
echo '</textarea>';
|
429 |
}
|
430 |
|
439 |
function textarea($name, $width = '100%', $height = '50') {
|
440 |
$value = $this->get_value($name);
|
441 |
echo '<textarea class="dynamic" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . '">';
|
442 |
+
echo esc_html($value);
|
443 |
echo '</textarea>';
|
444 |
}
|
445 |
|
446 |
function textarea_fixed($name, $width = '100%', $height = '200') {
|
447 |
$value = $this->get_value($name);
|
448 |
echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
|
449 |
+
echo esc_html($value);
|
450 |
echo '</textarea>';
|
451 |
}
|
452 |
|
457 |
echo '<br><br>';
|
458 |
echo '<div style="position: relative">';
|
459 |
echo '<textarea id="options-' . $name . '" name="options[' . $name . ']" wrap="off" style="width:' . $width . ';height:' . $height . 'px">';
|
460 |
+
echo esc_html($value);
|
461 |
echo '</textarea>';
|
462 |
echo '<iframe id="options-' . $name . '-iframe" class="newsletter-textarea-preview" style="background-color: #fff; width: ' . $width . '; height: ' . $height . 'px; position: absolute; top: 0; left: 0; z-index: 10000; display: none"></iframe>';
|
463 |
echo '</div>';
|
468 |
$this->disabled($prefix . '_disabled');
|
469 |
echo '<br>';
|
470 |
}
|
471 |
+
|
472 |
$this->text($prefix . '_subject', 90, 'Subject');
|
473 |
+
|
474 |
if ($editor == 'wordpress') {
|
475 |
$this->wp_editor($prefix . '_message');
|
476 |
} else if ($editor == 'textarea') {
|
481 |
}
|
482 |
|
483 |
function checkbox($name, $label = '') {
|
484 |
+
if ($label != '') {
|
485 |
echo '<label>';
|
486 |
+
}
|
487 |
echo '<input type="checkbox" id="' . $name . '" name="options[' . $name . ']" value="1"';
|
488 |
+
if (!empty($this->data[$name])) {
|
489 |
echo ' checked="checked"';
|
490 |
+
}
|
491 |
+
echo '>';
|
492 |
+
if ($label != '') {
|
493 |
echo ' ' . $label . '</label>';
|
494 |
+
}
|
495 |
}
|
496 |
|
497 |
function checkbox2($name, $label = '') {
|
498 |
+
if ($label != '') {
|
499 |
echo '<label>';
|
500 |
+
}
|
501 |
echo '<input type="checkbox" id="' . $name . '" onchange="document.getElementById(\'' . $name . '_hidden\').value=this.checked?\'1\':\'0\'"';
|
502 |
+
if (!empty($this->data[$name])) {
|
503 |
echo ' checked="checked"';
|
504 |
+
}
|
505 |
+
echo '>';
|
506 |
+
if ($label != '') {
|
507 |
echo ' ' . $label . '</label>';
|
508 |
+
}
|
509 |
echo '<input type="hidden" id="' . $name . '_hidden" name="options[' . $name . ']" value="';
|
510 |
|
511 |
echo empty($this->data[$name]) ? '0' : '1';
|
512 |
+
echo '">';
|
513 |
}
|
514 |
|
515 |
function radio($name, $value, $label = '') {
|
532 |
* the key $name an array containig the passed value.
|
533 |
*/
|
534 |
function checkbox_group($name, $value, $label = '') {
|
535 |
+
echo '<label><input type="checkbox" id="' . $name . '" name="options[' . $name . '][]" value="' . esc_attr($value) . '"';
|
536 |
+
if (is_array($this->data[$name]) && array_search($value, $this->data[$name]) !== false) {
|
537 |
+
echo ' checked';
|
538 |
+
}
|
539 |
echo '/>';
|
540 |
+
if ($label != '') {
|
541 |
echo $label;
|
542 |
+
}
|
543 |
echo '</label>';
|
544 |
}
|
545 |
|
590 |
echo '<div class="newsletter-preferences-group">';
|
591 |
|
592 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
593 |
+
if (empty($options_profile['list_' . $i])) {
|
594 |
continue;
|
595 |
+
}
|
596 |
echo '<div class="newsletter-preferences-item">';
|
597 |
$this->checkbox2($name . '_' . $i, esc_html($options_profile['list_' . $i]));
|
598 |
echo '</div>';
|
615 |
|
616 |
echo '<div class="newsletter-preferences-group">';
|
617 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
618 |
+
if (empty($options_profile['list_' . $i])) {
|
619 |
continue;
|
620 |
+
}
|
621 |
echo '<div class="newsletter-preferences-item">';
|
622 |
+
$this->checkbox_group($name, $i, '(' . $i . ') ' . esc_html($options_profile['list_' . $i]));
|
623 |
echo '</div>';
|
624 |
}
|
625 |
echo '<div style="clear: both"></div>';
|
637 |
|
638 |
echo '<div class="newsletter-preferences-group">';
|
639 |
for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
|
640 |
+
if (empty($options_profile['list_' . $i])) {
|
641 |
continue;
|
642 |
+
}
|
643 |
|
644 |
echo '<div class="newsletter-preferences-item">';
|
645 |
|
646 |
$this->select($name . '_' . $i, array(0 => 'Any', 1 => 'Yes', 2 => 'No'));
|
647 |
+
echo '(' . $i . ') ' . esc_html($options_profile['list_' . $i]);
|
648 |
|
649 |
echo '</div>';
|
650 |
}
|
653 |
echo '</div>';
|
654 |
}
|
655 |
|
656 |
+
/**
|
657 |
+
* Creates a single select with the active preferences.
|
658 |
+
*/
|
659 |
function preferences_select($name = 'preference') {
|
660 |
$options_profile = get_option('newsletter_profile');
|
661 |
|
675 |
echo '<select id="' . $name . '_month" onchange="' . $onchange . '">';
|
676 |
for ($i = 0; $i < 12; $i++) {
|
677 |
echo '<option value="' . $i . '"';
|
678 |
+
if ($month - 1 == $i) {
|
679 |
echo ' selected';
|
680 |
+
}
|
681 |
echo '>' . date('F', mktime(0, 0, 0, $i + 1, 1, 2000)) . '</option>';
|
682 |
}
|
683 |
echo '</select>';
|
685 |
echo '<select id="' . $name . '_day" onchange="' . $onchange . '">';
|
686 |
for ($i = 1; $i <= 31; $i++) {
|
687 |
echo '<option value="' . $i . '"';
|
688 |
+
if ($day == $i) {
|
689 |
echo ' selected';
|
690 |
+
}
|
691 |
echo '>' . $i . '</option>';
|
692 |
}
|
693 |
echo '</select>';
|
695 |
echo '<select id="' . $name . '_year" onchange="' . $onchange . '">';
|
696 |
for ($i = 2011; $i <= 2021; $i++) {
|
697 |
echo '<option value="' . $i . '"';
|
698 |
+
if ($year == $i) {
|
699 |
echo ' selected';
|
700 |
+
}
|
701 |
echo '>' . $i . '</option>';
|
702 |
}
|
703 |
echo '</select>';
|
704 |
}
|
705 |
|
706 |
+
/**
|
707 |
+
* Date and time (hour) selector. Timestamp stored.
|
708 |
+
*/
|
709 |
function datetime($name) {
|
710 |
echo '<input type="hidden" name="fields[' . $name . ']" value="datetime">';
|
711 |
$time = $this->data[$name] + get_option('gmt_offset') * 3600;
|
717 |
echo '<select name="' . $name . '_month">';
|
718 |
for ($i = 1; $i <= 12; $i++) {
|
719 |
echo '<option value="' . $i . '"';
|
720 |
+
if ($month == $i) {
|
721 |
echo ' selected';
|
722 |
+
}
|
723 |
echo '>' . date('F', mktime(0, 0, 0, $i, 1, 2000)) . '</option>';
|
724 |
}
|
725 |
echo '</select>';
|
727 |
echo '<select name="' . $name . '_day">';
|
728 |
for ($i = 1; $i <= 31; $i++) {
|
729 |
echo '<option value="' . $i . '"';
|
730 |
+
if ($day == $i) {
|
731 |
echo ' selected';
|
732 |
+
}
|
733 |
echo '>' . $i . '</option>';
|
734 |
}
|
735 |
echo '</select>';
|
737 |
echo '<select name="' . $name . '_year">';
|
738 |
for ($i = 2011; $i <= 2021; $i++) {
|
739 |
echo '<option value="' . $i . '"';
|
740 |
+
if ($year == $i) {
|
741 |
echo ' selected';
|
742 |
+
}
|
743 |
echo '>' . $i . '</option>';
|
744 |
}
|
745 |
echo '</select>';
|
747 |
echo '<select name="' . $name . '_hour">';
|
748 |
for ($i = 0; $i <= 23; $i++) {
|
749 |
echo '<option value="' . $i . '"';
|
750 |
+
if ($hour == $i) {
|
751 |
echo ' selected';
|
752 |
+
}
|
753 |
echo '>' . $i . ':00</option>';
|
754 |
}
|
755 |
echo '</select>';
|
770 |
|
771 |
function init($options = array()) {
|
772 |
$cookie_name = 'newsletter_tab';
|
773 |
+
if (isset($options['cookie_name'])) {
|
774 |
$cookie_name = $options['cookie_name'];
|
775 |
+
}
|
776 |
echo '<script type="text/javascript">
|
777 |
jQuery(document).ready(function(){
|
778 |
jQuery("textarea.dynamic").focus(function() {
|
827 |
}
|
828 |
|
829 |
function update_option($name, $data = null) {
|
830 |
+
if ($data == null) {
|
831 |
$data = $this->data;
|
832 |
+
}
|
833 |
update_option($name, $data);
|
834 |
if (isset($data['log_level'])) {
|
835 |
update_option($name . '_log_level', $data['log_level']);
|
836 |
}
|
837 |
}
|
838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
function js_redirect($url) {
|
840 |
echo '<script>';
|
841 |
echo 'location.href="' . $url . '"';
|
862 |
echo '<select id="options-' . $name . '" name="options[' . $name . ']">';
|
863 |
for ($i = 8; $i < 50; $i++) {
|
864 |
echo '<option value="' . $i . '"';
|
865 |
+
if ($value == $i) {
|
866 |
echo ' selected';
|
867 |
+
}
|
868 |
echo '>' . $i . '</option>';
|
869 |
}
|
870 |
echo '</select> px';
|
876 |
echo 'width <select id="options-' . $name . '-width" name="options[' . $name . '_width]">';
|
877 |
for ($i = 0; $i < 10; $i++) {
|
878 |
echo '<option value="' . $i . '"';
|
879 |
+
if ($value == $i) {
|
880 |
echo ' selected';
|
881 |
+
}
|
882 |
echo '>' . $i . '</option>';
|
883 |
}
|
884 |
echo '</select> px ';
|
892 |
echo ' radius <select id="options-' . $name . '-radius" name="options[' . $name . '_radius]">';
|
893 |
for ($i = 0; $i < 10; $i++) {
|
894 |
echo '<option value="' . $i . '"';
|
895 |
+
if ($value == $i) {
|
896 |
echo ' selected';
|
897 |
+
}
|
898 |
echo '>' . $i . '</option>';
|
899 |
}
|
900 |
echo '</select> px';
|
920 |
|
921 |
function media_input($option, $name, $label) {
|
922 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
923 |
if (!empty($label)) {
|
924 |
$output = '<label class="select" for="tnp_' . $name . '">' . $label . ':</label>';
|
925 |
}
|
plugin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
-
Version: 4.5.
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
@@ -14,7 +14,7 @@
|
|
14 |
*/
|
15 |
|
16 |
// Used as dummy parameter on css and js links
|
17 |
-
define('NEWSLETTER_VERSION', '4.5.
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
+
Version: 4.5.2
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
14 |
*/
|
15 |
|
16 |
// Used as dummy parameter on css and js links
|
17 |
+
define('NEWSLETTER_VERSION', '4.5.2');
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 4.5.2
|
5 |
-
Stable tag: 4.5.
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
@@ -15,17 +15,17 @@ send and track e-mails, headache-free. It just works out of box!
|
|
15 |
= Main Features =
|
16 |
|
17 |
* NEW **responsive email Drag & Drop composer**
|
18 |
-
* **Unlimited Subscribers** with statistics
|
19 |
* **Unlimited Emails** with tracking
|
20 |
* Customizable **subscription widget**, **page** or **custom form**
|
21 |
* Wordpress User Registration **seamless integration**
|
22 |
* **Single** And **Double Opt-In** plus privacy checkbox for EU laws compliance
|
23 |
* **Subscribers preferences** to fine-target your campaigns
|
24 |
-
* SMTP-Ready
|
25 |
* Customizable Themes
|
26 |
-
* Html and Text versions of Emails
|
27 |
* All messages are **fully translatable** from Admin Panel (no .po/.mo)
|
28 |
-
* Diagnostics Panel to check your blog mailing capability
|
29 |
* **Compatible with Postman, WP Mail SMTP, Easy WP SMTP, Easy SMTP Mail, WP Mail Bank**
|
30 |
|
31 |
= Integration with WordPress registration =
|
@@ -77,6 +77,10 @@ Thank you, The Newsletter Team
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
80 |
= 4.5.1 =
|
81 |
|
82 |
* Warning fix
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 4.5.2
|
5 |
+
Stable tag: 4.5.2
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
15 |
= Main Features =
|
16 |
|
17 |
* NEW **responsive email Drag & Drop composer**
|
18 |
+
* **Unlimited Subscribers** with statistics
|
19 |
* **Unlimited Emails** with tracking
|
20 |
* Customizable **subscription widget**, **page** or **custom form**
|
21 |
* Wordpress User Registration **seamless integration**
|
22 |
* **Single** And **Double Opt-In** plus privacy checkbox for EU laws compliance
|
23 |
* **Subscribers preferences** to fine-target your campaigns
|
24 |
+
* SMTP-Ready
|
25 |
* Customizable Themes
|
26 |
+
* Html and Text versions of Emails
|
27 |
* All messages are **fully translatable** from Admin Panel (no .po/.mo)
|
28 |
+
* Diagnostics Panel to check your blog mailing capability
|
29 |
* **Compatible with Postman, WP Mail SMTP, Easy WP SMTP, Easy SMTP Mail, WP Mail Bank**
|
30 |
|
31 |
= Integration with WordPress registration =
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 4.5.2 =
|
81 |
+
|
82 |
+
* Escape fix
|
83 |
+
|
84 |
= 4.5.1 =
|
85 |
|
86 |
* Warning fix
|