Version Description
- June 20, 2016 =
Minor maintenance round. Removed obsolete HTML5 option, as 99.9% of browsers support this now.
Download this release
Release Info
Developer | DvanKooten |
Plugin | Newsletter Sign-Up |
Version | 2.0.6 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.6
- includes/NSU.php +10 -23
- includes/NSU_Admin.php +5 -5
- includes/NSU_Checkbox.php +9 -4
- includes/NSU_Form.php +8 -26
- includes/functions.php +2 -2
- includes/views/checkbox_settings.php +2 -2
- includes/views/config_helper.php +2 -2
- includes/views/dashboard.php +2 -2
- includes/views/form_settings.php +2 -7
- includes/views/parts/rows-mailchimp.php +2 -3
- includes/views/parts/sidebar.php +6 -19
- newsletter-sign-up.php +6 -6
- readme.txt +9 -7
includes/NSU.php
CHANGED
@@ -24,13 +24,13 @@ class NSU {
|
|
24 |
if ( is_admin() ) {
|
25 |
|
26 |
// backend only
|
27 |
-
require_once NSU_PLUGIN_DIR . 'includes/NSU_Admin.php';
|
28 |
new NSU_Admin();
|
29 |
|
30 |
} else {
|
31 |
|
32 |
// frontend only
|
33 |
-
require_once NSU_PLUGIN_DIR . 'includes/functions.php';
|
34 |
|
35 |
add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
36 |
add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
@@ -41,7 +41,7 @@ class NSU {
|
|
41 |
|
42 |
public static function checkbox() {
|
43 |
if ( !self::$checkbox ) {
|
44 |
-
require_once NSU_PLUGIN_DIR .'includes/NSU_Checkbox.php';
|
45 |
self::$checkbox = new NSU_Checkbox;
|
46 |
}
|
47 |
|
@@ -50,7 +50,7 @@ class NSU {
|
|
50 |
|
51 |
public static function form() {
|
52 |
if ( !self::$form ) {
|
53 |
-
require_once NSU_PLUGIN_DIR . 'includes/NSU_Form.php';
|
54 |
self::$form = new NSU_Form;
|
55 |
}
|
56 |
|
@@ -68,7 +68,7 @@ class NSU {
|
|
68 |
$keys = array( 'form', 'mailinglist', 'checkbox' );
|
69 |
|
70 |
$defaults = array(
|
71 |
-
'form' => array( 'load_form_css' => 0, '
|
72 |
'name_label' => 'Name:', 'email_label' => "Email:", 'email_default_value' => 'Your emailaddress..', 'name_required' => 0, 'name_default_value' => 'Your name..', 'wpautop' => 0,
|
73 |
'text_after_signup' => 'Thanks for signing up to our newsletter. Please check your inbox to confirm your email address.', 'redirect_to' => '',
|
74 |
'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.'
|
@@ -95,18 +95,16 @@ class NSU {
|
|
95 |
|
96 |
/**
|
97 |
* Registers the Newsletter Sign-Up Widget
|
98 |
-
*
|
99 |
-
* @return type
|
100 |
*/
|
101 |
public function register_widget() {
|
102 |
-
require_once NSU_PLUGIN_DIR . 'includes/NewsletterSignUpWidget.php';
|
103 |
-
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
* Factory method for NewsletterSignUp class. Only instantiate once.
|
108 |
*
|
109 |
-
* @return
|
110 |
*/
|
111 |
public static function instance() {
|
112 |
if ( !self::$instance ) self::$instance = new NSU();
|
@@ -161,10 +159,6 @@ class NSU {
|
|
161 |
|
162 |
$result = wp_remote_post( $url );
|
163 |
|
164 |
-
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
165 |
-
var_dump( $result ); die();
|
166 |
-
}
|
167 |
-
|
168 |
break;
|
169 |
|
170 |
/* Send data using the MailChimp API */
|
@@ -211,11 +205,7 @@ class NSU {
|
|
211 |
'https://'.substr( $opts['mc_api_key'], -3 ).'.api.mailchimp.com/1.3/?output=php&method=listSubscribe',
|
212 |
array( 'body' => json_encode( $request ) )
|
213 |
);
|
214 |
-
|
215 |
-
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
216 |
-
var_dump( $result ); die();
|
217 |
-
}
|
218 |
-
|
219 |
break;
|
220 |
|
221 |
}
|
@@ -256,10 +246,6 @@ class NSU {
|
|
256 |
array( 'body' => $post_data )
|
257 |
);
|
258 |
|
259 |
-
if ( isset( $_POST['_nsu_debug'] ) || isset( $_GET['_nsu_debug'] ) ) {
|
260 |
-
var_dump( $result ); die();
|
261 |
-
}
|
262 |
-
|
263 |
}
|
264 |
|
265 |
// store a cookie, if preferred by site owner
|
@@ -282,6 +268,7 @@ class NSU {
|
|
282 |
* Returns array with additional data names as key, values as value.
|
283 |
*
|
284 |
* @param array $args, the normal form data (name, email, list variables)
|
|
|
285 |
*/
|
286 |
function add_additional_data( $args = array() ) {
|
287 |
$opts = $this->options['mailinglist'];
|
24 |
if ( is_admin() ) {
|
25 |
|
26 |
// backend only
|
27 |
+
require_once NSU_PLUGIN_DIR . '/includes/NSU_Admin.php';
|
28 |
new NSU_Admin();
|
29 |
|
30 |
} else {
|
31 |
|
32 |
// frontend only
|
33 |
+
require_once NSU_PLUGIN_DIR . '/includes/functions.php';
|
34 |
|
35 |
add_action( 'wp_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
36 |
add_action( 'login_enqueue_scripts', array( $this, 'load_stylesheets' ) );
|
41 |
|
42 |
public static function checkbox() {
|
43 |
if ( !self::$checkbox ) {
|
44 |
+
require_once NSU_PLUGIN_DIR .'/includes/NSU_Checkbox.php';
|
45 |
self::$checkbox = new NSU_Checkbox;
|
46 |
}
|
47 |
|
50 |
|
51 |
public static function form() {
|
52 |
if ( !self::$form ) {
|
53 |
+
require_once NSU_PLUGIN_DIR . '/includes/NSU_Form.php';
|
54 |
self::$form = new NSU_Form;
|
55 |
}
|
56 |
|
68 |
$keys = array( 'form', 'mailinglist', 'checkbox' );
|
69 |
|
70 |
$defaults = array(
|
71 |
+
'form' => array( 'load_form_css' => 0, 'submit_button' => 'Sign up',
|
72 |
'name_label' => 'Name:', 'email_label' => "Email:", 'email_default_value' => 'Your emailaddress..', 'name_required' => 0, 'name_default_value' => 'Your name..', 'wpautop' => 0,
|
73 |
'text_after_signup' => 'Thanks for signing up to our newsletter. Please check your inbox to confirm your email address.', 'redirect_to' => '',
|
74 |
'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.'
|
95 |
|
96 |
/**
|
97 |
* Registers the Newsletter Sign-Up Widget
|
|
|
|
|
98 |
*/
|
99 |
public function register_widget() {
|
100 |
+
require_once NSU_PLUGIN_DIR . '/includes/NewsletterSignUpWidget.php';
|
101 |
+
register_widget( 'NewsletterSignUpWidget' );
|
102 |
}
|
103 |
|
104 |
/**
|
105 |
* Factory method for NewsletterSignUp class. Only instantiate once.
|
106 |
*
|
107 |
+
* @return NSU Instance of Newsletter Sign-Up class
|
108 |
*/
|
109 |
public static function instance() {
|
110 |
if ( !self::$instance ) self::$instance = new NSU();
|
159 |
|
160 |
$result = wp_remote_post( $url );
|
161 |
|
|
|
|
|
|
|
|
|
162 |
break;
|
163 |
|
164 |
/* Send data using the MailChimp API */
|
205 |
'https://'.substr( $opts['mc_api_key'], -3 ).'.api.mailchimp.com/1.3/?output=php&method=listSubscribe',
|
206 |
array( 'body' => json_encode( $request ) )
|
207 |
);
|
208 |
+
|
|
|
|
|
|
|
|
|
209 |
break;
|
210 |
|
211 |
}
|
246 |
array( 'body' => $post_data )
|
247 |
);
|
248 |
|
|
|
|
|
|
|
|
|
249 |
}
|
250 |
|
251 |
// store a cookie, if preferred by site owner
|
268 |
* Returns array with additional data names as key, values as value.
|
269 |
*
|
270 |
* @param array $args, the normal form data (name, email, list variables)
|
271 |
+
* @return array
|
272 |
*/
|
273 |
function add_additional_data( $args = array() ) {
|
274 |
$opts = $this->options['mailinglist'];
|
includes/NSU_Admin.php
CHANGED
@@ -47,7 +47,7 @@ if (!class_exists('NSU_Admin')) {
|
|
47 |
{
|
48 |
?>
|
49 |
<div class="updated">
|
50 |
-
<p><strong>Newsletter Sign-Up Notice:</strong> You are using MailChimp, great!
|
51 |
It can be downloaded from the WordPress repository <a href="https://wordpress.org/plugins/mailchimp-for-wp/">here</a>. | <a href="?nsu-hide-mc4wp-notice=1">Hide Notice</a></p>
|
52 |
</div>
|
53 |
<?php
|
@@ -116,7 +116,7 @@ if (!class_exists('NSU_Admin')) {
|
|
116 |
}
|
117 |
}
|
118 |
|
119 |
-
require_once NSU_PLUGIN_DIR . 'includes/views/dashboard.php';
|
120 |
}
|
121 |
|
122 |
/**
|
@@ -125,7 +125,7 @@ if (!class_exists('NSU_Admin')) {
|
|
125 |
public function options_page_checkbox_settings() {
|
126 |
$tab = 'checkbox-settings';
|
127 |
$opts = $this->options['checkbox'];
|
128 |
-
require_once NSU_PLUGIN_DIR . 'includes/views/checkbox_settings.php';
|
129 |
}
|
130 |
|
131 |
/**
|
@@ -135,7 +135,7 @@ if (!class_exists('NSU_Admin')) {
|
|
135 |
$tab = 'form-settings';
|
136 |
$opts = $this->options['form'];
|
137 |
$opts['mailinglist'] = $this->options['mailinglist'];
|
138 |
-
require_once NSU_PLUGIN_DIR . 'includes/views/form_settings.php';
|
139 |
}
|
140 |
|
141 |
/**
|
@@ -282,6 +282,7 @@ if (!class_exists('NSU_Admin')) {
|
|
282 |
/**
|
283 |
* Validate the submitted options
|
284 |
* @param array $options The submitted options
|
|
|
285 |
*/
|
286 |
public function validate_options($options) {
|
287 |
return $options;
|
@@ -298,7 +299,6 @@ if (!class_exists('NSU_Admin')) {
|
|
298 |
|
299 |
$options['name_required'] = (isset($options['name_required'])) ? 1 : 0;
|
300 |
$options['wpautop'] = (isset($options['wpautop'])) ? 1 : 0;
|
301 |
-
$options['use_html5'] = (isset($options['use_html5'])) ? 1 : 0;
|
302 |
$options['load_form_css'] = (isset($options['load_form_css'])) ? 1 : 0;
|
303 |
|
304 |
return $options;
|
47 |
{
|
48 |
?>
|
49 |
<div class="updated">
|
50 |
+
<p><strong>Newsletter Sign-Up Notice:</strong> You are using MailChimp, great! Please consider switching to our improved <a href="https://mc4wp.com/">MailChimp for WordPress</a> plugin.
|
51 |
It can be downloaded from the WordPress repository <a href="https://wordpress.org/plugins/mailchimp-for-wp/">here</a>. | <a href="?nsu-hide-mc4wp-notice=1">Hide Notice</a></p>
|
52 |
</div>
|
53 |
<?php
|
116 |
}
|
117 |
}
|
118 |
|
119 |
+
require_once NSU_PLUGIN_DIR . '/includes/views/dashboard.php';
|
120 |
}
|
121 |
|
122 |
/**
|
125 |
public function options_page_checkbox_settings() {
|
126 |
$tab = 'checkbox-settings';
|
127 |
$opts = $this->options['checkbox'];
|
128 |
+
require_once NSU_PLUGIN_DIR . '/includes/views/checkbox_settings.php';
|
129 |
}
|
130 |
|
131 |
/**
|
135 |
$tab = 'form-settings';
|
136 |
$opts = $this->options['form'];
|
137 |
$opts['mailinglist'] = $this->options['mailinglist'];
|
138 |
+
require_once NSU_PLUGIN_DIR . '/includes/views/form_settings.php';
|
139 |
}
|
140 |
|
141 |
/**
|
282 |
/**
|
283 |
* Validate the submitted options
|
284 |
* @param array $options The submitted options
|
285 |
+
* @return array
|
286 |
*/
|
287 |
public function validate_options($options) {
|
288 |
return $options;
|
299 |
|
300 |
$options['name_required'] = (isset($options['name_required'])) ? 1 : 0;
|
301 |
$options['wpautop'] = (isset($options['wpautop'])) ? 1 : 0;
|
|
|
302 |
$options['load_form_css'] = (isset($options['load_form_css'])) ? 1 : 0;
|
303 |
|
304 |
return $options;
|
includes/NSU_Checkbox.php
CHANGED
@@ -7,6 +7,9 @@ class NSU_Checkbox {
|
|
7 |
*/
|
8 |
private $showed_checkbox = false;
|
9 |
|
|
|
|
|
|
|
10 |
public function __construct() {
|
11 |
|
12 |
$options = NSU::instance()->get_options();
|
@@ -132,8 +135,8 @@ class NSU_Checkbox {
|
|
132 |
*
|
133 |
* @param int $blog_id The id of the new blow
|
134 |
* @param int $user_id The ID of the new user
|
135 |
-
* @param
|
136 |
-
* @param
|
137 |
* @param array $meta The meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
138 |
*/
|
139 |
public function grab_email_from_ms_blog_signup( $blog_id, $user_id, $a, $b, $meta ) {
|
@@ -183,8 +186,10 @@ class NSU_Checkbox {
|
|
183 |
/**
|
184 |
* Grab the emailadress and name from comment and then send it to mailinglist.
|
185 |
*
|
186 |
-
* @param int $cid
|
187 |
-
* @param
|
|
|
|
|
188 |
*/
|
189 |
public function grab_email_from_comment( $cid, $comment_approved = '' ) {
|
190 |
|
7 |
*/
|
8 |
private $showed_checkbox = false;
|
9 |
|
10 |
+
/** @var array */
|
11 |
+
private $options;
|
12 |
+
|
13 |
public function __construct() {
|
14 |
|
15 |
$options = NSU::instance()->get_options();
|
135 |
*
|
136 |
* @param int $blog_id The id of the new blow
|
137 |
* @param int $user_id The ID of the new user
|
138 |
+
* @param mixed $a No idea, seriously.
|
139 |
+
* @param mixed $b No idea, seriously.
|
140 |
* @param array $meta The meta values that belong to this user, holds the value of our 'newsletter-sign-up' checkbox.
|
141 |
*/
|
142 |
public function grab_email_from_ms_blog_signup( $blog_id, $user_id, $a, $b, $meta ) {
|
186 |
/**
|
187 |
* Grab the emailadress and name from comment and then send it to mailinglist.
|
188 |
*
|
189 |
+
* @param int $cid the ID of the comment
|
190 |
+
* @param string $comment_approved the comment object, optionally
|
191 |
+
*
|
192 |
+
* @return bool
|
193 |
*/
|
194 |
public function grab_email_from_comment( $cid, $comment_approved = '' ) {
|
195 |
|
includes/NSU_Form.php
CHANGED
@@ -121,50 +121,35 @@ class NSU_Form {
|
|
121 |
}
|
122 |
|
123 |
$ed['value'] = str_replace( "%%IP%%", $_SERVER['REMOTE_ADDR'], $ed['value'] );
|
124 |
-
$additional_fields .=
|
125 |
}
|
126 |
}
|
127 |
|
128 |
$email_label = __( $opts['form']['email_label'], 'nsu' );
|
129 |
$name_label = __( $opts['form']['name_label'], 'nsu' );
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
$name_atts = 'placeholder="' . esc_attr( $opts['form']['name_default_value'] ) . '" ';
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
}
|
139 |
-
|
140 |
-
} else {
|
141 |
-
$email_type = 'text';
|
142 |
-
$email_value = $opts['form']['email_default_value'];
|
143 |
-
$email_atts = 'value="' . esc_attr( $email_value ) . '"';
|
144 |
-
$name_value = $opts['form']['name_default_value'];
|
145 |
-
$name_atts = 'value="' . esc_attr( $name_value ) . '"';
|
146 |
}
|
147 |
|
148 |
$submit_button = $opts['form']['submit_button'];
|
149 |
|
150 |
$text_after_signup = $opts['form']['text_after_signup'];
|
151 |
$text_after_signup = ( $opts['form']['wpautop'] == 1 ) ? wpautop( wptexturize( $text_after_signup ) ) : $text_after_signup;
|
152 |
-
|
153 |
-
|
154 |
// check if form was not submitted or contains error
|
155 |
if ( ! isset( $_POST['nsu_submit'] ) || count( $errors ) > 0 ) {
|
156 |
|
157 |
-
|
158 |
$output .= '<form class="nsu-form" id="nsu-form-' . esc_attr( $formno ) .'" action="' . esc_attr( $form_action ) . '" method="post">';
|
159 |
|
160 |
if ( $opts['mailinglist']['subscribe_with_name'] == 1 ) {
|
161 |
$output .= '<p><label for="nsu-name-'. esc_attr( $formno ) . '">'. esc_html( $name_label ) . '</label>';
|
162 |
$output .= '<input class="nsu-field" id="nsu-name-"' . $formno .'" type="text" name="'. esc_attr( $name_id ) .'" ' . $name_atts;
|
163 |
|
164 |
-
if ( ! $opts['form']['use_html5'] ) {
|
165 |
-
$output .= "onblur=\"if(!this.value) this.value = '$name_value';\" onfocus=\"if(this.value == '$name_value') this.value=''\" ";
|
166 |
-
}
|
167 |
-
|
168 |
$output .= "/>";
|
169 |
|
170 |
if ( isset( $errors['name-field'] ) ) {
|
@@ -174,9 +159,6 @@ class NSU_Form {
|
|
174 |
}
|
175 |
|
176 |
$output .= "<p><label for=\"nsu-email-$formno\">$email_label</label><input class=\"nsu-field\" id=\"nsu-email-$formno\" type=\"$email_type\" name=\"$email_id\" $email_atts ";
|
177 |
-
if ( ! $opts['form']['use_html5'] ) {
|
178 |
-
$output .= "onblur=\"if(!this.value) this.value = '$email_value';\" onfocus=\"if(this.value == '$email_value') this.value = ''\" ";
|
179 |
-
}
|
180 |
$output .= "/>";
|
181 |
if ( isset( $errors['email-field'] ) ) {
|
182 |
$output .= '<span class="nsu-error error notice">' . $errors['email-field'] . '</span>';
|
@@ -184,7 +166,7 @@ class NSU_Form {
|
|
184 |
$output .= "</p>";
|
185 |
$output .= $additional_fields;
|
186 |
$output .= '<textarea name="nsu_robocop" style="display: none;"></textarea>';
|
187 |
-
$output .=
|
188 |
$output .= "</form>";
|
189 |
|
190 |
} else { // form has been submitted
|
121 |
}
|
122 |
|
123 |
$ed['value'] = str_replace( "%%IP%%", $_SERVER['REMOTE_ADDR'], $ed['value'] );
|
124 |
+
$additional_fields .= sprintf( '<input type="hidden" name="%s" value="%s" />', esc_attr( $ed['name'] ), esc_attr( $ed['value'] ) );
|
125 |
}
|
126 |
}
|
127 |
|
128 |
$email_label = __( $opts['form']['email_label'], 'nsu' );
|
129 |
$name_label = __( $opts['form']['name_label'], 'nsu' );
|
130 |
|
131 |
+
$email_type = 'email';
|
132 |
+
$email_atts = 'placeholder="' . esc_attr( $opts['form']['email_default_value'] ) . '" required';
|
133 |
+
$name_atts = 'placeholder="' . esc_attr( $opts['form']['name_default_value'] ) . '" ';
|
|
|
134 |
|
135 |
+
if ( $opts['form']['name_required'] ) {
|
136 |
+
$name_atts .= 'required ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
|
139 |
$submit_button = $opts['form']['submit_button'];
|
140 |
|
141 |
$text_after_signup = $opts['form']['text_after_signup'];
|
142 |
$text_after_signup = ( $opts['form']['wpautop'] == 1 ) ? wpautop( wptexturize( $text_after_signup ) ) : $text_after_signup;
|
143 |
+
|
|
|
144 |
// check if form was not submitted or contains error
|
145 |
if ( ! isset( $_POST['nsu_submit'] ) || count( $errors ) > 0 ) {
|
146 |
|
|
|
147 |
$output .= '<form class="nsu-form" id="nsu-form-' . esc_attr( $formno ) .'" action="' . esc_attr( $form_action ) . '" method="post">';
|
148 |
|
149 |
if ( $opts['mailinglist']['subscribe_with_name'] == 1 ) {
|
150 |
$output .= '<p><label for="nsu-name-'. esc_attr( $formno ) . '">'. esc_html( $name_label ) . '</label>';
|
151 |
$output .= '<input class="nsu-field" id="nsu-name-"' . $formno .'" type="text" name="'. esc_attr( $name_id ) .'" ' . $name_atts;
|
152 |
|
|
|
|
|
|
|
|
|
153 |
$output .= "/>";
|
154 |
|
155 |
if ( isset( $errors['name-field'] ) ) {
|
159 |
}
|
160 |
|
161 |
$output .= "<p><label for=\"nsu-email-$formno\">$email_label</label><input class=\"nsu-field\" id=\"nsu-email-$formno\" type=\"$email_type\" name=\"$email_id\" $email_atts ";
|
|
|
|
|
|
|
162 |
$output .= "/>";
|
163 |
if ( isset( $errors['email-field'] ) ) {
|
164 |
$output .= '<span class="nsu-error error notice">' . $errors['email-field'] . '</span>';
|
166 |
$output .= "</p>";
|
167 |
$output .= $additional_fields;
|
168 |
$output .= '<textarea name="nsu_robocop" style="display: none;"></textarea>';
|
169 |
+
$output .= sprintf( '<p><input type="submit" id="nsu-submit-%s" class="nsu-submit" name="nsu_submit" value="%s" /></p>', $formno, esc_attr( $submit_button ) );
|
170 |
$output .= "</form>";
|
171 |
|
172 |
} else { // form has been submitted
|
includes/functions.php
CHANGED
@@ -20,8 +20,8 @@ if(!function_exists('nsu_form')) {
|
|
20 |
|
21 |
/* Backwards Compatibility */
|
22 |
if(!function_exists('nsu_signup_form')) {
|
23 |
-
function nsu_signup_form()
|
24 |
-
|
25 |
nsu_form();
|
26 |
}
|
27 |
}
|
20 |
|
21 |
/* Backwards Compatibility */
|
22 |
if(!function_exists('nsu_signup_form')) {
|
23 |
+
function nsu_signup_form() {
|
24 |
+
_deprecated_function( __FUNCTION__, '2.0', 'nsu_form' );
|
25 |
nsu_form();
|
26 |
}
|
27 |
}
|
includes/views/checkbox_settings.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
-
<?php
|
5 |
|
6 |
<h2>Newsletter Sign-Up :: Checkbox Settings</h2>
|
7 |
|
@@ -54,6 +54,6 @@
|
|
54 |
</form>
|
55 |
</div>
|
56 |
|
57 |
-
|
58 |
|
59 |
</div>
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
+
<?php include dirname( __FILE__ ) . '/parts/navigation.php'; ?>
|
5 |
|
6 |
<h2>Newsletter Sign-Up :: Checkbox Settings</h2>
|
7 |
|
54 |
</form>
|
55 |
</div>
|
56 |
|
57 |
+
<?php include dirname( __FILE__ ) . '/parts/sidebar.php'; ?>
|
58 |
|
59 |
</div>
|
includes/views/config_helper.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
|
5 |
-
|
6 |
|
7 |
<h2>Newsletter Sign-Up :: Config Extractor</h2>
|
8 |
|
@@ -68,6 +68,6 @@
|
|
68 |
|
69 |
</div>
|
70 |
|
71 |
-
<?php
|
72 |
|
73 |
</div>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
|
5 |
+
<?php include dirname( __FILE__ ) . '/parts/navigation.php'; ?>
|
6 |
|
7 |
<h2>Newsletter Sign-Up :: Config Extractor</h2>
|
8 |
|
68 |
|
69 |
</div>
|
70 |
|
71 |
+
<?php include dirname( __FILE__ ) . '/parts/sidebar.php'; ?>
|
72 |
|
73 |
</div>
|
includes/views/dashboard.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
-
<?php
|
5 |
|
6 |
<h2>Newsletter Sign-Up :: Mailinglist Settings</h2>
|
7 |
<?php settings_errors(); ?>
|
@@ -107,7 +107,7 @@
|
|
107 |
</div>
|
108 |
|
109 |
|
110 |
-
<?php
|
111 |
|
112 |
</div>
|
113 |
<br style="clear:both;" />
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
+
<?php include dirname( __FILE__ ) . '/parts/navigation.php'; ?>
|
5 |
|
6 |
<h2>Newsletter Sign-Up :: Mailinglist Settings</h2>
|
7 |
<?php settings_errors(); ?>
|
107 |
</div>
|
108 |
|
109 |
|
110 |
+
<?php include dirname( __FILE__ ) . '/parts/sidebar.php'; ?>
|
111 |
|
112 |
</div>
|
113 |
<br style="clear:both;" />
|
includes/views/form_settings.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
-
<?php
|
5 |
|
6 |
<div id="nsu-main">
|
7 |
|
@@ -58,11 +58,6 @@
|
|
58 |
<td><input type="checkbox" id="ns_load_form_styles" name="nsu_form[load_form_css]" value="1" <?php if($opts['load_form_css'] == 1) echo 'checked'; ?> /></td>
|
59 |
<td><small>Check this to load some default form CSS styles.</small></td>
|
60 |
</tr>
|
61 |
-
<tr valign="top">
|
62 |
-
<th scope="row"><label for="nsu_use_html_5">Use HTML 5?</label></th>
|
63 |
-
<td><input type="checkbox" id="nsu_use_html_5" name="nsu_form[use_html5]" value="1" <?php checked($opts['use_html5'], 1); ?> /></td>
|
64 |
-
<td><small>Use HTML5 fields and attributes? (recommended)</small></td>
|
65 |
-
</tr>
|
66 |
</table>
|
67 |
|
68 |
<?php submit_button(); ?>
|
@@ -89,6 +84,6 @@
|
|
89 |
</form>
|
90 |
</div>
|
91 |
|
92 |
-
<?php
|
93 |
|
94 |
</div>
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<div class="wrap" id="nsu-admin">
|
3 |
|
4 |
+
<?php include dirname( __FILE__ ) . '/parts/navigation.php'; ?>
|
5 |
|
6 |
<div id="nsu-main">
|
7 |
|
58 |
<td><input type="checkbox" id="ns_load_form_styles" name="nsu_form[load_form_css]" value="1" <?php if($opts['load_form_css'] == 1) echo 'checked'; ?> /></td>
|
59 |
<td><small>Check this to load some default form CSS styles.</small></td>
|
60 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
61 |
</table>
|
62 |
|
63 |
<?php submit_button(); ?>
|
84 |
</form>
|
85 |
</div>
|
86 |
|
87 |
+
<?php include dirname( __FILE__ ) . '/parts/sidebar.php'; ?>
|
88 |
|
89 |
</div>
|
includes/views/parts/rows-mailchimp.php
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<tr valign="top">
|
3 |
-
<th colspan="2" style="background: lightskyblue; padding: 20px;">
|
4 |
-
As you're using MailChimp, I highly recommend switching to
|
5 |
-
<a href="https://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a>.
|
6 |
You'll be up and running (again) in just a few minutes.
|
7 |
</th>
|
8 |
</tr>
|
1 |
<?php defined( 'ABSPATH' ) or exit; ?>
|
2 |
<tr valign="top">
|
3 |
+
<th colspan="2" style="background: white; border-left: 10px solid lightskyblue; padding: 20px;">
|
4 |
+
As you're using MailChimp, I highly recommend switching to our improved <a href="https://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a> plugin.
|
|
|
5 |
You'll be up and running (again) in just a few minutes.
|
6 |
</th>
|
7 |
</tr>
|
includes/views/parts/sidebar.php
CHANGED
@@ -1,39 +1,26 @@
|
|
1 |
<div id="nsu-sidebar">
|
2 |
|
3 |
<div id="nsu-donate-box">
|
4 |
-
<h3>
|
5 |
-
<p>If you like Newsletter Sign-Up, consider showing
|
6 |
-
|
7 |
-
<form class="donate" action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
8 |
-
<input type="hidden" name="cmd" value="_donations">
|
9 |
-
<input type="hidden" name="business" value="AP87UHXWPNBBU">
|
10 |
-
<input type="hidden" name="lc" value="US">
|
11 |
-
<input type="hidden" name="item_name" value="Danny van Kooten">
|
12 |
-
<input type="hidden" name="item_number" value="Newsletter Sign-Up">
|
13 |
-
<input type="hidden" name="currency_code" value="USD">
|
14 |
-
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
|
15 |
-
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
16 |
-
<img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1">
|
17 |
-
</form>
|
18 |
|
19 |
<p>Alternatively, you can: </p>
|
20 |
<ul class="ul-square">
|
21 |
<li><a href="https://wordpress.org/support/view/plugin-reviews/newsletter-sign-up?rate=5#postform" target="_blank">Give a ★★★★★ rating on WordPress.org</a></li>
|
22 |
-
<li><a href="https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/" target="_blank">Blog about it and link to the plugin page</a></li>
|
23 |
<li><a href="https://twitter.com/?status=I%27m%20using%20the%20Newsletter%20Sign-Up%20%23WordPress%20plugin%20by%20%40DannyvanKooten%20on%20my%20website.%20Love%20it!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Fnewsletter-sign-up%2F" target="_blank">Tweet about Newsletter Sign-Up</a></li>
|
24 |
<li><a href="https://wordpress.org/plugins/newsletter-sign-up/#compatibility">Vote "works" on the Wordpress.org plugin page</a>
|
|
|
25 |
</ul>
|
26 |
</div>
|
27 |
|
28 |
<div>
|
29 |
-
<h3>Other
|
30 |
<ul class="ul-square">
|
31 |
<li class="has-icon mc4wp"><a href="https://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a></li>
|
32 |
-
<li><a href="https://wordpress.org/plugins/
|
33 |
<li><a href="https://wordpress.org/plugins/dvk-social-sharing/">Social Sharing</a></li>
|
34 |
<li class="has-icon rfb"><a href="https://wordpress.org/plugins/recent-facebook-posts/">Recent Facebook Posts</a></li>
|
35 |
-
|
36 |
-
<li class="has-icon dvk-twitter">Follow <a href="https://twitter.com/dannyvankooten">@Dannyvankooten</a> on Twitter</li>
|
37 |
</ul>
|
38 |
</div>
|
39 |
|
1 |
<div id="nsu-sidebar">
|
2 |
|
3 |
<div id="nsu-donate-box">
|
4 |
+
<h3>Help us, help you</h3>
|
5 |
+
<p>If you like Newsletter Sign-Up, consider showing a token of your appreciation.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
<p>Alternatively, you can: </p>
|
8 |
<ul class="ul-square">
|
9 |
<li><a href="https://wordpress.org/support/view/plugin-reviews/newsletter-sign-up?rate=5#postform" target="_blank">Give a ★★★★★ rating on WordPress.org</a></li>
|
|
|
10 |
<li><a href="https://twitter.com/?status=I%27m%20using%20the%20Newsletter%20Sign-Up%20%23WordPress%20plugin%20by%20%40DannyvanKooten%20on%20my%20website.%20Love%20it!%20http%3A%2F%2Fwordpress.org%2Fplugins%2Fnewsletter-sign-up%2F" target="_blank">Tweet about Newsletter Sign-Up</a></li>
|
11 |
<li><a href="https://wordpress.org/plugins/newsletter-sign-up/#compatibility">Vote "works" on the Wordpress.org plugin page</a>
|
12 |
+
<li class="has-icon dvk-twitter">Follow <a href="https://twitter.com/dannyvankooten">@Dannyvankooten</a> on Twitter</li>
|
13 |
</ul>
|
14 |
</div>
|
15 |
|
16 |
<div>
|
17 |
+
<h3>Other plugins by the same author</h3>
|
18 |
<ul class="ul-square">
|
19 |
<li class="has-icon mc4wp"><a href="https://wordpress.org/plugins/mailchimp-for-wp/">MailChimp for WordPress</a></li>
|
20 |
+
<li><a href="https://wordpress.org/plugins/boxzilla/">Boxzilla (pop-ups)</a></li>
|
21 |
<li><a href="https://wordpress.org/plugins/dvk-social-sharing/">Social Sharing</a></li>
|
22 |
<li class="has-icon rfb"><a href="https://wordpress.org/plugins/recent-facebook-posts/">Recent Facebook Posts</a></li>
|
23 |
+
|
|
|
24 |
</ul>
|
25 |
</div>
|
26 |
|
newsletter-sign-up.php
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
/*
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
Plugin URI: https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/
|
5 |
-
Description: Adds various ways for your visitors to sign-up to your
|
6 |
-
Version: 2.0.
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: https://dannyvankooten.com
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
-
/* Copyright 2010-
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License, version 2, as
|
@@ -29,8 +29,8 @@ if( ! defined( 'ABSPATH' ) ) {
|
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
-
define('NSU_VERSION_NUMBER', "2.0.
|
33 |
-
define("NSU_PLUGIN_DIR",
|
34 |
|
35 |
-
require_once NSU_PLUGIN_DIR . 'includes/NSU.php';
|
36 |
new NSU();
|
2 |
/*
|
3 |
Plugin Name: Newsletter Sign-Up
|
4 |
Plugin URI: https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/
|
5 |
+
Description: Adds various ways for your visitors to sign-up to your mailing list (checkbox, widget, form)
|
6 |
+
Version: 2.0.6
|
7 |
Author: Danny van Kooten
|
8 |
Author URI: https://dannyvankooten.com
|
9 |
License: GPL2
|
10 |
*/
|
11 |
|
12 |
+
/* Copyright 2010-2016 Danny van Kooten (email: hi@dannyvankooten.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License, version 2, as
|
29 |
exit;
|
30 |
}
|
31 |
|
32 |
+
define('NSU_VERSION_NUMBER', "2.0.6");
|
33 |
+
define("NSU_PLUGIN_DIR", dirname( __FILE__ ) );
|
34 |
|
35 |
+
require_once NSU_PLUGIN_DIR . '/includes/NSU.php';
|
36 |
new NSU();
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Newsletter Sign-Up ===
|
2 |
Contributors: DvanKooten
|
3 |
Donate link: https://dannyvankooten.com/donate/
|
4 |
-
Tags: newsletter,sign-up,mailchimp,aweber,
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPL2
|
9 |
|
10 |
Integrate your WordPress site with 3rd-party newsletter services like Aweber and YMLP. Adds various sign-up methods to your site.
|
@@ -15,7 +15,6 @@ Integrate your WordPress site with 3rd-party newsletter services like Aweber and
|
|
15 |
|
16 |
This plugin adds various sign-up methods to your WordPress website, like sign-up checkboxes in your comment form and a sign-up form to show in posts, pages or widget areas.
|
17 |
|
18 |
-
|
19 |
> **MailChimp user?**
|
20 |
>
|
21 |
> Use [MailChimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) instead. It's free & so much better.
|
@@ -35,7 +34,6 @@ This plugin works with *almost all* third-party email marketing services includi
|
|
35 |
**More information**
|
36 |
|
37 |
* [MailChimp for WordPress plugin](https://mc4wp.com/)
|
38 |
-
* [Newsletter Sign-Up for WordPress](https://dannyvankooten.com/wordpress-plugins/newsletter-sign-up/)
|
39 |
* Check out more [WordPress plugins](https://dannyvankooten.com/wordpress-plugins/) by Danny van Kooten
|
40 |
* Follow [@DannyvanKooten](https://twitter.com/DannyvanKooten) on Twitter
|
41 |
|
@@ -51,9 +49,9 @@ You can set your own messages and even choose to redirect the visitor to a certa
|
|
51 |
|
52 |
== Installation ==
|
53 |
|
54 |
-
1. Upload the contents of newsletter-sign-up.zip to your plugins directory.
|
55 |
1. Activate the plugin
|
56 |
-
1. Specify your newsletter service settings.
|
57 |
1. That's all. You're done!
|
58 |
|
59 |
== Frequently Asked Questions ==
|
@@ -94,6 +92,10 @@ For more questions and answers go have a look at the [Newsletter Sign-Up](https:
|
|
94 |
|
95 |
== Changelog ==
|
96 |
|
|
|
|
|
|
|
|
|
97 |
= 2.0.5 - February 19, 2015 =
|
98 |
|
99 |
**Improvements**
|
1 |
=== Newsletter Sign-Up ===
|
2 |
Contributors: DvanKooten
|
3 |
Donate link: https://dannyvankooten.com/donate/
|
4 |
+
Tags: newsletter, sign-up, mailchimp, aweber, ymlp, phplist, icontact, newsletter widget, subscribe widget
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 4.5.2
|
7 |
+
Stable tag: 2.0.6
|
8 |
License: GPL2
|
9 |
|
10 |
Integrate your WordPress site with 3rd-party newsletter services like Aweber and YMLP. Adds various sign-up methods to your site.
|
15 |
|
16 |
This plugin adds various sign-up methods to your WordPress website, like sign-up checkboxes in your comment form and a sign-up form to show in posts, pages or widget areas.
|
17 |
|
|
|
18 |
> **MailChimp user?**
|
19 |
>
|
20 |
> Use [MailChimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) instead. It's free & so much better.
|
34 |
**More information**
|
35 |
|
36 |
* [MailChimp for WordPress plugin](https://mc4wp.com/)
|
|
|
37 |
* Check out more [WordPress plugins](https://dannyvankooten.com/wordpress-plugins/) by Danny van Kooten
|
38 |
* Follow [@DannyvanKooten](https://twitter.com/DannyvanKooten) on Twitter
|
39 |
|
49 |
|
50 |
== Installation ==
|
51 |
|
52 |
+
1. Upload the contents of `newsletter-sign-up.zip` to your plugins directory.
|
53 |
1. Activate the plugin
|
54 |
+
1. Specify your newsletter service settings.
|
55 |
1. That's all. You're done!
|
56 |
|
57 |
== Frequently Asked Questions ==
|
92 |
|
93 |
== Changelog ==
|
94 |
|
95 |
+
= 2.0.6 - June 20, 2016 =
|
96 |
+
|
97 |
+
Minor maintenance round. Removed obsolete HTML5 option, as 99.9% of browsers support this now.
|
98 |
+
|
99 |
= 2.0.5 - February 19, 2015 =
|
100 |
|
101 |
**Improvements**
|