Version Description
- Fixed broken link to settings pages after widget form
- Improved: better stylesheet loading, encouraged browser caching
- Improved: Some UI improvements
- Improved: better default checkbox CSS
- Improved: better default form CSS
Download this release
Release Info
Developer | DvanKooten |
Plugin | Newsletter Sign-Up |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- assets/css/checkbox.css +6 -0
- assets/css/css.php +16 -0
- assets/css/form.css +14 -0
- assets/css/newsletter-sign-up.php +0 -22
- includes/NSU.php +201 -212
- includes/NSU_Checkbox.php +11 -11
- includes/NSU_Form.php +1 -0
- includes/NewsletterSignUpWidget.php +5 -6
- includes/views/form_settings.php +22 -22
- newsletter-sign-up.php +2 -2
- readme.txt +13 -6
assets/css/checkbox.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* Newsletter Sign-Up - Checkbox */
|
3 |
+
#nsu-checkbox { clear:both; display:block; }
|
4 |
+
#nsu-checkbox-input { position:relative; margin:0 5px 0 0; padding:0; height:13px; width:13px; display:inline-block !important; -webkit-appearance: checkbox; }
|
5 |
+
#nsu-checkbox-label { cursor:pointer; line-height:normal; }
|
6 |
+
#registerform #nsu-checkbox{ margin-bottom:10px; }
|
assets/css/css.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Set headers to serve CSS and encourage browser caching
|
3 |
+
$expires = 60 * 60 * 34 * 3; // cache time: 3 days
|
4 |
+
header('Content-Type: text/css; charset: UTF-8');
|
5 |
+
header("Cache-Control: public, max-age=" . $expires);
|
6 |
+
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
|
7 |
+
|
8 |
+
if(isset($_GET['checkbox'])) {
|
9 |
+
readfile('checkbox.css');
|
10 |
+
}
|
11 |
+
|
12 |
+
if(isset($_GET['form'])) {
|
13 |
+
readfile('form.css');
|
14 |
+
}
|
15 |
+
|
16 |
+
exit;
|
assets/css/form.css
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.nsu-form { margin:1em 0; }
|
2 |
+
.nsu-form > :first-child{ margin-top: 0; }
|
3 |
+
.nsu-form > :last-child{ margin-bottom:0; }
|
4 |
+
|
5 |
+
.nsu-form p { text-align:left; margin:1em 0; }
|
6 |
+
|
7 |
+
.nsu-form label{ display:block; font-weight:bold; margin-bottom:3px; text-align:left; }
|
8 |
+
.nsu-form input[type="text"],
|
9 |
+
.nsu-form input[type="email"],
|
10 |
+
.nsu-form input[type="tel"],
|
11 |
+
.nsu-form input[type="url"] { display:block; width:100%; height:auto; box-sizing:border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; }
|
12 |
+
.nsu-form input[type="submit"], .nsu-form button { display:block; }
|
13 |
+
|
14 |
+
.nsu-error { color: red; font-style:italic; }
|
assets/css/newsletter-sign-up.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php header('Content-type: text/css');
|
2 |
-
|
3 |
-
if (isset($_GET['checkbox_reset']) && $_GET['checkbox_reset'] == 1) { ?>
|
4 |
-
p#ns-checkbox{ clear:both; display:block; }
|
5 |
-
p#ns-checkbox input{ margin:0 5px 0 0; display:inline-block !important; width:13px; height:13px; }
|
6 |
-
p#ns-checkbox label{ display:inline-block !important; }
|
7 |
-
<?php }
|
8 |
-
if (isset($_GET['form_css']) && $_GET['form_css'] == 1) { ?>
|
9 |
-
.nsu-form { margin:10px 0; }
|
10 |
-
|
11 |
-
.nsu-form p,.nsu-text-before-form,.nsu-text-after-form{ clear:both; display:block; margin:5px 0; }
|
12 |
-
.nsu-text-before-form ul,nsu-text-after-form ul,.nsu-text-before-form ol,nsu-text-after-form ol{ margin-left:15px; }
|
13 |
-
|
14 |
-
.nsu-form label{ display:block; font-weight:bold; }
|
15 |
-
.nsu-form input{ padding:2px; display:block; color:#999; }
|
16 |
-
.nsu-form input:focus, .nsu-form input:active{ color:#000; }
|
17 |
-
|
18 |
-
.nsu-field{ background:white; }
|
19 |
-
input.nsu-submit{ color:#000; }
|
20 |
-
|
21 |
-
.nsu-error { font-size:75%; font-style:italic; }
|
22 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/NSU.php
CHANGED
@@ -1,32 +1,26 @@
|
|
1 |
<?php
|
2 |
|
3 |
class NSU {
|
4 |
-
|
5 |
private $options = array();
|
6 |
private static $instance = null;
|
7 |
private static $checkbox = null;
|
8 |
private static $form = null;
|
9 |
-
|
10 |
-
public function __construct()
|
11 |
-
{
|
12 |
self::$instance = $this;
|
13 |
|
14 |
$opts = $this->get_options();
|
15 |
|
16 |
// widget hooks
|
17 |
-
add_action('widgets_init', array($this, 'register_widget'));
|
18 |
-
|
19 |
-
|
20 |
-
if($opts['checkbox']['css_reset'] == 1 || $opts['form']['load_form_css'] == 1) {
|
21 |
-
add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
|
22 |
-
}
|
23 |
-
|
24 |
-
self::checkbox();
|
25 |
self::form();
|
26 |
|
27 |
-
if(!defined("DOING_AJAX") || !DOING_AJAX) {
|
28 |
// regular request
|
29 |
-
if(is_admin()) {
|
30 |
|
31 |
// backend only
|
32 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Admin.php';
|
@@ -34,13 +28,15 @@ class NSU {
|
|
34 |
} else {
|
35 |
// frontend only
|
36 |
require_once NSU_PLUGIN_DIR . 'includes/functions.php';
|
|
|
|
|
|
|
37 |
}
|
38 |
}
|
39 |
}
|
40 |
|
41 |
-
public static function checkbox()
|
42 |
-
|
43 |
-
if(!self::$checkbox) {
|
44 |
require_once NSU_PLUGIN_DIR .'includes/NSU_Checkbox.php';
|
45 |
self::$checkbox = new NSU_Checkbox;
|
46 |
}
|
@@ -48,9 +44,8 @@ class NSU {
|
|
48 |
return self::$checkbox;
|
49 |
}
|
50 |
|
51 |
-
public static function form()
|
52 |
-
|
53 |
-
if(!self::$form) {
|
54 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Form.php';
|
55 |
self::$form = new NSU_Form;
|
56 |
}
|
@@ -60,256 +55,250 @@ class NSU {
|
|
60 |
|
61 |
|
62 |
/**
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
{
|
68 |
-
if(empty($this->options)) {
|
69 |
-
$keys = array('form', 'mailinglist', 'checkbox');
|
70 |
|
71 |
$defaults = array(
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
}
|
93 |
|
94 |
return $this->options;
|
95 |
}
|
96 |
-
|
97 |
/**
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
{
|
103 |
require_once NSU_PLUGIN_DIR . 'includes/NewsletterSignUpWidget.php';
|
104 |
-
return register_widget('NewsletterSignUpWidget');
|
105 |
}
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
111 |
public static function instance() {
|
112 |
-
if(!self::$instance) self::$instance = new NSU();
|
113 |
-
|
114 |
return self::$instance;
|
115 |
}
|
116 |
|
117 |
-
public function
|
118 |
-
{
|
119 |
$opts = $this->get_options();
|
120 |
|
121 |
-
|
122 |
-
$
|
|
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
}
|
128 |
|
129 |
-
// Load CSS to reset label and input fields for the sign-up form?
|
130 |
-
if($opts['form']['load_form_css'] == 1) {
|
131 |
-
$stylesheet_opts .= 'form_css=1&';
|
132 |
-
}
|
133 |
-
|
134 |
-
wp_enqueue_style('ns_checkbox_style', plugins_url("/assets/css/newsletter-sign-up.php{$stylesheet_opts}", dirname(__FILE__)));
|
135 |
}
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
/**
|
141 |
-
|
142 |
-
|
143 |
-
function send_post_data($email, $name = '', $type = 'checkbox')
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
// when not using api and no form action has been given, abandon.
|
148 |
-
if(empty($opts['use_api']) && empty($opts['form_action'])) return;
|
149 |
-
|
150 |
/* Are we using API? */
|
151 |
-
if($opts['use_api'] == 1) {
|
152 |
-
|
153 |
-
switch($opts['provider']) {
|
154 |
-
|
155 |
/* Send data using the YMLP API */
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
|
169 |
-
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
|
175 |
break;
|
176 |
-
|
177 |
/* Send data using the MailChimp API */
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
|
|
|
|
|
|
187 |
);
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
$request['merge_vars']['FNAME'] = substr($name, 0, $strpos);
|
205 |
-
$request['merge_vars']['LNAME'] = substr($name, $strpos);
|
206 |
-
} else {
|
207 |
-
$request['merge_vars']['FNAME'] = $name;
|
208 |
-
$request['merge_vars']['LNAME'] = '...';
|
209 |
-
}
|
210 |
-
|
211 |
-
$request['merge_vars'][$opts['name_id']] = $name;
|
212 |
}
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
|
|
|
|
|
|
226 |
break;
|
227 |
-
|
228 |
}
|
229 |
-
|
230 |
} else {
|
231 |
-
|
232 |
-
|
233 |
$post_data = array(
|
234 |
$opts['email_id'] => $email,
|
235 |
);
|
236 |
-
|
237 |
// Subscribe with name? Add to $post_data array.
|
238 |
-
if($opts['subscribe_with_name'] == 1) $post_data[$opts['name_id']] = $name;
|
239 |
-
|
240 |
// Add list specific data
|
241 |
-
switch($opts['provider']) {
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
break;
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
break;
|
257 |
-
|
258 |
}
|
259 |
-
|
260 |
-
$post_data = array_merge($post_data, $this->add_additional_data(array_merge(array('email' => $email, 'name' => $name), $post_data)));
|
261 |
|
262 |
-
$
|
263 |
-
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
|
266 |
-
if(isset($_POST['_nsu_debug']) || isset($_GET['_nsu_debug'])) {
|
267 |
-
var_dump($result); die();
|
268 |
-
}
|
269 |
-
|
270 |
}
|
271 |
-
|
272 |
// store a cookie, if preferred by site owner
|
273 |
-
if($type == 'checkbox' && $this->options['checkbox']['cookie_hide'] == 1) @setcookie('ns_subscriber',TRUE,time() + 9999999);
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
}
|
286 |
|
287 |
-
|
288 |
-
/**
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
{
|
294 |
-
|
295 |
$defaults = array(
|
296 |
'format' => 'array',
|
297 |
'api' => NULL
|
298 |
);
|
299 |
-
|
300 |
$args = wp_parse_args( $args, $defaults );
|
301 |
-
|
302 |
$add_data = array();
|
303 |
-
if(isset($opts['extra_data']) && is_array($opts['extra_data'])) {
|
304 |
-
foreach($opts['extra_data'] as $key => $value) {
|
305 |
-
if($args['api'] == 'ymlp') $value['name'] = str_replace('YMP','Field', $value['name']);
|
306 |
-
$value['value'] = str_replace("%%NAME%%", $args['name'], $value['value']);
|
307 |
-
$value['value'] = str_replace("%%IP%%", $_SERVER['REMOTE_ADDR'], $value['value']);
|
308 |
$add_data[$value['name']] = $value['value'];
|
309 |
-
}
|
310 |
}
|
311 |
|
312 |
return $add_data;
|
313 |
}
|
314 |
-
|
315 |
-
}
|
1 |
<?php
|
2 |
|
3 |
class NSU {
|
4 |
+
|
5 |
private $options = array();
|
6 |
private static $instance = null;
|
7 |
private static $checkbox = null;
|
8 |
private static $form = null;
|
9 |
+
|
10 |
+
public function __construct() {
|
|
|
11 |
self::$instance = $this;
|
12 |
|
13 |
$opts = $this->get_options();
|
14 |
|
15 |
// widget hooks
|
16 |
+
add_action( 'widgets_init', array( $this, 'register_widget' ) );
|
17 |
+
|
18 |
+
self::checkbox();
|
|
|
|
|
|
|
|
|
|
|
19 |
self::form();
|
20 |
|
21 |
+
if ( !defined( "DOING_AJAX" ) || !DOING_AJAX ) {
|
22 |
// regular request
|
23 |
+
if ( is_admin() ) {
|
24 |
|
25 |
// backend only
|
26 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Admin.php';
|
28 |
} else {
|
29 |
// frontend only
|
30 |
require_once NSU_PLUGIN_DIR . 'includes/functions.php';
|
31 |
+
|
32 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
33 |
+
add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
34 |
}
|
35 |
}
|
36 |
}
|
37 |
|
38 |
+
public static function checkbox() {
|
39 |
+
if ( !self::$checkbox ) {
|
|
|
40 |
require_once NSU_PLUGIN_DIR .'includes/NSU_Checkbox.php';
|
41 |
self::$checkbox = new NSU_Checkbox;
|
42 |
}
|
44 |
return self::$checkbox;
|
45 |
}
|
46 |
|
47 |
+
public static function form() {
|
48 |
+
if ( !self::$form ) {
|
|
|
49 |
require_once NSU_PLUGIN_DIR . 'includes/NSU_Form.php';
|
50 |
self::$form = new NSU_Form;
|
51 |
}
|
55 |
|
56 |
|
57 |
/**
|
58 |
+
* Initalize options
|
59 |
+
*
|
60 |
+
* @return array $options
|
61 |
+
*/
|
62 |
+
public function get_options() {
|
63 |
+
if ( empty( $this->options ) ) {
|
64 |
+
$keys = array( 'form', 'mailinglist', 'checkbox' );
|
65 |
|
66 |
$defaults = array(
|
67 |
+
'form' => array( 'load_form_css' => 0, 'use_html5' => 1, 'submit_button' => 'Sign up',
|
68 |
+
'name_label' => 'Name:', 'email_label' => "Email:", 'email_default_value' => 'Your emailaddress..', 'name_required' => 0, 'name_default_value' => 'Your name..', 'wpautop' => 0,
|
69 |
+
'text_after_signup' => 'Thanks for signing up to our newsletter. Please check your inbox to confirm your email address.', 'redirect_to' => '',
|
70 |
+
'text_empty_name' => 'Please fill in the name field.', 'text_empty_email' => 'Please fill in the email field.', 'text_invalid_email' => 'Please enter a valid email address.'
|
71 |
+
),
|
72 |
+
'mailinglist' => array( 'provider' => '', 'use_api' => 0, 'subscribe_with_name' => 0, 'email_id' => '', 'name_id' => '', 'form_action' => '' ),
|
73 |
+
'checkbox' => array( 'text' => 'Sign me up for the newsletter', 'redirect_to' => '', 'precheck' => 0, 'cookie_hide' => 0, 'css_reset' => 0,
|
74 |
+
'add_to_registration_form' => 0, 'add_to_comment_form' => 1, 'add_to_buddypress_form' => 0,
|
75 |
+
'add_to_multisite_form' => 0, 'add_to_bbpress_forms' => 0
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
foreach ( $keys as $key ) {
|
80 |
+
if ( ( $option = get_option( 'nsu_'. $key ) ) == false ) {
|
81 |
+
add_option( 'nsu_'. $key, $defaults[$key] );
|
82 |
+
}
|
83 |
+
|
84 |
+
$this->options[$key] = array_merge( $defaults[$key], (array) $option );
|
85 |
+
}
|
86 |
|
87 |
}
|
88 |
|
89 |
return $this->options;
|
90 |
}
|
91 |
+
|
92 |
/**
|
93 |
+
* Registers the Newsletter Sign-Up Widget
|
94 |
+
*
|
95 |
+
* @return type
|
96 |
+
*/
|
97 |
+
public function register_widget() {
|
98 |
require_once NSU_PLUGIN_DIR . 'includes/NewsletterSignUpWidget.php';
|
99 |
+
return register_widget( 'NewsletterSignUpWidget' );
|
100 |
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Factory method for NewsletterSignUp class. Only instantiate once.
|
104 |
+
*
|
105 |
+
* @return NewsletterSignUp Instance of Newsletter Sign-Up class
|
106 |
+
*/
|
107 |
public static function instance() {
|
108 |
+
if ( !self::$instance ) self::$instance = new NSU();
|
109 |
+
|
110 |
return self::$instance;
|
111 |
}
|
112 |
|
113 |
+
public function load_stylesheets() {
|
|
|
114 |
$opts = $this->get_options();
|
115 |
|
116 |
+
$stylesheets = array();
|
117 |
+
if ( $opts['checkbox']['css_reset'] == 1 ) { $stylesheets['checkbox'] = 1; }
|
118 |
+
if ( $opts['form']['load_form_css'] == 1 ) { $stylesheets['form'] = 1; }
|
119 |
|
120 |
+
if ( !empty( $stylesheets ) ) {
|
121 |
+
$stylesheet_url = add_query_arg( $stylesheets, plugins_url( "/assets/css/css.php", dirname( __FILE__ ) ) );
|
122 |
+
wp_enqueue_style( 'newsletter-sign-up', $stylesheet_url );
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
/**
|
131 |
+
* Send the post data to the newsletter service, mimic form request
|
132 |
+
*/
|
133 |
+
function send_post_data( $email, $name = '', $type = 'checkbox' ) {
|
134 |
+
$opts = $this->options['mailinglist'];
|
135 |
+
|
|
|
136 |
// when not using api and no form action has been given, abandon.
|
137 |
+
if ( empty( $opts['use_api'] ) && empty( $opts['form_action'] ) ) return;
|
138 |
+
|
139 |
/* Are we using API? */
|
140 |
+
if ( $opts['use_api'] == 1 ) {
|
141 |
+
|
142 |
+
switch ( $opts['provider'] ) {
|
143 |
+
|
144 |
/* Send data using the YMLP API */
|
145 |
+
case 'ymlp':
|
146 |
+
$data = array(
|
147 |
+
'key' => $opts['ymlp_api_key'],
|
148 |
+
'username' => $opts['ymlp_username'],
|
149 |
+
'Email' => $email,
|
150 |
+
'GroupId' => $opts['ymlp_groupid'],
|
151 |
+
'output' => 'JSON'
|
152 |
+
);
|
153 |
|
154 |
+
$data = array_merge( $data, $this->add_additional_data( array( 'api' => 'ymlp' ) ) );
|
155 |
+
$data = http_build_query( $data );
|
156 |
+
$url = 'https://www.ymlp.com/api/Contacts.Add?'.$data;
|
157 |
|
158 |
+
$result = wp_remote_post( $url );
|
159 |
|
160 |
+
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
161 |
+
var_dump( $result ); die();
|
162 |
+
}
|
163 |
|
164 |
break;
|
165 |
+
|
166 |
/* Send data using the MailChimp API */
|
167 |
+
case 'mailchimp':
|
168 |
+
$request = array(
|
169 |
+
'apikey' => $opts['mc_api_key'],
|
170 |
+
'id' => $opts['mc_list_id'],
|
171 |
+
'email_address' => $email,
|
172 |
+
'double_optin' => ( isset( $opts['mc_no_double_optin'] ) && $opts['mc_no_double_optin'] == 1 ) ? FALSE : TRUE,
|
173 |
+
'merge_vars' => array(
|
174 |
+
'OPTIN_TIME' => date( 'Y-M-D H:i:s' )
|
175 |
+
)
|
176 |
+
);
|
177 |
+
|
178 |
+
if ( isset( $opts['mc_use_groupings'] ) && $opts['mc_use_groupings'] == 1 && !empty( $opts['mc_groupings_name'] ) ) {
|
179 |
+
$request['merge_vars']['GROUPINGS'] = array(
|
180 |
+
array( 'name' => $opts['mc_groupings_name'], 'groups' => $opts['mc_groupings_groups'] )
|
181 |
);
|
182 |
+
}
|
183 |
+
|
184 |
+
/* Subscribe with name? If so, add name to merge_vars array */
|
185 |
+
if ( isset( $opts['subscribe_with_name'] ) && $opts['subscribe_with_name'] == 1 ) {
|
186 |
+
// Try to provide values for First and Lastname fields
|
187 |
+
// These can be overridden, of just ignored by mailchimp.
|
188 |
+
$strpos = strpos( $name, ' ' );
|
189 |
+
|
190 |
+
$request['merge_vars']['FNAME'] = $name;
|
191 |
+
|
192 |
+
if ( $strpos ) {
|
193 |
+
$request['merge_vars']['FNAME'] = substr( $name, 0, $strpos );
|
194 |
+
$request['merge_vars']['LNAME'] = substr( $name, $strpos );
|
195 |
+
} else {
|
196 |
+
$request['merge_vars']['FNAME'] = $name;
|
197 |
+
$request['merge_vars']['LNAME'] = '...';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
}
|
199 |
|
200 |
+
$request['merge_vars'][$opts['name_id']] = $name;
|
201 |
+
}
|
202 |
+
|
203 |
+
// Add any set additional data to merge_vars array
|
204 |
+
$request['merge_vars'] = array_merge( $request['merge_vars'], $this->add_additional_data( array( 'email' => $email, 'name' => $name ) ) );
|
205 |
+
|
206 |
+
$result = wp_remote_post(
|
207 |
+
'http://'.substr( $opts['mc_api_key'], -3 ).'.api.mailchimp.com/1.3/?output=php&method=listSubscribe',
|
208 |
+
array( 'body' => json_encode( $request ) )
|
209 |
+
);
|
210 |
+
|
211 |
+
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
212 |
+
var_dump( $result ); die();
|
213 |
+
}
|
214 |
+
|
215 |
break;
|
216 |
+
|
217 |
}
|
218 |
+
|
219 |
} else {
|
220 |
+
/* We are not using API, mimic a normal form request */
|
221 |
+
|
222 |
$post_data = array(
|
223 |
$opts['email_id'] => $email,
|
224 |
);
|
225 |
+
|
226 |
// Subscribe with name? Add to $post_data array.
|
227 |
+
if ( $opts['subscribe_with_name'] == 1 ) $post_data[$opts['name_id']] = $name;
|
228 |
+
|
229 |
// Add list specific data
|
230 |
+
switch ( $opts['provider'] ) {
|
231 |
+
|
232 |
+
case 'aweber':
|
233 |
+
$post_data['listname'] = $opts['aweber_list_name'];
|
234 |
+
$post_data['redirect'] = get_bloginfo( 'wpurl' );
|
235 |
+
$post_data['meta_message'] = '1';
|
236 |
+
$post_data['meta_required'] = 'email';
|
237 |
break;
|
238 |
+
|
239 |
+
case 'phplist':
|
240 |
+
$post_data['list['.$opts['phplist_list_id'].']'] = 'signup';
|
241 |
+
$post_data['subscribe'] = "Subscribe";
|
242 |
+
$post_data["htmlemail"] = "1";
|
243 |
+
$post_data['emailconfirm'] = $email;
|
244 |
+
$post_data['makeconfirmed']='0';
|
245 |
break;
|
246 |
+
|
247 |
}
|
|
|
|
|
248 |
|
249 |
+
$post_data = array_merge( $post_data, $this->add_additional_data( array_merge( array( 'email' => $email, 'name' => $name ), $post_data ) ) );
|
250 |
+
|
251 |
+
$result = wp_remote_post( $opts['form_action'],
|
252 |
+
array( 'body' => $post_data )
|
253 |
+
);
|
254 |
+
|
255 |
+
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
256 |
+
var_dump( $result ); die();
|
257 |
+
}
|
258 |
|
|
|
|
|
|
|
|
|
259 |
}
|
260 |
+
|
261 |
// store a cookie, if preferred by site owner
|
262 |
+
if ( $type == 'checkbox' && $this->options['checkbox']['cookie_hide'] == 1 ) @setcookie( 'ns_subscriber', TRUE, time() + 9999999 );
|
263 |
+
|
264 |
+
// Check if we should redirect to a given page
|
265 |
+
if ( $type == 'form' && strlen( $this->options['form']['redirect_to'] ) > 6 ) {
|
266 |
+
wp_redirect( $this->options['form']['redirect_to'] );
|
267 |
+
exit;
|
268 |
+
} elseif ( $type == 'checkbox' && strlen( $this->options['checkbox']['redirect_to'] ) > 6 ) {
|
269 |
+
wp_redirect( $this->options['checkbox']['redirect_to'] );
|
270 |
+
exit;
|
271 |
+
}
|
272 |
+
|
273 |
+
return true;
|
274 |
}
|
275 |
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Returns array with additional data names as key, values as value.
|
279 |
+
*
|
280 |
+
* @param array $args, the normal form data (name, email, list variables)
|
281 |
+
*/
|
282 |
+
function add_additional_data( $args = array() ) {
|
283 |
+
$opts = $this->options['mailinglist'];
|
284 |
$defaults = array(
|
285 |
'format' => 'array',
|
286 |
'api' => NULL
|
287 |
);
|
288 |
+
|
289 |
$args = wp_parse_args( $args, $defaults );
|
290 |
+
|
291 |
$add_data = array();
|
292 |
+
if ( isset( $opts['extra_data'] ) && is_array( $opts['extra_data'] ) ) {
|
293 |
+
foreach ( $opts['extra_data'] as $key => $value ) {
|
294 |
+
if ( $args['api'] == 'ymlp' ) $value['name'] = str_replace( 'YMP', 'Field', $value['name'] );
|
295 |
+
$value['value'] = str_replace( "%%NAME%%", $args['name'], $value['value'] );
|
296 |
+
$value['value'] = str_replace( "%%IP%%", $_SERVER['REMOTE_ADDR'], $value['value'] );
|
297 |
$add_data[$value['name']] = $value['value'];
|
298 |
+
}
|
299 |
}
|
300 |
|
301 |
return $add_data;
|
302 |
}
|
303 |
+
|
304 |
+
}
|
includes/NSU_Checkbox.php
CHANGED
@@ -65,10 +65,10 @@ class NSU_Checkbox {
|
|
65 |
|
66 |
?>
|
67 |
<!-- Checkbox by Newsletter Sign-Up Checkbox v<?php echo NSU_VERSION_NUMBER; ?> - http://wordpress.org/plugins/newsletter-sign-up/ -->
|
68 |
-
<p id="
|
69 |
-
<
|
70 |
-
|
71 |
-
<?php _e($opts['text']); ?>
|
72 |
</label>
|
73 |
</p>
|
74 |
<!-- / Newsletter Sign-Up -->
|
@@ -84,7 +84,7 @@ class NSU_Checkbox {
|
|
84 |
function add_hidden_checkbox()
|
85 |
{
|
86 |
?>
|
87 |
-
<input type="hidden" name="newsletter-
|
88 |
<?php
|
89 |
}
|
90 |
|
@@ -93,7 +93,7 @@ class NSU_Checkbox {
|
|
93 |
*/
|
94 |
function add_checkbox_to_usermeta($meta)
|
95 |
{
|
96 |
-
$meta['newsletter-
|
97 |
return $meta;
|
98 |
}
|
99 |
|
@@ -105,7 +105,7 @@ class NSU_Checkbox {
|
|
105 |
* @param array $meta : the meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
106 |
*/
|
107 |
public function grab_email_from_ms_user_signup($user_id, $password = NULL,$meta = NULL){
|
108 |
-
if(!isset($meta['newsletter-
|
109 |
$user_info = get_userdata($user_id);
|
110 |
|
111 |
$email = $user_info->user_email;
|
@@ -125,7 +125,7 @@ class NSU_Checkbox {
|
|
125 |
*/
|
126 |
public function grab_email_from_ms_blog_signup($blog_id, $user_id, $a, $b ,$meta){
|
127 |
|
128 |
-
if(!isset($meta['newsletter-
|
129 |
$user_info = get_userdata($user_id);
|
130 |
|
131 |
$email = $user_info->user_email;
|
@@ -139,7 +139,7 @@ class NSU_Checkbox {
|
|
139 |
*/
|
140 |
function grab_email_from_wp_signup()
|
141 |
{
|
142 |
-
if($_POST['newsletter-
|
143 |
|
144 |
if(isset($_POST['user_email'])) {
|
145 |
|
@@ -165,7 +165,7 @@ class NSU_Checkbox {
|
|
165 |
*/
|
166 |
public function grab_email_from_comment($cid, $comment_approved = '')
|
167 |
{
|
168 |
-
if(!isset($_POST['newsletter-
|
169 |
if($comment_approved === 'spam') { return false; }
|
170 |
|
171 |
// get comment data
|
@@ -179,7 +179,7 @@ class NSU_Checkbox {
|
|
179 |
|
180 |
public function subscribe_from_bbpress($anonymous_data, $user_id)
|
181 |
{
|
182 |
-
if(!isset($_POST['newsletter-
|
183 |
|
184 |
if($anonymous_data) {
|
185 |
|
65 |
|
66 |
?>
|
67 |
<!-- Checkbox by Newsletter Sign-Up Checkbox v<?php echo NSU_VERSION_NUMBER; ?> - http://wordpress.org/plugins/newsletter-sign-up/ -->
|
68 |
+
<p id="nsu-checkbox">
|
69 |
+
<label for="nsu-checkbox-input" id="nsu-checkbox-label">
|
70 |
+
<input value="1" id="nsu-checkbox-input" type="checkbox" name="newsletter-sign-up-do" <?php checked($opts['precheck'], 1); ?> />
|
71 |
+
<?php _e($opts['text'], 'newsletter-sign-up'); ?>
|
72 |
</label>
|
73 |
</p>
|
74 |
<!-- / Newsletter Sign-Up -->
|
84 |
function add_hidden_checkbox()
|
85 |
{
|
86 |
?>
|
87 |
+
<input type="hidden" name="newsletter-sign-up-do" value="<?php echo (isset($_POST['newsletter-sign-up-do'])) ? 1 : 0; ?>" />
|
88 |
<?php
|
89 |
}
|
90 |
|
93 |
*/
|
94 |
function add_checkbox_to_usermeta($meta)
|
95 |
{
|
96 |
+
$meta['newsletter-sign-up-do'] = (isset($_POST['newsletter-sign-up-do'])) ? 1 : 0;
|
97 |
return $meta;
|
98 |
}
|
99 |
|
105 |
* @param array $meta : the meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
106 |
*/
|
107 |
public function grab_email_from_ms_user_signup($user_id, $password = NULL,$meta = NULL){
|
108 |
+
if(!isset($meta['newsletter-sign-up-do']) || $meta['newsletter-sign-up-do'] != 1) return;
|
109 |
$user_info = get_userdata($user_id);
|
110 |
|
111 |
$email = $user_info->user_email;
|
125 |
*/
|
126 |
public function grab_email_from_ms_blog_signup($blog_id, $user_id, $a, $b ,$meta){
|
127 |
|
128 |
+
if(!isset($meta['newsletter-sign-up-do']) || $meta['newsletter-sign-up-do'] != 1) return;
|
129 |
$user_info = get_userdata($user_id);
|
130 |
|
131 |
$email = $user_info->user_email;
|
139 |
*/
|
140 |
function grab_email_from_wp_signup()
|
141 |
{
|
142 |
+
if($_POST['newsletter-sign-up-do'] != 1) return;
|
143 |
|
144 |
if(isset($_POST['user_email'])) {
|
145 |
|
165 |
*/
|
166 |
public function grab_email_from_comment($cid, $comment_approved = '')
|
167 |
{
|
168 |
+
if(!isset($_POST['newsletter-sign-up-do']) || $_POST['newsletter-sign-up-do'] != 1) { return false; }
|
169 |
if($comment_approved === 'spam') { return false; }
|
170 |
|
171 |
// get comment data
|
179 |
|
180 |
public function subscribe_from_bbpress($anonymous_data, $user_id)
|
181 |
{
|
182 |
+
if(!isset($_POST['newsletter-sign-up-do']) || $_POST['newsletter-sign-up-do'] != 1) { return false; }
|
183 |
|
184 |
if($anonymous_data) {
|
185 |
|
includes/NSU_Form.php
CHANGED
@@ -15,6 +15,7 @@ class NSU_Form {
|
|
15 |
// register the shortcode which can be used to output sign-up form
|
16 |
add_shortcode('newsletter-sign-up-form', array($this,'form_shortcode'));
|
17 |
add_shortcode('nsu-form', array($this,'form_shortcode'));
|
|
|
18 |
|
19 |
if(isset($_POST['nsu_submit'])) {
|
20 |
add_action('init', array($this, 'submit'));
|
15 |
// register the shortcode which can be used to output sign-up form
|
16 |
add_shortcode('newsletter-sign-up-form', array($this,'form_shortcode'));
|
17 |
add_shortcode('nsu-form', array($this,'form_shortcode'));
|
18 |
+
add_shortcode('nsu_form', array($this,'form_shortcode'));
|
19 |
|
20 |
if(isset($_POST['nsu_submit'])) {
|
21 |
add_action('init', array($this, 'submit'));
|
includes/NewsletterSignUpWidget.php
CHANGED
@@ -5,9 +5,9 @@ if(!class_exists('NewsletterSignUpWidget')) {
|
|
5 |
class NewsletterSignUpWidget extends WP_Widget {
|
6 |
|
7 |
function __construct() {
|
8 |
-
$widget_ops = array('classname' => 'nsu_widget', 'description' => __('
|
9 |
$control_ops = array('width' => 400, 'height' => 350);
|
10 |
-
parent::__construct(false, 'Newsletter Sign-Up
|
11 |
}
|
12 |
|
13 |
function widget($args, $instance) {
|
@@ -66,8 +66,7 @@ if(!class_exists('NewsletterSignUpWidget')) {
|
|
66 |
extract($instance);
|
67 |
$title = strip_tags($title);
|
68 |
|
69 |
-
?>
|
70 |
-
|
71 |
|
72 |
<p>
|
73 |
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
|
@@ -83,10 +82,10 @@ if(!class_exists('NewsletterSignUpWidget')) {
|
|
83 |
<p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p>
|
84 |
|
85 |
<p>
|
86 |
-
|
87 |
</p>
|
88 |
|
89 |
-
<p style="
|
90 |
<?php
|
91 |
}
|
92 |
|
5 |
class NewsletterSignUpWidget extends WP_Widget {
|
6 |
|
7 |
function __construct() {
|
8 |
+
$widget_ops = array('classname' => 'nsu_widget', 'description' => __('Displays a newsletter sign-up form.'));
|
9 |
$control_ops = array('width' => 400, 'height' => 350);
|
10 |
+
parent::__construct(false, 'Newsletter Sign-Up', $widget_ops, $control_ops);
|
11 |
}
|
12 |
|
13 |
function widget($args, $instance) {
|
66 |
extract($instance);
|
67 |
$title = strip_tags($title);
|
68 |
|
69 |
+
?>
|
|
|
70 |
|
71 |
<p>
|
72 |
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
|
82 |
<p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p>
|
83 |
|
84 |
<p>
|
85 |
+
Configure the sign-up form at the <a href="admin.php?page=newsletter-sign-up-form-settings">Newsletter Sign-Up configuration page</a>.
|
86 |
</p>
|
87 |
|
88 |
+
<p style="background:#222; color:#eee; padding:10px;">If you like this plugin, consider <a href="http://dannyvankooten.com/donate/">donating $10, $20 or $50</a> as a token of your appreciation.</p>
|
89 |
<?php
|
90 |
}
|
91 |
|
includes/views/form_settings.php
CHANGED
@@ -7,14 +7,14 @@
|
|
7 |
<h2>Newsletter Sign-Up :: Form Settings</h2>
|
8 |
<?php settings_errors(); ?>
|
9 |
|
10 |
-
<p>Customize your newsletter sign-up form by customizing the labels, input fields, buttons and validation texts using the settings below. </p>
|
11 |
|
12 |
<form method="post" action="options.php">
|
13 |
<?php settings_fields('nsu_form_group'); ?>
|
14 |
<table class="form-table">
|
15 |
<tr valign="top">
|
16 |
<th scope="row">E-mail label</th>
|
17 |
-
<td colspan="2"><input class="widefat" type="text" name="nsu_form[email_label]" value="<?php echo esc_attr($opts['email_label']); ?>" /></td>
|
18 |
</tr>
|
19 |
<tr valign="top">
|
20 |
<th scope="row">E-mail default value</th>
|
@@ -35,7 +35,7 @@
|
|
35 |
</tr>
|
36 |
<tr valign="top">
|
37 |
<th scope="row">Submit button text</th>
|
38 |
-
<td colspan="2"><input class="widefat" type="text" name="nsu_form[submit_button]" value="<?php echo esc_attr($opts['submit_button']); ?>" /></td>
|
39 |
</tr>
|
40 |
<tr valign="top">
|
41 |
<th scope="row">Text to replace the form with after a successful sign-up</th>
|
@@ -66,25 +66,25 @@
|
|
66 |
|
67 |
<?php submit_button(); ?>
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
</form>
|
89 |
</div>
|
90 |
|
7 |
<h2>Newsletter Sign-Up :: Form Settings</h2>
|
8 |
<?php settings_errors(); ?>
|
9 |
|
10 |
+
<p>Customize your newsletter sign-up form by customizing the labels, input fields, buttons and validation texts using the settings below. Use <code>[nsu_form]</code> to render a sign-up form in your posts or pages or use the <em>Newsletter Sign-Up</em> widget to display a sign-up form in your widget areas.</p>
|
11 |
|
12 |
<form method="post" action="options.php">
|
13 |
<?php settings_fields('nsu_form_group'); ?>
|
14 |
<table class="form-table">
|
15 |
<tr valign="top">
|
16 |
<th scope="row">E-mail label</th>
|
17 |
+
<td colspan="2"><input class="widefat" type="text" name="nsu_form[email_label]" value="<?php echo esc_attr($opts['email_label']); ?>" placeholder="Eg: Your email:" required /></td>
|
18 |
</tr>
|
19 |
<tr valign="top">
|
20 |
<th scope="row">E-mail default value</th>
|
35 |
</tr>
|
36 |
<tr valign="top">
|
37 |
<th scope="row">Submit button text</th>
|
38 |
+
<td colspan="2"><input class="widefat" type="text" name="nsu_form[submit_button]" value="<?php echo esc_attr($opts['submit_button']); ?>" placeholder="Eg: Subscribe" required /></td>
|
39 |
</tr>
|
40 |
<tr valign="top">
|
41 |
<th scope="row">Text to replace the form with after a successful sign-up</th>
|
66 |
|
67 |
<?php submit_button(); ?>
|
68 |
|
69 |
+
<?php if($this->options['mailinglist']['use_api'] == 1) { ?>
|
70 |
+
<h3>Form text messages</h3>
|
71 |
+
<table class="form-table">
|
72 |
+
<?php if($opts['mailinglist']['subscribe_with_name']) { ?>
|
73 |
+
<tr valign="top">
|
74 |
+
<th scope="row">Empty name field message</th>
|
75 |
+
<td colspan="2"><input class="widefat" type="text" name="nsu_form[text_empty_name]" value="<?php echo esc_attr($opts['text_empty_name']); ?>" /></td>
|
76 |
+
</tr>
|
77 |
+
<?php } ?>
|
78 |
+
<tr valign="top">
|
79 |
+
<th scope="row">Empty email address field message</th>
|
80 |
+
<td colspan="2"><input class="widefat" type="text" name="nsu_form[text_empty_email]" value="<?php echo esc_attr($opts['text_empty_email']); ?>" /></td>
|
81 |
+
</tr>
|
82 |
+
<tr valign="top">
|
83 |
+
<th scope="row">Invalid email address message</th>
|
84 |
+
<td colspan="2"><input class="widefat" type="text" name="nsu_form[text_invalid_email]" value="<?php echo esc_attr($opts['text_invalid_email']); ?>" /></td>
|
85 |
+
</tr>
|
86 |
+
</table>
|
87 |
+
<?php } ?>
|
88 |
</form>
|
89 |
</div>
|
90 |
|
newsletter-sign-up.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
Plugin URI: http://DannyvanKooten.com/wordpress-plugins/newsletter-sign-up/
|
5 |
Description: Adds various ways for your visitors to sign-up to your mailinglist (checkbox, widget, form)
|
6 |
-
Version: 2.0.
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: http://dannyvankooten.com
|
9 |
License: GPL2
|
@@ -25,7 +25,7 @@ License: GPL2
|
|
25 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
*/
|
27 |
|
28 |
-
define('NSU_VERSION_NUMBER', "2.0.
|
29 |
define("NSU_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
30 |
|
31 |
require_once NSU_PLUGIN_DIR . 'includes/NSU.php';
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
Plugin URI: http://DannyvanKooten.com/wordpress-plugins/newsletter-sign-up/
|
5 |
Description: Adds various ways for your visitors to sign-up to your mailinglist (checkbox, widget, form)
|
6 |
+
Version: 2.0.3
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: http://dannyvankooten.com
|
9 |
License: GPL2
|
25 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
26 |
*/
|
27 |
|
28 |
+
define('NSU_VERSION_NUMBER', "2.0.3");
|
29 |
define("NSU_PLUGIN_DIR", plugin_dir_path(__FILE__));
|
30 |
|
31 |
require_once NSU_PLUGIN_DIR . 'includes/NSU.php';
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://dannyvankooten.com/donate/
|
|
4 |
Tags: newsletter,sign-up,mailchimp,aweber,newsletter signup,checkbox,ymlp,email,phplist,icontact,mailinglist,checkbox,form widget,widget,newsletter widget,subscribe widget,form shortcode,mailchimp api
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 3.6.1
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPL2
|
9 |
|
10 |
Ultimate newsletter plugin. Works with 3rd-party newsletter services like Aweber and YMLP. includes sign-up checkboxes, widget forms and form shortcodes.
|
@@ -23,7 +23,7 @@ This plugin works with *almost all* third-party email marketing services includi
|
|
23 |
|
24 |
* Add a "sign-up to our newsletter" checkbox to your comment form or registration form
|
25 |
* Easy customizable Newsletter Sign-Up Form Widget
|
26 |
-
* Embed a sign-up form in your posts with a simple shortcode `[
|
27 |
* Embed a sign-up form in your template files by calling `nsu_form();`
|
28 |
* Use the MailChimp or YMLP API or any other third-party newsletter service.
|
29 |
* Works with most major mailinglist services like Aweber, Constant Contact, iContact, etc.
|
@@ -31,7 +31,7 @@ This plugin works with *almost all* third-party email marketing services includi
|
|
31 |
|
32 |
**More information**
|
33 |
|
34 |
-
* [MailChimp for WordPress plugin](http://wordpress.org/plugins/mailchimp-for-wp/)
|
35 |
* [Newsletter Sign-Up for WordPress](http://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/)
|
36 |
* Check out more [WordPress plugins](http://dannyvankooten.com/wordpress-plugins/) by Danny van Kooten
|
37 |
* You should follow [@DannyvanKooten](http://twitter.com/DannyvanKooten) on Twitter
|
@@ -42,7 +42,7 @@ Most of your commenters will be interested in your newsletter as well. This plug
|
|
42 |
You can also add the sign-up checkbox to your WP registration form, your BuddyPress registration form, your MultiSite sign-up forms or your bbPress new topic and new reply forms.
|
43 |
|
44 |
= Sign-up forms =
|
45 |
-
Easily configure a sign-up form and show it in various places on your website using the sign-up form widget, the `[
|
46 |
|
47 |
You can set your own messages and even choose to redirect the visitor to a certain page after signing-up.
|
48 |
|
@@ -61,7 +61,7 @@ This plugin adds various sign-up methods to your WordPress website, like a sign-
|
|
61 |
|
62 |
= What is the shortcode to display a sign-up form in my posts or pages? =
|
63 |
|
64 |
-
`[
|
65 |
|
66 |
= Where can I get the form action of my sign-up form? =
|
67 |
|
@@ -91,6 +91,13 @@ For more questions and answers go have a look at the [Newsletter Sign-Up](http:/
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 2.0.2 =
|
95 |
* Improved: UI improvement, added some HTML5 to settings pages
|
96 |
* Improved: Code improvement
|
@@ -212,7 +219,7 @@ to easily edit the widget's text. :)
|
|
212 |
= 1.4 =
|
213 |
* Improvement: Hide metaboxes in the NSU configuration screen
|
214 |
* Improvement: Edit all widget labels in NSU configuration screen instead of widget options. (You might have to reconfigure some of your settings, sorry!)
|
215 |
-
* Added: Ability to add a sign-up form to your posts or pages using the shortcode `[
|
216 |
* Some more restructuring of the code.
|
217 |
|
218 |
= 1.3.3 =
|
4 |
Tags: newsletter,sign-up,mailchimp,aweber,newsletter signup,checkbox,ymlp,email,phplist,icontact,mailinglist,checkbox,form widget,widget,newsletter widget,subscribe widget,form shortcode,mailchimp api
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 3.6.1
|
7 |
+
Stable tag: 2.0.3
|
8 |
License: GPL2
|
9 |
|
10 |
Ultimate newsletter plugin. Works with 3rd-party newsletter services like Aweber and YMLP. includes sign-up checkboxes, widget forms and form shortcodes.
|
23 |
|
24 |
* Add a "sign-up to our newsletter" checkbox to your comment form or registration form
|
25 |
* Easy customizable Newsletter Sign-Up Form Widget
|
26 |
+
* Embed a sign-up form in your posts with a simple shortcode `[nsu_form]`.
|
27 |
* Embed a sign-up form in your template files by calling `nsu_form();`
|
28 |
* Use the MailChimp or YMLP API or any other third-party newsletter service.
|
29 |
* Works with most major mailinglist services like Aweber, Constant Contact, iContact, etc.
|
31 |
|
32 |
**More information**
|
33 |
|
34 |
+
* [MailChimp for WordPress plugin](http://wordpress.org/plugins/mailchimp-for-wp/)
|
35 |
* [Newsletter Sign-Up for WordPress](http://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/)
|
36 |
* Check out more [WordPress plugins](http://dannyvankooten.com/wordpress-plugins/) by Danny van Kooten
|
37 |
* You should follow [@DannyvanKooten](http://twitter.com/DannyvanKooten) on Twitter
|
42 |
You can also add the sign-up checkbox to your WP registration form, your BuddyPress registration form, your MultiSite sign-up forms or your bbPress new topic and new reply forms.
|
43 |
|
44 |
= Sign-up forms =
|
45 |
+
Easily configure a sign-up form and show it in various places on your website using the sign-up form widget, the `[nsu_form]` shortcode or the `nsu_form()` template function.
|
46 |
|
47 |
You can set your own messages and even choose to redirect the visitor to a certain page after signing-up.
|
48 |
|
61 |
|
62 |
= What is the shortcode to display a sign-up form in my posts or pages? =
|
63 |
|
64 |
+
`[nsu_form]`
|
65 |
|
66 |
= Where can I get the form action of my sign-up form? =
|
67 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 2.0.3 =
|
95 |
+
* Fixed broken link to settings pages after widget form
|
96 |
+
* Improved: better stylesheet loading, encouraged browser caching
|
97 |
+
* Improved: Some UI improvements
|
98 |
+
* Improved: better default checkbox CSS
|
99 |
+
* Improved: better default form CSS
|
100 |
+
|
101 |
= 2.0.2 =
|
102 |
* Improved: UI improvement, added some HTML5 to settings pages
|
103 |
* Improved: Code improvement
|
219 |
= 1.4 =
|
220 |
* Improvement: Hide metaboxes in the NSU configuration screen
|
221 |
* Improvement: Edit all widget labels in NSU configuration screen instead of widget options. (You might have to reconfigure some of your settings, sorry!)
|
222 |
+
* Added: Ability to add a sign-up form to your posts or pages using the shortcode `[nsu_form]`
|
223 |
* Some more restructuring of the code.
|
224 |
|
225 |
= 1.3.3 =
|