Subscribe2 - Version 10.32

Version Description

Download this release

Release Info

Developer Collizo4sky
Plugin Icon 128x128 Subscribe2
Version 10.32
Comparing to
See all releases

Code changes from version 10.31 to 10.32

ChangeLog.txt CHANGED
@@ -1,3 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  = 10.31 =
2
 
3
  * Enhance DNS check when validating email addresses
@@ -5,9 +21,9 @@
5
  * Validate emails fully when making database changes, but simpler and faster checks when sending notifications
6
  * Better escaping of subscriber email data when reporting errors to Subscribers page
7
  * Fix some Coding Standards Issues
8
-
9
- = 10.30.1 =
10
-
11
  * Clean unused global variables
12
  * Implemented compatibility with Fusion Builder
13
  * Fix error caused by menu registration in WordPress 5.3
1
+ = 10.32 =
2
+
3
+ * Bump minimum required WordPress to 4.4
4
+ * Apply fix for poor list layout in plaintext emails when using Block Editor - thank to @eightize
5
+ * Introduce 's2_plaintext' filter to allow plaintext to be filtered before tags are stripped to correct for layout needs
6
+ * Show join date for Registered Subscribers with data from WordPress table
7
+ * Fix email templates to preserve line spacing on new installs and resets
8
+ * Send Digest Preview emails from editing pages if Subscribe2 HTML is in Digest email mode
9
+ * Fix typo error in default options file
10
+ * Improve Help tab for Excluded categories - thanks to @iwaddo
11
+ * Convert some self closing HTML tags to HTML5
12
+ * Escape plugin output for better security
13
+ * Don't capitalise Custom Post Type names registered via the API when displayed back to admins
14
+ * Remove MailOptin from this fork
15
+ * Fix for JavaScript IP updater setting not saving when unchecked
16
+
17
  = 10.31 =
18
 
19
  * Enhance DNS check when validating email addresses
21
  * Validate emails fully when making database changes, but simpler and faster checks when sending notifications
22
  * Better escaping of subscriber email data when reporting errors to Subscribers page
23
  * Fix some Coding Standards Issues
24
+ * Correct maximum execution time limit to 5 minutes
25
+ * Fix some new Coding Standards errors and warnings
26
+ * Applied coding standards to MO Notice class
27
  * Clean unused global variables
28
  * Implemented compatibility with Fusion Builder
29
  * Fix error caused by menu registration in WordPress 5.3
ReadMe.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: collizo4sky
3
  Donate link: https://mailoptin.io
4
  Tags: posts, subscription, email, subscribe, notify, notification, newsletter, post notification, email marketing, optin, form
5
  Requires at least: 4.0
6
- Tested up to: 5.2
7
  License: GPLv3
8
 
9
  Sends a list of subscribers an email notification when you publish new posts.
3
  Donate link: https://mailoptin.io
4
  Tags: posts, subscription, email, subscribe, notify, notification, newsletter, post notification, email marketing, optin, form
5
  Requires at least: 4.0
6
+ Tested up to: 5.3
7
  License: GPLv3
8
 
9
  Sends a list of subscribers an email notification when you publish new posts.
admin/send-email.php CHANGED
@@ -8,7 +8,7 @@ global $current_user;
8
  // was anything POSTed?
9
  if ( isset( $_POST['s2_admin'] ) && 'mail' === $_POST['s2_admin'] ) {
10
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-write_subscribers' . S2VERSION ) ) {
11
- die( '<p>' . __( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
12
  }
13
 
14
  $subject = html_entity_decode( stripslashes( wp_kses( $this->substitute( $_POST['subject'] ), '' ) ), ENT_QUOTES );
@@ -97,12 +97,12 @@ if ( isset( $_POST['s2_admin'] ) && 'mail' === $_POST['s2_admin'] ) {
97
  global $phpmailer;
98
  $message = '<p class="s2_error">' . __( 'Message failed!', 'subscribe2' ) . '</p>' . $error_message . $phpmailer->ErrorInfo;
99
  }
100
- echo '<div id="message" class="updated"><strong><p>' . $message . '</p></strong></div>' . "\r\n";
101
  }
102
 
103
  // show our form
104
  echo '<div class="wrap">';
105
- echo '<h1>' . __( 'Send an email to subscribers', 'subscribe2' ) . '</h1>' . "\r\n";
106
  echo '<form method="post" enctype="multipart/form-data">' . "\r\n";
107
 
108
  wp_nonce_field( 'subscribe2-write_subscribers' . S2VERSION );
@@ -115,15 +115,15 @@ if ( isset( $_POST['subject'] ) ) {
115
  if ( ! isset( $_POST['content'] ) ) {
116
  $body = '';
117
  }
118
- echo '<p>' . __( 'Subject', 'subscribe2' ) . ': <input type="text" size="69" name="subject" value="' . $subject . '" /> <br /><br />';
119
- echo '<textarea rows="12" cols="75" name="content">' . $body . '</textarea>';
120
- echo "<br /><div id=\"upload_files\"><input type=\"file\" name=\"file[]\"></div>\r\n";
121
- echo '<input type="button" class="button-secondary" name="addmore" value="' . __( 'Add More Files', 'subscribe2' ) . "\" onClick=\"add_file_upload();\" />\r\n";
122
- echo "<br /><br />\r\n";
123
- echo __( 'Recipients:', 'subscribe2' ) . ' ';
124
  $this->display_subscriber_dropdown( apply_filters( 's2_subscriber_dropdown_default', 'registered' ), false );
125
  echo '<input type="hidden" name="s2_admin" value="mail" />';
126
- echo '<p class="submit"><input type="submit" class="button-secondary" name="preview" value="' . __( 'Preview', 'subscribe2' ) . '" />&nbsp;<input type="submit" class="button-primary" name="send" value="' . __( 'Send', 'subscribe2' ) . '" /></p>';
127
  echo '</form></div>' . "\r\n";
128
  echo '<div style="clear: both;"><p>&nbsp;</p></div>';
129
  ?>
8
  // was anything POSTed?
9
  if ( isset( $_POST['s2_admin'] ) && 'mail' === $_POST['s2_admin'] ) {
10
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-write_subscribers' . S2VERSION ) ) {
11
+ die( '<p>' . esc_html__( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
12
  }
13
 
14
  $subject = html_entity_decode( stripslashes( wp_kses( $this->substitute( $_POST['subject'] ), '' ) ), ENT_QUOTES );
97
  global $phpmailer;
98
  $message = '<p class="s2_error">' . __( 'Message failed!', 'subscribe2' ) . '</p>' . $error_message . $phpmailer->ErrorInfo;
99
  }
100
+ echo '<div id="message" class="updated"><strong><p>' . wp_kses_post( $message ) . '</p></strong></div>' . "\r\n";
101
  }
102
 
103
  // show our form
104
  echo '<div class="wrap">';
105
+ echo '<h1>' . esc_html__( 'Send an email to subscribers', 'subscribe2' ) . '</h1>' . "\r\n";
106
  echo '<form method="post" enctype="multipart/form-data">' . "\r\n";
107
 
108
  wp_nonce_field( 'subscribe2-write_subscribers' . S2VERSION );
115
  if ( ! isset( $_POST['content'] ) ) {
116
  $body = '';
117
  }
118
+ echo '<p>' . esc_html__( 'Subject', 'subscribe2' ) . ': <input type="text" size="69" name="subject" value="' . esc_attr( $subject ) . '" /> <br><br>';
119
+ echo '<textarea rows="12" cols="75" name="content">' . esc_textarea( $body ) . '</textarea>';
120
+ echo "<br><div id=\"upload_files\"><input type=\"file\" name=\"file[]\"></div>\r\n";
121
+ echo '<input type="button" class="button-secondary" name="addmore" value="' . esc_attr( __( 'Add More Files', 'subscribe2' ) ) . "\" onClick=\"add_file_upload();\" />\r\n";
122
+ echo "<br><br>\r\n";
123
+ echo esc_html__( 'Recipients:', 'subscribe2' ) . ' ';
124
  $this->display_subscriber_dropdown( apply_filters( 's2_subscriber_dropdown_default', 'registered' ), false );
125
  echo '<input type="hidden" name="s2_admin" value="mail" />';
126
+ echo '<p class="submit"><input type="submit" class="button-secondary" name="preview" value="' . esc_attr( __( 'Preview', 'subscribe2' ) ) . '" />&nbsp;<input type="submit" class="button-primary" name="send" value="' . esc_attr( __( 'Send', 'subscribe2' ) ) . '" /></p>';
127
  echo '</form></div>' . "\r\n";
128
  echo '<div style="clear: both;"><p>&nbsp;</p></div>';
129
  ?>
admin/settings.php CHANGED
@@ -8,7 +8,7 @@ global $wpdb, $current_tab;
8
  // was anything POSTed?
9
  if ( isset( $_POST['s2_admin'] ) ) {
10
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-options_subscribers' . S2VERSION ) ) {
11
- die( '<p>' . __( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
12
  }
13
 
14
  if ( isset( $_POST['reset'] ) ) {
@@ -16,7 +16,7 @@ if ( isset( $_POST['s2_admin'] ) ) {
16
  global $s2_upgrade;
17
  $s2_upgrade = new S2_Upgrade();
18
  $s2_upgrade->reset();
19
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Options reset!', 'subscribe2' ) . '</strong></p></div>';
20
  } elseif ( isset( $_POST['preview'] ) ) {
21
  global $user_email, $post;
22
  $this->preview_email = true;
@@ -27,14 +27,14 @@ if ( isset( $_POST['s2_admin'] ) ) {
27
  } else {
28
  do_action( 's2_digest_preview', $user_email );
29
  }
30
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Preview message(s) sent to logged in user', 'subscribe2' ) . '</strong></p></div>';
31
  } elseif ( isset( $_POST['resend'] ) ) {
32
  $stickies = get_option( 'sticky_posts' );
33
  if ( ! empty( $this->subscribe2_options['last_s2cron'] ) || ( 'yes' === $this->subscribe2_options['stickies'] && ! empty( $stickies ) ) ) {
34
  do_action( 's2_digest_resend', 'resend' );
35
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Attempt made to resend the Digest Notification email', 'subscribe2' ) . '</strong></p></div>';
36
  } else {
37
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'The Digest Notification email contained no post information. No email was sent', 'subscribe2' ) . '</strong></p></div>';
38
  }
39
  } elseif ( isset( $_POST['submit'] ) ) {
40
  foreach ( $_POST as $key => $value ) {
@@ -47,7 +47,7 @@ if ( isset( $_POST['s2_admin'] ) ) {
47
  // check box entries
48
  ( isset( $_POST[ $key ] ) && '1' === $_POST[ $key ] ) ? $this->subscribe2_options[ $key ] = '1' : $this->subscribe2_options[ $key ] = '0';
49
  } elseif ( 'appearance_tab' === $key ) {
50
- $options = array( 'show_meta', 'show_button', 'ajax', 'widget', 'counterwidget', 's2meta_default' );
51
  foreach ( $options as $option ) {
52
  if ( ! isset( $_POST[ $option ] ) ) {
53
  $this->subscribe2_options[ $option ] = '0';
@@ -117,7 +117,7 @@ if ( isset( $_POST['s2_admin'] ) ) {
117
  }
118
  }
119
 
120
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Options saved!', 'subscribe2' ) . '</strong></p></div>';
121
  update_option( 'subscribe2_options', $this->subscribe2_options );
122
  }
123
  }
@@ -125,13 +125,13 @@ if ( isset( $_POST['s2_admin'] ) ) {
125
  // send error message if no WordPress page exists
126
  $page_id = $wpdb->get_var( "SELECT ID FROM `{$wpdb->prefix}posts` WHERE post_type='page' AND post_status='publish' LIMIT 1" );
127
  if ( empty( $page_id ) ) {
128
- echo '<div id="page_message" class="error"><p class="s2_error"><strong>' . __( 'You must create a WordPress page for this plugin to work correctly.', 'subscribe2' ) . '</strong></p></div>';
129
  }
130
 
131
  // display error message for GDPR
132
  if ( defined( 'S2GDPR' ) && true === S2GDPR ) {
133
  if ( 'yes' === $this->subscribe2_options['autosub'] || 'yes' === $this->subscribe2_options['wpregdef'] || 'yes' === $this->subscribe2_options['autosub_def'] || 'yes' === $this->subscribe2_options['comment_def'] ) {
134
- echo '<div id="gdpr_message" class="error"><p class="s2_error"><strong>' . __( 'Your Settings may breach GDPR', 'subscribe2' ) . '</strong></p></div>';
135
  }
136
  }
137
 
@@ -150,7 +150,7 @@ foreach ( $disallowed_keywords as $disallowed_keyword ) {
150
  $template_link = '<a href="' . admin_url( 'admin.php?page=s2_settings&tab=templates' ) . '">' . __( 'Modify your template', 'subscribe2' ) . '</a>';
151
  if ( false !== $disallowed ) {
152
  $disallowed_keywords = __( 'Your chosen email type (per-post or digest) does not support the following keywords:', 'subscribe2' );
153
- echo '<div id="keyword_message" class="error"><p class="s2_error"><strong>' . $disallowed_keywords . '</strong><br />' . implode( ', ', $disallowed ) . '<br />' . $template_link . '</p></div>';
154
  }
155
 
156
  // send error message if sender email address is off-domain
@@ -163,7 +163,7 @@ if ( 'blogname' === $this->subscribe2_options['sender'] ) {
163
  list( $user, $sender_domain ) = explode( '@', $sender, 2 );
164
  if ( ! stristr( esc_html( $_SERVER['SERVER_NAME'] ), $sender_domain ) && 'author' !== $this->subscribe2_options['sender'] && '0' === $this->subscribe2_options['dismiss_sender_warning'] ) {
165
  // Translators: Warning message
166
- echo '<div id="sender_message" class="error notice is-dismissible"><p class="s2_error"><strong>' . sprintf( __( 'You appear to be sending notifications from %1$s, which has a different domain name than your blog server %2$s. This may result in failed emails.', 'subscribe2' ), $sender, $_SERVER['SERVER_NAME'] ) . '</strong></p></div>';
167
  }
168
 
169
  // detect or define which tab we are in
@@ -171,7 +171,7 @@ $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'email';
171
 
172
  // show our form
173
  echo '<div class="wrap">';
174
- echo '<h1>' . __( 'Settings', 'subscribe2' ) . '</h1>' . "\r\n";
175
  $s2tabs = array(
176
  'email' => __( 'Email Settings', 'subscribe2' ),
177
  'templates' => __( 'Templates', 'subscribe2' ),
@@ -182,7 +182,7 @@ $s2tabs = array(
182
  echo '<h2 class="nav-tab-wrapper">';
183
  foreach ( $s2tabs as $tab_key => $tab_caption ) {
184
  $active = ( $current_tab === $tab_key ) ? 'nav-tab-active' : '';
185
- echo '<a class="nav-tab ' . $active . '" href="?page=s2_settings&amp;tab=' . $tab_key . '">' . $tab_caption . '</a>';
186
  }
187
  echo '</h2>';
188
 
@@ -191,84 +191,86 @@ echo '<form method="post">' . "\r\n";
191
  wp_nonce_field( 'subscribe2-options_subscribers' . S2VERSION );
192
 
193
  echo '<input type="hidden" name="s2_admin" value="options" />' . "\r\n";
194
- echo '<input type="hidden" id="jsbcclimit" value="' . $this->subscribe2_options['bcclimit'] . '" />';
195
 
196
  switch ( $current_tab ) {
197
  case 'email':
198
  // settings for outgoing emails
199
  echo '<div class="s2_admin" id="s2_notification_settings">' . "\r\n";
200
  echo '<p>' . "\r\n";
201
- echo __( 'Restrict the number of <strong>recipients per email</strong> to (0 for unlimited)', 'subscribe2' ) . ': ';
202
- echo '<span id="s2bcclimit_1"><span id="s2bcclimit" style="background-color: #FFFBCC">' . $this->subscribe2_options['bcclimit'] . '</span> ';
203
- echo '<a href="#" onclick="s2Show(\'bcclimit\'); return false;">' . __( 'Edit', 'subscribe2' ) . '</a></span>' . "\r\n";
204
  echo '<span id="s2bcclimit_2">' . "\r\n";
205
- echo '<input type="text" name="bcclimit" value="' . $this->subscribe2_options['bcclimit'] . '" size="3" />' . "\r\n";
206
- echo '<a href="#" onclick="s2Update(\'bcclimit\'); return false;">' . __( 'Update', 'subscribe2' ) . '</a>' . "\r\n";
207
- echo '<a href="#" onclick="s2Revert(\'bcclimit\'); return false;">' . __( 'Revert', 'subscribe2' ) . '</a></span>' . "\n";
208
 
209
- echo '<br /><br />' . __( 'Send Admins notifications for new', 'subscribe2' ) . ': ';
210
  echo '<label><input type="radio" name="admin_email" value="subs"' . checked( $this->subscribe2_options['admin_email'], 'subs', false ) . ' />' . "\r\n";
211
- echo __( 'Subscriptions', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
212
  echo '<label><input type="radio" name="admin_email" value="unsubs"' . checked( $this->subscribe2_options['admin_email'], 'unsubs', false ) . ' />' . "\r\n";
213
- echo __( 'Unsubscriptions', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
214
  echo '<label><input type="radio" name="admin_email" value="both"' . checked( $this->subscribe2_options['admin_email'], 'both', false ) . ' />' . "\r\n";
215
- echo __( 'Both', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
216
  echo '<label><input type="radio" name="admin_email" value="none"' . checked( $this->subscribe2_options['admin_email'], 'none', false ) . ' />' . "\r\n";
217
- echo __( 'Neither', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
218
 
219
- echo __( 'Include theme CSS stylesheet in HTML notifications', 'subscribe2' ) . ': ';
220
  echo '<label><input type="radio" name="stylesheet" value="yes"' . checked( $this->subscribe2_options['stylesheet'], 'yes', false ) . ' /> ';
221
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
222
  echo '<label><input type="radio" name="stylesheet" value="no"' . checked( $this->subscribe2_options['stylesheet'], 'no', false ) . ' /> ';
223
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
224
 
225
- echo __( 'Send Emails for Pages', 'subscribe2' ) . ': ';
226
  echo '<label><input type="radio" name="pages" value="yes"' . checked( $this->subscribe2_options['pages'], 'yes', false ) . ' /> ';
227
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
228
  echo '<label><input type="radio" name="pages" value="no"' . checked( $this->subscribe2_options['pages'], 'no', false ) . ' /> ';
229
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
230
- $s2_post_types = apply_filters( 's2_post_types', null );
 
231
  if ( ! empty( $s2_post_types ) ) {
232
- $types = '';
233
- echo __( 'Subscribe2 will send email notifications for the following custom post types', 'subscribe2' ) . ': <strong>';
234
- foreach ( $s2_post_types as $s2_post_type ) {
235
- ( '' === $types ) ? $types = ucwords( $s2_post_type ) : $types .= ', ' . ucwords( $s2_post_type );
236
  }
237
- echo $types . '</strong><br /><br />' . "\r\n";
238
  }
239
- echo __( 'Send Emails for Password Protected Posts', 'subscribe2' ) . ': ';
 
240
  echo '<label><input type="radio" name="password" value="yes"' . checked( $this->subscribe2_options['password'], 'yes', false ) . ' /> ';
241
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
242
  echo '<label><input type="radio" name="password" value="no"' . checked( $this->subscribe2_options['password'], 'no', false ) . ' /> ';
243
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
244
- echo __( 'Send Emails for Private Posts', 'subscribe2' ) . ': ';
245
  echo '<label><input type="radio" name="private" value="yes"' . checked( $this->subscribe2_options['private'], 'yes', false ) . ' /> ';
246
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
247
  echo '<label><input type="radio" name="private" value="no"' . checked( $this->subscribe2_options['private'], 'no', false ) . ' /> ';
248
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
249
  if ( 'never' !== $this->subscribe2_options['email_freq'] ) {
250
- echo __( 'Include Sticky Posts at the top of all Digest Notifications', 'subscribe2' ) . ': ';
251
  echo '<label><input type="radio" name="stickies" value="yes"' . checked( $this->subscribe2_options['stickies'], 'yes', false ) . ' /> ';
252
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
253
  echo '<label><input type="radio" name="stickies" value="no"' . checked( $this->subscribe2_options['stickies'], 'no', false ) . ' /> ';
254
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
255
  }
256
- echo __( 'Send Email From', 'subscribe2' ) . ': ';
257
  echo '<label>' . "\r\n";
258
  $this->admin_dropdown( true );
259
- echo '</label><br /><br />' . "\r\n";
260
  if ( function_exists( 'wp_schedule_event' ) ) {
261
- echo __( 'Send Emails', 'subscribe2' ) . ': <br /><br />' . "\r\n";
262
  $this->display_digest_choices();
263
- echo '<p>' . __( 'For digest notifications, date order for posts is', 'subscribe2' ) . ': ' . "\r\n";
 
 
264
  echo '<label><input type="radio" name="cron_order" value="desc"' . checked( $this->subscribe2_options['cron_order'], 'desc', false ) . ' /> ';
265
- echo __( 'Descending', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
266
  echo '<label><input type="radio" name="cron_order" value="asc"' . checked( $this->subscribe2_options['cron_order'], 'asc', false ) . ' /> ';
267
- echo __( 'Ascending', 'subscribe2' ) . '</label></p>' . "\r\n";
268
  }
269
- echo __( 'Add Tracking Parameters to the Permalink', 'subscribe2' ) . ': ';
270
- echo '<input type="text" name="tracking" value="' . stripslashes( $this->subscribe2_options['tracking'] ) . '" size="50" /> ';
271
- echo '<br />' . __( 'eg. utm_source=subscribe2&amp;utm_medium=email&amp;utm_campaign=postnotify&amp;utm_id={ID}&amp;utm_title={TITLE}', 'subscribe2' ) . "\r\n";
272
  echo '</p>' . "\r\n";
273
  echo '</div>' . "\r\n";
274
  break;
@@ -279,48 +281,54 @@ switch ( $current_tab ) {
279
  echo '<p>' . "\r\n";
280
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 5px; *border-collapse: expression(\'separate\', cellSpacing = \'5px\');" class="editform">' . "\r\n";
281
  echo '<tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
282
- echo __( 'Notification email (must not be empty)', 'subscribe2' ) . ':<br />' . "\r\n";
283
- echo __( 'Subject Line', 'subscribe2' ) . ': ';
284
- echo '<input type="text" name="notification_subject" value="' . stripslashes( $this->subscribe2_options['notification_subject'] ) . '" size="45" />';
285
- echo '<br />' . "\r\n";
286
- echo '<textarea rows="9" cols="60" name="mailtext" style="width:95%;">' . stripslashes( $this->subscribe2_options['mailtext'] ) . '</textarea>' . "\r\n";
287
  echo '</td><td style="vertical-align: top;" rowspan="3">';
288
- echo '<p class="submit"><input type="submit" class="button-secondary" name="preview" value="' . __( 'Send Email Preview', 'subscribe2' ) . '" /></p>' . "\r\n";
289
- echo '<h3>' . __( 'Message substitutions', 'subscribe2' ) . '</h3>' . "\r\n";
290
  echo '<dl>';
291
- echo '<dt><b><em style="color: red">' . __( 'IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED', 'subscribe2' ) . '</em></b></dt><dd></dd>' . "\r\n";
292
- echo '<dt><b>{BLOGNAME}</b></dt><dd>' . get_option( 'blogname' ) . '</dd>' . "\r\n";
293
- echo '<dt><b>{BLOGLINK}</b></dt><dd>' . get_option( 'home' ) . '</dd>' . "\r\n";
294
- echo '<dt><b>{TITLE}</b></dt><dd>' . __( "the post's title<br />(<i>for per-post emails only</i>)", 'subscribe2' ) . '</dd>' . "\r\n";
295
- echo '<dt><b>{TITLETEXT}</b></dt><dd>' . __( "the post's unformatted title <br />(<i>for per-post emails only</i>)", 'subscribe2' ) . '</dd>' . "\r\n";
296
- echo '<dt><b>{POST}</b></dt><dd>' . __( "the excerpt or the entire post<br />(<i>based on the subscriber's preferences</i>)", 'subscribe2' ) . '</dd>' . "\r\n";
297
- echo '<dt><b>{POSTTIME}</b></dt><dd>' . __( 'the excerpt of the post and the time it was posted<br />(<i>for digest emails only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
298
- echo '<dt><b>{TABLE}</b></dt><dd>' . __( 'a list of post titles<br />(<i>for digest emails only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
299
- echo '<dt><b>{TABLELINKS}</b></dt><dd>' . __( 'a list of post titles followed by links to the articles<br />(<i>for digest emails only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
300
- echo '<dt><b>{REFERENCELINKS}</b></dt><dd>' . __( 'a reference style list of links at the end of the email with corresponding numbers in the content<br />(<i>for the full content plain text per-post email only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
301
- echo '<dt><b>{PERMALINK}</b></dt><dd>' . __( "the post's permalink<br />(<i>for per-post emails only</i>)", 'subscribe2' ) . '</dd>' . "\r\n";
302
- echo '<dt><b>{TINYLINK}</b></dt><dd>' . __( "the post's permalink after conversion by TinyURL", 'subscribe2' ) . '</dd>' . "\r\n";
303
- echo '<dt><b>{PERMAURL}</b></dt><dd>' . __( "the post's unformatted permalink<br />(<i>for per-post emails only</i>)", 'subscribe2' ) . '</dd>' . "\r\n";
304
- echo '<dt><b>{DATE}</b></dt><dd>' . __( 'the date the post was made<br />(<i>for per-post emails only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
305
- echo '<dt><b>{TIME}</b></dt><dd>' . __( 'the time the post was made<br />(<i>for per-post emails only</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
306
- echo '<dt><b>{MYNAME}</b></dt><dd>' . __( "the admin or post author's name", 'subscribe2' ) . '</dd>' . "\r\n";
307
- echo '<dt><b>{EMAIL}</b></dt><dd>' . __( "the admin or post author's email", 'subscribe2' ) . ' </dd>' . "\r\n";
308
- echo '<dt><b>{AUTHORNAME}</b></dt><dd>' . __( "the post author's name", 'subscribe2' ) . '</dd>' . "\r\n";
309
- echo '<dt><b>{LINK}</b></dt><dd>' . __( 'the generated link to confirm a request<br />(<i>only used in the confirmation email template</i>)', 'subscribe2' ) . '</dd>' . "\r\n";
310
- echo '<dt><b>{ACTION}</b></dt><dd>' . __( 'Action performed by LINK in confirmation email<br />(<i>only used in the confirmation email template</i>)', 'subscribe2' ) . "</dd>\r\n";
311
- echo '<dt><b>{CATS}</b></dt><dd>' . __( "the post's assigned categories", 'subscribe2' ) . "</dd>\r\n";
312
- echo '<dt><b>{TAGS}</b></dt><dd>' . __( "the post's assigned Tags", 'subscribe2' ) . "</dd>\r\n";
313
- echo '<dt><b>{COUNT}</b></dt><dd>' . __( 'the number of posts included in the digest email<br />(<i>for digest emails only</i>)', 'subscribe2' ) . "</dd>\r\n";
 
 
 
 
 
 
314
  echo '</dl></td></tr><tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
315
- echo __( 'Subscribe / Unsubscribe confirmation email', 'subscribe2' ) . ':<br />' . "\r\n";
316
- echo __( 'Subject Line', 'subscribe2' ) . ': ';
317
- echo '<input type="text" name="confirm_subject" value="' . stripslashes( $this->subscribe2_options['confirm_subject'] ) . '" size="45" /><br />' . "\r\n";
318
- echo '<textarea rows="9" cols="60" name="confirm_email" style="width:95%;">' . stripslashes( $this->subscribe2_options['confirm_email'] ) . '</textarea>' . "\r\n";
319
  echo '</td></tr><tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
320
- echo __( 'Reminder email to Unconfirmed Subscribers', 'subscribe2' ) . ':<br />' . "\r\n";
321
- echo __( 'Subject Line', 'subscribe2' ) . ': ';
322
- echo '<input type="text" name="remind_subject" value="' . stripslashes( $this->subscribe2_options['remind_subject'] ) . '" size="45" /><br />' . "\r\n";
323
- echo '<textarea rows="9" cols="60" name="remind_email" style="width:95%;">' . stripslashes( $this->subscribe2_options['remind_email'] ) . '</textarea><br /><br />' . "\r\n";
324
  echo '</td></tr></table>' . "\r\n";
325
  echo '</div>' . "\r\n";
326
  break;
@@ -333,22 +341,22 @@ switch ( $current_tab ) {
333
  // compulsory categories
334
  echo '<div class="s2_admin" id="s2_compulsory_categories">' . "\r\n";
335
  echo '<input type="hidden" name="registered_users_tab" value="options" />' . "\r\n";
336
- echo '<h3>' . __( 'Compulsory Categories', 'subscribe2' ) . '</h3>' . "\r\n";
337
  echo '<p>' . "\r\n";
338
- echo '<strong><em style="color: red">' . __( 'Compulsory categories will be checked by default for Registered Subscribers', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
339
  echo '</p>';
340
  $s2_forms->display_category_form( explode( ',', $this->subscribe2_options['compulsory'] ), 1, array(), 'compulsory' );
341
  echo "</div>\r\n";
342
 
343
  // excluded categories
344
  echo '<div class="s2_admin" id="s2_excluded_categories">' . "\r\n";
345
- echo '<h3>' . __( 'Excluded Categories', 'subscribe2' ) . '</h3>' . "\r\n";
346
  echo '<p>';
347
- echo '<strong><em style="color: red">' . __( 'Posts assigned to any Excluded Category do not generate notifications and are not included in digest notifications', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
348
  echo '</p>';
349
  $s2_forms->display_category_form( explode( ',', $this->subscribe2_options['exclude'] ), 1, array(), 'exclude' );
350
  echo '<p style="text-align: center;"><label><input type="checkbox" name="reg_override" value="1"' . checked( $this->subscribe2_options['reg_override'], '1', false ) . ' /> ';
351
- echo __( 'Allow registered users to subscribe to excluded categories?', 'subscribe2' ) . '</label></p>' . "\r\n";
352
  echo '</div>' . "\r\n";
353
 
354
  // excluded post formats
@@ -356,9 +364,9 @@ switch ( $current_tab ) {
356
  if ( false !== $formats ) {
357
  // excluded formats
358
  echo '<div class="s2_admin" id="s2_excluded_formats">' . "\r\n";
359
- echo '<h3>' . __( 'Excluded Formats', 'subscribe2' ) . '</h3>' . "\r\n";
360
  echo '<p>';
361
- echo '<strong><em style="color: red">' . __( 'Posts assigned to any Excluded Format do not generate notifications and are not included in digest notifications', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
362
  echo '</p>';
363
  $this->display_format_form( $formats, explode( ',', $this->subscribe2_options['exclude_formats'] ) );
364
  echo '</div>' . "\r\n";
@@ -366,74 +374,74 @@ switch ( $current_tab ) {
366
 
367
  //Auto Subscription for new registrations
368
  echo '<div class="s2_admin" id="s2_autosubscribe_settings">' . "\r\n";
369
- echo '<h3>' . __( 'Auto-Subscribe', 'subscribe2' ) . '</h3>' . "\r\n";
370
  echo '<p>' . "\r\n";
371
- echo __( 'Subscribe new users registering with your blog', 'subscribe2' ) . ':<br />' . "\r\n";
372
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['autosub'] ) || ( false === S2GDPR ) ) ) {
373
  echo '<label><input type="radio" name="autosub" value="yes"' . checked( $this->subscribe2_options['autosub'], 'yes', false ) . ' /> ';
374
- echo __( 'Automatically', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
375
  }
376
  echo '<label><input type="radio" name="autosub" value="wpreg"' . checked( $this->subscribe2_options['autosub'], 'wpreg', false ) . ' /> ';
377
- echo __( 'Display option on Registration Form', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
378
  echo '<label><input type="radio" name="autosub" value="no"' . checked( $this->subscribe2_options['autosub'], 'no', false ) . ' /> ';
379
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
380
- echo __( 'Auto-subscribe includes any excluded categories', 'subscribe2' ) . ':<br />' . "\r\n";
381
  echo '<label><input type="radio" name="newreg_override" value="yes"' . checked( $this->subscribe2_options['newreg_override'], 'yes', false ) . ' /> ';
382
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
383
  echo '<label><input type="radio" name="newreg_override" value="no"' . checked( $this->subscribe2_options['newreg_override'], 'no', false ) . ' /> ';
384
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
385
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['wpregdef'] ) || ( false === S2GDPR ) ) ) {
386
- echo __( 'Registration Form option is checked by default', 'subscribe2' ) . ':<br />' . "\r\n";
387
  echo '<label><input type="radio" name="wpregdef" value="yes"' . checked( $this->subscribe2_options['wpregdef'], 'yes', false ) . ' /> ';
388
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
389
  echo '<label><input type="radio" name="wpregdef" value="no"' . checked( $this->subscribe2_options['wpregdef'], 'no', false ) . ' /> ';
390
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
391
  }
392
- echo __( 'Auto-subscribe users to receive email as', 'subscribe2' ) . ': <br />' . "\r\n";
393
  echo '<label><input type="radio" name="autoformat" value="html"' . checked( $this->subscribe2_options['autoformat'], 'html', false ) . ' /> ';
394
- echo __( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
395
  echo '<label><input type="radio" name="autoformat" value="html_excerpt"' . checked( $this->subscribe2_options['autoformat'], 'html_excerpt', false ) . ' /> ';
396
- echo __( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
397
  echo '<label><input type="radio" name="autoformat" value="post"' . checked( $this->subscribe2_options['autoformat'], 'post', false ) . ' /> ';
398
- echo __( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
399
  echo '<label><input type="radio" name="autoformat" value="excerpt"' . checked( $this->subscribe2_options['autoformat'], 'excerpt', false ) . ' /> ';
400
- echo __( 'Plain Text - Excerpt', 'subscribe2' ) . '</label><br /><br />';
401
- echo __( 'Registered Users have the option to auto-subscribe to new categories', 'subscribe2' ) . ': <br />' . "\r\n";
402
  echo '<label><input type="radio" name="show_autosub" value="yes"' . checked( $this->subscribe2_options['show_autosub'], 'yes', false ) . ' /> ';
403
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
404
  echo '<label><input type="radio" name="show_autosub" value="no"' . checked( $this->subscribe2_options['show_autosub'], 'no', false ) . ' /> ';
405
- echo __( 'No', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
406
  echo '<label><input type="radio" name="show_autosub" value="exclude"' . checked( $this->subscribe2_options['show_autosub'], 'exclude', false ) . ' /> ';
407
- echo __( 'New categories are immediately excluded', 'subscribe2' ) . '</label><br /><br />';
408
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['autosub_def'] ) || ( false === S2GDPR ) ) ) {
409
- echo __( 'Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2' ) . ': <br />' . "\r\n";
410
  echo '<label><input type="radio" name="autosub_def" value="yes"' . checked( $this->subscribe2_options['autosub_def'], 'yes', false ) . ' /> ';
411
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
412
  echo '<label><input type="radio" name="autosub_def" value="no"' . checked( $this->subscribe2_options['autosub_def'], 'no', false ) . ' /> ';
413
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />';
414
  }
415
  // Hide these options if using Jetpack Comments
416
  if ( ! class_exists( 'Jetpack_Comments' ) ) {
417
- echo __( 'Display checkbox to allow subscriptions from the comment form', 'subscribe2' ) . ': <br />' . "\r\n";
418
  echo '<label><input type="radio" name="comment_subs" value="before"' . checked( $this->subscribe2_options['comment_subs'], 'before', false ) . ' /> ';
419
- echo __( 'Before the Comment Submit button', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
420
  echo '<label><input type="radio" name="comment_subs" value="after"' . checked( $this->subscribe2_options['comment_subs'], 'after', false ) . ' /> ';
421
- echo __( 'After the Comment Submit button', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
422
  echo '<label><input type="radio" name="comment_subs" value="no"' . checked( $this->subscribe2_options['comment_subs'], 'no', false ) . ' /> ';
423
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />';
424
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['comment_def'] ) || ( false === S2GDPR ) ) ) {
425
- echo __( 'Comment form checkbox is checked by default', 'subscribe2' ) . ': <br />' . "\r\n";
426
  echo '<label><input type="radio" name="comment_def" value="yes"' . checked( $this->subscribe2_options['comment_def'], 'yes', false ) . ' /> ';
427
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
428
  echo '<label><input type="radio" name="comment_def" value="no"' . checked( $this->subscribe2_options['comment_def'], 'no', false ) . ' /> ';
429
- echo __( 'No', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
430
  }
431
  }
432
- echo __( 'Show one-click subscription on profile page', 'subscribe2' ) . ':<br />' . "\r\n";
433
  echo '<label><input type="radio" name="one_click_profile" value="yes"' . checked( $this->subscribe2_options['one_click_profile'], 'yes', false ) . ' /> ';
434
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
435
  echo '<label><input type="radio" name="one_click_profile" value="no"' . checked( $this->subscribe2_options['one_click_profile'], 'no', false ) . ' /> ';
436
- echo __( 'No', 'subscribe2' ) . '</label>' . "\r\n";
437
  echo '</p></div>' . "\r\n";
438
  break;
439
 
@@ -444,39 +452,36 @@ switch ( $current_tab ) {
444
  echo '<p>' . "\r\n";
445
 
446
  // WordPress page ID where subscribe2 token is used
447
- echo __( 'Set default Subscribe2 page as', 'subscribe2' ) . ': ';
448
- echo '<select name="s2page">' . "\r\n";
449
- echo '<option value="0">' . __( 'Select a page', 'subscribe2' ) . '</option>' . "\r\n";
450
  $this->pages_dropdown( $this->subscribe2_options['s2page'] );
451
- echo '</select>' . "\r\n";
452
 
453
  // show link to WordPress page in meta
454
- echo '<br /><br /><label><input type="checkbox" name="show_meta" value="1"' . checked( $this->subscribe2_options['show_meta'], '1', false ) . ' /> ';
455
- echo __( 'Show a link to your subscription page in "meta"?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
456
 
457
  // show QuickTag button
458
  echo '<label><input type="checkbox" name="show_button" value="1"' . checked( $this->subscribe2_options['show_button'], '1', false ) . ' /> ';
459
- echo __( 'Show the Subscribe2 button on the Write toolbar?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
460
 
461
  // enable popup style form
462
  echo '<label><input type="checkbox" name="ajax" value="1"' . checked( $this->subscribe2_options['ajax'], '1', false ) . ' /> ';
463
- echo __( 'Enable popup style subscription form?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
464
 
465
  // show Widget
466
  echo '<label><input type="checkbox" name="widget" value="1"' . checked( $this->subscribe2_options['widget'], '1', false ) . ' /> ';
467
- echo __( 'Enable Subscribe2 Widget?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
468
 
469
  // show Counter Widget
470
  echo '<label><input type="checkbox" name="counterwidget" value="1"' . checked( $this->subscribe2_options['counterwidget'], '1', false ) . ' /> ';
471
- echo __( 'Enable Subscribe2 Counter Widget?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
472
 
473
  // s2_meta checked by default
474
  echo '<label><input type="checkbox" name="s2meta_default" value="1"' . checked( $this->subscribe2_options['s2meta_default'], '1', false ) . ' /> ';
475
- echo __( 'Disable email notifications is checked by default on authoring pages?', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
476
 
477
  // Subscription form for Registered Users on Frontend
478
  echo '<label><input type="checkbox" name="js_ip_updater" value="1"' . checked( $this->subscribe2_options['js_ip_updater'], '1', false ) . ' /> ';
479
- echo __( 'Use javascript to update IP address in Subscribe2 HTML form data? (useful if caching is enabled)', 'subscribe2' ) . '</label>' . "\r\n";
480
  echo '</p>';
481
  echo '</div>' . "\r\n";
482
  break;
@@ -484,31 +489,29 @@ switch ( $current_tab ) {
484
  case 'misc':
485
  //barred domains
486
  echo '<div class="s2_admin" id="s2_barred_domains">' . "\r\n";
487
- echo '<h3>' . __( 'Barred Domains', 'subscribe2' ) . '</h3>' . "\r\n";
488
  echo '<p>' . "\r\n";
489
- echo __( 'Enter domains to bar for public subscriptions, wildcards (*) and exceptions (!) are allowed', 'subscribe2' ) . '<br />' . "\r\n";
490
- echo __( 'Use a new line for each entry and omit the "@" symbol, for example !email.com, hotmail.com, yahoo.*', 'subscribe2' );
491
- echo "\r\n" . '<br /><textarea style="width: 98%;" rows="4" cols="60" name="barred">' . esc_textarea( $this->subscribe2_options['barred'] ) . '</textarea>';
492
  echo '</p>';
493
- echo '<h3>' . __( 'Links', 'subscribe2' ) . '</h3>' . "\r\n";
494
- echo '<a href="http://wordpress.org/plugins/subscribe2/">' . __( 'Plugin Site', 'subscribe2' ) . '</a><br />';
495
- echo '<a href="http://wordpress.org/support/plugin/subscribe2">' . __( 'Plugin Forum', 'subscribe2' ) . '</a><br />';
496
- echo '<a href="http://subscribe2.wordpress.com/">' . __( 'Plugin Blog', 'subscribe2' ) . '</a><br />';
497
- echo '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904">' . __( 'Make a donation via PayPal', 'subscribe2' ) . '</a>';
498
  echo '</div>' . "\r\n";
499
  break;
500
 
501
  }
502
  // submit
503
- echo '<p class="submit" style="text-align: center"><input type="submit" class="button-primary" name="submit" value="' . __( 'Submit', 'subscribe2' ) . '" /></p>';
504
 
505
  if ( 'misc' === $current_tab ) {
506
  // reset
507
- echo '<h3>' . __( 'Reset to Default Settings', 'subscribe2' ) . '</h3>' . "\r\n";
508
- echo '<p>' . __( 'Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2' ) . '</p>' . "\r\n";
509
  echo '<p class="submit" style="text-align: center">';
510
- echo '<input type="submit" id="deletepost" name="reset" value="' . __( 'RESET', 'subscribe2' ) .
511
- '" /></p>';
512
  }
513
  echo '</form></div>' . "\r\n";
514
 
8
  // was anything POSTed?
9
  if ( isset( $_POST['s2_admin'] ) ) {
10
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-options_subscribers' . S2VERSION ) ) {
11
+ die( '<p>' . esc_html__( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
12
  }
13
 
14
  if ( isset( $_POST['reset'] ) ) {
16
  global $s2_upgrade;
17
  $s2_upgrade = new S2_Upgrade();
18
  $s2_upgrade->reset();
19
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Options reset!', 'subscribe2' ) . '</strong></p></div>';
20
  } elseif ( isset( $_POST['preview'] ) ) {
21
  global $user_email, $post;
22
  $this->preview_email = true;
27
  } else {
28
  do_action( 's2_digest_preview', $user_email );
29
  }
30
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Preview message(s) sent to logged in user', 'subscribe2' ) . '</strong></p></div>';
31
  } elseif ( isset( $_POST['resend'] ) ) {
32
  $stickies = get_option( 'sticky_posts' );
33
  if ( ! empty( $this->subscribe2_options['last_s2cron'] ) || ( 'yes' === $this->subscribe2_options['stickies'] && ! empty( $stickies ) ) ) {
34
  do_action( 's2_digest_resend', 'resend' );
35
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Attempt made to resend the Digest Notification email', 'subscribe2' ) . '</strong></p></div>';
36
  } else {
37
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'The Digest Notification email contained no post information. No email was sent', 'subscribe2' ) . '</strong></p></div>';
38
  }
39
  } elseif ( isset( $_POST['submit'] ) ) {
40
  foreach ( $_POST as $key => $value ) {
47
  // check box entries
48
  ( isset( $_POST[ $key ] ) && '1' === $_POST[ $key ] ) ? $this->subscribe2_options[ $key ] = '1' : $this->subscribe2_options[ $key ] = '0';
49
  } elseif ( 'appearance_tab' === $key ) {
50
+ $options = array( 'show_meta', 'show_button', 'ajax', 'widget', 'counterwidget', 's2meta_default', 'js_ip_updater' );
51
  foreach ( $options as $option ) {
52
  if ( ! isset( $_POST[ $option ] ) ) {
53
  $this->subscribe2_options[ $option ] = '0';
117
  }
118
  }
119
 
120
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Options saved!', 'subscribe2' ) . '</strong></p></div>';
121
  update_option( 'subscribe2_options', $this->subscribe2_options );
122
  }
123
  }
125
  // send error message if no WordPress page exists
126
  $page_id = $wpdb->get_var( "SELECT ID FROM `{$wpdb->prefix}posts` WHERE post_type='page' AND post_status='publish' LIMIT 1" );
127
  if ( empty( $page_id ) ) {
128
+ echo '<div id="page_message" class="error"><p class="s2_error"><strong>' . esc_html__( 'You must create a WordPress page for this plugin to work correctly.', 'subscribe2' ) . '</strong></p></div>';
129
  }
130
 
131
  // display error message for GDPR
132
  if ( defined( 'S2GDPR' ) && true === S2GDPR ) {
133
  if ( 'yes' === $this->subscribe2_options['autosub'] || 'yes' === $this->subscribe2_options['wpregdef'] || 'yes' === $this->subscribe2_options['autosub_def'] || 'yes' === $this->subscribe2_options['comment_def'] ) {
134
+ echo '<div id="gdpr_message" class="error"><p class="s2_error"><strong>' . esc_html__( 'Your Settings may breach GDPR', 'subscribe2' ) . '</strong></p></div>';
135
  }
136
  }
137
 
150
  $template_link = '<a href="' . admin_url( 'admin.php?page=s2_settings&tab=templates' ) . '">' . __( 'Modify your template', 'subscribe2' ) . '</a>';
151
  if ( false !== $disallowed ) {
152
  $disallowed_keywords = __( 'Your chosen email type (per-post or digest) does not support the following keywords:', 'subscribe2' );
153
+ echo '<div id="keyword_message" class="error"><p class="s2_error"><strong>' . esc_html( $disallowed_keywords ) . '</strong><br>' . esc_html( implode( ', ', $disallowed ) ) . '<br>' . wp_kses_post( $template_link ) . '</p></div>';
154
  }
155
 
156
  // send error message if sender email address is off-domain
163
  list( $user, $sender_domain ) = explode( '@', $sender, 2 );
164
  if ( ! stristr( esc_html( $_SERVER['SERVER_NAME'] ), $sender_domain ) && 'author' !== $this->subscribe2_options['sender'] && '0' === $this->subscribe2_options['dismiss_sender_warning'] ) {
165
  // Translators: Warning message
166
+ echo wp_kses_post( '<div id="sender_message" class="error notice is-dismissible"><p class="s2_error"><strong>' . sprintf( __( 'You appear to be sending notifications from %1$s, which has a different domain name than your blog server %2$s. This may result in failed emails.', 'subscribe2' ), $sender, $_SERVER['SERVER_NAME'] ) . '</strong></p></div>' );
167
  }
168
 
169
  // detect or define which tab we are in
171
 
172
  // show our form
173
  echo '<div class="wrap">';
174
+ echo '<h1>' . esc_html__( 'Settings', 'subscribe2' ) . '</h1>' . "\r\n";
175
  $s2tabs = array(
176
  'email' => __( 'Email Settings', 'subscribe2' ),
177
  'templates' => __( 'Templates', 'subscribe2' ),
182
  echo '<h2 class="nav-tab-wrapper">';
183
  foreach ( $s2tabs as $tab_key => $tab_caption ) {
184
  $active = ( $current_tab === $tab_key ) ? 'nav-tab-active' : '';
185
+ echo '<a class="nav-tab ' . esc_attr( $active ) . '" href="?page=s2_settings&amp;tab=' . esc_html( $tab_key ) . '">' . esc_html( $tab_caption ) . '</a>';
186
  }
187
  echo '</h2>';
188
 
191
  wp_nonce_field( 'subscribe2-options_subscribers' . S2VERSION );
192
 
193
  echo '<input type="hidden" name="s2_admin" value="options" />' . "\r\n";
194
+ echo '<input type="hidden" id="jsbcclimit" value="' . esc_attr( $this->subscribe2_options['bcclimit'] ) . '" />';
195
 
196
  switch ( $current_tab ) {
197
  case 'email':
198
  // settings for outgoing emails
199
  echo '<div class="s2_admin" id="s2_notification_settings">' . "\r\n";
200
  echo '<p>' . "\r\n";
201
+ echo wp_kses_post( 'Restrict the number of <strong>recipients per email</strong> to (0 for unlimited)', 'subscribe2' ) . ': ';
202
+ echo '<span id="s2bcclimit_1"><span id="s2bcclimit" style="background-color: #FFFBCC">' . esc_html( $this->subscribe2_options['bcclimit'] ) . '</span> ';
203
+ echo '<a href="#" onclick="s2Show(\'bcclimit\'); return false;">' . esc_html__( 'Edit', 'subscribe2' ) . '</a></span>' . "\r\n";
204
  echo '<span id="s2bcclimit_2">' . "\r\n";
205
+ echo '<input type="text" name="bcclimit" value="' . esc_attr( $this->subscribe2_options['bcclimit'] ) . '" size="3" />' . "\r\n";
206
+ echo '<a href="#" onclick="s2Update(\'bcclimit\'); return false;">' . esc_html__( 'Update', 'subscribe2' ) . '</a>' . "\r\n";
207
+ echo '<a href="#" onclick="s2Revert(\'bcclimit\'); return false;">' . esc_html__( 'Revert', 'subscribe2' ) . '</a></span>' . "\n";
208
 
209
+ echo '<br><br>' . esc_html__( 'Send Admins notifications for new', 'subscribe2' ) . ': ';
210
  echo '<label><input type="radio" name="admin_email" value="subs"' . checked( $this->subscribe2_options['admin_email'], 'subs', false ) . ' />' . "\r\n";
211
+ echo esc_html__( 'Subscriptions', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
212
  echo '<label><input type="radio" name="admin_email" value="unsubs"' . checked( $this->subscribe2_options['admin_email'], 'unsubs', false ) . ' />' . "\r\n";
213
+ echo esc_html__( 'Unsubscriptions', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
214
  echo '<label><input type="radio" name="admin_email" value="both"' . checked( $this->subscribe2_options['admin_email'], 'both', false ) . ' />' . "\r\n";
215
+ echo esc_html__( 'Both', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
216
  echo '<label><input type="radio" name="admin_email" value="none"' . checked( $this->subscribe2_options['admin_email'], 'none', false ) . ' />' . "\r\n";
217
+ echo esc_html__( 'Neither', 'subscribe2' ) . '</label><br><br>' . "\r\n";
218
 
219
+ echo esc_html__( 'Include theme CSS stylesheet in HTML notifications', 'subscribe2' ) . ': ';
220
  echo '<label><input type="radio" name="stylesheet" value="yes"' . checked( $this->subscribe2_options['stylesheet'], 'yes', false ) . ' /> ';
221
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
222
  echo '<label><input type="radio" name="stylesheet" value="no"' . checked( $this->subscribe2_options['stylesheet'], 'no', false ) . ' /> ';
223
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
224
 
225
+ echo esc_html__( 'Send Emails for Pages', 'subscribe2' ) . ': ';
226
  echo '<label><input type="radio" name="pages" value="yes"' . checked( $this->subscribe2_options['pages'], 'yes', false ) . ' /> ';
227
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
228
  echo '<label><input type="radio" name="pages" value="no"' . checked( $this->subscribe2_options['pages'], 'no', false ) . ' /> ';
229
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
230
+
231
+ $s2_post_types = apply_filters( 's2_post_types', array() );
232
  if ( ! empty( $s2_post_types ) ) {
233
+ if ( ! empty( $s2_post_types ) ) {
234
+ echo esc_html__( 'Subscribe2 will send email notifications for the following custom post types', 'subscribe2' ) . ': ';
235
+ echo '<strong>' . esc_html( implode( ', ', $s2_post_types ) ) . '</strong><br><br>' . "\r\n";
 
236
  }
 
237
  }
238
+
239
+ echo esc_html__( 'Send Emails for Password Protected Posts', 'subscribe2' ) . ': ';
240
  echo '<label><input type="radio" name="password" value="yes"' . checked( $this->subscribe2_options['password'], 'yes', false ) . ' /> ';
241
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
242
  echo '<label><input type="radio" name="password" value="no"' . checked( $this->subscribe2_options['password'], 'no', false ) . ' /> ';
243
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
244
+ echo esc_html__( 'Send Emails for Private Posts', 'subscribe2' ) . ': ';
245
  echo '<label><input type="radio" name="private" value="yes"' . checked( $this->subscribe2_options['private'], 'yes', false ) . ' /> ';
246
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
247
  echo '<label><input type="radio" name="private" value="no"' . checked( $this->subscribe2_options['private'], 'no', false ) . ' /> ';
248
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
249
  if ( 'never' !== $this->subscribe2_options['email_freq'] ) {
250
+ echo esc_html__( 'Include Sticky Posts at the top of all Digest Notifications', 'subscribe2' ) . ': ';
251
  echo '<label><input type="radio" name="stickies" value="yes"' . checked( $this->subscribe2_options['stickies'], 'yes', false ) . ' /> ';
252
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
253
  echo '<label><input type="radio" name="stickies" value="no"' . checked( $this->subscribe2_options['stickies'], 'no', false ) . ' /> ';
254
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
255
  }
256
+ echo esc_html__( 'Send Email From', 'subscribe2' ) . ': ';
257
  echo '<label>' . "\r\n";
258
  $this->admin_dropdown( true );
259
+ echo '</label><br><br>' . "\r\n";
260
  if ( function_exists( 'wp_schedule_event' ) ) {
261
+ echo esc_html__( 'Send Emails', 'subscribe2' ) . ': <br>' . "\r\n";
262
  $this->display_digest_choices();
263
+ }
264
+ if ( 'never' !== $this->subscribe2_options['email_freq'] ) {
265
+ echo '<p>' . esc_html__( 'For digest notifications, date order for posts is', 'subscribe2' ) . ': ' . "\r\n";
266
  echo '<label><input type="radio" name="cron_order" value="desc"' . checked( $this->subscribe2_options['cron_order'], 'desc', false ) . ' /> ';
267
+ echo esc_html__( 'Descending', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
268
  echo '<label><input type="radio" name="cron_order" value="asc"' . checked( $this->subscribe2_options['cron_order'], 'asc', false ) . ' /> ';
269
+ echo esc_html__( 'Ascending', 'subscribe2' ) . '</label></p>' . "\r\n";
270
  }
271
+ echo esc_html__( 'Add Tracking Parameters to the Permalink', 'subscribe2' ) . ': ';
272
+ echo '<input type="text" name="tracking" value="' . esc_attr( $this->subscribe2_options['tracking'] ) . '" size="50" /> ';
273
+ echo '<br>' . esc_html__( 'eg. utm_source=subscribe2&amp;utm_medium=email&amp;utm_campaign=postnotify&amp;utm_id={ID}&amp;utm_title={TITLE}', 'subscribe2' ) . "\r\n";
274
  echo '</p>' . "\r\n";
275
  echo '</div>' . "\r\n";
276
  break;
281
  echo '<p>' . "\r\n";
282
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 5px; *border-collapse: expression(\'separate\', cellSpacing = \'5px\');" class="editform">' . "\r\n";
283
  echo '<tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
284
+ echo esc_html__( 'Notification email (must not be empty)', 'subscribe2' ) . ':<br>' . "\r\n";
285
+ echo esc_html__( 'Subject Line', 'subscribe2' ) . ': ';
286
+ echo '<input type="text" name="notification_subject" value="' . esc_attr( $this->subscribe2_options['notification_subject'] ) . '" size="45" />';
287
+ echo '<br>' . "\r\n";
288
+ echo '<textarea rows="9" cols="60" name="mailtext" style="width:95%;">' . esc_textarea( stripslashes( $this->subscribe2_options['mailtext'] ) ) . '</textarea>' . "\r\n";
289
  echo '</td><td style="vertical-align: top;" rowspan="3">';
290
+ echo '<p class="submit"><input type="submit" class="button-secondary" name="preview" value="' . esc_html__( 'Send Email Preview', 'subscribe2' ) . '" /></p>' . "\r\n";
291
+ echo '<h3>' . esc_html__( 'Message substitutions', 'subscribe2' ) . '</h3>' . "\r\n";
292
  echo '<dl>';
293
+ echo '<dt><b><em style="color: red">' . esc_html__( 'IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED', 'subscribe2' ) . '</em></b></dt><dd></dd>' . "\r\n";
294
+ echo '<dt><b>{BLOGNAME}</b></dt><dd>' . esc_html( get_option( 'blogname' ) ) . '</dd>' . "\r\n";
295
+ echo '<dt><b>{BLOGLINK}</b></dt><dd>' . esc_html( get_option( 'home' ) ) . '</dd>' . "\r\n";
296
+ echo '<dt><b>{TITLE}</b></dt><dd>' . wp_kses_post( __( "the post's title<br>(<i>for per-post emails only</i>)", 'subscribe2' ) ) . '</dd>' . "\r\n";
297
+ echo '<dt><b>{TITLETEXT}</b></dt><dd>' . wp_kses_post( __( "the post's unformatted title <br>(<i>for per-post emails only</i>)", 'subscribe2' ) ) . '</dd>' . "\r\n";
298
+ echo '<dt><b>{POST}</b></dt><dd>' . wp_kses_post( __( "the excerpt or the entire post<br>(<i>based on the subscriber's preferences</i>)", 'subscribe2' ) ) . '</dd>' . "\r\n";
299
+ echo '<dt><b>{POSTTIME}</b></dt><dd>' . wp_kses_post( __( 'the excerpt of the post and the time it was posted<br>(<i>for digest emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
300
+ echo '<dt><b>{TABLE}</b></dt><dd>' . wp_kses_post( __( 'a list of post titles<br>(<i>for digest emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
301
+ echo '<dt><b>{TABLELINKS}</b></dt><dd>' . wp_kses_post( __( 'a list of post titles followed by links to the articles<br>(<i>for digest emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
302
+ echo '<dt><b>{REFERENCELINKS}</b></dt><dd>' . wp_kses_post( __( 'a reference style list of links at the end of the email with corresponding numbers in the content<br>(<i>for the full content plain text per-post email only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
303
+ echo '<dt><b>{PERMALINK}</b></dt><dd>' . wp_kses_post( __( "the post's permalink<br>(<i>for per-post emails only</i>)", 'subscribe2' ) ) . '</dd>' . "\r\n";
304
+ echo '<dt><b>{TINYLINK}</b></dt><dd>' . esc_html__( "the post's permalink after conversion by TinyURL", 'subscribe2' ) . '</dd>' . "\r\n";
305
+ echo '<dt><b>{PERMAURL}</b></dt><dd>' . wp_kses_post( __( "the post's unformatted permalink<br>(<i>for per-post emails only</i>)", 'subscribe2' ) ) . '</dd>' . "\r\n";
306
+ echo '<dt><b>{DATE}</b></dt><dd>' . wp_kses_post( __( 'the date the post was made<br>(<i>for per-post emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
307
+ echo '<dt><b>{TIME}</b></dt><dd>' . wp_kses_post( __( 'the time the post was made<br>(<i>for per-post emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
308
+ echo '<dt><b>{MYNAME}</b></dt><dd>' . esc_html__( "the admin or post author's name", 'subscribe2' ) . '</dd>' . "\r\n";
309
+ echo '<dt><b>{EMAIL}</b></dt><dd>' . esc_html__( "the admin or post author's email", 'subscribe2' ) . ' </dd>' . "\r\n";
310
+ echo '<dt><b>{AUTHORNAME}</b></dt><dd>' . esc_html__( "the post author's name", 'subscribe2' ) . '</dd>' . "\r\n";
311
+ echo '<dt><b>{LINK}</b></dt><dd>' . wp_kses_post( __( 'the generated link to confirm a request<br>(<i>only used in the confirmation email template</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
312
+ if ( 1 === $this->subscribe2_options['bcclimit'] ) {
313
+ echo '<dt><b>{UNSUBLINK}</b></dt><dd>' . wp_kses_post( __( 'a generated unsubscribe link<br>(<i>only used in the email notification template</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
314
+ }
315
+ echo '<dt><b>{ACTION}</b></dt><dd>' . wp_kses_post( __( 'Action performed by LINK in confirmation email<br>(<i>only used in the confirmation email template</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
316
+ echo '<dt><b>{CATS}</b></dt><dd>' . esc_html__( "the post's assigned categories", 'subscribe2' ) . '</dd>' . "\r\n";
317
+ echo '<dt><b>{TAGS}</b></dt><dd>' . esc_html__( "the post's assigned Tags", 'subscribe2' ) . '</dd>' . "\r\n";
318
+ echo '<dt><b>{COUNT}</b></dt><dd>' . wp_kses_post( __( 'the number of posts included in the digest email<br>(<i>for digest emails only</i>)', 'subscribe2' ) ) . '</dd>' . "\r\n";
319
+ if ( current_theme_supports( 'post-thumbnails' ) ) {
320
+ echo '<dt><b>{IMAGE}</b></dt><dd>' . esc_html__( "the post's featured image", 'subscribe2' ) . '</dd>' . "\r\n";
321
+ }
322
  echo '</dl></td></tr><tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
323
+ echo esc_html__( 'Subscribe / Unsubscribe confirmation email', 'subscribe2' ) . ':<br>' . "\r\n";
324
+ echo esc_html__( 'Subject Line', 'subscribe2' ) . ': ';
325
+ echo '<input type="text" name="confirm_subject" value="' . esc_attr( $this->subscribe2_options['confirm_subject'] ) . '" size="45" /><br>' . "\r\n";
326
+ echo '<textarea rows="9" cols="60" name="confirm_email" style="width:95%;">' . esc_textarea( stripslashes( $this->subscribe2_options['confirm_email'] ) ) . '</textarea>' . "\r\n";
327
  echo '</td></tr><tr><td style="vertical-align: top; height: 350px; min-height: 350px;">';
328
+ echo esc_html__( 'Reminder email to Unconfirmed Subscribers', 'subscribe2' ) . ':<br>' . "\r\n";
329
+ echo esc_html__( 'Subject Line', 'subscribe2' ) . ': ';
330
+ echo '<input type="text" name="remind_subject" value="' . esc_attr( $this->subscribe2_options['remind_subject'] ) . '" size="45" /><br>' . "\r\n";
331
+ echo '<textarea rows="9" cols="60" name="remind_email" style="width:95%;">' . esc_textarea( stripslashes( $this->subscribe2_options['remind_email'] ) ) . '</textarea><br><br>' . "\r\n";
332
  echo '</td></tr></table>' . "\r\n";
333
  echo '</div>' . "\r\n";
334
  break;
341
  // compulsory categories
342
  echo '<div class="s2_admin" id="s2_compulsory_categories">' . "\r\n";
343
  echo '<input type="hidden" name="registered_users_tab" value="options" />' . "\r\n";
344
+ echo '<h3>' . esc_html__( 'Compulsory Categories', 'subscribe2' ) . '</h3>' . "\r\n";
345
  echo '<p>' . "\r\n";
346
+ echo '<strong><em style="color: red">' . esc_html__( 'Compulsory categories will be checked by default for Registered Subscribers', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
347
  echo '</p>';
348
  $s2_forms->display_category_form( explode( ',', $this->subscribe2_options['compulsory'] ), 1, array(), 'compulsory' );
349
  echo "</div>\r\n";
350
 
351
  // excluded categories
352
  echo '<div class="s2_admin" id="s2_excluded_categories">' . "\r\n";
353
+ echo '<h3>' . esc_html__( 'Excluded Categories', 'subscribe2' ) . '</h3>' . "\r\n";
354
  echo '<p>';
355
+ echo '<strong><em style="color: red">' . esc_html__( 'Posts assigned to any Excluded Category do not generate notifications and are not included in digest notifications', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
356
  echo '</p>';
357
  $s2_forms->display_category_form( explode( ',', $this->subscribe2_options['exclude'] ), 1, array(), 'exclude' );
358
  echo '<p style="text-align: center;"><label><input type="checkbox" name="reg_override" value="1"' . checked( $this->subscribe2_options['reg_override'], '1', false ) . ' /> ';
359
+ echo esc_html__( 'Allow registered users to subscribe to excluded categories?', 'subscribe2' ) . '</label></p>' . "\r\n";
360
  echo '</div>' . "\r\n";
361
 
362
  // excluded post formats
364
  if ( false !== $formats ) {
365
  // excluded formats
366
  echo '<div class="s2_admin" id="s2_excluded_formats">' . "\r\n";
367
+ echo '<h3>' . esc_html__( 'Excluded Formats', 'subscribe2' ) . '</h3>' . "\r\n";
368
  echo '<p>';
369
+ echo '<strong><em style="color: red">' . esc_html__( 'Posts assigned to any Excluded Format do not generate notifications and are not included in digest notifications', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
370
  echo '</p>';
371
  $this->display_format_form( $formats, explode( ',', $this->subscribe2_options['exclude_formats'] ) );
372
  echo '</div>' . "\r\n";
374
 
375
  //Auto Subscription for new registrations
376
  echo '<div class="s2_admin" id="s2_autosubscribe_settings">' . "\r\n";
377
+ echo '<h3>' . esc_html__( 'Auto-Subscribe', 'subscribe2' ) . '</h3>' . "\r\n";
378
  echo '<p>' . "\r\n";
379
+ echo esc_html__( 'Subscribe new users registering with your blog', 'subscribe2' ) . ':<br>' . "\r\n";
380
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['autosub'] ) || ( false === S2GDPR ) ) ) {
381
  echo '<label><input type="radio" name="autosub" value="yes"' . checked( $this->subscribe2_options['autosub'], 'yes', false ) . ' /> ';
382
+ echo esc_html__( 'Automatically', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
383
  }
384
  echo '<label><input type="radio" name="autosub" value="wpreg"' . checked( $this->subscribe2_options['autosub'], 'wpreg', false ) . ' /> ';
385
+ echo esc_html__( 'Display option on Registration Form', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
386
  echo '<label><input type="radio" name="autosub" value="no"' . checked( $this->subscribe2_options['autosub'], 'no', false ) . ' /> ';
387
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
388
+ echo esc_html__( 'Auto-subscribe includes any excluded categories', 'subscribe2' ) . ':<br>' . "\r\n";
389
  echo '<label><input type="radio" name="newreg_override" value="yes"' . checked( $this->subscribe2_options['newreg_override'], 'yes', false ) . ' /> ';
390
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
391
  echo '<label><input type="radio" name="newreg_override" value="no"' . checked( $this->subscribe2_options['newreg_override'], 'no', false ) . ' /> ';
392
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
393
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['wpregdef'] ) || ( false === S2GDPR ) ) ) {
394
+ echo esc_html__( 'Registration Form option is checked by default', 'subscribe2' ) . ':<br>' . "\r\n";
395
  echo '<label><input type="radio" name="wpregdef" value="yes"' . checked( $this->subscribe2_options['wpregdef'], 'yes', false ) . ' /> ';
396
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
397
  echo '<label><input type="radio" name="wpregdef" value="no"' . checked( $this->subscribe2_options['wpregdef'], 'no', false ) . ' /> ';
398
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
399
  }
400
+ echo esc_html__( 'Auto-subscribe users to receive email as', 'subscribe2' ) . ': <br>' . "\r\n";
401
  echo '<label><input type="radio" name="autoformat" value="html"' . checked( $this->subscribe2_options['autoformat'], 'html', false ) . ' /> ';
402
+ echo esc_html__( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
403
  echo '<label><input type="radio" name="autoformat" value="html_excerpt"' . checked( $this->subscribe2_options['autoformat'], 'html_excerpt', false ) . ' /> ';
404
+ echo esc_html__( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
405
  echo '<label><input type="radio" name="autoformat" value="post"' . checked( $this->subscribe2_options['autoformat'], 'post', false ) . ' /> ';
406
+ echo esc_html__( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
407
  echo '<label><input type="radio" name="autoformat" value="excerpt"' . checked( $this->subscribe2_options['autoformat'], 'excerpt', false ) . ' /> ';
408
+ echo esc_html__( 'Plain Text - Excerpt', 'subscribe2' ) . '</label><br><br>';
409
+ echo esc_html__( 'Registered Users have the option to auto-subscribe to new categories', 'subscribe2' ) . ': <br>' . "\r\n";
410
  echo '<label><input type="radio" name="show_autosub" value="yes"' . checked( $this->subscribe2_options['show_autosub'], 'yes', false ) . ' /> ';
411
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
412
  echo '<label><input type="radio" name="show_autosub" value="no"' . checked( $this->subscribe2_options['show_autosub'], 'no', false ) . ' /> ';
413
+ echo esc_html__( 'No', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
414
  echo '<label><input type="radio" name="show_autosub" value="exclude"' . checked( $this->subscribe2_options['show_autosub'], 'exclude', false ) . ' /> ';
415
+ echo esc_html__( 'New categories are immediately excluded', 'subscribe2' ) . '</label><br><br>';
416
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['autosub_def'] ) || ( false === S2GDPR ) ) ) {
417
+ echo esc_html__( 'Option for Registered Users to auto-subscribe to new categories is checked by default', 'subscribe2' ) . ': <br>' . "\r\n";
418
  echo '<label><input type="radio" name="autosub_def" value="yes"' . checked( $this->subscribe2_options['autosub_def'], 'yes', false ) . ' /> ';
419
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
420
  echo '<label><input type="radio" name="autosub_def" value="no"' . checked( $this->subscribe2_options['autosub_def'], 'no', false ) . ' /> ';
421
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>';
422
  }
423
  // Hide these options if using Jetpack Comments
424
  if ( ! class_exists( 'Jetpack_Comments' ) ) {
425
+ echo esc_html__( 'Display checkbox to allow subscriptions from the comment form', 'subscribe2' ) . ': <br>' . "\r\n";
426
  echo '<label><input type="radio" name="comment_subs" value="before"' . checked( $this->subscribe2_options['comment_subs'], 'before', false ) . ' /> ';
427
+ echo esc_html__( 'Before the Comment Submit button', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
428
  echo '<label><input type="radio" name="comment_subs" value="after"' . checked( $this->subscribe2_options['comment_subs'], 'after', false ) . ' /> ';
429
+ echo esc_html__( 'After the Comment Submit button', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
430
  echo '<label><input type="radio" name="comment_subs" value="no"' . checked( $this->subscribe2_options['comment_subs'], 'no', false ) . ' /> ';
431
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>';
432
  if ( defined( 'S2GDPR' ) && ( ( true === S2GDPR && 'yes' === $this->subscribe2_options['comment_def'] ) || ( false === S2GDPR ) ) ) {
433
+ echo esc_html__( 'Comment form checkbox is checked by default', 'subscribe2' ) . ': <br>' . "\r\n";
434
  echo '<label><input type="radio" name="comment_def" value="yes"' . checked( $this->subscribe2_options['comment_def'], 'yes', false ) . ' /> ';
435
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
436
  echo '<label><input type="radio" name="comment_def" value="no"' . checked( $this->subscribe2_options['comment_def'], 'no', false ) . ' /> ';
437
+ echo esc_html__( 'No', 'subscribe2' ) . '</label><br><br>' . "\r\n";
438
  }
439
  }
440
+ echo esc_html__( 'Show one-click subscription on profile page', 'subscribe2' ) . ':<br>' . "\r\n";
441
  echo '<label><input type="radio" name="one_click_profile" value="yes"' . checked( $this->subscribe2_options['one_click_profile'], 'yes', false ) . ' /> ';
442
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
443
  echo '<label><input type="radio" name="one_click_profile" value="no"' . checked( $this->subscribe2_options['one_click_profile'], 'no', false ) . ' /> ';
444
+ echo esc_html__( 'No', 'subscribe2' ) . '</label>' . "\r\n";
445
  echo '</p></div>' . "\r\n";
446
  break;
447
 
452
  echo '<p>' . "\r\n";
453
 
454
  // WordPress page ID where subscribe2 token is used
455
+ echo esc_html__( 'Set default Subscribe2 page as', 'subscribe2' ) . ': ';
 
 
456
  $this->pages_dropdown( $this->subscribe2_options['s2page'] );
 
457
 
458
  // show link to WordPress page in meta
459
+ echo '<br><br><label><input type="checkbox" name="show_meta" value="1"' . checked( $this->subscribe2_options['show_meta'], '1', false ) . ' /> ';
460
+ echo esc_html__( 'Show a link to your subscription page in "meta"?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
461
 
462
  // show QuickTag button
463
  echo '<label><input type="checkbox" name="show_button" value="1"' . checked( $this->subscribe2_options['show_button'], '1', false ) . ' /> ';
464
+ echo esc_html__( 'Show the Subscribe2 button on the Write toolbar?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
465
 
466
  // enable popup style form
467
  echo '<label><input type="checkbox" name="ajax" value="1"' . checked( $this->subscribe2_options['ajax'], '1', false ) . ' /> ';
468
+ echo esc_html__( 'Enable popup style subscription form?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
469
 
470
  // show Widget
471
  echo '<label><input type="checkbox" name="widget" value="1"' . checked( $this->subscribe2_options['widget'], '1', false ) . ' /> ';
472
+ echo esc_html__( 'Enable Subscribe2 Widget?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
473
 
474
  // show Counter Widget
475
  echo '<label><input type="checkbox" name="counterwidget" value="1"' . checked( $this->subscribe2_options['counterwidget'], '1', false ) . ' /> ';
476
+ echo esc_html__( 'Enable Subscribe2 Counter Widget?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
477
 
478
  // s2_meta checked by default
479
  echo '<label><input type="checkbox" name="s2meta_default" value="1"' . checked( $this->subscribe2_options['s2meta_default'], '1', false ) . ' /> ';
480
+ echo esc_html__( 'Disable email notifications is checked by default on authoring pages?', 'subscribe2' ) . '</label><br><br>' . "\r\n";
481
 
482
  // Subscription form for Registered Users on Frontend
483
  echo '<label><input type="checkbox" name="js_ip_updater" value="1"' . checked( $this->subscribe2_options['js_ip_updater'], '1', false ) . ' /> ';
484
+ echo esc_html__( 'Use javascript to update IP address in Subscribe2 HTML form data? (useful if caching is enabled)', 'subscribe2' ) . '</label>' . "\r\n";
485
  echo '</p>';
486
  echo '</div>' . "\r\n";
487
  break;
489
  case 'misc':
490
  //barred domains
491
  echo '<div class="s2_admin" id="s2_barred_domains">' . "\r\n";
492
+ echo '<h3>' . esc_html__( 'Barred Domains', 'subscribe2' ) . '</h3>' . "\r\n";
493
  echo '<p>' . "\r\n";
494
+ echo esc_html__( 'Enter domains to bar for public subscriptions, wildcards (*) and exceptions (!) are allowed', 'subscribe2' ) . '<br>' . "\r\n";
495
+ echo esc_html__( 'Use a new line for each entry and omit the "@" symbol, for example !email.com, hotmail.com, yahoo.*', 'subscribe2' );
496
+ echo "\r\n" . '<br><textarea style="width: 98%;" rows="4" cols="60" name="barred">' . esc_textarea( $this->subscribe2_options['barred'] ) . '</textarea>';
497
  echo '</p>';
498
+ echo '<h3>' . esc_html__( 'Links', 'subscribe2' ) . '</h3>' . "\r\n";
499
+ echo '<a href="http://wordpress.org/plugins/subscribe2/">' . esc_html__( 'Plugin Site', 'subscribe2' ) . '</a><br>';
500
+ echo '<a href="http://wordpress.org/support/plugin/subscribe2">' . esc_html__( 'Plugin Forum', 'subscribe2' ) . '</a><br>';
501
+ echo '<a href="http://subscribe2.wordpress.com/">' . esc_html__( 'Plugin Blog', 'subscribe2' ) . '</a><br>';
 
502
  echo '</div>' . "\r\n";
503
  break;
504
 
505
  }
506
  // submit
507
+ echo '<p class="submit" style="text-align: center"><input type="submit" class="button-primary" name="submit" value="' . esc_attr( __( 'Submit', 'subscribe2' ) ) . '" /></p>';
508
 
509
  if ( 'misc' === $current_tab ) {
510
  // reset
511
+ echo '<h3>' . esc_html__( 'Reset to Default Settings', 'subscribe2' ) . '</h3>' . "\r\n";
512
+ echo '<p>' . esc_html__( 'Use this to reset all options to their defaults. This <strong><em>will not</em></strong> modify your list of subscribers.', 'subscribe2' ) . '</p>' . "\r\n";
513
  echo '<p class="submit" style="text-align: center">';
514
+ echo '<input type="submit" class="button" id="deletepost" name="reset" value="' . esc_attr( __( 'RESET', 'subscribe2' ) ) . '" /></p>';
 
515
  }
516
  echo '</form></div>' . "\r\n";
517
 
admin/subscribers.php CHANGED
@@ -17,19 +17,14 @@ if ( ! class_exists( 'WP_List_Table' ) ) {
17
  require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
  }
19
  if ( ! class_exists( 'Subscribe2_List_Table' ) ) {
20
- if ( version_compare( $GLOBALS['wp_version'], '4.3', '<' ) ) {
21
- require_once S2PATH . 'classes/class-s2-list-table-legacy.php';
22
- $s2_list_table = new S2_List_Table_Legacy();
23
- } else {
24
- require_once S2PATH . 'classes/class-s2-list-table.php';
25
- $s2_list_table = new S2_List_Table();
26
- }
27
  }
28
 
29
  // was anything POSTed ?
30
  if ( isset( $_POST['s2_admin'] ) ) {
31
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $s2_list_table->_args['plural'] ) ) {
32
- die( '<p>' . __( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
33
  }
34
 
35
  if ( ! empty( $_POST['addresses'] ) ) {
@@ -54,64 +49,64 @@ if ( isset( $_POST['s2_admin'] ) ) {
54
  continue;
55
  }
56
  $this->add( $clean_email, true );
57
- $message = '<div id="message" class="updated fade"><p><strong>' . __( 'Address(es) subscribed!', 'subscribe2' ) . '</strong></p></div>';
58
  } elseif ( isset( $_POST['unsubscribe'] ) ) {
59
  if ( false === $this->is_public( $clean_email ) || $this->is_registered( $clean_email ) ) {
60
  ( '' === $unsub_error ) ? $unsub_error = "$clean_email" : $unsub_error .= ", $clean_email";
61
  continue;
62
  }
63
  $this->delete( $clean_email );
64
- $message = '<div id="message" class="updated fade"><p><strong>' . __( 'Address(es) unsubscribed!', 'subscribe2' ) . '</strong></p></div>';
65
  }
66
  }
67
  }
68
  if ( '' !== $reg_sub_error ) {
69
- echo '<div id="message" class="error"><p><strong>' . __( 'Some emails were not processed, the following are already Registered Subscribers', 'subscribe2' ) . ':<br />' . esc_html( $reg_sub_error ) . '</strong></p></div>';
70
  }
71
  if ( '' !== $pub_sub_error ) {
72
- echo '<div id="message" class="error"><p><strong>' . __( 'Some emails were not processed, the following are already Public Subscribers', 'subscribe2' ) . ':<br />' . esc_html( $pub_sub_error ) . '</strong></p></div>';
73
  }
74
  if ( '' !== $unsub_error ) {
75
- echo '<div id="message" class="error"><p><strong>' . __( 'Some emails were not processed, the following were not in the database', 'subscribe2' ) . ':<br /> ' . esc_html( $unsub_error ) . '</strong></p></div>';
76
  }
77
  if ( '' !== $email_error ) {
78
- echo '<div id="message" class="error"><p><strong>' . __( 'Some emails were not processed, the following were invalid email addresses', 'subscribe2' ) . ':<br /> ' . esc_html( $email_error ) . '</strong></p></div>';
79
  }
80
  if ( '' !== $message ) {
81
- echo $message;
82
  }
83
  $_POST['what'] = 'confirmed';
84
  } elseif ( isset( $_POST['remind'] ) ) {
85
  $this->remind( $_POST['reminderemails'] );
86
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Reminder Email(s) Sent!', 'subscribe2' ) . '</strong></p></div>';
87
  } elseif ( isset( $_POST['sub_categories'] ) && 'subscribe' === $_POST['manage'] ) {
88
  if ( isset( $_REQUEST['subscriber'] ) ) {
89
  $this->subscribe_registered_users( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['category'] );
90
  } else {
91
  $this->subscribe_registered_users( $_POST['exportcsv'], $_POST['category'] );
92
  }
93
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Registered Users Subscribed!', 'subscribe2' ) . '</strong></p></div>';
94
  } elseif ( isset( $_POST['sub_categories'] ) && 'unsubscribe' === $_POST['manage'] ) {
95
  if ( isset( $_REQUEST['subscriber'] ) ) {
96
  $this->unsubscribe_registered_users( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['category'] );
97
  } else {
98
  $this->unsubscribe_registered_users( $_POST['exportcsv'], $_POST['category'] );
99
  }
100
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Registered Users Unsubscribed!', 'subscribe2' ) . '</strong></p></div>';
101
  } elseif ( isset( $_POST['sub_format'] ) ) {
102
  if ( isset( $_REQUEST['subscriber'] ) ) {
103
  $this->format_change( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['format'] );
104
  } else {
105
  $this->format_change( $_POST['exportcsv'], $_POST['format'] );
106
  }
107
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Format updated for Selected Registered Users!', 'subscribe2' ) . '</strong></p></div>';
108
  } elseif ( isset( $_POST['sub_digest'] ) ) {
109
  if ( isset( $_REQUEST['subscriber'] ) ) {
110
  $this->digest_change( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['sub_category'] );
111
  } else {
112
  $this->digest_change( $_POST['exportcsv'], $_POST['sub_category'] );
113
  }
114
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Digest Subscription updated for Selected Registered Users!', 'subscribe2' ) . '</strong></p></div>';
115
  }
116
  }
117
 
@@ -196,7 +191,7 @@ $s2_list_table->prepare_items();
196
 
197
  // show our form
198
  echo '<div class="wrap">';
199
- echo '<h1>' . __( 'Subscribers', 'subscribe2' ) . '</h1>' . "\r\n";
200
  $s2tabs = array(
201
  'public' => __( 'Public Subscribers', 'subscribe2' ),
202
  'registered' => __( 'Registered Subscribers', 'subscribe2' ),
@@ -204,7 +199,7 @@ $s2tabs = array(
204
  echo '<h2 class="nav-tab-wrapper">';
205
  foreach ( $s2tabs as $tab_key => $tab_caption ) {
206
  $active = ( $current_tab === $tab_key ) ? 'nav-tab-active' : '';
207
- echo '<a class="nav-tab ' . $active . '" href="?page=s2_tools&amp;tab=' . $tab_key . '">' . $tab_caption . '</a>';
208
  }
209
  echo '</h2>';
210
  echo '<form method="post">' . "\r\n";
@@ -214,18 +209,18 @@ switch ( $current_tab ) {
214
  case 'public':
215
  echo '<input type="hidden" id="s2_location" name="s2_location" value="public" />' . "\r\n";
216
  echo '<div class="s2_admin" id="s2_add_subscribers">' . "\r\n";
217
- echo '<h2>' . __( 'Add/Remove Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
218
- echo '<p>' . __( 'Enter addresses, one per line or comma-separated', 'subscribe2' ) . '<br />' . "\r\n";
219
  echo '<textarea rows="2" cols="80" name="addresses"></textarea></p>' . "\r\n";
220
  echo '<input type="hidden" name="s2_admin" />' . "\r\n";
221
- echo '<p class="submit" style="border-top: none;"><input type="submit" class="button-primary" name="subscribe" value="' . __( 'Subscribe', 'subscribe2' ) . '" />';
222
- echo '&nbsp;<input type="submit" class="button-primary" name="unsubscribe" value="' . __( 'Unsubscribe', 'subscribe2' ) . '" /></p>' . "\r\n";
223
  echo '</div>' . "\r\n";
224
 
225
  // subscriber lists
226
  echo '<div class="s2_admin" id="s2_current_subscribers">' . "\r\n";
227
- echo '<h2>' . __( 'Current Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
228
- echo '<br />';
229
  $cats = $this->all_cats();
230
  $cat_ids = array();
231
  foreach ( $cats as $category ) {
@@ -237,15 +232,15 @@ switch ( $current_tab ) {
237
  case 'registered':
238
  echo '<input type="hidden" id="s2_location" name="s2_location" value="registered" />' . "\r\n";
239
  echo '<div class="s2_admin" id="s2_add_subscribers">' . "\r\n";
240
- echo '<h2>' . __( 'Add/Remove Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
241
- echo '<p class="submit" style="border-top: none;"><a class="button-primary" href="' . admin_url( 'user-new.php' ) . '">' . __( 'Add Registered User', 'subscribe2' ) . '</a></p>' . "\r\n";
242
 
243
  echo "</div>\r\n";
244
 
245
  // subscriber lists
246
  echo '<div class="s2_admin" id="s2_current_subscribers">' . "\r\n";
247
- echo '<h2>' . __( 'Current Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
248
- echo '<br />';
249
  $exclude = array( 'all', 'public', 'confirmed', 'unconfirmed' );
250
  break;
251
  }
@@ -256,8 +251,8 @@ echo '<td style="width: 50%; text-align: left;">';
256
  $this->display_subscriber_dropdown( $what, __( 'Filter', 'subscribe2' ), $exclude );
257
  echo '</td>' . "\r\n";
258
  if ( $reminderform ) {
259
- echo '<td style="width: 25%; text-align: right;"><input type="hidden" name="reminderemails" value="' . $reminderemails . '" />' . "\r\n";
260
- echo '<input type="submit" class="button-secondary" name="remind" value="' . __( 'Send Reminder Email', 'subscribe2' ) . '" /></td>' . "\r\n";
261
  } else {
262
  echo '<td style="width: 25%;"></td>';
263
  }
@@ -270,8 +265,8 @@ if ( ! empty( $subscribers ) ) {
270
  ( '' === $exportcsv ) ? $exportcsv = $subscriber['user_email'] : $exportcsv .= ",\r\n" . $subscriber['user_email'];
271
  }
272
  }
273
- echo '<td style="width: 25%; text-align: right;"><input type="hidden" name="exportcsv" value="' . $exportcsv . '" />' . "\r\n";
274
- echo '<input type="submit" class="button-secondary" name="csv" value="' . __( 'Save Emails to CSV File', 'subscribe2' ) . '" /></td>' . "\r\n";
275
  } else {
276
  echo '<td style="width: 25%;"></td>';
277
  }
@@ -285,7 +280,7 @@ echo '</div>' . "\r\n";
285
  // show bulk management form if filtered in some Registered Users
286
  if ( 'registered' === $current_tab ) {
287
  echo '<div class="s2_admin" id="s2_bulk_manage">' . "\r\n";
288
- echo '<h2>' . __( 'Bulk Management', 'subscribe2' ) . '</h2>' . "\r\n";
289
  if ( 'never' === $this->subscribe2_options['email_freq'] ) {
290
  $categories = array();
291
  if ( isset( $_POST['category'] ) ) {
@@ -299,36 +294,36 @@ if ( 'registered' === $current_tab ) {
299
  if ( isset( $_POST['format'] ) ) {
300
  $format = $_POST['format'];
301
  }
302
- echo __( 'Preferences for Registered Users selected above can be changed using this section.', 'subscribe2' ) . '<br />' . "\r\n";
303
- echo '<strong><em style="color: red">' . __( 'Consider User Privacy as changes cannot be undone', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
304
- echo '<br />' . __( 'Action to perform', 'subscribe2' ) . ':' . "\r\n";
305
- echo '<label><input type="radio" name="manage" value="subscribe"' . checked( $manage, 'subscribe', false ) . ' /> ' . __( 'Subscribe', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
306
- echo '<label><input type="radio" name="manage" value="unsubscribe"' . checked( $manage, 'unsubscribe', false ) . ' /> ' . __( 'Unsubscribe', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
307
  if ( '1' === $this->subscribe2_options['reg_override'] ) {
308
  $s2_forms->display_category_form( $categories, 1 );
309
  } else {
310
  $s2_forms->display_category_form( $categories, 0 );
311
  }
312
- echo '<p class="submit"><button class="button-primary" name="sub_categories" onclick="return bmCheck();">' . __( 'Bulk Update Categories', 'subscribe2' ) . '</button></p>';
313
- echo '<br />' . __( 'Send email as', 'subscribe2' ) . ':' . "\r\n";
314
- echo '<label><input type="radio" name="format" value="html"' . checked( $format, 'html', false ) . ' /> ' . __( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
315
- echo '<label><input type="radio" name="format" value="html_excerpt"' . checked( $format, 'html_excerpt', false ) . ' /> ' . __( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
316
- echo '<label><input type="radio" name="format" value="post"' . checked( $format, 'post', false ) . ' /> ' . __( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
317
- echo '<label><input type="radio" name="format" value="excerpt"' . checked( $format, 'excerpt', false ) . '/> ' . __( 'Plain Text - Excerpt', 'subscribe2' ) . '</label>' . "\r\n";
318
- echo '<p class="submit"><button class="button-primary" name="sub_format" onclick="return bmCheck();">' . __( 'Bulk Update Format', 'subscribe2' ) . '</button></p>';
319
  } else {
320
  $sub_cats = '';
321
  if ( isset( $_POST['sub_category'] ) ) {
322
  $sub_cats = $_POST['sub_category'];
323
  }
324
- echo __( 'Preferences for Registered Users selected above can be changed using this section.', 'subscribe2' ) . "<br />\r\n";
325
- echo '<strong><em style="color: red">' . __( 'Consider User Privacy as changes cannot be undone.', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
326
- echo '<br />' . __( 'Subscribe Selected Users to receive a periodic digest notification', 'subscribe2' ) . ':' . "\r\n";
327
  echo '<label><input type="radio" name="sub_category" value="digest"' . checked( $sub_cats, 'digest', false ) . ' /> ';
328
- echo __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
329
  echo '<label><input type="radio" name="sub_category" value="-1"' . checked( $sub_cats, '-1', false ) . ' /> ';
330
- echo __( 'No', 'subscribe2' ) . '</label>';
331
- echo '<p class="submit"><button class="button-primary" name="sub_digest" onclick="return bmCheck();">' . __( 'Bulk Update Digest Subscription', 'subscribe2' ) . '</button></p>';
332
  }
333
  echo '</div>' . "\r\n";
334
  }
17
  require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
  }
19
  if ( ! class_exists( 'Subscribe2_List_Table' ) ) {
20
+ require_once S2PATH . 'classes/class-s2-list-table.php';
21
+ $s2_list_table = new S2_List_Table();
 
 
 
 
 
22
  }
23
 
24
  // was anything POSTed ?
25
  if ( isset( $_POST['s2_admin'] ) ) {
26
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'bulk-' . $s2_list_table->_args['plural'] ) ) {
27
+ die( '<p>' . esc_html__( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
28
  }
29
 
30
  if ( ! empty( $_POST['addresses'] ) ) {
49
  continue;
50
  }
51
  $this->add( $clean_email, true );
52
+ $message = __( 'Address(es) subscribed!', 'subscribe2' );
53
  } elseif ( isset( $_POST['unsubscribe'] ) ) {
54
  if ( false === $this->is_public( $clean_email ) || $this->is_registered( $clean_email ) ) {
55
  ( '' === $unsub_error ) ? $unsub_error = "$clean_email" : $unsub_error .= ", $clean_email";
56
  continue;
57
  }
58
  $this->delete( $clean_email );
59
+ $message = __( 'Address(es) unsubscribed!', 'subscribe2' );
60
  }
61
  }
62
  }
63
  if ( '' !== $reg_sub_error ) {
64
+ echo '<div id="message" class="error"><p><strong>' . esc_html__( 'Some emails were not processed, the following are already Registered Subscribers', 'subscribe2' ) . ':<br>' . esc_html( $reg_sub_error ) . '</strong></p></div>';
65
  }
66
  if ( '' !== $pub_sub_error ) {
67
+ echo '<div id="message" class="error"><p><strong>' . esc_html__( 'Some emails were not processed, the following are already Public Subscribers', 'subscribe2' ) . ':<br>' . esc_html( $pub_sub_error ) . '</strong></p></div>';
68
  }
69
  if ( '' !== $unsub_error ) {
70
+ echo '<div id="message" class="error"><p><strong>' . esc_html__( 'Some emails were not processed, the following were not in the database', 'subscribe2' ) . ':<br> ' . esc_html( $unsub_error ) . '</strong></p></div>';
71
  }
72
  if ( '' !== $email_error ) {
73
+ echo '<div id="message" class="error"><p><strong>' . esc_html__( 'Some emails were not processed, the following were invalid email addresses', 'subscribe2' ) . ':<br> ' . esc_html( $email_error ) . '</strong></p></div>';
74
  }
75
  if ( '' !== $message ) {
76
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html( $message ) . '</strong></p></div>';
77
  }
78
  $_POST['what'] = 'confirmed';
79
  } elseif ( isset( $_POST['remind'] ) ) {
80
  $this->remind( $_POST['reminderemails'] );
81
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Reminder Email(s) Sent!', 'subscribe2' ) . '</strong></p></div>';
82
  } elseif ( isset( $_POST['sub_categories'] ) && 'subscribe' === $_POST['manage'] ) {
83
  if ( isset( $_REQUEST['subscriber'] ) ) {
84
  $this->subscribe_registered_users( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['category'] );
85
  } else {
86
  $this->subscribe_registered_users( $_POST['exportcsv'], $_POST['category'] );
87
  }
88
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Registered Users Subscribed!', 'subscribe2' ) . '</strong></p></div>';
89
  } elseif ( isset( $_POST['sub_categories'] ) && 'unsubscribe' === $_POST['manage'] ) {
90
  if ( isset( $_REQUEST['subscriber'] ) ) {
91
  $this->unsubscribe_registered_users( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['category'] );
92
  } else {
93
  $this->unsubscribe_registered_users( $_POST['exportcsv'], $_POST['category'] );
94
  }
95
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Registered Users Unsubscribed!', 'subscribe2' ) . '</strong></p></div>';
96
  } elseif ( isset( $_POST['sub_format'] ) ) {
97
  if ( isset( $_REQUEST['subscriber'] ) ) {
98
  $this->format_change( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['format'] );
99
  } else {
100
  $this->format_change( $_POST['exportcsv'], $_POST['format'] );
101
  }
102
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Format updated for Selected Registered Users!', 'subscribe2' ) . '</strong></p></div>';
103
  } elseif ( isset( $_POST['sub_digest'] ) ) {
104
  if ( isset( $_REQUEST['subscriber'] ) ) {
105
  $this->digest_change( implode( ",\r\n", $_REQUEST['subscriber'] ), $_POST['sub_category'] );
106
  } else {
107
  $this->digest_change( $_POST['exportcsv'], $_POST['sub_category'] );
108
  }
109
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Digest Subscription updated for Selected Registered Users!', 'subscribe2' ) . '</strong></p></div>';
110
  }
111
  }
112
 
191
 
192
  // show our form
193
  echo '<div class="wrap">';
194
+ echo '<h1>' . esc_html__( 'Subscribers', 'subscribe2' ) . '</h1>' . "\r\n";
195
  $s2tabs = array(
196
  'public' => __( 'Public Subscribers', 'subscribe2' ),
197
  'registered' => __( 'Registered Subscribers', 'subscribe2' ),
199
  echo '<h2 class="nav-tab-wrapper">';
200
  foreach ( $s2tabs as $tab_key => $tab_caption ) {
201
  $active = ( $current_tab === $tab_key ) ? 'nav-tab-active' : '';
202
+ echo '<a class="nav-tab ' . esc_attr( $active ) . '" href="' . esc_url( '?page=s2_tools&amp;tab=' . $tab_key ) . '">' . esc_html( $tab_caption ) . '</a>';
203
  }
204
  echo '</h2>';
205
  echo '<form method="post">' . "\r\n";
209
  case 'public':
210
  echo '<input type="hidden" id="s2_location" name="s2_location" value="public" />' . "\r\n";
211
  echo '<div class="s2_admin" id="s2_add_subscribers">' . "\r\n";
212
+ echo '<h2>' . esc_html__( 'Add/Remove Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
213
+ echo '<p>' . esc_html__( 'Enter addresses, one per line or comma-separated', 'subscribe2' ) . '<br>' . "\r\n";
214
  echo '<textarea rows="2" cols="80" name="addresses"></textarea></p>' . "\r\n";
215
  echo '<input type="hidden" name="s2_admin" />' . "\r\n";
216
+ echo '<p class="submit" style="border-top: none;"><input type="submit" class="button-primary" name="subscribe" value="' . esc_attr( __( 'Subscribe', 'subscribe2' ) ) . '" />';
217
+ echo '&nbsp;<input type="submit" class="button-primary" name="unsubscribe" value="' . esc_attr( __( 'Unsubscribe', 'subscribe2' ) ) . '" /></p>' . "\r\n";
218
  echo '</div>' . "\r\n";
219
 
220
  // subscriber lists
221
  echo '<div class="s2_admin" id="s2_current_subscribers">' . "\r\n";
222
+ echo '<h2>' . esc_html__( 'Current Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
223
+ echo '<br>';
224
  $cats = $this->all_cats();
225
  $cat_ids = array();
226
  foreach ( $cats as $category ) {
232
  case 'registered':
233
  echo '<input type="hidden" id="s2_location" name="s2_location" value="registered" />' . "\r\n";
234
  echo '<div class="s2_admin" id="s2_add_subscribers">' . "\r\n";
235
+ echo '<h2>' . esc_html__( 'Add/Remove Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
236
+ echo '<p class="submit" style="border-top: none;"><a class="button-primary" href="' . esc_url( admin_url( 'user-new.php' ) ) . '">' . esc_html__( 'Add Registered User', 'subscribe2' ) . '</a></p>' . "\r\n";
237
 
238
  echo "</div>\r\n";
239
 
240
  // subscriber lists
241
  echo '<div class="s2_admin" id="s2_current_subscribers">' . "\r\n";
242
+ echo '<h2>' . esc_html__( 'Current Subscribers', 'subscribe2' ) . '</h2>' . "\r\n";
243
+ echo '<br>';
244
  $exclude = array( 'all', 'public', 'confirmed', 'unconfirmed' );
245
  break;
246
  }
251
  $this->display_subscriber_dropdown( $what, __( 'Filter', 'subscribe2' ), $exclude );
252
  echo '</td>' . "\r\n";
253
  if ( $reminderform ) {
254
+ echo '<td style="width: 25%; text-align: right;"><input type="hidden" name="reminderemails" value="' . esc_attr( $reminderemails ) . '" />' . "\r\n";
255
+ echo '<input type="submit" class="button-secondary" name="remind" value="' . esc_attr( __( 'Send Reminder Email', 'subscribe2' ) ) . '" /></td>' . "\r\n";
256
  } else {
257
  echo '<td style="width: 25%;"></td>';
258
  }
265
  ( '' === $exportcsv ) ? $exportcsv = $subscriber['user_email'] : $exportcsv .= ",\r\n" . $subscriber['user_email'];
266
  }
267
  }
268
+ echo '<td style="width: 25%; text-align: right;"><input type="hidden" name="exportcsv" value="' . esc_attr( $exportcsv ) . '" />' . "\r\n";
269
+ echo '<input type="submit" class="button-secondary" name="csv" value="' . esc_attr( __( 'Save Emails to CSV File', 'subscribe2' ) ) . '" /></td>' . "\r\n";
270
  } else {
271
  echo '<td style="width: 25%;"></td>';
272
  }
280
  // show bulk management form if filtered in some Registered Users
281
  if ( 'registered' === $current_tab ) {
282
  echo '<div class="s2_admin" id="s2_bulk_manage">' . "\r\n";
283
+ echo '<h2>' . esc_html__( 'Bulk Management', 'subscribe2' ) . '</h2>' . "\r\n";
284
  if ( 'never' === $this->subscribe2_options['email_freq'] ) {
285
  $categories = array();
286
  if ( isset( $_POST['category'] ) ) {
294
  if ( isset( $_POST['format'] ) ) {
295
  $format = $_POST['format'];
296
  }
297
+ echo esc_html__( 'Preferences for Registered Users selected above can be changed using this section.', 'subscribe2' ) . '<br>' . "\r\n";
298
+ echo '<strong><em style="color: red">' . esc_html__( 'Consider User Privacy as changes cannot be undone', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
299
+ echo '<br>' . esc_html__( 'Action to perform', 'subscribe2' ) . ':' . "\r\n";
300
+ echo '<label><input type="radio" name="manage" value="subscribe"' . checked( $manage, 'subscribe', false ) . ' /> ' . esc_html__( 'Subscribe', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
301
+ echo '<label><input type="radio" name="manage" value="unsubscribe"' . checked( $manage, 'unsubscribe', false ) . ' /> ' . esc_html__( 'Unsubscribe', 'subscribe2' ) . '</label><br><br>' . "\r\n";
302
  if ( '1' === $this->subscribe2_options['reg_override'] ) {
303
  $s2_forms->display_category_form( $categories, 1 );
304
  } else {
305
  $s2_forms->display_category_form( $categories, 0 );
306
  }
307
+ echo '<p class="submit"><button class="button-primary" name="sub_categories" onclick="return bmCheck();">' . esc_html__( 'Bulk Update Categories', 'subscribe2' ) . '</button></p>';
308
+ echo '<br>' . esc_html__( 'Send email as', 'subscribe2' ) . ':' . "\r\n";
309
+ echo '<label><input type="radio" name="format" value="html"' . checked( $format, 'html', false ) . ' /> ' . esc_html__( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
310
+ echo '<label><input type="radio" name="format" value="html_excerpt"' . checked( $format, 'html_excerpt', false ) . ' /> ' . esc_html__( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
311
+ echo '<label><input type="radio" name="format" value="post"' . checked( $format, 'post', false ) . ' /> ' . esc_html__( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
312
+ echo '<label><input type="radio" name="format" value="excerpt"' . checked( $format, 'excerpt', false ) . '/> ' . esc_html__( 'Plain Text - Excerpt', 'subscribe2' ) . '</label>' . "\r\n";
313
+ echo '<p class="submit"><button class="button-primary" name="sub_format" onclick="return bmCheck();">' . esc_html__( 'Bulk Update Format', 'subscribe2' ) . '</button></p>';
314
  } else {
315
  $sub_cats = '';
316
  if ( isset( $_POST['sub_category'] ) ) {
317
  $sub_cats = $_POST['sub_category'];
318
  }
319
+ echo esc_html__( 'Preferences for Registered Users selected above can be changed using this section.', 'subscribe2' ) . "<br>\r\n";
320
+ echo '<strong><em style="color: red">' . esc_html__( 'Consider User Privacy as changes cannot be undone.', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
321
+ echo '<br>' . esc_html__( 'Subscribe Selected Users to receive a periodic digest notification', 'subscribe2' ) . ':' . "\r\n";
322
  echo '<label><input type="radio" name="sub_category" value="digest"' . checked( $sub_cats, 'digest', false ) . ' /> ';
323
+ echo esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;' . "\r\n";
324
  echo '<label><input type="radio" name="sub_category" value="-1"' . checked( $sub_cats, '-1', false ) . ' /> ';
325
+ echo esc_html__( 'No', 'subscribe2' ) . '</label>';
326
+ echo '<p class="submit"><button class="button-primary" name="sub_digest" onclick="return bmCheck();">' . esc_html__( 'Bulk Update Digest Subscription', 'subscribe2' ) . '</button></p>';
327
  }
328
  echo '</div>' . "\r\n";
329
  }
admin/your-subscriptions.php CHANGED
@@ -10,7 +10,7 @@ $s2_forms->init();
10
  // was anything POSTed?
11
  if ( isset( $_POST['s2_admin'] ) && 'user' === $_POST['s2_admin'] ) {
12
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-user_subscribers' . S2VERSION ) ) {
13
- die( '<p>' . __( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
14
  }
15
  do_action( 's2_subscription_submit' );
16
  }
@@ -23,9 +23,9 @@ $userid = $s2_forms->get_userid();
23
  $user = get_userdata( $userid );
24
 
25
  if ( $userid === $user_ID ) {
26
- echo '<h1>' . __( 'Your Notification Settings', 'subscribe2' ) . "</h1>\r\n";
27
  } else {
28
- echo '<h1>' . __( 'Notification Settings for user:', 'subscribe2' ) . ' <span style="color: red;">' . $user->display_name . '</span></h1>' . "\r\n";
29
  }
30
 
31
 
@@ -37,7 +37,7 @@ echo '<p>';
37
  do_action( 's2_subscription_form', $userid );
38
 
39
  // submit
40
- echo '<p class="submit"><input type="submit" class="button-primary" name="submit" value="' . __( 'Update Preferences', 'subscribe2' ) . ' &raquo;" /></p>';
41
  echo '</form>' . "\r\n";
42
 
43
  echo '</div>' . "\r\n";
10
  // was anything POSTed?
11
  if ( isset( $_POST['s2_admin'] ) && 'user' === $_POST['s2_admin'] ) {
12
  if ( false === wp_verify_nonce( $_REQUEST['_wpnonce'], 'subscribe2-user_subscribers' . S2VERSION ) ) {
13
+ die( '<p>' . esc_html__( 'Security error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
14
  }
15
  do_action( 's2_subscription_submit' );
16
  }
23
  $user = get_userdata( $userid );
24
 
25
  if ( $userid === $user_ID ) {
26
+ echo '<h1>' . esc_html__( 'Your Notification Settings', 'subscribe2' ) . "</h1>\r\n";
27
  } else {
28
+ echo '<h1>' . esc_html__( 'Notification Settings for user:', 'subscribe2' ) . ' <span style="color: red;">' . esc_html( $user->display_name ) . '</span></h1>' . "\r\n";
29
  }
30
 
31
 
37
  do_action( 's2_subscription_form', $userid );
38
 
39
  // submit
40
+ echo '<p class="submit"><input type="submit" class="button-primary" name="submit" value="' . esc_attr( __( 'Update Preferences', 'subscribe2' ) ) . ' &raquo;" /></p>';
41
  echo '</form>' . "\r\n";
42
 
43
  echo '</div>' . "\r\n";
classes/class-s2-admin.php CHANGED
@@ -135,7 +135,7 @@ class S2_Admin extends S2_Core {
135
  'id' => 's2-settings-help4',
136
  'title' => __( 'Registered Users', 'subscribe2' ),
137
  'content' => '<p>' . __( 'This section allows settings that apply to Registered Subscribers to be configured.', 'subscribe2' ) .
138
- '</p><p>' . __( 'Categories can be made compulsory so emails are always sent for posts in these categories. They can also be excludes so that emails are not generated. Excluded categories take precedence over Compulsory categories.', 'subscribe2' ) .
139
  '</p><p>' . __( 'A set of default settings for new users can also be specified using the Auto Subscribe section. Settings specified here will be applied to any newly created user accounts while Subscribe2 is activated.', 'subscribe2' ) . '</p>',
140
  )
141
  );
@@ -148,21 +148,11 @@ class S2_Admin extends S2_Core {
148
  '</p><p>' . __( 'The email over ride check box can be set to be automatically checked for every new post and page from here to, this may be useful if you will only want to send very occasional notifications for specific posts. You can then uncheck this box just before you publish your content.', 'subscribe2' ) . '</p>',
149
  )
150
  );
151
- $screen->add_help_tab(
152
- array(
153
- 'id' => 's2-settings-help6',
154
- 'title' => __( 'ReCaptcha', 'subscribe2' ),
155
- 'content' => '<p>' . __( 'This section holds site and secret keys for using Google ReCaptcha.', 'subscribe2' ) .
156
- '</p><p>' . __( 'V2 ReCaptcha takes precedence over Invisible ReCaptcha. To use Invisible ReCaptcha, leave the V2 ReCaptcha key fields empty.', 'subscribe2' ) .
157
- '</p><p>' . __( 'Both key files needs populating for V2 ReCaptcha or Invisible ReCaptcha, failure to complete both fields will result in ReCaptcha not working.', 'subscribe2' ) . '</p>',
158
- )
159
- );
160
  $screen->add_help_tab(
161
  array(
162
  'id' => 's2-settings-help7',
163
  'title' => __( 'Miscellaneous', 'subscribe2' ),
164
  'content' => '<p>' . __( 'This section contains a place to bar specified domains from becoming Public Subscribers and links to help and support pages.', 'subscribe2' ) .
165
- '</p><p>' . __( 'In the paid Subscribe2 HTML version there is also a place here to enter a license code so that updates can be accessed automatically.', 'subscribe2' ) .
166
  '</p>',
167
  )
168
  );
@@ -257,7 +247,6 @@ class S2_Admin extends S2_Core {
257
  public function plugin_links( $links, $file ) {
258
  if ( S2DIR . 'subscribe2.php' === $file ) {
259
  $links[] = '<a href="admin.php?page=s2_settings">' . __( 'Settings', 'subscribe2' ) . '</a>';
260
- $links[] = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=2387904"><b>' . __( 'Donate', 'subscribe2' ) . '</b></a>';
261
  }
262
  return $links;
263
  }
@@ -316,12 +305,7 @@ class S2_Admin extends S2_Core {
316
  * Add buttons for Rich Text Editor
317
  */
318
  public function mce_plugin( $arr ) {
319
- if ( version_compare( $this->wp_release, '3.9', '<' ) ) {
320
- $path = S2URL . 'tinymce/editor-plugin3' . $this->script_debug . '.js';
321
- } else {
322
- $path = S2URL . 'tinymce/editor-plugin4' . $this->script_debug . '.js';
323
- }
324
- $arr['subscribe2'] = $path;
325
  return $arr;
326
  }
327
 
@@ -413,8 +397,8 @@ class S2_Admin extends S2_Core {
413
  public function s2_override_meta() {
414
  global $post_ID;
415
  $s2mail = get_post_meta( $post_ID, '_s2mail', true );
416
- echo '<input type="hidden" name="s2meta_nonce" id="s2meta_nonce" value="' . wp_create_nonce( wp_hash( plugin_basename( __FILE__ ) ) ) . '" />';
417
- echo __( 'Check here to disable sending of an email notification for this post/page', 'subscribe2' );
418
  echo '&nbsp;&nbsp;<input type="checkbox" name="s2_meta_field" value="no"';
419
  if ( 'no' === $s2mail || ( '1' === $this->subscribe2_options['s2meta_default'] && '' === $s2mail ) ) {
420
  echo ' checked="checked"';
@@ -451,8 +435,8 @@ class S2_Admin extends S2_Core {
451
  * Meta preview box code
452
  */
453
  public function s2_preview_meta() {
454
- echo '<p>' . __( 'Send preview email of this post to currently logged in user:', 'subscribe2' ) . '</p>' . "\r\n";
455
- echo '<input class="button" name="s2_preview" type="submit" value="' . __( 'Send Preview', 'subscribe2' ) . '" />' . "\r\n";
456
  }
457
 
458
  /**
@@ -464,7 +448,11 @@ class S2_Admin extends S2_Core {
464
  return;
465
  }
466
  global $post, $current_user;
467
- $this->publish( $post, $current_user->user_email );
 
 
 
 
468
  }
469
  }
470
 
@@ -472,8 +460,8 @@ class S2_Admin extends S2_Core {
472
  * Meta resend box code
473
  */
474
  public function s2_resend_meta() {
475
- echo '<p>' . __( 'Resend the notification email of this post to current subscribers:', 'subscribe2' ) . '</p>' . "\r\n";
476
- echo '<input class="button" name="s2_resend" type="submit" value="' . __( 'Resend Notification', 'subscribe2' ) . '" />' . "\r\n";
477
  }
478
 
479
  /**
@@ -605,7 +593,7 @@ class S2_Admin extends S2_Core {
605
  $j = 0;
606
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
607
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
608
- echo '<label><input type="checkbox" name="checkall" value="checkall_format" /> ' . __( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
609
  echo '</td></tr>' . "\r\n";
610
  echo '<tr style="vertical-align: top;"><td style="width: 50%; text-align: left">' . "\r\n";
611
  foreach ( $formats[0] as $format ) {
@@ -615,17 +603,17 @@ class S2_Admin extends S2_Core {
615
  }
616
 
617
  if ( 0 === $j ) {
618
- echo '<label><input class="checkall_format" type="checkbox" name="format[]" value="' . $format . '"';
619
  if ( in_array( $format, $selected, true ) ) {
620
  echo ' checked="checked"';
621
  }
622
- echo ' /> ' . ucwords( $format ) . '</label><br />' . "\r\n";
623
  } else {
624
- echo '<label><input class="checkall_format" type="checkbox" name="format[]" value="' . $format . '"';
625
  if ( in_array( $format, $selected, true ) ) {
626
  echo ' checked="checked"';
627
  }
628
- echo ' /> ' . ucwords( $format ) . '</label><br />' . "\r\n";
629
  }
630
  $i++;
631
  }
@@ -701,11 +689,11 @@ class S2_Admin extends S2_Core {
701
  continue;
702
  }
703
 
704
- echo '<option value="' . $whom . '"';
705
  if ( $whom === $selected ) {
706
  echo ' selected="selected" ';
707
  }
708
- echo '>' . $display . ' (' . ( $count[ $whom ] ) . ')</option>' . "\r\n";
709
  }
710
 
711
  if ( 'public' !== $current_tab && $count['registered'] > 0 && 'never' === $this->subscribe2_options['email_freq'] ) {
@@ -713,17 +701,17 @@ class S2_Admin extends S2_Core {
713
  if ( in_array( (string) $cat->term_id, $exclude, true ) ) {
714
  continue;
715
  }
716
- echo '<option value="' . $cat->term_id . '"';
717
  if ( $cat->term_id === $selected ) {
718
  echo ' selected="selected" ';
719
  }
720
- echo '> &nbsp;&nbsp;' . $cat->name . '&nbsp;(' . $count[ $cat->name ] . ') </option>' . "\r\n";
721
  }
722
  }
723
 
724
  echo '</select>';
725
  if ( false !== $submit ) {
726
- echo '&nbsp;<input type="submit" class="button-secondary" value="' . $submit . '" />' . "\r\n";
727
  }
728
  }
729
 
@@ -763,15 +751,27 @@ class S2_Admin extends S2_Core {
763
  $admins = array_merge( $author, $admins );
764
  }
765
 
766
- echo '<select name="sender">' . "\r\n";
767
  foreach ( $admins as $admin ) {
768
- echo '<option value="' . $admin->ID . '"';
769
  if ( $admin->ID === $this->subscribe2_options['sender'] ) {
770
- echo ' selected="selected"';
771
  }
772
- echo '>' . $admin->display_name . '</option>' . "\r\n";
773
  }
774
- echo '</select>' . "\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
775
  }
776
 
777
  /**
@@ -782,7 +782,7 @@ class S2_Admin extends S2_Core {
782
  global $wpdb;
783
  $cron_file = ABSPATH . 'wp-cron.php';
784
  if ( ! is_readable( $cron_file ) ) {
785
- echo '<strong><em style="color: red">' . __( 'The WordPress cron functions may be disabled on this server. Digest notifications may not work.', 'subscribe2' ) . '</em></strong><br />' . "\r\n";
786
  }
787
  $scheduled_time = wp_next_scheduled( 's2_digest_cron' );
788
  $offset = get_option( 'gmt_offset' ) * 60 * 60;
@@ -807,43 +807,43 @@ class S2_Admin extends S2_Core {
807
  $schedule_sorted[ $key ] = $schedule[ $key ];
808
  }
809
  foreach ( $schedule_sorted as $key => $value ) {
810
- echo '<label><input type="radio" name="email_freq" value="' . $key . '"' . checked( $this->subscribe2_options['email_freq'], $key, false ) . ' />';
811
- echo ' ' . $value['display'] . '</label><br />' . "\r\n";
812
  }
813
  if ( $scheduled_time ) {
814
  $date_format = get_option( 'date_format' );
815
  $time_format = get_option( 'time_format' );
816
- echo '<p>' . __( 'Current UTC time is', 'subscribe2' ) . ': ' . "\r\n";
817
- echo '<strong>' . date_i18n( $date_format . ' @ ' . $time_format, false, 'gmt' ) . '</strong></p>' . "\r\n";
818
- echo '<p>' . __( 'Current blog time is', 'subscribe2' ) . ': ' . "\r\n";
819
- echo '<strong>' . date_i18n( $date_format . ' @ ' . $time_format ) . '</strong></p>' . "\r\n";
820
- echo '<p>' . __( 'Next email notification will be sent when your blog time is after', 'subscribe2' ) . ': ' . "\r\n";
821
- echo '<input type="hidden" id="jscrondate" value="' . date_i18n( $date_format, $scheduled_time + $offset ) . '" />';
822
- echo '<input type="hidden" id="jscrontime" value="' . date_i18n( $time_format, $scheduled_time + $offset ) . '" />';
823
- echo '<span id="s2cron_1"><span id="s2crondate" style="background-color: #FFFBCC">' . date_i18n( $date_format, $scheduled_time + $offset ) . '</span>';
824
- echo ' @ <span id="s2crontime" style="background-color: #FFFBCC">' . date_i18n( $time_format, $scheduled_time + $offset ) . '</span> ';
825
- echo '<a href="#" onclick="s2Show(\'cron\'); return false;">' . __( 'Edit', 'subscribe2' ) . '</a></span>' . "\r\n";
826
  echo '<span id="s2cron_2">' . "\r\n";
827
- echo '<input id="s2datepicker" name="crondate" value="' . date_i18n( $date_format, $scheduled_time + $offset ) . '">' . "\r\n";
828
  $hours = array( '12:00 am', '1:00 am', '2:00 am', '3:00 am', '4:00 am', '5:00 am', '6:00 am', '7:00 am', '8:00 am', '9:00 am', '10:00 am', '11:00 am', '12:00 pm', '1:00 pm', '2:00 pm', '3:00 pm', '4:00 pm', '5:00 pm', '6:00 pm', '7:00 pm', '8:00 pm', '9:00 pm', '10:00 pm', '11:00 pm' );
829
  $current_hour = intval( date_i18n( 'G', $scheduled_time + $offset ) );
830
  echo '<select name="crontime">' . "\r\n";
831
  foreach ( $hours as $key => $value ) {
832
- echo '<option value="' . $key . '"';
833
  if ( ! empty( $scheduled_time ) && $key === $current_hour ) {
834
  echo ' selected="selected"';
835
  }
836
- echo '>' . $value . '</option>' . "\r\n";
837
  }
838
  echo '</select>' . "\r\n";
839
- echo '<a href="#" onclick="s2CronUpdate(\'cron\'); return false;">' . __( 'Update', 'subscribe2' ) . '</a>' . "\r\n";
840
- echo '<a href="#" onclick="s2CronRevert(\'cron\'); return false;">' . __( 'Revert', 'subscribe2' ) . '</a></span>' . "\r\n";
841
  if ( ! empty( $this->subscribe2_options['last_s2cron'] ) ) {
842
- echo '<p>' . __( 'Attempt to resend the last Digest Notification email', 'subscribe2' ) . ': ';
843
- echo '<input type="submit" class="button-secondary" name="resend" value="' . __( 'Resend Digest', 'subscribe2' ) . '" /></p>' . "\r\n";
844
  }
845
  } else {
846
- echo '<br />';
847
  }
848
  }
849
 
@@ -856,7 +856,8 @@ class S2_Admin extends S2_Core {
856
  return;
857
  }
858
 
859
- $option = '';
 
860
  foreach ( $pages as $page ) {
861
  $option .= '<option value="' . $page->ID . '"';
862
  if ( $page->ID === $s2page ) {
@@ -871,8 +872,19 @@ class S2_Admin extends S2_Core {
871
  }
872
  $option .= $page->post_title . '</option>' . "\r\n";
873
  }
 
874
 
875
- echo $option;
 
 
 
 
 
 
 
 
 
 
876
  }
877
 
878
  /**
@@ -1116,11 +1128,11 @@ class S2_Admin extends S2_Core {
1116
  * Show form for one-click subscription on user profile page
1117
  */
1118
  public function one_click_profile_form( $user ) {
1119
- echo '<h3>' . __( 'Email subscription', 'subscribe2' ) . '</h3>' . "\r\n";
1120
  echo '<table class="form-table">' . "\r\n";
1121
- echo '<tr><th scope="row">' . __( 'Subscribe / Unsubscribe', 'subscribe2' ) . '</th>' . "\r\n";
1122
- echo '<td><label><input type="checkbox" name="sub2-one-click-subscribe" value="1" ' . checked( ! get_user_meta( $user->ID, $this->get_usermeta_keyname( 's2_subscribed' ), true ), false, false ) . ' /> ' . __( 'Receive notifications', 'subscribe2' ) . '</label><br />' . "\r\n";
1123
- echo '<span class="description">' . __( 'Check if you want to receive email notification when new posts are published', 'subscribe2' ) . '</span>' . "\r\n";
1124
  echo '</td></tr></table>' . "\r\n";
1125
  }
1126
 
@@ -1159,4 +1171,13 @@ class S2_Admin extends S2_Core {
1159
  $this->subscribe2_cron( '', 'resend' );
1160
  }
1161
  }
 
 
 
 
 
 
 
 
 
1162
  }
135
  'id' => 's2-settings-help4',
136
  'title' => __( 'Registered Users', 'subscribe2' ),
137
  'content' => '<p>' . __( 'This section allows settings that apply to Registered Subscribers to be configured.', 'subscribe2' ) .
138
+ '</p><p>' . __( 'Categories can be made compulsory so emails are always sent to Public and Registered Subscribers for posts in these categories. They can also be excluded so that emails are not generated for Subscribers. Registered Subscribers can be allowed to bypass category exclusions. Excluded categories take precedence over Compulsory categories.', 'subscribe2' ) .
139
  '</p><p>' . __( 'A set of default settings for new users can also be specified using the Auto Subscribe section. Settings specified here will be applied to any newly created user accounts while Subscribe2 is activated.', 'subscribe2' ) . '</p>',
140
  )
141
  );
148
  '</p><p>' . __( 'The email over ride check box can be set to be automatically checked for every new post and page from here to, this may be useful if you will only want to send very occasional notifications for specific posts. You can then uncheck this box just before you publish your content.', 'subscribe2' ) . '</p>',
149
  )
150
  );
 
 
 
 
 
 
 
 
 
151
  $screen->add_help_tab(
152
  array(
153
  'id' => 's2-settings-help7',
154
  'title' => __( 'Miscellaneous', 'subscribe2' ),
155
  'content' => '<p>' . __( 'This section contains a place to bar specified domains from becoming Public Subscribers and links to help and support pages.', 'subscribe2' ) .
 
156
  '</p>',
157
  )
158
  );
247
  public function plugin_links( $links, $file ) {
248
  if ( S2DIR . 'subscribe2.php' === $file ) {
249
  $links[] = '<a href="admin.php?page=s2_settings">' . __( 'Settings', 'subscribe2' ) . '</a>';
 
250
  }
251
  return $links;
252
  }
305
  * Add buttons for Rich Text Editor
306
  */
307
  public function mce_plugin( $arr ) {
308
+ $arr['subscribe2'] = S2URL . 'tinymce/editor-plugin4' . $this->script_debug . '.js';
 
 
 
 
 
309
  return $arr;
310
  }
311
 
397
  public function s2_override_meta() {
398
  global $post_ID;
399
  $s2mail = get_post_meta( $post_ID, '_s2mail', true );
400
+ echo '<input type="hidden" name="s2meta_nonce" id="s2meta_nonce" value="' . esc_attr( wp_create_nonce( wp_hash( plugin_basename( __FILE__ ) ) ) ) . '" />';
401
+ echo esc_html__( 'Check here to disable sending of an email notification for this post/page', 'subscribe2' );
402
  echo '&nbsp;&nbsp;<input type="checkbox" name="s2_meta_field" value="no"';
403
  if ( 'no' === $s2mail || ( '1' === $this->subscribe2_options['s2meta_default'] && '' === $s2mail ) ) {
404
  echo ' checked="checked"';
435
  * Meta preview box code
436
  */
437
  public function s2_preview_meta() {
438
+ echo '<p>' . esc_html__( 'Send preview email of this post to currently logged in user:', 'subscribe2' ) . '</p>' . "\r\n";
439
+ echo '<input class="button" name="s2_preview" type="submit" value="' . esc_attr( __( 'Send Preview', 'subscribe2' ) ) . '" />' . "\r\n";
440
  }
441
 
442
  /**
448
  return;
449
  }
450
  global $post, $current_user;
451
+ if ( 'never' !== $this->subscribe2_options['email_freq'] ) {
452
+ $this->subscribe2_cron( $current_user->user_email );
453
+ } else {
454
+ $this->publish( $post, $current_user->user_email );
455
+ }
456
  }
457
  }
458
 
460
  * Meta resend box code
461
  */
462
  public function s2_resend_meta() {
463
+ echo '<p>' . esc_html__( 'Resend the notification email of this post to current subscribers:', 'subscribe2' ) . '</p>' . "\r\n";
464
+ echo '<input class="button" name="s2_resend" type="submit" value="' . esc_attr( __( 'Resend Notification', 'subscribe2' ) ) . '" />' . "\r\n";
465
  }
466
 
467
  /**
593
  $j = 0;
594
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
595
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
596
+ echo '<label><input type="checkbox" name="checkall" value="checkall_format" /> ' . esc_html__( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
597
  echo '</td></tr>' . "\r\n";
598
  echo '<tr style="vertical-align: top;"><td style="width: 50%; text-align: left">' . "\r\n";
599
  foreach ( $formats[0] as $format ) {
603
  }
604
 
605
  if ( 0 === $j ) {
606
+ echo '<label><input class="checkall_format" type="checkbox" name="format[]" value="' . esc_attr( $format ) . '"';
607
  if ( in_array( $format, $selected, true ) ) {
608
  echo ' checked="checked"';
609
  }
610
+ echo ' /> ' . esc_html( ucwords( $format ) ) . '</label><br>' . "\r\n";
611
  } else {
612
+ echo '<label><input class="checkall_format" type="checkbox" name="format[]" value="' . esc_attr( $format ) . '"';
613
  if ( in_array( $format, $selected, true ) ) {
614
  echo ' checked="checked"';
615
  }
616
+ echo ' /> ' . esc_html( ucwords( $format ) ) . '</label><br>' . "\r\n";
617
  }
618
  $i++;
619
  }
689
  continue;
690
  }
691
 
692
+ echo '<option value="' . esc_attr( $whom ) . '"';
693
  if ( $whom === $selected ) {
694
  echo ' selected="selected" ';
695
  }
696
+ echo '>' . esc_html( $display ) . ' (' . esc_html( $count[ $whom ] ) . ')</option>' . "\r\n";
697
  }
698
 
699
  if ( 'public' !== $current_tab && $count['registered'] > 0 && 'never' === $this->subscribe2_options['email_freq'] ) {
701
  if ( in_array( (string) $cat->term_id, $exclude, true ) ) {
702
  continue;
703
  }
704
+ echo '<option value="' . esc_attr( $cat->term_id ) . '"';
705
  if ( $cat->term_id === $selected ) {
706
  echo ' selected="selected" ';
707
  }
708
+ echo '> &nbsp;&nbsp;' . esc_html( $cat->name ) . '&nbsp;(' . esc_html( $count[ $cat->name ] ) . ') </option>' . "\r\n";
709
  }
710
  }
711
 
712
  echo '</select>';
713
  if ( false !== $submit ) {
714
+ echo '&nbsp;<input type="submit" class="button-secondary" value="' . esc_attr( $submit ) . '" />' . "\r\n";
715
  }
716
  }
717
 
751
  $admins = array_merge( $author, $admins );
752
  }
753
 
754
+ $option = '<select name="sender">' . "\r\n";
755
  foreach ( $admins as $admin ) {
756
+ $option .= '<option value="' . $admin->ID . '"';
757
  if ( $admin->ID === $this->subscribe2_options['sender'] ) {
758
+ $option .= ' selected="selected"';
759
  }
760
+ $option .= '>' . $admin->display_name . '</option>' . "\r\n";
761
  }
762
+ $option .= '</select>' . "\r\n";
763
+
764
+ $allowed_tags = array(
765
+ 'select' => array(
766
+ 'name' => true,
767
+ ),
768
+ 'option' => array(
769
+ 'value' => true,
770
+ 'selected' => true,
771
+ ),
772
+ );
773
+
774
+ echo wp_kses( $option, $allowed_tags );
775
  }
776
 
777
  /**
782
  global $wpdb;
783
  $cron_file = ABSPATH . 'wp-cron.php';
784
  if ( ! is_readable( $cron_file ) ) {
785
+ echo '<strong><em style="color: red">' . esc_html__( 'The WordPress cron functions may be disabled on this server. Digest notifications may not work.', 'subscribe2' ) . '</em></strong><br>' . "\r\n";
786
  }
787
  $scheduled_time = wp_next_scheduled( 's2_digest_cron' );
788
  $offset = get_option( 'gmt_offset' ) * 60 * 60;
807
  $schedule_sorted[ $key ] = $schedule[ $key ];
808
  }
809
  foreach ( $schedule_sorted as $key => $value ) {
810
+ echo '<label><input type="radio" name="email_freq" value="' . esc_attr( $key ) . '"' . checked( $this->subscribe2_options['email_freq'], $key, false ) . ' />';
811
+ echo ' ' . esc_html( $value['display'] ) . '</label><br>' . "\r\n";
812
  }
813
  if ( $scheduled_time ) {
814
  $date_format = get_option( 'date_format' );
815
  $time_format = get_option( 'time_format' );
816
+ echo '<p>' . esc_html__( 'Current UTC time is', 'subscribe2' ) . ': ' . "\r\n";
817
+ echo '<strong>' . esc_html( date_i18n( $date_format . ' @ ' . $time_format, false, 'gmt' ) ) . '</strong></p>' . "\r\n";
818
+ echo '<p>' . esc_html__( 'Current blog time is', 'subscribe2' ) . ': ' . "\r\n";
819
+ echo '<strong>' . esc_html( date_i18n( $date_format . ' @ ' . $time_format ) ) . '</strong></p>' . "\r\n";
820
+ echo '<p>' . esc_html__( 'Next email notification will be sent when your blog time is after', 'subscribe2' ) . ': ' . "\r\n";
821
+ echo '<input type="hidden" id="jscrondate" value="' . esc_attr( date_i18n( $date_format, $scheduled_time + $offset ) ) . '" />';
822
+ echo '<input type="hidden" id="jscrontime" value="' . esc_attr( date_i18n( $time_format, $scheduled_time + $offset ) ) . '" />';
823
+ echo '<span id="s2cron_1"><span id="s2crondate" style="background-color: #FFFBCC">' . esc_html( date_i18n( $date_format, $scheduled_time + $offset ) ) . '</span>';
824
+ echo ' @ <span id="s2crontime" style="background-color: #FFFBCC">' . esc_html( date_i18n( $time_format, $scheduled_time + $offset ) ) . '</span> ';
825
+ echo '<a href="#" onclick="s2Show(\'cron\'); return false;">' . esc_html__( 'Edit', 'subscribe2' ) . '</a></span>' . "\r\n";
826
  echo '<span id="s2cron_2">' . "\r\n";
827
+ echo '<input id="s2datepicker" name="crondate" value="' . esc_attr( date_i18n( $date_format, $scheduled_time + $offset ) ) . '">' . "\r\n";
828
  $hours = array( '12:00 am', '1:00 am', '2:00 am', '3:00 am', '4:00 am', '5:00 am', '6:00 am', '7:00 am', '8:00 am', '9:00 am', '10:00 am', '11:00 am', '12:00 pm', '1:00 pm', '2:00 pm', '3:00 pm', '4:00 pm', '5:00 pm', '6:00 pm', '7:00 pm', '8:00 pm', '9:00 pm', '10:00 pm', '11:00 pm' );
829
  $current_hour = intval( date_i18n( 'G', $scheduled_time + $offset ) );
830
  echo '<select name="crontime">' . "\r\n";
831
  foreach ( $hours as $key => $value ) {
832
+ echo '<option value="' . esc_attr( $key ) . '"';
833
  if ( ! empty( $scheduled_time ) && $key === $current_hour ) {
834
  echo ' selected="selected"';
835
  }
836
+ echo '>' . esc_html( $value ) . '</option>' . "\r\n";
837
  }
838
  echo '</select>' . "\r\n";
839
+ echo '<a href="#" onclick="s2CronUpdate(\'cron\'); return false;">' . esc_html__( 'Update', 'subscribe2' ) . '</a>' . "\r\n";
840
+ echo '<a href="#" onclick="s2CronRevert(\'cron\'); return false;">' . esc_html__( 'Revert', 'subscribe2' ) . '</a></span>' . "\r\n";
841
  if ( ! empty( $this->subscribe2_options['last_s2cron'] ) ) {
842
+ echo '<p>' . esc_html__( 'Attempt to resend the last Digest Notification email', 'subscribe2' ) . ': ';
843
+ echo '<input type="submit" class="button-secondary" name="resend" value="' . esc_attr( __( 'Resend Digest', 'subscribe2' ) ) . '" /></p>' . "\r\n";
844
  }
845
  } else {
846
+ echo '<br>';
847
  }
848
  }
849
 
856
  return;
857
  }
858
 
859
+ $option = '<select name="s2page">' . "\r\n";
860
+ $option .= '<option value="0">' . __( 'Select a page', 'subscribe2' ) . '</option>' . "\r\n";
861
  foreach ( $pages as $page ) {
862
  $option .= '<option value="' . $page->ID . '"';
863
  if ( $page->ID === $s2page ) {
872
  }
873
  $option .= $page->post_title . '</option>' . "\r\n";
874
  }
875
+ $option .= '</select>' . "\r\n";
876
 
877
+ $allowed_tags = array(
878
+ 'select' => array(
879
+ 'name' => true,
880
+ ),
881
+ 'option' => array(
882
+ 'value' => true,
883
+ 'selected' => true,
884
+ ),
885
+ );
886
+
887
+ echo wp_kses( $option, $allowed_tags );
888
  }
889
 
890
  /**
1128
  * Show form for one-click subscription on user profile page
1129
  */
1130
  public function one_click_profile_form( $user ) {
1131
+ echo '<h3>' . esc_html__( 'Email subscription', 'subscribe2' ) . '</h3>' . "\r\n";
1132
  echo '<table class="form-table">' . "\r\n";
1133
+ echo '<tr><th scope="row">' . esc_html__( 'Subscribe / Unsubscribe', 'subscribe2' ) . '</th>' . "\r\n";
1134
+ echo '<td><label><input type="checkbox" name="sub2-one-click-subscribe" value="1" ' . checked( ! get_user_meta( $user->ID, $this->get_usermeta_keyname( 's2_subscribed' ), true ), false, false ) . ' /> ' . esc_html__( 'Receive notifications', 'subscribe2' ) . '</label><br>' . "\r\n";
1135
+ echo '<span class="description">' . esc_html__( 'Check if you want to receive email notification when new posts are published', 'subscribe2' ) . '</span>' . "\r\n";
1136
  echo '</td></tr></table>' . "\r\n";
1137
  }
1138
 
1171
  $this->subscribe2_cron( '', 'resend' );
1172
  }
1173
  }
1174
+
1175
+ /**
1176
+ * Uninstall hook
1177
+ */
1178
+ public function s2_uninstall() {
1179
+ require_once S2PATH . 'classes/class-s2-uninstall.php';
1180
+ $s2_uninstall = new S2_Uninstall();
1181
+ $s2_uninstall->uninstall();
1182
+ }
1183
  }
classes/class-s2-ajax.php CHANGED
@@ -10,6 +10,7 @@ class S2_Ajax {
10
  add_action( 'wp_ajax_nopriv_subscribe2_form', array( &$this, 's2_ajax_form_handler' ) );
11
  add_action( 'wp_ajax_nopriv_subscribe2_submit', array( &$this, 's2_ajax_submit_handler' ) );
12
  add_filter( 's2_ajax_form', array( &$this, 's2_ajax_form_class' ), 1 );
 
13
 
14
  global $s2_frontend;
15
  require_once S2PATH . 'classes/class-s2-core.php';
@@ -58,7 +59,34 @@ class S2_Ajax {
58
  global $s2_frontend;
59
  $content = $s2_frontend->shortcode( $atts );
60
  $content = apply_filters( 's2_ajax_form', $content );
61
- echo $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  exit();
63
  }
64
 
@@ -67,13 +95,13 @@ class S2_Ajax {
67
  */
68
  public function s2_ajax_submit_handler() {
69
  if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 's2_ajax_form_nonce' ) ) {
70
- echo '<p>' . __( 'There was an error validating your request. Please try again later.', 'subscribe2' ) . '</p>';
71
  wp_die();
72
  }
73
  $data = $_POST['data'];
74
  if ( ( isset( $data['firstname'] ) && '' !== $data['firstname'] ) || ( isset( $data['lastname'] ) && '' !== $data['lastname'] ) || ( isset( $data['uri'] ) && 'http://' !== $data['uri'] ) ) {
75
  // looks like some invisible-to-user fields were changed; falsely report success
76
- echo '<p>' . __( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
77
  wp_die();
78
  }
79
 
@@ -81,21 +109,21 @@ class S2_Ajax {
81
  $s2_frontend->email = $s2_frontend->sanitize_email( $data['email'] );
82
  $s2_frontend->ip = $data['ip'];
83
  if ( false === $s2_frontend->validate_email( $s2_frontend->email ) ) {
84
- echo '<p>' . __( 'Sorry, but that does not look like an email address to me.', 'subscribe2' ) . '</p>';
85
  } elseif ( $s2_frontend->is_barred( $s2_frontend->email ) ) {
86
- echo '<p>' . __( 'Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2' ) . '</p>';
87
  } else {
88
  if ( is_int( $s2_frontend->lockout ) && $s2_frontend->lockout > 0 ) {
89
  $date = gmdate( 'H:i:s.u', $s2_frontend->lockout );
90
  $ips = $wpdb->get_col( $wpdb->prepare( "SELECT ip FROM $wpdb->subscribe2 WHERE date = CURDATE() AND time > SUBTIME(CURTIME(), %s)", $date ) );
91
  if ( in_array( $s2_frontend->ip, $ips, true ) ) {
92
- echo '<p>' . __( 'Slow down, you move too fast.', 'subscribe2' ) . '</p>';
93
  }
94
  }
95
  $check = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_email = %s", $s2_frontend->email ) );
96
  if ( null !== $check ) {
97
  // Translators: Link to login page
98
- printf( __( 'To manage your subscription options please <a href="%1$s">login.</a>', 'subscribe2' ), get_option( 'siteurl' ) . '/wp-login.php' );
99
  }
100
  if ( 'subscribe' === $data['button'] ) {
101
  if ( '1' !== $s2_frontend->is_public( $s2_frontend->email ) ) {
@@ -103,23 +131,23 @@ class S2_Ajax {
103
  $s2_frontend->add( $s2_frontend->email );
104
  $status = $s2_frontend->send_confirm( 'add' );
105
  if ( $status ) {
106
- echo '<p>' . __( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
107
  } else {
108
- echo '<p>' . __( 'Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2' ) . '</p>';
109
  }
110
  } else {
111
  // they're already subscribed
112
- echo '<p>' . __( 'That email address is already subscribed.', 'subscribe2' ) . '</p>';
113
  }
114
  } elseif ( 'unsubscribe' === $data['button'] ) {
115
  if ( false === $s2_frontend->is_public( $s2_frontend->email ) ) {
116
- echo '<p>' . __( 'That email address is not subscribed.', 'subscribe2' ) . '</p>';
117
  } else {
118
  $status = $s2_frontend->send_confirm( 'del' );
119
  if ( $status ) {
120
- echo '<p>' . __( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
121
  } else {
122
- echo '<p>' . __( 'Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2' ) . '</p>';
123
  }
124
  }
125
  }
@@ -135,4 +163,12 @@ class S2_Ajax {
135
  $content = str_replace( 'wp-login.php"', 'wp-login.php" style="text-decoration: underline;"', $content );
136
  return $content;
137
  }
 
 
 
 
 
 
 
 
138
  }
10
  add_action( 'wp_ajax_nopriv_subscribe2_form', array( &$this, 's2_ajax_form_handler' ) );
11
  add_action( 'wp_ajax_nopriv_subscribe2_submit', array( &$this, 's2_ajax_submit_handler' ) );
12
  add_filter( 's2_ajax_form', array( &$this, 's2_ajax_form_class' ), 1 );
13
+ add_filter( 'safe_style_css', array( &$this, 's2_safe_css' ) );
14
 
15
  global $s2_frontend;
16
  require_once S2PATH . 'classes/class-s2-core.php';
59
  global $s2_frontend;
60
  $content = $s2_frontend->shortcode( $atts );
61
  $content = apply_filters( 's2_ajax_form', $content );
62
+
63
+ $allowed_tags = array(
64
+ 'form' => array(
65
+ 'action' => true,
66
+ 'id' => true,
67
+ 'method' => true,
68
+ 'name' => true,
69
+ ),
70
+ 'span' => array(
71
+ 'style' => true,
72
+ ),
73
+ 'label' => array(
74
+ 'for' => true,
75
+ ),
76
+ 'input' => array(
77
+ 'id' => true,
78
+ 'name' => true,
79
+ 'onblur' => true,
80
+ 'onfocus' => true,
81
+ 'size' => true,
82
+ 'type' => true,
83
+ 'value' => true,
84
+ ),
85
+ 'p' => true,
86
+ 'br' => true,
87
+ );
88
+
89
+ echo wp_kses( $content, $allowed_tags );
90
  exit();
91
  }
92
 
95
  */
96
  public function s2_ajax_submit_handler() {
97
  if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 's2_ajax_form_nonce' ) ) {
98
+ echo '<p>' . esc_html__( 'There was an error validating your request. Please try again later.', 'subscribe2' ) . '</p>';
99
  wp_die();
100
  }
101
  $data = $_POST['data'];
102
  if ( ( isset( $data['firstname'] ) && '' !== $data['firstname'] ) || ( isset( $data['lastname'] ) && '' !== $data['lastname'] ) || ( isset( $data['uri'] ) && 'http://' !== $data['uri'] ) ) {
103
  // looks like some invisible-to-user fields were changed; falsely report success
104
+ echo '<p>' . esc_html__( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
105
  wp_die();
106
  }
107
 
109
  $s2_frontend->email = $s2_frontend->sanitize_email( $data['email'] );
110
  $s2_frontend->ip = $data['ip'];
111
  if ( false === $s2_frontend->validate_email( $s2_frontend->email ) ) {
112
+ echo '<p>' . esc_html__( 'Sorry, but that does not look like an email address to me.', 'subscribe2' ) . '</p>';
113
  } elseif ( $s2_frontend->is_barred( $s2_frontend->email ) ) {
114
+ echo '<p>' . esc_html__( 'Sorry, email addresses at that domain are currently barred due to spam, please use an alternative email address.', 'subscribe2' ) . '</p>';
115
  } else {
116
  if ( is_int( $s2_frontend->lockout ) && $s2_frontend->lockout > 0 ) {
117
  $date = gmdate( 'H:i:s.u', $s2_frontend->lockout );
118
  $ips = $wpdb->get_col( $wpdb->prepare( "SELECT ip FROM $wpdb->subscribe2 WHERE date = CURDATE() AND time > SUBTIME(CURTIME(), %s)", $date ) );
119
  if ( in_array( $s2_frontend->ip, $ips, true ) ) {
120
+ echo '<p>' . esc_html__( 'Slow down, you move too fast.', 'subscribe2' ) . '</p>';
121
  }
122
  }
123
  $check = $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM $wpdb->users WHERE user_email = %s", $s2_frontend->email ) );
124
  if ( null !== $check ) {
125
  // Translators: Link to login page
126
+ printf( wp_kses_post( __( 'To manage your subscription options please <a href="%1$s">login.</a>', 'subscribe2' ) ), esc_url( get_option( 'siteurl' ) . '/wp-login.php' ) );
127
  }
128
  if ( 'subscribe' === $data['button'] ) {
129
  if ( '1' !== $s2_frontend->is_public( $s2_frontend->email ) ) {
131
  $s2_frontend->add( $s2_frontend->email );
132
  $status = $s2_frontend->send_confirm( 'add' );
133
  if ( $status ) {
134
+ echo '<p>' . esc_html__( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
135
  } else {
136
+ echo '<p>' . esc_html__( 'Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2' ) . '</p>';
137
  }
138
  } else {
139
  // they're already subscribed
140
+ echo '<p>' . esc_html__( 'That email address is already subscribed.', 'subscribe2' ) . '</p>';
141
  }
142
  } elseif ( 'unsubscribe' === $data['button'] ) {
143
  if ( false === $s2_frontend->is_public( $s2_frontend->email ) ) {
144
+ echo '<p>' . esc_html__( 'That email address is not subscribed.', 'subscribe2' ) . '</p>';
145
  } else {
146
  $status = $s2_frontend->send_confirm( 'del' );
147
  if ( $status ) {
148
+ echo '<p>' . esc_html__( 'A confirmation message is on its way!', 'subscribe2' ) . '</p>';
149
  } else {
150
+ echo '<p>' . esc_html__( 'Sorry, there seems to be an error on the server. Please try again later.', 'subscribe2' ) . '</p>';
151
  }
152
  }
153
  }
163
  $content = str_replace( 'wp-login.php"', 'wp-login.php" style="text-decoration: underline;"', $content );
164
  return $content;
165
  }
166
+
167
+ /**
168
+ * Add display attribute to safe CSS
169
+ */
170
+ public function s2_safe_css( $style_attributes ) {
171
+ $style_attributes[] = 'display';
172
+ return $style_attributes;
173
+ }
174
  }
classes/class-s2-block-editor.php CHANGED
@@ -120,7 +120,12 @@ class S2_Block_Editor {
120
  return false;
121
  }
122
 
123
- $mysubscribe2->publish( $post, $current_user->user_email );
 
 
 
 
 
124
  return true;
125
  }
126
 
120
  return false;
121
  }
122
 
123
+ if ( 'never' !== $this->subscribe2_options['email_freq'] ) {
124
+ $mysubscribe2->subscribe2_cron( $current_user->user_email );
125
+ } else {
126
+ $mysubscribe2->publish( $post, $current_user->user_email );
127
+ }
128
+
129
  return true;
130
  }
131
 
classes/class-s2-core.php CHANGED
@@ -461,9 +461,17 @@ class S2_Core {
461
  $plaintext = $post->post_content;
462
  $plaintext = strip_shortcodes( $plaintext );
463
 
464
- $plaintext = preg_replace( '/<s[^>]*>(.*)<\/s>/Ui', '', $plaintext );
465
- $plaintext = preg_replace( '/<strike[^>]*>(.*)<\/strike>/Ui', '', $plaintext );
466
- $plaintext = preg_replace( '/<del[^>]*>(.*)<\/del>/Ui', '', $plaintext );
 
 
 
 
 
 
 
 
467
  $excerpttext = $plaintext;
468
 
469
  if ( strstr( $mailtext, '{REFERENCELINKS}' ) ) {
@@ -534,9 +542,9 @@ class S2_Core {
534
  // prepare mail body texts
535
  $plain_excerpt_body = str_replace( '{POST}', $excerpt, $mailtext );
536
  $plain_body = str_replace( '{POST}', $plaintext, $mailtext );
537
- $html_body = str_replace( "\r\n", "<br />\r\n", $mailtext );
538
  $html_body = str_replace( '{POST}', $content, $html_body );
539
- $html_excerpt_body = str_replace( "\r\n", "<br />\r\n", $mailtext );
540
  $html_excerpt_body = str_replace( '{POST}', $html_excerpt, $html_excerpt_body );
541
 
542
  if ( '' !== $preview ) {
@@ -1241,12 +1249,12 @@ class S2_Core {
1241
  }
1242
  if ( 'wpreg' === $this->subscribe2_options['autosub'] ) {
1243
  echo '<p><label>';
1244
- echo __( 'Check here to Subscribe to email notifications for new posts', 'subscribe2' ) . ':<br />' . "\r\n";
1245
  echo '<input type="checkbox" name="reg_subscribe"' . checked( $this->subscribe2_options['wpregdef'], 'yes', false ) . ' />';
1246
  echo '</label></p>' . "\r\n";
1247
  } elseif ( 'yes' === $this->subscribe2_options['autosub'] ) {
1248
  echo '<p><center>' . "\r\n";
1249
- echo __( 'By registering with this blog you are also agreeing to receive email notifications for new posts but you can unsubscribe at anytime', 'subscribe2' ) . '.<br />' . "\r\n";
1250
  echo '</center></p>' . "\r\n";
1251
  }
1252
  }
@@ -1279,7 +1287,7 @@ class S2_Core {
1279
  if ( 'before' === $this->subscribe2_options['comment_subs'] ) {
1280
  return $comment_meta_form . $submit_field;
1281
  } else {
1282
- return $submit_field . '<br />' . $comment_meta_form;
1283
  }
1284
  }
1285
 
@@ -1471,8 +1479,13 @@ class S2_Core {
1471
  $posts = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL
1472
  }
1473
  } else {
1474
- // we are sending a preview
1475
- $posts = get_posts( 'numberposts=1' );
 
 
 
 
 
1476
  }
1477
 
1478
  // Collect sticky posts if desired
@@ -1517,14 +1530,14 @@ class S2_Core {
1517
  $this->post_count = count( $posts );
1518
  $s2_taxonomies = apply_filters( 's2_taxonomies', array( 'category' ) );
1519
 
1520
- foreach ( $posts as $post ) {
1521
  // keep an array of post ids and skip if we've already done it once
1522
- if ( in_array( $post->ID, $ids, true ) ) {
1523
  continue;
1524
  }
1525
- $ids[] = $post->ID;
1526
  $post_cats = wp_get_object_terms(
1527
- $post->ID,
1528
  $s2_taxonomies,
1529
  array(
1530
  'fields' => 'ids',
@@ -1538,7 +1551,7 @@ class S2_Core {
1538
  if ( '' === $preview ) {
1539
  // Pages are put into category 1 so make sure we don't exclude
1540
  // pages if category 1 is excluded
1541
- if ( 'page' !== $post->post_type ) {
1542
  // is the current post assigned to any categories
1543
  // which should not generate a notification email?
1544
  foreach ( explode( ',', $this->subscribe2_options['exclude'] ) as $cat ) {
@@ -1549,18 +1562,18 @@ class S2_Core {
1549
  }
1550
  // is the current post set by the user to
1551
  // not generate a notification email?
1552
- $s2mail = get_post_meta( $post->ID, '_s2mail', true );
1553
  if ( 'no' === strtolower( trim( $s2mail ) ) ) {
1554
  $check = true;
1555
  }
1556
  // is the current post private
1557
  // and should this not generate a notification email?
1558
- if ( 'no' === $this->subscribe2_options['password'] && '' !== $post->post_password ) {
1559
  $check = true;
1560
  }
1561
  // is the post assigned a format that should
1562
  // not be included in the notification email?
1563
- $post_format = get_post_format( $post->ID );
1564
  $excluded_formats = explode( ',', $this->subscribe2_options['exclude_formats'] );
1565
  if ( false !== $post_format && in_array( $post_format, $excluded_formats, true ) ) {
1566
  $check = true;
@@ -1574,18 +1587,18 @@ class S2_Core {
1574
  }
1575
  // is the current post set by the user to
1576
  // not generate a notification email?
1577
- $s2mail = get_post_meta( $post->ID, '_s2mail', true );
1578
  if ( 'no' === strtolower( trim( $s2mail ) ) ) {
1579
  $check = true;
1580
  }
1581
  // is the current post private
1582
  // and should this not generate a notification email?
1583
- if ( 'no' === $this->subscribe2_options['password'] && '' !== $post->post_password ) {
1584
  $check = true;
1585
  }
1586
  // is the post assigned a format that should
1587
  // not be included in the notification email?
1588
- $post_format = get_post_format( $post->ID );
1589
  $excluded_formats = explode( ',', $this->subscribe2_options['exclude_formats'] );
1590
  if ( false !== $post_format && in_array( $post_format, $excluded_formats, true ) ) {
1591
  $check = true;
@@ -1596,15 +1609,15 @@ class S2_Core {
1596
  continue;
1597
  }
1598
 
1599
- $digest_post_ids[] = $post->ID;
1600
 
1601
- $post_title = html_entity_decode( $post->post_title, ENT_QUOTES );
1602
  ( '' === $table ) ? $table .= '* ' . $post_title : $table .= "\r\n* " . $post_title;
1603
  ( '' === $tablelinks ) ? $tablelinks .= '* ' . $post_title : $tablelinks .= "\r\n* " . $post_title;
1604
  $message_post .= $post_title;
1605
  $message_posttime .= $post_title;
1606
  if ( strstr( $mailtext, '{AUTHORNAME}' ) ) {
1607
- $author = get_userdata( $post->post_author );
1608
  if ( '' !== $author->display_name ) {
1609
  $message_post .= ' (' . __( 'Author', 'subscribe2' ) . ': ' . html_entity_decode( apply_filters( 'the_author', $author->display_name ), ENT_QUOTES ) . ')';
1610
  $message_posttime .= ' (' . __( 'Author', 'subscribe2' ) . ': ' . html_entity_decode( apply_filters( 'the_author', $author->display_name ), ENT_QUOTES ) . ')';
@@ -1613,9 +1626,9 @@ class S2_Core {
1613
  $message_post .= "\r\n";
1614
  $message_posttime .= "\r\n";
1615
 
1616
- $message_posttime .= __( 'Posted on', 'subscribe2' ) . ': ' . mysql2date( $datetime, $post->post_date ) . "\r\n";
1617
  if ( strstr( $mailtext, '{TINYLINK}' ) ) {
1618
- $tinylink = wp_safe_remote_get( 'http://tinyurl.com/api-create.php?url=' . rawurlencode( $this->get_tracking_link( get_permalink( $post->ID ) ) ) );
1619
  } else {
1620
  $tinylink = false;
1621
  }
@@ -1624,16 +1637,16 @@ class S2_Core {
1624
  $message_post .= $tinylink . "\r\n";
1625
  $message_posttime .= $tinylink . "\r\n";
1626
  } else {
1627
- $tablelinks .= "\r\n" . $this->get_tracking_link( get_permalink( $post->ID ) ) . "\r\n";
1628
- $message_post .= $this->get_tracking_link( get_permalink( $post->ID ) ) . "\r\n";
1629
- $message_posttime .= $this->get_tracking_link( get_permalink( $post->ID ) ) . "\r\n";
1630
  }
1631
 
1632
  if ( strstr( $mailtext, '{CATS}' ) ) {
1633
  $post_cat_names = implode(
1634
  ', ',
1635
  wp_get_object_terms(
1636
- $post->ID,
1637
  $s2_taxonomies,
1638
  array(
1639
  'fields' => 'names',
@@ -1647,7 +1660,7 @@ class S2_Core {
1647
  $post_tag_names = implode(
1648
  ', ',
1649
  wp_get_post_tags(
1650
- $post->ID,
1651
  array(
1652
  'fields' => 'names',
1653
  )
@@ -1661,12 +1674,12 @@ class S2_Core {
1661
  $message_post .= "\r\n";
1662
  $message_posttime .= "\r\n";
1663
 
1664
- ( ! empty( $post->post_excerpt ) ) ? $excerpt = trim( $post->post_excerpt ) : $excerpt = '';
1665
  if ( '' === $excerpt ) {
1666
- $excerpt = apply_filters( 'the_content', $post->post_content );
1667
  // no excerpt, is there a <!--more--> ?
1668
- if ( false !== strpos( $post->post_content, '<!--more-->' ) ) {
1669
- list($excerpt, $more) = explode( '<!--more-->', $post->post_content, 2 );
1670
  $excerpt = wp_strip_all_tags( $excerpt );
1671
  $excerpt = strip_shortcodes( $excerpt );
1672
  } else {
@@ -1981,8 +1994,11 @@ class S2_Core {
1981
  // subscriber page options handler
1982
  add_filter( 'set-screen-option', array( &$this, 'subscribers_set_screen_option' ), 10, 3 );
1983
 
1984
- // MailOptin admin notices
1985
- require_once S2PATH . 'classes/class-mo-admin-notice.php';
 
 
 
1986
 
1987
  // capture CSV export
1988
  if ( isset( $_POST['s2_admin'] ) && isset( $_POST['csv'] ) ) {
@@ -1992,7 +2008,7 @@ class S2_Core {
1992
  header( "Content-Disposition: attachment; filename=subscribe2_users_$date.csv" );
1993
  header( 'Pragma: no-cache' );
1994
  header( 'Expires: 0' );
1995
- echo $this->prepare_export( $_POST['exportcsv'] );
1996
  exit( 0 );
1997
  }
1998
  } else {
461
  $plaintext = $post->post_content;
462
  $plaintext = strip_shortcodes( $plaintext );
463
 
464
+ $plaintext = preg_replace( '/<s[^>]*>(.*)<\/s>/Ui', '', $plaintext );
465
+ $plaintext = preg_replace( '/<strike[^>]*>(.*)<\/strike>/Ui', '', $plaintext );
466
+ $plaintext = preg_replace( '/<del[^>]*>(.*)<\/del>/Ui', '', $plaintext );
467
+
468
+ // Fix for how the Block Editor stores lists
469
+ if ( true === $this->block_editor ) {
470
+ $plaintext = str_replace( '</li><', "</li>\n<", $plaintext );
471
+ }
472
+
473
+ // Add filter here so $plaintext can be filtered to correct for layout needs
474
+ $plaintext = apply_filters( 's2_plaintext', $plaintext );
475
  $excerpttext = $plaintext;
476
 
477
  if ( strstr( $mailtext, '{REFERENCELINKS}' ) ) {
542
  // prepare mail body texts
543
  $plain_excerpt_body = str_replace( '{POST}', $excerpt, $mailtext );
544
  $plain_body = str_replace( '{POST}', $plaintext, $mailtext );
545
+ $html_body = str_replace( "\r\n", "<br>\r\n", $mailtext );
546
  $html_body = str_replace( '{POST}', $content, $html_body );
547
+ $html_excerpt_body = str_replace( "\r\n", "<br>\r\n", $mailtext );
548
  $html_excerpt_body = str_replace( '{POST}', $html_excerpt, $html_excerpt_body );
549
 
550
  if ( '' !== $preview ) {
1249
  }
1250
  if ( 'wpreg' === $this->subscribe2_options['autosub'] ) {
1251
  echo '<p><label>';
1252
+ echo esc_html__( 'Check here to Subscribe to email notifications for new posts', 'subscribe2' ) . ':<br>' . "\r\n";
1253
  echo '<input type="checkbox" name="reg_subscribe"' . checked( $this->subscribe2_options['wpregdef'], 'yes', false ) . ' />';
1254
  echo '</label></p>' . "\r\n";
1255
  } elseif ( 'yes' === $this->subscribe2_options['autosub'] ) {
1256
  echo '<p><center>' . "\r\n";
1257
+ echo esc_html__( 'By registering with this blog you are also agreeing to receive email notifications for new posts but you can unsubscribe at anytime', 'subscribe2' ) . '.<br>' . "\r\n";
1258
  echo '</center></p>' . "\r\n";
1259
  }
1260
  }
1287
  if ( 'before' === $this->subscribe2_options['comment_subs'] ) {
1288
  return $comment_meta_form . $submit_field;
1289
  } else {
1290
+ return $submit_field . '<br>' . $comment_meta_form;
1291
  }
1292
  }
1293
 
1479
  $posts = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL
1480
  }
1481
  } else {
1482
+ // we are sending a preview, use global if possible otherwise get last post
1483
+ global $post;
1484
+ if ( empty( $post ) ) {
1485
+ $posts = get_posts( 'numberposts=1' );
1486
+ } else {
1487
+ $posts = array( $post );
1488
+ }
1489
  }
1490
 
1491
  // Collect sticky posts if desired
1530
  $this->post_count = count( $posts );
1531
  $s2_taxonomies = apply_filters( 's2_taxonomies', array( 'category' ) );
1532
 
1533
+ foreach ( $posts as $digest_post ) {
1534
  // keep an array of post ids and skip if we've already done it once
1535
+ if ( in_array( $digest_post->ID, $ids, true ) ) {
1536
  continue;
1537
  }
1538
+ $ids[] = $digest_post->ID;
1539
  $post_cats = wp_get_object_terms(
1540
+ $digest_post->ID,
1541
  $s2_taxonomies,
1542
  array(
1543
  'fields' => 'ids',
1551
  if ( '' === $preview ) {
1552
  // Pages are put into category 1 so make sure we don't exclude
1553
  // pages if category 1 is excluded
1554
+ if ( 'page' !== $digest_post->post_type ) {
1555
  // is the current post assigned to any categories
1556
  // which should not generate a notification email?
1557
  foreach ( explode( ',', $this->subscribe2_options['exclude'] ) as $cat ) {
1562
  }
1563
  // is the current post set by the user to
1564
  // not generate a notification email?
1565
+ $s2mail = get_post_meta( $digest_post->ID, '_s2mail', true );
1566
  if ( 'no' === strtolower( trim( $s2mail ) ) ) {
1567
  $check = true;
1568
  }
1569
  // is the current post private
1570
  // and should this not generate a notification email?
1571
+ if ( 'no' === $this->subscribe2_options['password'] && '' !== $digest_post->post_password ) {
1572
  $check = true;
1573
  }
1574
  // is the post assigned a format that should
1575
  // not be included in the notification email?
1576
+ $post_format = get_post_format( $digest_post->ID );
1577
  $excluded_formats = explode( ',', $this->subscribe2_options['exclude_formats'] );
1578
  if ( false !== $post_format && in_array( $post_format, $excluded_formats, true ) ) {
1579
  $check = true;
1587
  }
1588
  // is the current post set by the user to
1589
  // not generate a notification email?
1590
+ $s2mail = get_post_meta( $digest_post->ID, '_s2mail', true );
1591
  if ( 'no' === strtolower( trim( $s2mail ) ) ) {
1592
  $check = true;
1593
  }
1594
  // is the current post private
1595
  // and should this not generate a notification email?
1596
+ if ( 'no' === $this->subscribe2_options['password'] && '' !== $digest_post->post_password ) {
1597
  $check = true;
1598
  }
1599
  // is the post assigned a format that should
1600
  // not be included in the notification email?
1601
+ $post_format = get_post_format( $digest_post->ID );
1602
  $excluded_formats = explode( ',', $this->subscribe2_options['exclude_formats'] );
1603
  if ( false !== $post_format && in_array( $post_format, $excluded_formats, true ) ) {
1604
  $check = true;
1609
  continue;
1610
  }
1611
 
1612
+ $digest_post_ids[] = $digest_post->ID;
1613
 
1614
+ $post_title = html_entity_decode( $digest_post->post_title, ENT_QUOTES );
1615
  ( '' === $table ) ? $table .= '* ' . $post_title : $table .= "\r\n* " . $post_title;
1616
  ( '' === $tablelinks ) ? $tablelinks .= '* ' . $post_title : $tablelinks .= "\r\n* " . $post_title;
1617
  $message_post .= $post_title;
1618
  $message_posttime .= $post_title;
1619
  if ( strstr( $mailtext, '{AUTHORNAME}' ) ) {
1620
+ $author = get_userdata( $digest_post->post_author );
1621
  if ( '' !== $author->display_name ) {
1622
  $message_post .= ' (' . __( 'Author', 'subscribe2' ) . ': ' . html_entity_decode( apply_filters( 'the_author', $author->display_name ), ENT_QUOTES ) . ')';
1623
  $message_posttime .= ' (' . __( 'Author', 'subscribe2' ) . ': ' . html_entity_decode( apply_filters( 'the_author', $author->display_name ), ENT_QUOTES ) . ')';
1626
  $message_post .= "\r\n";
1627
  $message_posttime .= "\r\n";
1628
 
1629
+ $message_posttime .= __( 'Posted on', 'subscribe2' ) . ': ' . mysql2date( $datetime, $digest_post->post_date ) . "\r\n";
1630
  if ( strstr( $mailtext, '{TINYLINK}' ) ) {
1631
+ $tinylink = wp_safe_remote_get( 'http://tinyurl.com/api-create.php?url=' . rawurlencode( $this->get_tracking_link( get_permalink( $digest_post->ID ) ) ) );
1632
  } else {
1633
  $tinylink = false;
1634
  }
1637
  $message_post .= $tinylink . "\r\n";
1638
  $message_posttime .= $tinylink . "\r\n";
1639
  } else {
1640
+ $tablelinks .= "\r\n" . $this->get_tracking_link( get_permalink( $digest_post->ID ) ) . "\r\n";
1641
+ $message_post .= $this->get_tracking_link( get_permalink( $digest_post->ID ) ) . "\r\n";
1642
+ $message_posttime .= $this->get_tracking_link( get_permalink( $digest_post->ID ) ) . "\r\n";
1643
  }
1644
 
1645
  if ( strstr( $mailtext, '{CATS}' ) ) {
1646
  $post_cat_names = implode(
1647
  ', ',
1648
  wp_get_object_terms(
1649
+ $digest_post->ID,
1650
  $s2_taxonomies,
1651
  array(
1652
  'fields' => 'names',
1660
  $post_tag_names = implode(
1661
  ', ',
1662
  wp_get_post_tags(
1663
+ $digest_post->ID,
1664
  array(
1665
  'fields' => 'names',
1666
  )
1674
  $message_post .= "\r\n";
1675
  $message_posttime .= "\r\n";
1676
 
1677
+ ( ! empty( $digest_post->post_excerpt ) ) ? $excerpt = trim( $digest_post->post_excerpt ) : $excerpt = '';
1678
  if ( '' === $excerpt ) {
1679
+ $excerpt = apply_filters( 'the_content', $digest_post->post_content );
1680
  // no excerpt, is there a <!--more--> ?
1681
+ if ( false !== strpos( $digest_post->post_content, '<!--more-->' ) ) {
1682
+ list($excerpt, $more) = explode( '<!--more-->', $digest_post->post_content, 2 );
1683
  $excerpt = wp_strip_all_tags( $excerpt );
1684
  $excerpt = strip_shortcodes( $excerpt );
1685
  } else {
1994
  // subscriber page options handler
1995
  add_filter( 'set-screen-option', array( &$this, 'subscribers_set_screen_option' ), 10, 3 );
1996
 
1997
+ // MailOptin admin notices
1998
+ require_once S2PATH . 'classes/class-mo-admin-notice.php';
1999
+
2000
+ // register uninstall functions
2001
+ register_uninstall_hook( S2PLUGIN, array( 'S2_Admin', 's2_uninstall' ) );
2002
 
2003
  // capture CSV export
2004
  if ( isset( $_POST['s2_admin'] ) && isset( $_POST['csv'] ) ) {
2008
  header( "Content-Disposition: attachment; filename=subscribe2_users_$date.csv" );
2009
  header( 'Pragma: no-cache' );
2010
  header( 'Expires: 0' );
2011
+ echo esc_html( $this->prepare_export( $_POST['exportcsv'] ) );
2012
  exit( 0 );
2013
  }
2014
  } else {
classes/class-s2-counter-widget.php CHANGED
@@ -28,18 +28,18 @@ class S2_Counter_Widget extends WP_Widget {
28
  $s2w_height = empty( $instance['s2w_height'] ) ? '16' : $instance['s2w_height'];
29
  $s2w_font = empty( $instance['s2w_font'] ) ? '11' : $instance['s2w_font'];
30
 
31
- echo $args['before_widget'];
32
  if ( ! empty( $title ) ) {
33
- echo $args['before_title'] . $title . $args['after_title'];
34
  }
35
  global $mysubscribe2;
36
  $registered = $mysubscribe2->get_registered();
37
  $confirmed = $mysubscribe2->get_public();
38
  $count = ( count( $registered ) + count( $confirmed ) );
39
- echo '<ul><div style="text-align:center; background-color:' . $s2w_bg . '; color:' . $s2w_fg . '; width:' . $s2w_width . 'px; height:' . $s2w_height . 'px; font:' . $s2w_font . 'pt Verdana, Arial, Helvetica, sans-serif; vertical-align:middle; padding:3px; border:1px solid #444;">';
40
- echo $count;
41
  echo '</div></ul>';
42
- echo $args['after_widget'];
43
  }
44
 
45
  /**
@@ -99,9 +99,9 @@ class S2_Counter_Widget extends WP_Widget {
99
  echo '<fieldset>' . "\r\n";
100
  echo '<legend>' . esc_html__( 'Color Scheme', 'subscribe2' ) . '</legend>' . "\r\n";
101
  echo '<label>' . "\r\n";
102
- echo '<input type="text" name="' . esc_attr( $this->get_field_name( 's2w_bg' ) ) . '" id="' . esc_attr( $this->get_field_id( 's2w_bg' ) ) . '" maxlength="6" value="' . esc_attr( $s2w_bg ) . '" class="colorpickerField" style="width:60px;" /> ' . esc_html__( 'Body', 'subscribe2' ) . '</label><br />' . "\r\n";
103
  echo '<label>' . "\r\n";
104
- echo '<input type="text" name="' . esc_attr( $this->get_field_name( 's2w_fg' ) ) . '" id="' . esc_attr( $this->get_field_id( 's2w_fg' ) ) . '" maxlength="6" value="' . esc_attr( $s2w_fg ) . '" class="colorpickerField" style="width:60px;" /> ' . esc_html__( 'Text', 'subscribe2' ) . '</label><br />' . "\r\n";
105
  echo '<div class="s2_colorpicker" id ="' . esc_attr( $this->get_field_id( 's2_colorpicker' ) ) . '"></div>';
106
  echo '</fieldset>';
107
 
28
  $s2w_height = empty( $instance['s2w_height'] ) ? '16' : $instance['s2w_height'];
29
  $s2w_font = empty( $instance['s2w_font'] ) ? '11' : $instance['s2w_font'];
30
 
31
+ echo wp_kses_post( $args['before_widget'] );
32
  if ( ! empty( $title ) ) {
33
+ echo wp_kses_post( $args['before_title'] ) . esc_html( $title ) . wp_kses_post( $args['after_title'] );
34
  }
35
  global $mysubscribe2;
36
  $registered = $mysubscribe2->get_registered();
37
  $confirmed = $mysubscribe2->get_public();
38
  $count = ( count( $registered ) + count( $confirmed ) );
39
+ echo wp_kses_post( '<ul><div style="text-align:center; background-color:' . $s2w_bg . '; color:' . $s2w_fg . '; width:' . $s2w_width . 'px; height:' . $s2w_height . 'px; font:' . $s2w_font . 'pt Verdana, Arial, Helvetica, sans-serif; vertical-align:middle; padding:3px; border:1px solid #444;">' );
40
+ echo esc_html( $count );
41
  echo '</div></ul>';
42
+ echo wp_kses_post( $args['after_widget'] );
43
  }
44
 
45
  /**
99
  echo '<fieldset>' . "\r\n";
100
  echo '<legend>' . esc_html__( 'Color Scheme', 'subscribe2' ) . '</legend>' . "\r\n";
101
  echo '<label>' . "\r\n";
102
+ echo '<input type="text" name="' . esc_attr( $this->get_field_name( 's2w_bg' ) ) . '" id="' . esc_attr( $this->get_field_id( 's2w_bg' ) ) . '" maxlength="6" value="' . esc_attr( $s2w_bg ) . '" class="colorpickerField" style="width:60px;" /> ' . esc_html__( 'Body', 'subscribe2' ) . '</label><br>' . "\r\n";
103
  echo '<label>' . "\r\n";
104
+ echo '<input type="text" name="' . esc_attr( $this->get_field_name( 's2w_fg' ) ) . '" id="' . esc_attr( $this->get_field_id( 's2w_fg' ) ) . '" maxlength="6" value="' . esc_attr( $s2w_fg ) . '" class="colorpickerField" style="width:60px;" /> ' . esc_html__( 'Text', 'subscribe2' ) . '</label><br>' . "\r\n";
105
  echo '<div class="s2_colorpicker" id ="' . esc_attr( $this->get_field_id( 's2_colorpicker' ) ) . '"></div>';
106
  echo '</fieldset>';
107
 
classes/class-s2-form-widget.php CHANGED
@@ -53,21 +53,20 @@ class S2_Form_Widget extends WP_Widget {
53
  $nowrap = ' wrap="false"';
54
  }
55
  $shortcode = '[subscribe2' . $hide . $postid . $size . $nojs . $noantispam . $nowrap . ' widget="true"]';
56
- echo $args['before_widget'];
57
  if ( ! empty( $title ) ) {
58
- echo $args['before_title'] . esc_attr( $title ) . $args['after_title'];
59
  }
60
  echo '<div class="' . esc_attr( $div ) . '">';
61
- $content = do_shortcode( $shortcode );
62
  if ( ! empty( $widgetprecontent ) ) {
63
- echo wp_kses( $widgetprecontent, 'post' );
64
  }
65
- echo $content;
66
  if ( ! empty( $widgetpostcontent ) ) {
67
- echo wp_kses( $widgetpostcontent, 'post' );
68
  }
69
  echo '</div>';
70
- echo $args['after_widget'];
71
  }
72
 
73
  /**
@@ -141,22 +140,22 @@ class S2_Form_Widget extends WP_Widget {
141
  $sql = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'";
142
 
143
  echo '<div>' . "\r\n";
144
- echo '<p><label for="' . esc_attr( $this->get_field_id( 'title' ) ) . '">' . __( 'Title', 'subscribe2' ) . ':' . "\r\n";
145
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>' . "\r\n";
146
- echo '<p><label for="' . esc_attr( $this->get_field_id( 'div' ) ) . '">' . __( 'Div class name', 'subscribe2' ) . ':' . "\r\n";
147
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'div' ) ) . '" name="' . esc_attr( $this->get_field_name( 'div' ) ) . '" type="text" value="' . esc_attr( $div ) . '" /></label></p>' . "\r\n";
148
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'widgetprecontent' ) ) . '">' . esc_html__( 'Pre-Content', 'subscribe2' ) . ':' . "\r\n";
149
  echo '<textarea class="widefat" id="' . esc_attr( $this->get_field_id( 'widgetprecontent' ) ) . '" name="' . esc_attr( $this->get_field_name( 'widgetprecontent' ) ) . '" rows="2" cols="25">' . esc_attr( $widgetprecontent ) . '</textarea></label></p>' . "\r\n";
150
- echo '<p><label for="' . esc_attr( $this->get_field_id( 'widgetpostcontent' ) ) . '">' . __( 'Post-Content', 'subscribe2' ) . ':' . "\r\n";
151
  echo '<textarea class="widefat" id="' . esc_attr( $this->get_field_id( 'widgetpostcontent' ) ) . '" name="' . esc_attr( $this->get_field_name( 'widgetpostcontent' ) ) . '" rows="2" cols="25">' . esc_attr( $widgetpostcontent ) . '</textarea></label></p>' . "\r\n";
152
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'size' ) ) . '">' . esc_html__( 'Text Box Size', 'subscribe2' ) . ':' . "\r\n";
153
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'size' ) ) . '" name="' . esc_attr( $this->get_field_name( 'size' ) ) . '" type="text" value="' . esc_attr( $size ) . '" /></label></p>' . "\r\n";
154
- echo '<p>' . __( 'Display options', 'subscribe2' ) . ':<br />' . "\r\n";
155
  echo '<label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'complete"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'complete" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="none"' . checked( 'none', $hidebutton, false ) . '/> ' . esc_html__( 'Show complete form', 'subscribe2' ) . '</label>' . "\r\n";
156
- echo '<br /><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'subscribe"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'subscribe" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="subscribe"' . checked( 'subscribe', $hidebutton, false ) . '/> ' . esc_html__( 'Hide Subscribe button', 'subscribe2' ) . '</label>' . "\r\n";
157
- echo '<br /><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'unsubscribe"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'unsubscribe" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="unsubscribe"' . checked( 'unsubscribe', $hidebutton, false ) . '/> ' . esc_html__( 'Hide Unsubscribe button', 'subscribe2' ) . '</label>' . "\r\n";
158
  if ( '1' === $mysubscribe2->subscribe2_options['ajax'] ) {
159
- echo '<br /><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'ajax"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'ajax" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="link"' . checked( 'link', $hidebutton, false ) . '/> ' . esc_html__( 'Show as link', 'subscribe2' ) . '</label>' . "\r\n";
160
  }
161
  echo '</p>' . "\r\n";
162
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'postto' ) ) . '">' . esc_html__( 'Post form content to page', 'subscribe2' ) . ':' . "\r\n";
53
  $nowrap = ' wrap="false"';
54
  }
55
  $shortcode = '[subscribe2' . $hide . $postid . $size . $nojs . $noantispam . $nowrap . ' widget="true"]';
56
+ echo wp_kses_post( $args['before_widget'] );
57
  if ( ! empty( $title ) ) {
58
+ echo wp_kses_post( $args['before_title'] ) . esc_attr( $title ) . wp_kses_post( $args['after_title'] );
59
  }
60
  echo '<div class="' . esc_attr( $div ) . '">';
 
61
  if ( ! empty( $widgetprecontent ) ) {
62
+ echo wp_kses_post( $widgetprecontent );
63
  }
64
+ echo do_shortcode( $shortcode );
65
  if ( ! empty( $widgetpostcontent ) ) {
66
+ echo wp_kses_post( $widgetpostcontent );
67
  }
68
  echo '</div>';
69
+ echo wp_kses_post( $args['after_widget'] );
70
  }
71
 
72
  /**
140
  $sql = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'";
141
 
142
  echo '<div>' . "\r\n";
143
+ echo '<p><label for="' . esc_attr( $this->get_field_id( 'title' ) ) . '">' . esc_html__( 'Title', 'subscribe2' ) . ':' . "\r\n";
144
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'title' ) ) . '" name="' . esc_attr( $this->get_field_name( 'title' ) ) . '" type="text" value="' . esc_attr( $title ) . '" /></label></p>' . "\r\n";
145
+ echo '<p><label for="' . esc_attr( $this->get_field_id( 'div' ) ) . '">' . esc_html__( 'Div class name', 'subscribe2' ) . ':' . "\r\n";
146
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'div' ) ) . '" name="' . esc_attr( $this->get_field_name( 'div' ) ) . '" type="text" value="' . esc_attr( $div ) . '" /></label></p>' . "\r\n";
147
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'widgetprecontent' ) ) . '">' . esc_html__( 'Pre-Content', 'subscribe2' ) . ':' . "\r\n";
148
  echo '<textarea class="widefat" id="' . esc_attr( $this->get_field_id( 'widgetprecontent' ) ) . '" name="' . esc_attr( $this->get_field_name( 'widgetprecontent' ) ) . '" rows="2" cols="25">' . esc_attr( $widgetprecontent ) . '</textarea></label></p>' . "\r\n";
149
+ echo '<p><label for="' . esc_attr( $this->get_field_id( 'widgetpostcontent' ) ) . '">' . esc_html__( 'Post-Content', 'subscribe2' ) . ':' . "\r\n";
150
  echo '<textarea class="widefat" id="' . esc_attr( $this->get_field_id( 'widgetpostcontent' ) ) . '" name="' . esc_attr( $this->get_field_name( 'widgetpostcontent' ) ) . '" rows="2" cols="25">' . esc_attr( $widgetpostcontent ) . '</textarea></label></p>' . "\r\n";
151
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'size' ) ) . '">' . esc_html__( 'Text Box Size', 'subscribe2' ) . ':' . "\r\n";
152
  echo '<input class="widefat" id="' . esc_attr( $this->get_field_id( 'size' ) ) . '" name="' . esc_attr( $this->get_field_name( 'size' ) ) . '" type="text" value="' . esc_attr( $size ) . '" /></label></p>' . "\r\n";
153
+ echo '<p>' . esc_html__( 'Display options', 'subscribe2' ) . ':<br>' . "\r\n";
154
  echo '<label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'complete"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'complete" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="none"' . checked( 'none', $hidebutton, false ) . '/> ' . esc_html__( 'Show complete form', 'subscribe2' ) . '</label>' . "\r\n";
155
+ echo '<br><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'subscribe"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'subscribe" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="subscribe"' . checked( 'subscribe', $hidebutton, false ) . '/> ' . esc_html__( 'Hide Subscribe button', 'subscribe2' ) . '</label>' . "\r\n";
156
+ echo '<br><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'unsubscribe"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'unsubscribe" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="unsubscribe"' . checked( 'unsubscribe', $hidebutton, false ) . '/> ' . esc_html__( 'Hide Unsubscribe button', 'subscribe2' ) . '</label>' . "\r\n";
157
  if ( '1' === $mysubscribe2->subscribe2_options['ajax'] ) {
158
+ echo '<br><label for="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'ajax"><input id="' . esc_attr( $this->get_field_id( 'hidebutton' ) ) . 'ajax" name="' . esc_attr( $this->get_field_name( 'hidebutton' ) ) . '" type="radio" value="link"' . checked( 'link', $hidebutton, false ) . '/> ' . esc_html__( 'Show as link', 'subscribe2' ) . '</label>' . "\r\n";
159
  }
160
  echo '</p>' . "\r\n";
161
  echo '<p><label for="' . esc_attr( $this->get_field_id( 'postto' ) ) . '">' . esc_html__( 'Post form content to page', 'subscribe2' ) . ':' . "\r\n";
classes/class-s2-forms.php CHANGED
@@ -14,11 +14,11 @@ class S2_Forms {
14
  public function get_userid() {
15
  if ( isset( $_GET['id'] ) ) {
16
  if ( ! current_user_can( apply_filters( 's2_capability', 'manage_options', 'manage' ) ) ) {
17
- die( '<p>' . __( 'Permission error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
18
  }
19
  if ( is_multisite() ) {
20
  if ( ! is_user_member_of_blog( $_GET['id'], get_current_blog_id() ) ) {
21
- die( '<p>' . __( 'Permission error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
22
  } else {
23
  $userid = (int) $_GET['id'];
24
  }
@@ -43,30 +43,30 @@ class S2_Forms {
43
 
44
  echo '<input type="hidden" name="s2_admin" value="user" />';
45
  if ( 'never' === $mysubscribe2->subscribe2_options['email_freq'] ) {
46
- echo __( 'Receive email as', 'subscribe2' ) . ': &nbsp;&nbsp;';
47
  echo '<label><input type="radio" name="s2_format" value="html"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'html', false ) . ' />';
48
- echo ' ' . __( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
49
  echo '<label><input type="radio" name="s2_format" value="html_excerpt"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'html_excerpt', false ) . ' />';
50
- echo ' ' . __( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
51
  echo '<label><input type="radio" name="s2_format" value="post"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'post', false ) . ' />';
52
- echo ' ' . __( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
53
  echo '<label><input type="radio" name="s2_format" value="excerpt"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'excerpt', false ) . ' />';
54
- echo ' ' . __( 'Plain Text - Excerpt', 'subscribe2' ) . '</label><br /><br />' . "\r\n";
55
 
56
  if ( 'yes' === $mysubscribe2->subscribe2_options['show_autosub'] ) {
57
- echo __( 'Automatically subscribe me to newly created categories', 'subscribe2' ) . ': &nbsp;&nbsp;';
58
  echo '<label><input type="radio" name="new_category" value="yes"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_autosub' ), true ), 'yes', false ) . ' />';
59
- echo ' ' . __( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
60
  echo '<label><input type="radio" name="new_category" value="no"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_autosub' ), true ), 'no', false ) . ' />';
61
- echo ' ' . __( 'No', 'subscribe2' ) . '</label>';
62
  echo '</p>';
63
  }
64
 
65
  if ( 'yes' === $mysubscribe2->subscribe2_options['one_click_profile'] ) {
66
  // One-click subscribe and unsubscribe buttons
67
- echo '<h2>' . __( 'One Click Subscription / Unsubscription', 'subscribe2' ) . "</h2>\r\n";
68
- echo '<p class="submit"><input type="submit" class="button-primary" name="subscribe" value="' . __( 'Subscribe to All', 'subscribe2' ) . '" />&nbsp;&nbsp;';
69
- echo '<input type="submit" class="button-primary" name="unsubscribe" value="' . __( 'Unsubscribe from All', 'subscribe2' ) . '" /></p>';
70
  }
71
 
72
  // subscribed categories
@@ -76,38 +76,38 @@ class S2_Forms {
76
  // if we are subscribed to the current blog display an "unsubscribe" link
77
  if ( ! empty( $subscribed ) ) {
78
  $unsubscribe_link = esc_url( add_query_arg( 's2mu_unsubscribe', $blog_id ) );
79
- echo '<p><a href="' . $unsubscribe_link . '" class="button">' . __( 'Unsubscribe me from this blog', 'subscribe2' ) . '</a></p>';
80
  } else {
81
  // else we show a "subscribe" link
82
  $subscribe_link = esc_url( add_query_arg( 's2mu_subscribe', $blog_id ) );
83
- echo '<p><a href="' . $subscribe_link . '" class="button">' . __( 'Subscribe to all categories', 'subscribe2' ) . '</a></p>';
84
  }
85
- echo '<h2>' . __( 'Subscribed Categories on', 'subscribe2' ) . ' ' . get_option( 'blogname' ) . ' </h2>' . "\r\n";
86
  } else {
87
- echo '<h2>' . __( 'Subscribed Categories', 'subscribe2' ) . '</h2>' . "\r\n";
88
  }
89
  ('' === $mysubscribe2->subscribe2_options['compulsory']) ? $compulsory = array() : $compulsory = explode( ',', $mysubscribe2->subscribe2_options['compulsory'] );
90
  $this->display_category_form( explode( ',', get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ), $mysubscribe2->subscribe2_options['reg_override'], $compulsory );
91
  } else {
92
  // we're doing daily digests, so just show
93
  // subscribe / unnsubscribe
94
- echo __( 'Receive periodic summaries of new posts?', 'subscribe2' ) . ': &nbsp;&nbsp;';
95
  echo '<label>';
96
  echo '<input type="radio" name="category" value="digest"';
97
  if ( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ) {
98
  echo ' checked="checked"';
99
  }
100
- echo ' /> ' . __( 'Yes', 'subscribe2' ) . '</label> <label><input type="radio" name="category" value="-1" ';
101
  if ( ! get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ) {
102
  echo ' checked="checked"';
103
  }
104
- echo ' /> ' . __( 'No', 'subscribe2' );
105
  echo '</label></p>';
106
  }
107
 
108
  if ( count( $this->get_authors() ) > 1 && 'never' === $mysubscribe2->subscribe2_options['email_freq'] ) {
109
  echo '<div class="s2_admin" id="s2_authors">' . "\r\n";
110
- echo '<h2>' . __( 'Do not send notifications for post made by these authors', 'subscribe2' ) . '</h2>' . "\r\n";
111
  $this->display_author_form( explode( ',', get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_authors' ), true ) ) );
112
  echo '</div>' . "\r\n";
113
  }
@@ -160,20 +160,20 @@ class S2_Forms {
160
  echo '<div class="s2_admin" id="s2_mu_sites">' . "\r\n";
161
  if ( ! empty( $blogs_subscribed ) ) {
162
  ksort( $blogs_subscribed );
163
- echo '<h2>' . __( 'Subscribed Blogs', 'subscribe2' ) . '</h2>' . "\r\n";
164
  echo '<ul class="s2_blogs">' . "\r\n";
165
  foreach ( $blogs_subscribed as $blog ) {
166
- echo '<li><span class="name"><a href="' . $blog['blogurl'] . '" title="' . $blog['description'] . '">' . $blog['blogname'] . '</a></span>' . "\r\n";
167
  if ( $s2blog_id === $blog['blog_id'] ) {
168
- echo '<span class="buttons">' . __( 'Viewing Settings Now', 'subscribe2' ) . '</span>' . "\r\n";
169
  } else {
170
  echo '<span class="buttons">';
171
  if ( is_user_member_of_blog( $current_user->id, $blog['blog_id'] ) ) {
172
- echo '<a href="' . $blog['subscribe_page'] . '">' . __( 'View Settings', 'subscribe2' ) . '</a>' . "\r\n";
173
  }
174
- echo '<a href="' . esc_url( add_query_arg( 's2mu_unsubscribe', $blog['blog_id'] ) ) . '">' . __( 'Unsubscribe', 'subscribe2' ) . '</a></span>' . "\r\n";
175
  }
176
- echo '<div class="additional_info">' . $blog['description'] . '</div>' . "\r\n";
177
  echo '</li>';
178
  }
179
  echo '</ul>' . "\r\n";
@@ -181,20 +181,20 @@ class S2_Forms {
181
 
182
  if ( ! empty( $blogs_notsubscribed ) ) {
183
  ksort( $blogs_notsubscribed );
184
- echo '<h2>' . __( 'Subscribe to new blogs', 'subscribe2' ) . "</h2>\r\n";
185
  echo '<ul class="s2_blogs">';
186
  foreach ( $blogs_notsubscribed as $blog ) {
187
- echo '<li><span class="name"><a href="' . $blog['blogurl'] . '" title="' . $blog['description'] . '">' . $blog['blogname'] . '</a></span>' . "\r\n";
188
  if ( $s2blog_id === $blog['blog_id'] ) {
189
- echo '<span class="buttons">' . __( 'Viewing Settings Now', 'subscribe2' ) . '</span>' . "\r\n";
190
  } else {
191
  echo '<span class="buttons">';
192
  if ( is_user_member_of_blog( $current_user->id, $blog['blog_id'] ) ) {
193
- echo '<a href="' . $blog['subscribe_page'] . '">' . __( 'View Settings', 'subscribe2' ) . '</a>' . "\r\n";
194
  }
195
- echo '<a href="' . esc_url( add_query_arg( 's2mu_subscribe', $blog['blog_id'] ) ) . '">' . __( 'Subscribe', 'subscribe2' ) . '</a></span>' . "\r\n";
196
  }
197
- echo '<div class="additional_info">' . $blog['description'] . '</div>' . "\r\n";
198
  echo '</li>';
199
  }
200
  echo '</ul>' . "\r\n";
@@ -282,7 +282,7 @@ class S2_Forms {
282
  $mysubscribe2->one_click_handler( $userid, 'unsubscribe' );
283
  }
284
 
285
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Subscription preferences updated.', 'subscribe2' ) . '</strong></p></div>' . "\r\n";
286
  }
287
 
288
  /**
@@ -303,7 +303,7 @@ class S2_Forms {
303
  $j = 0;
304
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
305
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
306
- echo '<label><input type="checkbox" name="checkall" value="checkall_' . $name . '" /> ' . __( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
307
  echo '</td></tr>' . "\r\n";
308
  echo '<tr style="vertical-align: top;"><td style="width: 50%; text-align: left;">' . "\r\n";
309
  foreach ( $all_cats as $cat ) {
@@ -322,29 +322,29 @@ class S2_Forms {
322
  $cat_name .= $cat->name;
323
 
324
  if ( 0 === $j ) {
325
- echo '<label><input class="checkall_' . $name . '" type="checkbox" name="' . $name . '[]" value="' . $cat->term_id . '"';
326
  if ( in_array( (string) $cat->term_id, $selected, true ) || in_array( (string) $cat->term_id, $compulsory, true ) ) {
327
  echo ' checked="checked"';
328
  }
329
  if ( in_array( (string) $cat->term_id, $compulsory, true ) && 'category' === $name ) {
330
  echo ' DISABLED';
331
  }
332
- echo ' /> <abbr title="' . $cat->slug . '">' . $cat_name . '</abbr></label><br />' . "\r\n";
333
  } else {
334
- echo '<label><input class="checkall_' . $name . '" type="checkbox" name="' . $name . '[]" value="' . $cat->term_id . '"';
335
  if ( in_array( (string) $cat->term_id, $selected, true ) || in_array( (string) $cat->term_id, $compulsory, true ) ) {
336
  echo ' checked="checked"';
337
  }
338
  if ( in_array( (string) $cat->term_id, $compulsory, true ) && 'category' === $name ) {
339
  echo ' DISABLED';
340
  }
341
- echo ' /> <abbr title="' . $cat->slug . '">' . $cat_name . '</abbr></label><br />' . "\r\n";
342
  }
343
  $i++;
344
  }
345
  if ( ! empty( $compulsory ) ) {
346
  foreach ( $compulsory as $cat ) {
347
- echo '<input type="hidden" name="' . $name . '[]" value="' . $cat . '">' . "\r\n";
348
  }
349
  }
350
  echo '</td></tr>' . "\r\n";
@@ -363,7 +363,7 @@ class S2_Forms {
363
  $j = 0;
364
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
365
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
366
- echo '<label><input type="checkbox" name="checkall" value="checkall_author" /> ' . __( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
367
  echo '</td></tr>' . "\r\n";
368
  echo '<tr style="vertical-align: top;"><td style="width: 50%; test-align: left;">' . "\r\n";
369
  foreach ( $all_authors as $author ) {
@@ -372,17 +372,17 @@ class S2_Forms {
372
  $j++;
373
  }
374
  if ( 0 === $j ) {
375
- echo '<label><input class="checkall_author" type="checkbox" name="author[]" value="' . $author->ID . '"';
376
  if ( in_array( $author->ID, $selected, true ) ) {
377
  echo ' checked="checked"';
378
  }
379
- echo ' /> ' . $author->display_name . '</label><br />' . "\r\n";
380
  } else {
381
- echo '<label><input class="checkall_author" type="checkbox" name="author[]" value="' . $author->ID . '"';
382
  if ( in_array( $author->ID, $selected, true ) ) {
383
  echo ' checked="checked"';
384
  }
385
- echo ' /> ' . $author->display_name . '</label><br />' . "\r\n";
386
  $i++;
387
  }
388
  }
14
  public function get_userid() {
15
  if ( isset( $_GET['id'] ) ) {
16
  if ( ! current_user_can( apply_filters( 's2_capability', 'manage_options', 'manage' ) ) ) {
17
+ die( '<p>' . esc_html__( 'Permission error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
18
  }
19
  if ( is_multisite() ) {
20
  if ( ! is_user_member_of_blog( $_GET['id'], get_current_blog_id() ) ) {
21
+ die( '<p>' . esc_html__( 'Permission error! Your request cannot be completed.', 'subscribe2' ) . '</p>' );
22
  } else {
23
  $userid = (int) $_GET['id'];
24
  }
43
 
44
  echo '<input type="hidden" name="s2_admin" value="user" />';
45
  if ( 'never' === $mysubscribe2->subscribe2_options['email_freq'] ) {
46
+ echo esc_html__( 'Receive email as', 'subscribe2' ) . ': &nbsp;&nbsp;';
47
  echo '<label><input type="radio" name="s2_format" value="html"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'html', false ) . ' />';
48
+ echo ' ' . esc_html__( 'HTML - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
49
  echo '<label><input type="radio" name="s2_format" value="html_excerpt"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'html_excerpt', false ) . ' />';
50
+ echo ' ' . esc_html__( 'HTML - Excerpt', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
51
  echo '<label><input type="radio" name="s2_format" value="post"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'post', false ) . ' />';
52
+ echo ' ' . esc_html__( 'Plain Text - Full', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
53
  echo '<label><input type="radio" name="s2_format" value="excerpt"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_format' ), true ), 'excerpt', false ) . ' />';
54
+ echo ' ' . esc_html__( 'Plain Text - Excerpt', 'subscribe2' ) . '</label><br><br>' . "\r\n";
55
 
56
  if ( 'yes' === $mysubscribe2->subscribe2_options['show_autosub'] ) {
57
+ echo esc_html__( 'Automatically subscribe me to newly created categories', 'subscribe2' ) . ': &nbsp;&nbsp;';
58
  echo '<label><input type="radio" name="new_category" value="yes"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_autosub' ), true ), 'yes', false ) . ' />';
59
+ echo ' ' . esc_html__( 'Yes', 'subscribe2' ) . '</label>&nbsp;&nbsp;';
60
  echo '<label><input type="radio" name="new_category" value="no"' . checked( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_autosub' ), true ), 'no', false ) . ' />';
61
+ echo ' ' . esc_html__( 'No', 'subscribe2' ) . '</label>';
62
  echo '</p>';
63
  }
64
 
65
  if ( 'yes' === $mysubscribe2->subscribe2_options['one_click_profile'] ) {
66
  // One-click subscribe and unsubscribe buttons
67
+ echo '<h2>' . esc_html__( 'One Click Subscription / Unsubscription', 'subscribe2' ) . "</h2>\r\n";
68
+ echo '<p class="submit"><input type="submit" class="button-primary" name="subscribe" value="' . esc_html__( 'Subscribe to All', 'subscribe2' ) . '" />&nbsp;&nbsp;';
69
+ echo '<input type="submit" class="button-primary" name="unsubscribe" value="' . esc_html__( 'Unsubscribe from All', 'subscribe2' ) . '" /></p>';
70
  }
71
 
72
  // subscribed categories
76
  // if we are subscribed to the current blog display an "unsubscribe" link
77
  if ( ! empty( $subscribed ) ) {
78
  $unsubscribe_link = esc_url( add_query_arg( 's2mu_unsubscribe', $blog_id ) );
79
+ echo '<p><a href="' . esc_url( $unsubscribe_link ) . '" class="button">' . esc_html__( 'Unsubscribe me from this blog', 'subscribe2' ) . '</a></p>';
80
  } else {
81
  // else we show a "subscribe" link
82
  $subscribe_link = esc_url( add_query_arg( 's2mu_subscribe', $blog_id ) );
83
+ echo '<p><a href="' . esc_url( $subscribe_link ) . '" class="button">' . esc_html__( 'Subscribe to all categories', 'subscribe2' ) . '</a></p>';
84
  }
85
+ echo '<h2>' . esc_html__( 'Subscribed Categories on', 'subscribe2' ) . ' ' . esc_html( get_option( 'blogname' ) ) . ' </h2>' . "\r\n";
86
  } else {
87
+ echo '<h2>' . esc_html__( 'Subscribed Categories', 'subscribe2' ) . '</h2>' . "\r\n";
88
  }
89
  ('' === $mysubscribe2->subscribe2_options['compulsory']) ? $compulsory = array() : $compulsory = explode( ',', $mysubscribe2->subscribe2_options['compulsory'] );
90
  $this->display_category_form( explode( ',', get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ), $mysubscribe2->subscribe2_options['reg_override'], $compulsory );
91
  } else {
92
  // we're doing daily digests, so just show
93
  // subscribe / unnsubscribe
94
+ echo esc_html__( 'Receive periodic summaries of new posts?', 'subscribe2' ) . ': &nbsp;&nbsp;';
95
  echo '<label>';
96
  echo '<input type="radio" name="category" value="digest"';
97
  if ( get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ) {
98
  echo ' checked="checked"';
99
  }
100
+ echo ' /> ' . esc_html__( 'Yes', 'subscribe2' ) . '</label> <label><input type="radio" name="category" value="-1" ';
101
  if ( ! get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_subscribed' ), true ) ) {
102
  echo ' checked="checked"';
103
  }
104
+ echo ' /> ' . esc_html__( 'No', 'subscribe2' );
105
  echo '</label></p>';
106
  }
107
 
108
  if ( count( $this->get_authors() ) > 1 && 'never' === $mysubscribe2->subscribe2_options['email_freq'] ) {
109
  echo '<div class="s2_admin" id="s2_authors">' . "\r\n";
110
+ echo '<h2>' . esc_html__( 'Do not send notifications for post made by these authors', 'subscribe2' ) . '</h2>' . "\r\n";
111
  $this->display_author_form( explode( ',', get_user_meta( $userid, $mysubscribe2->get_usermeta_keyname( 's2_authors' ), true ) ) );
112
  echo '</div>' . "\r\n";
113
  }
160
  echo '<div class="s2_admin" id="s2_mu_sites">' . "\r\n";
161
  if ( ! empty( $blogs_subscribed ) ) {
162
  ksort( $blogs_subscribed );
163
+ echo '<h2>' . esc_html__( 'Subscribed Blogs', 'subscribe2' ) . '</h2>' . "\r\n";
164
  echo '<ul class="s2_blogs">' . "\r\n";
165
  foreach ( $blogs_subscribed as $blog ) {
166
+ echo '<li><span class="name"><a href="' . esc_url( $blog['blogurl'] ) . '" title="' . esc_attr( $blog['description'] ) . '">' . esc_html( $blog['blogname'] ) . '</a></span>' . "\r\n";
167
  if ( $s2blog_id === $blog['blog_id'] ) {
168
+ echo '<span class="buttons">' . esc_html__( 'Viewing Settings Now', 'subscribe2' ) . '</span>' . "\r\n";
169
  } else {
170
  echo '<span class="buttons">';
171
  if ( is_user_member_of_blog( $current_user->id, $blog['blog_id'] ) ) {
172
+ echo '<a href="' . esc_url( $blog['subscribe_page'] ) . '">' . esc_html__( 'View Settings', 'subscribe2' ) . '</a>' . "\r\n";
173
  }
174
+ echo '<a href="' . esc_url( add_query_arg( 's2mu_unsubscribe', $blog['blog_id'] ) ) . '">' . esc_html__( 'Unsubscribe', 'subscribe2' ) . '</a></span>' . "\r\n";
175
  }
176
+ echo '<div class="additional_info">' . esc_html( $blog['description'] ) . '</div>' . "\r\n";
177
  echo '</li>';
178
  }
179
  echo '</ul>' . "\r\n";
181
 
182
  if ( ! empty( $blogs_notsubscribed ) ) {
183
  ksort( $blogs_notsubscribed );
184
+ echo '<h2>' . esc_html__( 'Subscribe to new blogs', 'subscribe2' ) . "</h2>\r\n";
185
  echo '<ul class="s2_blogs">';
186
  foreach ( $blogs_notsubscribed as $blog ) {
187
+ echo '<li><span class="name"><a href="' . esc_url( $blog['blogurl'] ) . '" title="' . esc_attr( $blog['description'] ) . '">' . esc_html( $blog['blogname'] ) . '</a></span>' . "\r\n";
188
  if ( $s2blog_id === $blog['blog_id'] ) {
189
+ echo '<span class="buttons">' . esc_html__( 'Viewing Settings Now', 'subscribe2' ) . '</span>' . "\r\n";
190
  } else {
191
  echo '<span class="buttons">';
192
  if ( is_user_member_of_blog( $current_user->id, $blog['blog_id'] ) ) {
193
+ echo '<a href="' . esc_url( $blog['subscribe_page'] ) . '">' . esc_html__( 'View Settings', 'subscribe2' ) . '</a>' . "\r\n";
194
  }
195
+ echo '<a href="' . esc_url( add_query_arg( 's2mu_subscribe', $blog['blog_id'] ) ) . '">' . esc_html__( 'Subscribe', 'subscribe2' ) . '</a></span>' . "\r\n";
196
  }
197
+ echo '<div class="additional_info">' . esc_html( $blog['description'] ) . '</div>' . "\r\n";
198
  echo '</li>';
199
  }
200
  echo '</ul>' . "\r\n";
282
  $mysubscribe2->one_click_handler( $userid, 'unsubscribe' );
283
  }
284
 
285
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Subscription preferences updated.', 'subscribe2' ) . '</strong></p></div>' . "\r\n";
286
  }
287
 
288
  /**
303
  $j = 0;
304
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
305
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
306
+ echo '<label><input type="checkbox" name="checkall" value="checkall_' . esc_attr( $name ) . '" /> ' . esc_html__( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
307
  echo '</td></tr>' . "\r\n";
308
  echo '<tr style="vertical-align: top;"><td style="width: 50%; text-align: left;">' . "\r\n";
309
  foreach ( $all_cats as $cat ) {
322
  $cat_name .= $cat->name;
323
 
324
  if ( 0 === $j ) {
325
+ echo '<label><input class="checkall_' . esc_attr( $name ) . '" type="checkbox" name="' . esc_attr( $name ) . '[]" value="' . esc_attr( $cat->term_id ) . '"';
326
  if ( in_array( (string) $cat->term_id, $selected, true ) || in_array( (string) $cat->term_id, $compulsory, true ) ) {
327
  echo ' checked="checked"';
328
  }
329
  if ( in_array( (string) $cat->term_id, $compulsory, true ) && 'category' === $name ) {
330
  echo ' DISABLED';
331
  }
332
+ echo ' /> <abbr title="' . esc_attr( $cat->slug ) . '">' . esc_html( $cat_name ) . '</abbr></label><br>' . "\r\n";
333
  } else {
334
+ echo '<label><input class="checkall_' . esc_attr( $name ) . '" type="checkbox" name="' . esc_attr( $name ) . '[]" value="' . esc_attr( $cat->term_id ) . '"';
335
  if ( in_array( (string) $cat->term_id, $selected, true ) || in_array( (string) $cat->term_id, $compulsory, true ) ) {
336
  echo ' checked="checked"';
337
  }
338
  if ( in_array( (string) $cat->term_id, $compulsory, true ) && 'category' === $name ) {
339
  echo ' DISABLED';
340
  }
341
+ echo ' /> <abbr title="' . esc_attr( $cat->slug ) . '">' . esc_html( $cat_name ) . '</abbr></label><br>' . "\r\n";
342
  }
343
  $i++;
344
  }
345
  if ( ! empty( $compulsory ) ) {
346
  foreach ( $compulsory as $cat ) {
347
+ echo '<input type="hidden" name="' . esc_attr( $name ) . '[]" value="' . esc_attr( $cat ) . '">' . "\r\n";
348
  }
349
  }
350
  echo '</td></tr>' . "\r\n";
363
  $j = 0;
364
  echo '<table style="width: 100%; border-collapse: separate; border-spacing: 2px; *border-collapse: expression(\'separate\', cellSpacing = \'2px\');" class="editform">' . "\r\n";
365
  echo '<tr><td style="text-align: left;" colspan="2">' . "\r\n";
366
+ echo '<label><input type="checkbox" name="checkall" value="checkall_author" /> ' . esc_html__( 'Select / Unselect All', 'subscribe2' ) . '</label>' . "\r\n";
367
  echo '</td></tr>' . "\r\n";
368
  echo '<tr style="vertical-align: top;"><td style="width: 50%; test-align: left;">' . "\r\n";
369
  foreach ( $all_authors as $author ) {
372
  $j++;
373
  }
374
  if ( 0 === $j ) {
375
+ echo '<label><input class="checkall_author" type="checkbox" name="author[]" value="' . esc_attr( $author->ID ) . '"';
376
  if ( in_array( $author->ID, $selected, true ) ) {
377
  echo ' checked="checked"';
378
  }
379
+ echo ' /> ' . esc_html( $author->display_name ) . '</label><br>' . "\r\n";
380
  } else {
381
+ echo '<label><input class="checkall_author" type="checkbox" name="author[]" value="' . esc_attr( $author->ID ) . '"';
382
  if ( in_array( $author->ID, $selected, true ) ) {
383
  echo ' checked="checked"';
384
  }
385
+ echo ' /> ' . esc_html( $author->display_name ) . '</label><br>' . "\r\n";
386
  $i++;
387
  }
388
  }
classes/class-s2-frontend.php CHANGED
@@ -5,11 +5,11 @@ class S2_Frontend extends S2_Core {
5
  */
6
  public function load_strings() {
7
  // Translators: Link to login page
8
- $this->please_log_in = '<p class="s2_message">' . sprintf( __( 'To manage your subscription options please <a href="%1$s">login.</a>', 'subscribe2' ), get_option( 'siteurl' ) . '/wp-login.php' ) . '</p>';
9
 
10
  $profile = apply_filters( 's2_profile_link', get_option( 'siteurl' ) . '/wp-admin/admin.php?page=s2' );
11
  // Translators: Link to Profile page
12
- $this->profile = '<p class="s2_message">' . sprintf( __( 'You may manage your subscription options from your <a href="%1$s">profile</a>', 'subscribe2' ), $profile ) . '</p>';
13
  if ( true === $this->s2_mu ) {
14
  global $blog_id;
15
  $user_ID = get_current_user_id();
@@ -152,9 +152,9 @@ class S2_Frontend extends S2_Core {
152
 
153
  // build default form
154
  if ( 'true' === strtolower( $args['nojs'] ) ) {
155
- $this->form = '<form name="' . $form_name . '" method="post"' . $action . '><input type="hidden" name="ip" value="' . esc_html( $_SERVER['REMOTE_ADDR'] ) . '" />' . $antispam_text . '<p><label for="s2email">' . __( 'Your email:', 'subscribe2' ) . '</label><br /><input type="email" name="email" id="s2email" value="' . $value . '" size="' . $args['size'] . '" />' . $wrap_text . $this->input_form_action . '</p></form>';
156
  } else {
157
- $this->form = '<form name="' . $form_name . '" method="post"' . $action . '><input type="hidden" name="ip" value="' . esc_html( $_SERVER['REMOTE_ADDR'] ) . '" />' . $antispam_text . '<p><label for="s2email">' . __( 'Your email:', 'subscribe2' ) . '</label><br /><input type="email" name="email" id="s2email" value="' . $value . '" size="' . $args['size'] . '" onfocus="if (this.value === \'' . $value . '\') {this.value = \'\';}" onblur="if (this.value === \'\') {this.value = \'' . $value . '\';}" />' . $wrap_text . $this->input_form_action . '</p></form>' . "\r\n";
158
  }
159
  $this->s2form = apply_filters( 's2_form', $this->form, $args );
160
 
@@ -401,7 +401,7 @@ class S2_Frontend extends S2_Core {
401
  */
402
  public function add_minimeta() {
403
  if ( 0 !== $this->subscribe2_options['s2page'] ) {
404
- echo '<li><a href="' . get_permalink( $this->subscribe2_options['s2page'] ) . '">' . __( '[Un]Subscribe to Posts', 'subscribe2' ) . '</a></li>' . "\r\n";
405
  }
406
  }
407
 
@@ -520,7 +520,22 @@ class S2_Frontend extends S2_Core {
520
  * Add ip updater library to footer
521
  */
522
  public function js_ip_library_script() {
523
- echo '<script async="async" src="https://api.ipify.org?format=jsonp&callback=getip"></script>' . "\r\n"; // phpcs:ignore WordPress.WP.EnqueuedResources
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  }
525
 
526
  /* ===== define some variables ===== */
5
  */
6
  public function load_strings() {
7
  // Translators: Link to login page
8
+ $this->please_log_in = '<p class="s2_message">' . sprintf( __( 'To manage your subscription options please <a href="%1$s">login</a>.', 'subscribe2' ), get_option( 'siteurl' ) . '/wp-login.php' ) . '</p>';
9
 
10
  $profile = apply_filters( 's2_profile_link', get_option( 'siteurl' ) . '/wp-admin/admin.php?page=s2' );
11
  // Translators: Link to Profile page
12
+ $this->profile = '<p class="s2_message">' . sprintf( __( 'You may manage your subscription options from your <a href="%1$s">profile</a>.', 'subscribe2' ), $profile ) . '</p>';
13
  if ( true === $this->s2_mu ) {
14
  global $blog_id;
15
  $user_ID = get_current_user_id();
152
 
153
  // build default form
154
  if ( 'true' === strtolower( $args['nojs'] ) ) {
155
+ $this->form = '<form name="' . $form_name . '" method="post"' . $action . '><input type="hidden" name="ip" value="' . esc_attr( $_SERVER['REMOTE_ADDR'] ) . '" />' . $antispam_text . '<p><label for="s2email">' . __( 'Your email:', 'subscribe2' ) . '</label><br><input type="email" name="email" id="s2email" value="' . $value . '" size="' . $args['size'] . '" />' . $wrap_text . $this->input_form_action . '</p></form>';
156
  } else {
157
+ $this->form = '<form name="' . $form_name . '" method="post"' . $action . '><input type="hidden" name="ip" value="' . esc_attr( $_SERVER['REMOTE_ADDR'] ) . '" />' . $antispam_text . '<p><label for="s2email">' . __( 'Your email:', 'subscribe2' ) . '</label><br><input type="email" name="email" id="s2email" value="' . $value . '" size="' . $args['size'] . '" onfocus="if (this.value === \'' . $value . '\') {this.value = \'\';}" onblur="if (this.value === \'\') {this.value = \'' . $value . '\';}" />' . $wrap_text . $this->input_form_action . '</p></form>' . "\r\n";
158
  }
159
  $this->s2form = apply_filters( 's2_form', $this->form, $args );
160
 
401
  */
402
  public function add_minimeta() {
403
  if ( 0 !== $this->subscribe2_options['s2page'] ) {
404
+ echo '<li><a href="' . esc_url( get_permalink( $this->subscribe2_options['s2page'] ) ) . '">' . esc_html__( '[Un]Subscribe to Posts', 'subscribe2' ) . '</a></li>' . "\r\n";
405
  }
406
  }
407
 
520
  * Add ip updater library to footer
521
  */
522
  public function js_ip_library_script() {
523
+ $args = array(
524
+ 'format' => 'jsonp',
525
+ 'callback' => 'getip',
526
+ );
527
+ wp_enqueue_script( 's2_ip_library', add_query_arg( $args, 'https://api.ipify.org' ), array(), S2VERSION, true );
528
+ }
529
+
530
+ /**
531
+ * Reformat WordPress escaped link to IPify library
532
+ */
533
+ public function tag_replace_ampersand( $tag ) {
534
+ if ( strstr( $tag, 'ipify' ) !== false ) {
535
+ $tag = str_replace( '&#038;', '&', $tag );
536
+ }
537
+
538
+ return $tag;
539
  }
540
 
541
  /* ===== define some variables ===== */
classes/class-s2-list-table-legacy.php DELETED
@@ -1,431 +0,0 @@
1
- <?php
2
- /**
3
- * List Table class used in WordPress 4.2.x and below
4
- */
5
- class S2_List_Table_Legacy extends WP_List_Table {
6
- private $date_format = '';
7
- private $time_format = '';
8
-
9
- public function __construct() {
10
- global $status, $page;
11
-
12
- parent::__construct(
13
- array(
14
- 'singular' => 'subscriber',
15
- 'plural' => 'subscribers',
16
- 'ajax' => false,
17
- )
18
- );
19
- $this->date_format = get_option( 'date_format' );
20
- $this->time_format = get_option( 'time_format' );
21
- }
22
-
23
- public function column_default( $item, $column_name ) {
24
- global $current_tab;
25
- if ( 'registered' === $current_tab ) {
26
- switch ( $column_name ) {
27
- case 'email':
28
- return $item[ $column_name ];
29
- }
30
- } else {
31
- switch ( $column_name ) {
32
- case 'email':
33
- case 'date':
34
- return $item[ $column_name ];
35
- }
36
- }
37
- }
38
-
39
- public function column_email( $item ) {
40
- global $current_tab;
41
- if ( 'registered' === $current_tab ) {
42
- $actions = array(
43
- 'edit' => sprintf( '<a href="?page=%s&amp;id=%d">%s</a>', 's2', rawurlencode( $item['id'] ), __( 'Edit', 'subscribe2' ) ),
44
- );
45
- return sprintf( '%1$s %2$s', $item['email'], $this->row_actions( $actions ) );
46
- } else {
47
- global $mysubscribe2;
48
- if ( '0' === $mysubscribe2->is_public( $item['email'] ) ) {
49
- return sprintf( '<span style="color:#FF0000"><abbr title="%2$s">%1$s</abbr></span>', $item['email'], $item['ip'] );
50
- } else {
51
- return sprintf( '<abbr title="%2$s">%1$s</abbr>', $item['email'], $item['ip'] );
52
- }
53
- }
54
- }
55
-
56
- public function column_date( $item ) {
57
- global $current_tab;
58
- if ( 'registered' === $current_tab ) {
59
- return $item['date'];
60
- } else {
61
- $timestamp = strtotime( $item['date'] . ' ' . $item['time'] );
62
- return sprintf( '<abbr title="%2$s">%1$s</abbr>', date_i18n( $this->date_format, $timestamp ), date_i18n( $this->time_format, $timestamp ) );
63
- }
64
- }
65
-
66
- public function column_cb( $item ) {
67
- return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], $item['email'] );
68
- }
69
-
70
- public function get_columns() {
71
- global $current_tab;
72
- if ( 'registered' === $current_tab ) {
73
- $columns = array(
74
- 'cb' => '<input type="checkbox" />',
75
- 'email' => _x( 'Email', 'column name', 'subscribe2' ),
76
- );
77
- } else {
78
- $columns = array(
79
- 'cb' => '<input type="checkbox" />',
80
- 'email' => _x( 'Email', 'column name', 'subscribe2' ),
81
- 'date' => _x( 'Date', 'column name', 'subscribe2' ),
82
- );
83
- }
84
- return $columns;
85
- }
86
-
87
- public function get_sortable_columns() {
88
- global $current_tab;
89
- if ( 'registered' === $current_tab ) {
90
- $sortable_columns = array(
91
- 'email' => array( 'email', true ),
92
- );
93
- } else {
94
- $sortable_columns = array(
95
- 'email' => array( 'email', true ),
96
- 'date' => array( 'date', false ),
97
- );
98
- }
99
- return $sortable_columns;
100
- }
101
-
102
- public function print_column_headers( $with_id = true ) {
103
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
104
-
105
- $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
106
- $current_url = remove_query_arg( 'paged', $current_url );
107
-
108
- if ( isset( $_REQUEST['what'] ) ) {
109
- $current_url = add_query_arg(
110
- array(
111
- 'what' => $_REQUEST['what'],
112
- ),
113
- $current_url
114
- );
115
- }
116
-
117
- if ( isset( $_GET['orderby'] ) ) {
118
- $current_orderby = $_GET['orderby'];
119
- } else {
120
- $current_orderby = '';
121
- }
122
-
123
- if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
124
- $current_order = 'desc';
125
- } else {
126
- $current_order = 'asc';
127
- }
128
-
129
- if ( ! empty( $columns['cb'] ) ) {
130
- static $cb_counter = 1;
131
- $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'subscribe2' ) . '</label>'
132
- . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
133
- $cb_counter++;
134
- }
135
-
136
- foreach ( $columns as $column_key => $column_display_name ) {
137
- $class = array( 'manage-column', "column-$column_key" );
138
-
139
- $style = '';
140
- if ( in_array( $column_key, $hidden, true ) ) {
141
- $style = 'display:none;';
142
- }
143
-
144
- $style = ' style="' . $style . '"';
145
-
146
- if ( 'cb' === $column_key ) {
147
- $class[] = 'check-column';
148
- }
149
-
150
- if ( isset( $sortable[ $column_key ] ) ) {
151
- list( $orderby, $desc_first ) = $sortable[ $column_key ];
152
-
153
- if ( $current_orderby === $orderby ) {
154
- $order = 'asc' === $current_order ? 'desc' : 'asc';
155
- $class[] = 'sorted';
156
- $class[] = $current_order;
157
- } else {
158
- $order = $desc_first ? 'desc' : 'asc';
159
- $class[] = 'sortable';
160
- $class[] = $desc_first ? 'asc' : 'desc';
161
- }
162
-
163
- $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
164
- }
165
-
166
- $id = $with_id ? "id='$column_key'" : '';
167
-
168
- if ( ! empty( $class ) ) {
169
- $class = "class='" . join( ' ', $class ) . "'";
170
- }
171
-
172
- echo "<th scope='col' $id $class $style>$column_display_name</th>";
173
- }
174
- }
175
-
176
- public function get_bulk_actions() {
177
- global $current_tab;
178
- if ( 'registered' === $current_tab ) {
179
- if ( is_multisite() ) {
180
- return array();
181
- } else {
182
- return array(
183
- 'delete' => __( 'Delete', 'subscribe2' ),
184
- );
185
- }
186
- } else {
187
- $actions = array(
188
- 'delete' => __( 'Delete', 'subscribe2' ),
189
- 'toggle' => __( 'Toggle', 'subscribe2' ),
190
- );
191
- return $actions;
192
- }
193
- }
194
-
195
- public function process_bulk_action() {
196
- if ( in_array( $this->current_action(), array( 'delete', 'toggle' ), true ) ) {
197
- if ( ! isset( $_REQUEST['subscriber'] ) ) {
198
- echo '<div id="message" class="error"><p><strong>' . __( 'No users were selected.', 'subscribe2' ) . '</strong></p></div>';
199
- return;
200
- }
201
- }
202
- if ( 'delete' === $this->current_action() ) {
203
- global $mysubscribe2, $current_user, $subscribers;
204
- $message = array();
205
- foreach ( $_REQUEST['subscriber'] as $address ) {
206
- $address = trim( stripslashes( $address ) );
207
- if ( false !== $mysubscribe2->is_public( $address ) ) {
208
- $mysubscribe2->delete( $address );
209
- $key = array_search( $address, $subscribers, true );
210
- unset( $subscribers[ $key ] );
211
- $message['public_deleted'] = __( 'Address(es) deleted!', 'subscribe2' );
212
- } else {
213
- $user = get_user_by( 'email', $address );
214
- if ( ! current_user_can( 'delete_user', $user->ID ) || $user->ID === $current_user->ID ) {
215
- $message['reg_delete_error'] = __( 'Delete failed! You cannot delete some or all of these users.', 'subscribe2' );
216
- continue;
217
- } else {
218
- $message['reg_deleted'] = __( 'Registered user(s) deleted! Any posts made by these users were assigned to you.', 'subscribe2' );
219
- foreach ( $subscribers as $key => $data ) {
220
- if ( in_array( $address, $data, true ) ) {
221
- unset( $subscribers[ $key ] );
222
- }
223
- }
224
- wp_delete_user( $user->ID, $current_user->ID );
225
- }
226
- }
227
- }
228
- $final_message = implode( '<br /><br />', array_filter( $message ) );
229
- echo '<div id="message" class="updated fade"><p><strong>' . $final_message . '</strong></p></div>';
230
- }
231
- if ( 'toggle' === $this->current_action() ) {
232
- global $mysubscribe2, $current_user, $subscribers;
233
- $mysubscribe2->ip = $current_user->user_login;
234
- foreach ( $_REQUEST['subscriber'] as $address ) {
235
- $address = trim( stripslashes( $address ) );
236
- $mysubscribe2->toggle( $address );
237
- if ( 'confirmed' === $_POST['what'] || 'unconfirmed' === $_POST['what'] ) {
238
- $key = array_search( $address, $subscribers, true );
239
- unset( $subscribers[ $key ] );
240
- }
241
- }
242
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Status changed!', 'subscribe2' ) . '</strong></p></div>';
243
- }
244
- }
245
-
246
- public function pagination( $which ) {
247
- if ( empty( $this->_pagination_args ) ) {
248
- return;
249
- }
250
-
251
- $total_items = intval( $this->_pagination_args['total_items'] );
252
- $total_pages = intval( $this->_pagination_args['total_pages'] );
253
- $infinite_scroll = false;
254
- if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
255
- $infinite_scroll = $this->_pagination_args['infinite_scroll'];
256
- }
257
-
258
- // Translators: Pagination
259
- $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items, 'subscribe2' ), number_format_i18n( $total_items ) ) . '</span>';
260
-
261
- if ( isset( $_POST['what'] ) ) {
262
- $current = 1;
263
- } else {
264
- $current = intval( $this->get_pagenum() );
265
- }
266
-
267
- if ( version_compare( $GLOBALS['wp_version'], '3.5', '<' ) ) {
268
- $current_url = esc_url( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
269
- } else {
270
- $current_url = esc_url( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
271
- }
272
-
273
- $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
274
-
275
- if ( isset( $_REQUEST['what'] ) ) {
276
- $current_url = add_query_arg(
277
- array(
278
- 'what' => $_REQUEST['what'],
279
- ),
280
- $current_url
281
- );
282
- }
283
-
284
- if ( isset( $_POST['s'] ) ) {
285
- $current_url = add_query_arg(
286
- array(
287
- 's' => $_POST['s'],
288
- ),
289
- $current_url
290
- );
291
- }
292
-
293
- $page_links = array();
294
-
295
- $disable_first = '';
296
- $disable_last = '';
297
- if ( 1 === $current ) {
298
- $disable_first = ' disabled';
299
- }
300
- if ( $current === $total_pages ) {
301
- $disable_last = ' disabled';
302
- }
303
-
304
- $page_links[] = sprintf(
305
- "<a class='%s' title='%s' href='%s'>%s</a>",
306
- 'first-page' . $disable_first,
307
- esc_attr__( 'Go to the first page', 'subscribe2' ),
308
- remove_query_arg( 'paged', $current_url ),
309
- '&laquo;'
310
- );
311
-
312
- $page_links[] = sprintf(
313
- "<a class='%s' title='%s' href='%s'>%s</a>",
314
- 'prev-page' . $disable_first,
315
- esc_attr__( 'Go to the previous page', 'subscribe2' ),
316
- add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ),
317
- '&lsaquo;'
318
- );
319
-
320
- if ( 'bottom' === $which ) {
321
- $html_current_page = $current;
322
- } else {
323
- $html_current_page = sprintf(
324
- "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />",
325
- esc_attr__( 'Current page', 'subscribe2' ),
326
- $current,
327
- strlen( $total_pages )
328
- );
329
- }
330
-
331
- $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
332
- // Translators: Pagination
333
- $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging', 'subscribe2' ), $html_current_page, $html_total_pages ) . '</span>';
334
-
335
- $page_links[] = sprintf(
336
- "<a class='%s' title='%s' href='%s'>%s</a>",
337
- 'next-page' . $disable_last,
338
- esc_attr__( 'Go to the next page', 'subscribe2' ),
339
- add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ),
340
- '&rsaquo;'
341
- );
342
-
343
- $page_links[] = sprintf(
344
- "<a class='%s' title='%s' href='%s'>%s</a>",
345
- 'last-page' . $disable_last,
346
- esc_attr__( 'Go to the last page', 'subscribe2' ),
347
- add_query_arg( 'paged', $total_pages, $current_url ),
348
- '&raquo;'
349
- );
350
-
351
- $pagination_links_class = 'pagination-links';
352
- if ( ! empty( $infinite_scroll ) ) {
353
- $pagination_links_class = ' hide-if-js';
354
- }
355
- $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
356
-
357
- if ( $total_pages ) {
358
- $page_class = $total_pages < 2 ? ' one-page' : '';
359
- } else {
360
- $page_class = ' no-pages';
361
- }
362
-
363
- $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
364
-
365
- echo $this->_pagination;
366
- }
367
-
368
- public function prepare_items() {
369
- global $mysubscribe2, $subscribers, $current_tab;
370
-
371
- $user = get_current_user_id();
372
- $screen = get_current_screen();
373
- $screen_option = $screen->get_option( 'per_page', 'option' );
374
- $per_page = get_user_meta( $user, $screen_option, true );
375
- if ( empty( $per_page ) || $per_page < 1 ) {
376
- $per_page = $screen->get_option( 'per_page', 'default' );
377
- }
378
-
379
- $columns = $this->get_columns();
380
- $hidden = array();
381
- $sortable = $this->get_sortable_columns();
382
-
383
- $this->_column_headers = array( $columns, $hidden, $sortable );
384
-
385
- $this->process_bulk_action();
386
-
387
- $data = array();
388
- if ( 'public' === $current_tab ) {
389
- foreach ( (array) $subscribers as $email ) {
390
- $data[] = array(
391
- 'email' => $email,
392
- 'date' => $mysubscribe2->signup_date( $email ),
393
- 'time' => $mysubscribe2->signup_time( $email ),
394
- 'ip' => $mysubscribe2->signup_ip( $email ),
395
- );
396
- }
397
- } else {
398
- foreach ( (array) $subscribers as $subscriber ) {
399
- $data[] = array(
400
- 'email' => $subscriber['user_email'],
401
- 'id' => $subscriber['ID'],
402
- );
403
- }
404
- }
405
-
406
- function usort_reorder( $a, $b ) {
407
- $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'email';
408
- $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc';
409
- $result = strcasecmp( $a[ $orderby ], $b[ $orderby ] );
410
- return ( 'asc' === $order ) ? $result : -$result;
411
- }
412
- usort( $data, 'usort_reorder' );
413
-
414
- if ( isset( $_POST['what'] ) ) {
415
- $current_page = 1;
416
- } else {
417
- $current_page = $this->get_pagenum();
418
- }
419
- $total_items = count( $data );
420
- $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
421
- $this->items = $data;
422
-
423
- $this->set_pagination_args(
424
- array(
425
- 'total_items' => $total_items,
426
- 'per_page' => $per_page,
427
- 'total_pages' => ceil( $total_items / $per_page ),
428
- )
429
- );
430
- }
431
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-s2-list-table.php CHANGED
@@ -22,17 +22,10 @@ class S2_List_Table extends WP_List_Table {
22
 
23
  public function column_default( $item, $column_name ) {
24
  global $current_tab;
25
- if ( 'registered' === $current_tab ) {
26
- switch ( $column_name ) {
27
- case 'email':
28
- return $item[ $column_name ];
29
- }
30
- } else {
31
- switch ( $column_name ) {
32
- case 'email':
33
- case 'date':
34
- return $item[ $column_name ];
35
- }
36
  }
37
  }
38
 
@@ -56,7 +49,8 @@ class S2_List_Table extends WP_List_Table {
56
  public function column_date( $item ) {
57
  global $current_tab;
58
  if ( 'registered' === $current_tab ) {
59
- return $item['date'];
 
60
  } else {
61
  $timestamp = strtotime( $item['date'] . ' ' . $item['time'] );
62
  return sprintf( '<abbr title="%2$s">%1$s</abbr>', date_i18n( $this->date_format, $timestamp ), date_i18n( $this->time_format, $timestamp ) );
@@ -69,33 +63,20 @@ class S2_List_Table extends WP_List_Table {
69
 
70
  public function get_columns() {
71
  global $current_tab;
72
- if ( 'registered' === $current_tab ) {
73
- $columns = array(
74
- 'cb' => '<input type="checkbox" />',
75
- 'email' => _x( 'Email', 'column name', 'subscribe2' ),
76
- );
77
- } else {
78
- $columns = array(
79
- 'cb' => '<input type="checkbox" />',
80
- 'email' => _x( 'Email', 'column name', 'subscribe2' ),
81
- 'date' => _x( 'Date', 'column name', 'subscribe2' ),
82
- );
83
- }
84
  return $columns;
85
  }
86
 
87
  public function get_sortable_columns() {
88
  global $current_tab;
89
- if ( 'registered' === $current_tab ) {
90
- $sortable_columns = array(
91
- 'email' => array( 'email', true ),
92
- );
93
- } else {
94
- $sortable_columns = array(
95
- 'email' => array( 'email', true ),
96
- 'date' => array( 'date', false ),
97
- );
98
- }
99
  return $sortable_columns;
100
  }
101
 
@@ -172,7 +153,7 @@ class S2_List_Table extends WP_List_Table {
172
  $class = "class='" . join( ' ', $class ) . "'";
173
  }
174
 
175
- echo "<$tag $scope $id $class>$column_display_name</$tag>";
176
  }
177
  }
178
 
@@ -198,7 +179,7 @@ class S2_List_Table extends WP_List_Table {
198
  public function process_bulk_action() {
199
  if ( in_array( $this->current_action(), array( 'delete', 'toggle' ), true ) ) {
200
  if ( ! isset( $_REQUEST['subscriber'] ) ) {
201
- echo '<div id="message" class="error"><p><strong>' . __( 'No users were selected.', 'subscribe2' ) . '</strong></p></div>';
202
  return;
203
  }
204
  }
@@ -228,8 +209,8 @@ class S2_List_Table extends WP_List_Table {
228
  }
229
  }
230
  }
231
- $final_message = implode( '<br /><br />', array_filter( $message ) );
232
- echo '<div id="message" class="updated fade"><p><strong>' . $final_message . '</strong></p></div>';
233
  }
234
  if ( 'toggle' === $this->current_action() ) {
235
  global $mysubscribe2, $current_user, $subscribers;
@@ -242,7 +223,7 @@ class S2_List_Table extends WP_List_Table {
242
  unset( $subscribers[ $key ] );
243
  }
244
  }
245
- echo '<div id="message" class="updated fade"><p><strong>' . __( 'Status changed!', 'subscribe2' ) . '</strong></p></div>';
246
  }
247
  }
248
 
@@ -392,7 +373,7 @@ class S2_List_Table extends WP_List_Table {
392
 
393
  $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
394
 
395
- echo $this->_pagination;
396
  }
397
 
398
  public function prepare_items() {
@@ -429,6 +410,7 @@ class S2_List_Table extends WP_List_Table {
429
  $data[] = array(
430
  'email' => $subscriber['user_email'],
431
  'id' => $subscriber['ID'],
 
432
  );
433
  }
434
  }
22
 
23
  public function column_default( $item, $column_name ) {
24
  global $current_tab;
25
+ switch ( $column_name ) {
26
+ case 'email':
27
+ case 'date':
28
+ return $item[ $column_name ];
 
 
 
 
 
 
 
29
  }
30
  }
31
 
49
  public function column_date( $item ) {
50
  global $current_tab;
51
  if ( 'registered' === $current_tab ) {
52
+ $timestamp = strtotime( $item['date'] );
53
+ return sprintf( '<abbr title="%2$s">%1$s</abbr>', date_i18n( $this->date_format, $timestamp ), date_i18n( $this->time_format, $timestamp ) );
54
  } else {
55
  $timestamp = strtotime( $item['date'] . ' ' . $item['time'] );
56
  return sprintf( '<abbr title="%2$s">%1$s</abbr>', date_i18n( $this->date_format, $timestamp ), date_i18n( $this->time_format, $timestamp ) );
63
 
64
  public function get_columns() {
65
  global $current_tab;
66
+ $columns = array(
67
+ 'cb' => '<input type="checkbox" />',
68
+ 'email' => _x( 'Email', 'column name', 'subscribe2' ),
69
+ 'date' => _x( 'Date', 'column name', 'subscribe2' ),
70
+ );
 
 
 
 
 
 
 
71
  return $columns;
72
  }
73
 
74
  public function get_sortable_columns() {
75
  global $current_tab;
76
+ $sortable_columns = array(
77
+ 'email' => array( 'email', true ),
78
+ 'date' => array( 'date', false ),
79
+ );
 
 
 
 
 
 
80
  return $sortable_columns;
81
  }
82
 
153
  $class = "class='" . join( ' ', $class ) . "'";
154
  }
155
 
156
+ echo "<$tag $scope $id $class>$column_display_name</$tag>"; // phpcs:ignore WordPress.Security.EscapeOutput
157
  }
158
  }
159
 
179
  public function process_bulk_action() {
180
  if ( in_array( $this->current_action(), array( 'delete', 'toggle' ), true ) ) {
181
  if ( ! isset( $_REQUEST['subscriber'] ) ) {
182
+ echo '<div id="message" class="error"><p><strong>' . esc_html__( 'No users were selected.', 'subscribe2' ) . '</strong></p></div>';
183
  return;
184
  }
185
  }
209
  }
210
  }
211
  }
212
+ $final_message = implode( '<br><br>', array_filter( $message ) );
213
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html( $final_message ) . '</strong></p></div>';
214
  }
215
  if ( 'toggle' === $this->current_action() ) {
216
  global $mysubscribe2, $current_user, $subscribers;
223
  unset( $subscribers[ $key ] );
224
  }
225
  }
226
+ echo '<div id="message" class="updated fade"><p><strong>' . esc_html__( 'Status changed!', 'subscribe2' ) . '</strong></p></div>';
227
  }
228
  }
229
 
373
 
374
  $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
375
 
376
+ echo $this->_pagination; // phpcs:ignore WordPress.Security.EscapeOutput
377
  }
378
 
379
  public function prepare_items() {
410
  $data[] = array(
411
  'email' => $subscriber['user_email'],
412
  'id' => $subscriber['ID'],
413
+ 'date' => get_userdata( $subscriber['ID'] )->user_registered,
414
  );
415
  }
416
  }
classes/class-s2-uninstall.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class S2_Uninstall {
3
+ public function uninstall() {
4
+ global $wp_version, $wpmu_version;
5
+ // Is Subscribe2 free active
6
+ if ( is_plugin_active( 'subscribe2/subscribe2.php' ) ) {
7
+ return;
8
+ }
9
+
10
+ // Is this WordPressMU or not?
11
+ if ( isset( $wpmu_version ) || strpos( $wp_version, 'wordpress-mu' ) ) {
12
+ $s2_mu = true;
13
+ }
14
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
15
+ $s2_mu = true;
16
+ }
17
+
18
+ if ( isset( $s2_mu ) && true === $s2_mu ) {
19
+ global $wpdb;
20
+ $blogs = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" );
21
+ foreach ( $blogs as $blog ) {
22
+ switch_to_blog( $blog );
23
+ $this->clean_database();
24
+ restore_current_blog();
25
+ }
26
+ } else {
27
+ $this->clean_database();
28
+ }
29
+ }
30
+
31
+ private function clean_database() {
32
+ global $wpdb;
33
+ // delete entry from wp_options table
34
+ delete_option( 'subscribe2_options' );
35
+ // delete legacy entry from wp-options table
36
+ delete_option( 's2_future_posts' );
37
+ // remove and scheduled events
38
+ wp_clear_scheduled_hook( 's2_digest_cron' );
39
+ // delete usermeta data for registered users
40
+ // use LIKE and % wildcard as meta_key names are prepended on WPMU
41
+ // and s2_cat is appended with category ID integer
42
+ $wpdb->query( "DELETE from $wpdb->usermeta WHERE meta_key LIKE '%s2_cat%'" );
43
+ $wpdb->query( "DELETE from $wpdb->usermeta WHERE meta_key LIKE '%s2_subscribed'" );
44
+ $wpdb->query( "DELETE from $wpdb->usermeta WHERE meta_key LIKE '%s2_format'" );
45
+ $wpdb->query( "DELETE from $wpdb->usermeta WHERE meta_key LIKE '%s2_autosub'" );
46
+ // delete any postmeta data that supressed notifications
47
+ $wpdb->query( "DELETE from $wpdb->postmeta WHERE meta_key = 's2mail'" );
48
+
49
+ // drop the subscribe2 table
50
+ $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}subscribe2" );
51
+ }
52
+ }
include/options.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- // include.php - Handles options for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  global $mysubscribe2;
@@ -145,7 +145,7 @@ if ( ! isset( $mysubscribe2->subscribe2_options['notification_subject'] ) ) {
145
  } // Default notification email subject
146
 
147
  if ( ! isset( $mysubscribe2->subscribe2_options['confirm_email'] ) ) {
148
- $mysubscribe2->subscribe2_options['confirm_email'] = __( '{BLOGNAME} has received a request to {ACTION} for this email address. To complete your request please click on the link below:\n\n{LINK}\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\n{MYNAME}.', 'subscribe2' );
149
  } // Default confirmation email text
150
 
151
  if ( ! isset( $mysubscribe2->subscribe2_options['confirm_subject'] ) ) {
@@ -153,7 +153,7 @@ if ( ! isset( $mysubscribe2->subscribe2_options['confirm_subject'] ) ) {
153
  } // Default confirmation email subject
154
 
155
  if ( ! isset( $mysubscribe2->subscribe2_options['remind_email'] ) ) {
156
- $mysubscribe2->subscribe2_options['remind_email'] = __( 'This email address was subscribed for notifications at {BLOGNAME} ({BLOGLINK}) but the subscription remains incomplete.\n\nIf you wish to complete your subscription please click on the link below:\n\n{LINK}\n\nIf you do not wish to complete your subscription please ignore this email and your address will be removed from our database.\n\nRegards,\n{MYNAME}', 'subscribe2' );
157
  } // Default reminder email text
158
 
159
  if ( ! isset( $mysubscribe2->subscribe2_options['remind_subject'] ) ) {
1
  <?php
2
+ // Handles options for subscribe2
3
  // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE
4
 
5
  global $mysubscribe2;
145
  } // Default notification email subject
146
 
147
  if ( ! isset( $mysubscribe2->subscribe2_options['confirm_email'] ) ) {
148
+ $mysubscribe2->subscribe2_options['confirm_email'] = __( "{BLOGNAME} has received a request to {ACTION} for this email address. To complete your request please click on the link below:\n\n{LINK}\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\n{MYNAME}.", 'subscribe2' );
149
  } // Default confirmation email text
150
 
151
  if ( ! isset( $mysubscribe2->subscribe2_options['confirm_subject'] ) ) {
153
  } // Default confirmation email subject
154
 
155
  if ( ! isset( $mysubscribe2->subscribe2_options['remind_email'] ) ) {
156
+ $mysubscribe2->subscribe2_options['remind_email'] = __( "This email address was subscribed for notifications at {BLOGNAME} ({BLOGLINK}) but the subscription remains incomplete.\n\nIf you wish to complete your subscription please click on the link below:\n\n{LINK}\n\nIf you do not wish to complete your subscription please ignore this email and your address will be removed from our database.\n\nRegards,\n{MYNAME}", 'subscribe2' );
157
  } // Default reminder email text
158
 
159
  if ( ! isset( $mysubscribe2->subscribe2_options['remind_subject'] ) ) {
subscribe2.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
  /*
3
  Plugin Name: Subscribe2
4
- Plugin URI: https://subscribe2.wordpress.com/
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 10.31
7
  Author: Subscribe2
8
- Author URI: https://subscribe2.wordpress.com/
9
  Licence: GPLv3
10
  Text Domain: subscribe2
11
  */
12
 
13
  /*
14
- Copyright (C) 2006-19 Matthew Robinson
15
  Based on the Original Subscribe2 plugin by
16
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
17
 
@@ -31,14 +31,14 @@ You should have received a copy of the GNU General Public License
31
  along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
32
  */
33
 
34
- if ( version_compare( $GLOBALS['wp_version'], '3.3', '<' ) || ! function_exists( 'add_action' ) ) {
35
  if ( ! function_exists( 'add_action' ) ) {
36
  $exit_msg = __( "I'm just a plugin, please don't call me directly", 'subscribe2' );
37
  } else {
38
- // Translators: Subscribe2 needs WordPress 3.3 or above, exit if not on a compatible version
39
- $exit_msg = sprintf( __( 'This version of Subscribe2 requires WordPress 3.3 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2' ), '<a href="http://codex.wordpress.org/Updating_WordPress">WordPress</a>', '<a href="https://semperplugins.com/subscribe2-html/">Subscribe2</a>' );
40
  }
41
- exit( $exit_msg );
42
  }
43
 
44
  // stop Subscribe2 being activated site wide on Multisite installs
@@ -49,12 +49,13 @@ if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
49
  if ( is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
50
  deactivate_plugins( plugin_basename( __FILE__ ) );
51
  $exit_msg = __( 'Subscribe2 HTML cannot be activated as a network plugin. Please activate it on a site level', 'subscribe2' );
52
- exit( $exit_msg );
53
  }
54
 
55
  // our version number. Don't touch this or any line below
56
  // unless you know exactly what you are doing
57
- define( 'S2VERSION', '10.31' );
 
58
  define( 'S2PATH', trailingslashit( dirname( __FILE__ ) ) );
59
  define( 'S2DIR', trailingslashit( dirname( plugin_basename( __FILE__ ) ) ) );
60
  define( 'S2URL', plugin_dir_url( dirname( __FILE__ ) ) . S2DIR );
@@ -64,14 +65,13 @@ if ( function_exists( 'set_time_limit' ) ) {
64
  set_time_limit( 300 );
65
  }
66
 
 
67
  require_once S2PATH . 'classes/class-s2-core.php';
68
  if ( is_admin() ) {
69
  require_once S2PATH . 'classes/class-s2-admin.php';
70
- global $mysubscribe2;
71
  $mysubscribe2 = new S2_Admin();
72
  } else {
73
  require_once S2PATH . 'classes/class-s2-frontend.php';
74
- global $mysubscribe2;
75
  $mysubscribe2 = new S2_Frontend();
76
  }
77
  add_action( 'plugins_loaded', array( $mysubscribe2, 's2init' ) );
1
  <?php
2
  /*
3
  Plugin Name: Subscribe2
4
+ Plugin URI: https://mailoptin.io
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 10.32
7
  Author: Subscribe2
8
+ Author URI: https://mailoptin.io
9
  Licence: GPLv3
10
  Text Domain: subscribe2
11
  */
12
 
13
  /*
14
+ Copyright (C) 2006-20 Matthew Robinson
15
  Based on the Original Subscribe2 plugin by
16
  Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
17
 
31
  along with Subscribe2. If not, see <http://www.gnu.org/licenses/>.
32
  */
33
 
34
+ if ( version_compare( $GLOBALS['wp_version'], '4.4', '<' ) || ! function_exists( 'add_action' ) ) {
35
  if ( ! function_exists( 'add_action' ) ) {
36
  $exit_msg = __( "I'm just a plugin, please don't call me directly", 'subscribe2' );
37
  } else {
38
+ // Translators: Subscribe2 needs WordPress 4.4 or above, exit if not on a compatible version
39
+ $exit_msg = sprintf( __( 'This version of Subscribe2 requires WordPress 4.4 or greater. Please update %1$s or use an older version of %2$s.', 'subscribe2' ), '<a href="http://codex.wordpress.org/Updating_WordPress">WordPress</a>', '<a href="https://subscribe2.wordpress.com/subscribe2-html/">Subscribe2</a>' );
40
  }
41
+ exit( esc_html( $exit_msg ) );
42
  }
43
 
44
  // stop Subscribe2 being activated site wide on Multisite installs
49
  if ( is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
50
  deactivate_plugins( plugin_basename( __FILE__ ) );
51
  $exit_msg = __( 'Subscribe2 HTML cannot be activated as a network plugin. Please activate it on a site level', 'subscribe2' );
52
+ exit( esc_html( $exit_msg ) );
53
  }
54
 
55
  // our version number. Don't touch this or any line below
56
  // unless you know exactly what you are doing
57
+ define( 'S2VERSION', '10.32' );
58
+ define( 'S2PLUGIN', __FILE__ );
59
  define( 'S2PATH', trailingslashit( dirname( __FILE__ ) ) );
60
  define( 'S2DIR', trailingslashit( dirname( plugin_basename( __FILE__ ) ) ) );
61
  define( 'S2URL', plugin_dir_url( dirname( __FILE__ ) ) . S2DIR );
65
  set_time_limit( 300 );
66
  }
67
 
68
+ global $mysubscribe2;
69
  require_once S2PATH . 'classes/class-s2-core.php';
70
  if ( is_admin() ) {
71
  require_once S2PATH . 'classes/class-s2-admin.php';
 
72
  $mysubscribe2 = new S2_Admin();
73
  } else {
74
  require_once S2PATH . 'classes/class-s2-frontend.php';
 
75
  $mysubscribe2 = new S2_Frontend();
76
  }
77
  add_action( 'plugins_loaded', array( $mysubscribe2, 's2init' ) );
subscribe2.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2019 Subscribe2
2
  # This file is distributed under the same license as the Subscribe2 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Subscribe2 10.29\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/subscribe2\n"
7
- "POT-Creation-Date: 2019-05-18 12:23:21+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "Language: en\n"
@@ -149,22 +149,16 @@ msgstr ""
149
  msgid "Miscellaneous"
150
  msgstr ""
151
 
152
- #: admin/settings.php:201
153
- msgid ""
154
- "Restrict the number of <strong>recipients per email</strong> to (0 for "
155
- "unlimited)"
156
- msgstr ""
157
-
158
- #: admin/settings.php:203 classes/class-s2-admin.php:819
159
- #: classes/class-s2-list-table-legacy.php:43 classes/class-s2-list-table.php:43
160
  msgid "Edit"
161
  msgstr ""
162
 
163
- #: admin/settings.php:206 classes/class-s2-admin.php:833
164
  msgid "Update"
165
  msgstr ""
166
 
167
- #: admin/settings.php:207 classes/class-s2-admin.php:834
168
  msgid "Revert"
169
  msgstr ""
170
 
@@ -192,16 +186,16 @@ msgstr ""
192
  msgid "Include theme CSS stylesheet in HTML notifications"
193
  msgstr ""
194
 
195
- #: admin/settings.php:221 admin/settings.php:227 admin/settings.php:241
196
- #: admin/settings.php:246 admin/settings.php:252 admin/settings.php:382
197
  #: admin/settings.php:388 admin/settings.php:403 admin/settings.php:411
198
  #: admin/settings.php:427 admin/settings.php:434 admin/subscribers.php:328
199
  #: classes/class-s2-forms.php:59 classes/class-s2-forms.php:100
200
  msgid "Yes"
201
  msgstr ""
202
 
203
- #: admin/settings.php:223 admin/settings.php:229 admin/settings.php:243
204
- #: admin/settings.php:248 admin/settings.php:254 admin/settings.php:379
205
  #: admin/settings.php:384 admin/settings.php:390 admin/settings.php:405
206
  #: admin/settings.php:413 admin/settings.php:423 admin/settings.php:429
207
  #: admin/settings.php:436 admin/subscribers.php:330
@@ -213,168 +207,174 @@ msgstr ""
213
  msgid "Send Emails for Pages"
214
  msgstr ""
215
 
216
- #: admin/settings.php:233
217
- msgid "Subscribe2 will send email notifications for the following custom post types"
218
- msgstr ""
219
-
220
- #: admin/settings.php:239
221
  msgid "Send Emails for Password Protected Posts"
222
  msgstr ""
223
 
224
- #: admin/settings.php:244
225
  msgid "Send Emails for Private Posts"
226
  msgstr ""
227
 
228
- #: admin/settings.php:250
229
  msgid "Include Sticky Posts at the top of all Digest Notifications"
230
  msgstr ""
231
 
232
- #: admin/settings.php:256
233
  msgid "Send Email From"
234
  msgstr ""
235
 
236
- #: admin/settings.php:261
237
  msgid "Send Emails"
238
  msgstr ""
239
 
240
- #: admin/settings.php:263
241
  msgid "For digest notifications, date order for posts is"
242
  msgstr ""
243
 
244
- #: admin/settings.php:265
245
  msgid "Descending"
246
  msgstr ""
247
 
248
- #: admin/settings.php:267
249
  msgid "Ascending"
250
  msgstr ""
251
 
252
- #: admin/settings.php:269
253
  msgid "Add Tracking Parameters to the Permalink"
254
  msgstr ""
255
 
256
- #: admin/settings.php:271
257
  msgid ""
258
  "eg. "
259
  "utm_source=subscribe2&amp;utm_medium=email&amp;utm_campaign=postnotify&"
260
  "amp;utm_id={ID}&amp;utm_title={TITLE}"
261
  msgstr ""
262
 
263
- #: admin/settings.php:282
264
  msgid "Notification email (must not be empty)"
265
  msgstr ""
266
 
267
- #: admin/settings.php:283 admin/settings.php:316 admin/settings.php:321
268
  msgid "Subject Line"
269
  msgstr ""
270
 
271
- #: admin/settings.php:288
272
  msgid "Send Email Preview"
273
  msgstr ""
274
 
275
- #: admin/settings.php:289
276
  msgid "Message substitutions"
277
  msgstr ""
278
 
279
- #: admin/settings.php:291
280
  msgid "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
281
  msgstr ""
282
 
283
- #: admin/settings.php:294
284
- msgid "the post's title<br />(<i>for per-post emails only</i>)"
285
  msgstr ""
286
 
287
- #: admin/settings.php:295
288
- msgid "the post's unformatted title <br />(<i>for per-post emails only</i>)"
289
  msgstr ""
290
 
291
- #: admin/settings.php:296
292
  msgid ""
293
- "the excerpt or the entire post<br />(<i>based on the subscriber's "
294
  "preferences</i>)"
295
  msgstr ""
296
 
297
- #: admin/settings.php:297
298
  msgid ""
299
- "the excerpt of the post and the time it was posted<br />(<i>for digest "
300
- "emails only</i>)"
301
  msgstr ""
302
 
303
- #: admin/settings.php:298
304
- msgid "a list of post titles<br />(<i>for digest emails only</i>)"
305
  msgstr ""
306
 
307
- #: admin/settings.php:299
308
  msgid ""
309
- "a list of post titles followed by links to the articles<br />(<i>for digest "
310
  "emails only</i>)"
311
  msgstr ""
312
 
313
- #: admin/settings.php:300
314
  msgid ""
315
  "a reference style list of links at the end of the email with corresponding "
316
- "numbers in the content<br />(<i>for the full content plain text per-post "
317
  "email only</i>)"
318
  msgstr ""
319
 
320
- #: admin/settings.php:301
321
- msgid "the post's permalink<br />(<i>for per-post emails only</i>)"
322
  msgstr ""
323
 
324
- #: admin/settings.php:302
325
  msgid "the post's permalink after conversion by TinyURL"
326
  msgstr ""
327
 
328
- #: admin/settings.php:303
329
- msgid "the post's unformatted permalink<br />(<i>for per-post emails only</i>)"
330
  msgstr ""
331
 
332
- #: admin/settings.php:304
333
- msgid "the date the post was made<br />(<i>for per-post emails only</i>)"
334
  msgstr ""
335
 
336
- #: admin/settings.php:305
337
- msgid "the time the post was made<br />(<i>for per-post emails only</i>)"
338
  msgstr ""
339
 
340
- #: admin/settings.php:306
341
  msgid "the admin or post author's name"
342
  msgstr ""
343
 
344
- #: admin/settings.php:307
345
  msgid "the admin or post author's email"
346
  msgstr ""
347
 
348
- #: admin/settings.php:308
349
  msgid "the post author's name"
350
  msgstr ""
351
 
352
- #: admin/settings.php:309
353
  msgid ""
354
- "the generated link to confirm a request<br />(<i>only used in the "
355
  "confirmation email template</i>)"
356
  msgstr ""
357
 
358
- #: admin/settings.php:310
 
 
 
 
 
 
359
  msgid ""
360
- "Action performed by LINK in confirmation email<br />(<i>only used in the "
361
  "confirmation email template</i>)"
362
  msgstr ""
363
 
364
- #: admin/settings.php:311
365
  msgid "the post's assigned categories"
366
  msgstr ""
367
 
368
- #: admin/settings.php:312
369
  msgid "the post's assigned Tags"
370
  msgstr ""
371
 
372
- #: admin/settings.php:313
373
  msgid ""
374
- "the number of posts included in the digest email<br />(<i>for digest emails "
375
  "only</i>)"
376
  msgstr ""
377
 
 
 
 
 
378
  #: admin/settings.php:315
379
  msgid "Subscribe / Unsubscribe confirmation email"
380
  msgstr ""
@@ -501,91 +501,87 @@ msgstr ""
501
  msgid "Set default Subscribe2 page as"
502
  msgstr ""
503
 
504
- #: admin/settings.php:449
505
- msgid "Select a page"
506
- msgstr ""
507
-
508
- #: admin/settings.php:455
509
  msgid "Show a link to your subscription page in \"meta\"?"
510
  msgstr ""
511
 
512
- #: admin/settings.php:459
513
  msgid "Show the Subscribe2 button on the Write toolbar?"
514
  msgstr ""
515
 
516
- #: admin/settings.php:463
517
  msgid "Enable popup style subscription form?"
518
  msgstr ""
519
 
520
- #: admin/settings.php:467
521
  msgid "Enable Subscribe2 Widget?"
522
  msgstr ""
523
 
524
- #: admin/settings.php:471
525
  msgid "Enable Subscribe2 Counter Widget?"
526
  msgstr ""
527
 
528
- #: admin/settings.php:475
529
  msgid "Disable email notifications is checked by default on authoring pages?"
530
  msgstr ""
531
 
532
- #: admin/settings.php:479
533
  msgid ""
534
  "Use javascript to update IP address in Subscribe2 HTML form data? (useful "
535
  "if caching is enabled)"
536
  msgstr ""
537
 
538
- #: admin/settings.php:487
539
  msgid "Barred Domains"
540
  msgstr ""
541
 
542
- #: admin/settings.php:489
543
  msgid ""
544
  "Enter domains to bar for public subscriptions, wildcards (*) and exceptions "
545
  "(!) are allowed"
546
  msgstr ""
547
 
548
- #: admin/settings.php:490
549
  msgid ""
550
  "Use a new line for each entry and omit the \"@\" symbol, for example "
551
  "!email.com, hotmail.com, yahoo.*"
552
  msgstr ""
553
 
554
- #: admin/settings.php:493
555
  msgid "Links"
556
  msgstr ""
557
 
558
- #: admin/settings.php:494
559
  msgid "Plugin Site"
560
  msgstr ""
561
 
562
- #: admin/settings.php:495
563
  msgid "Plugin Forum"
564
  msgstr ""
565
 
566
- #: admin/settings.php:496
567
  msgid "Plugin Blog"
568
  msgstr ""
569
 
570
- #: admin/settings.php:497
571
  msgid "Make a donation via PayPal"
572
  msgstr ""
573
 
574
- #: admin/settings.php:503
575
  msgid "Submit"
576
  msgstr ""
577
 
578
- #: admin/settings.php:507
579
  msgid "Reset to Default Settings"
580
  msgstr ""
581
 
582
- #: admin/settings.php:508
583
  msgid ""
584
  "Use this to reset all options to their defaults. This <strong><em>will "
585
  "not</em></strong> modify your list of subscribers."
586
  msgstr ""
587
 
588
- #: admin/settings.php:510
589
  msgid "RESET"
590
  msgstr ""
591
 
@@ -640,12 +636,12 @@ msgid "Subscribers"
640
  msgstr ""
641
 
642
  #: admin/subscribers.php:201 classes/class-s2-admin.php:69
643
- #: classes/class-s2-admin.php:640
644
  msgid "Public Subscribers"
645
  msgstr ""
646
 
647
  #: admin/subscribers.php:202 classes/class-s2-admin.php:76
648
- #: classes/class-s2-admin.php:644
649
  msgid "Registered Subscribers"
650
  msgstr ""
651
 
@@ -745,6 +741,26 @@ msgstr ""
745
  msgid "Update Preferences"
746
  msgstr ""
747
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  #. Author of the plugin/theme
749
  msgid "Subscribe2"
750
  msgstr ""
@@ -892,9 +908,11 @@ msgstr ""
892
 
893
  #: classes/class-s2-admin.php:138
894
  msgid ""
895
- "Categories can be made compulsory so emails are always sent for posts in "
896
- "these categories. They can also be excludes so that emails are not "
897
- "generated. Excluded categories take precedence over Compulsory categories."
 
 
898
  msgstr ""
899
 
900
  #: classes/class-s2-admin.php:139
@@ -1012,7 +1030,7 @@ msgstr ""
1012
  msgid "Donate"
1013
  msgstr ""
1014
 
1015
- #: classes/class-s2-admin.php:371
1016
  msgid "Subscribe2 Notification Override"
1017
  msgstr ""
1018
 
@@ -1020,7 +1038,7 @@ msgstr ""
1020
  msgid "Subscribe2 Preview"
1021
  msgstr ""
1022
 
1023
- #: classes/class-s2-admin.php:396 gutenberg/gutenberg-translations.php:21
1024
  msgid "Subscribe2 Resend"
1025
  msgstr ""
1026
 
@@ -1036,197 +1054,201 @@ msgstr ""
1036
  msgid "Send Preview"
1037
  msgstr ""
1038
 
1039
- #: classes/class-s2-admin.php:472 gutenberg/gutenberg-translations.php:22
1040
  msgid "Resend the notification email of this post to current subscribers:"
1041
  msgstr ""
1042
 
1043
- #: classes/class-s2-admin.php:473 gutenberg/gutenberg-translations.php:23
1044
  msgid "Resend Notification"
1045
  msgstr ""
1046
 
1047
- #: classes/class-s2-admin.php:578
1048
  msgid "Registered User"
1049
  msgstr ""
1050
 
1051
- #: classes/class-s2-admin.php:583
1052
  msgid "Confirmed Public Subscriber"
1053
  msgstr ""
1054
 
1055
- #: classes/class-s2-admin.php:585
1056
  msgid "Unconfirmed Public Subscriber"
1057
  msgstr ""
1058
 
1059
- #: classes/class-s2-admin.php:602 classes/class-s2-forms.php:306
1060
  #: classes/class-s2-forms.php:366
1061
  msgid "Select / Unselect All"
1062
  msgstr ""
1063
 
1064
- #: classes/class-s2-admin.php:639
1065
  msgid "All Users and Subscribers"
1066
  msgstr ""
1067
 
1068
- #: classes/class-s2-admin.php:641
1069
  msgid "Confirmed"
1070
  msgstr ""
1071
 
1072
- #: classes/class-s2-admin.php:642
1073
  msgid "Unconfirmed"
1074
  msgstr ""
1075
 
1076
- #: classes/class-s2-admin.php:643
1077
  msgid "All Registered Users"
1078
  msgstr ""
1079
 
1080
- #: classes/class-s2-admin.php:751
1081
  msgid "Post Author"
1082
  msgstr ""
1083
 
1084
- #: classes/class-s2-admin.php:779
1085
  msgid ""
1086
  "The WordPress cron functions may be disabled on this server. Digest "
1087
  "notifications may not work."
1088
  msgstr ""
1089
 
1090
- #: classes/class-s2-admin.php:788
1091
  msgid "For each Post"
1092
  msgstr ""
1093
 
1094
- #: classes/class-s2-admin.php:810
1095
  msgid "Current UTC time is"
1096
  msgstr ""
1097
 
1098
- #: classes/class-s2-admin.php:812
1099
  msgid "Current blog time is"
1100
  msgstr ""
1101
 
1102
- #: classes/class-s2-admin.php:814
1103
  msgid "Next email notification will be sent when your blog time is after"
1104
  msgstr ""
1105
 
1106
- #: classes/class-s2-admin.php:836
1107
  msgid "Attempt to resend the last Digest Notification email"
1108
  msgstr ""
1109
 
1110
- #: classes/class-s2-admin.php:837
1111
  msgid "Resend Digest"
1112
  msgstr ""
1113
 
1114
- #: classes/class-s2-admin.php:1113
 
 
 
 
1115
  msgid "Email subscription"
1116
  msgstr ""
1117
 
1118
- #: classes/class-s2-admin.php:1115
1119
  msgid "Subscribe / Unsubscribe"
1120
  msgstr ""
1121
 
1122
- #: classes/class-s2-admin.php:1116
1123
  msgid "Receive notifications"
1124
  msgstr ""
1125
 
1126
- #: classes/class-s2-admin.php:1117
1127
  msgid "Check if you want to receive email notification when new posts are published"
1128
  msgstr ""
1129
 
1130
- #: classes/class-s2-ajax.php:41
1131
  msgid "Subscribe to this blog"
1132
  msgstr ""
1133
 
1134
- #: classes/class-s2-ajax.php:70
1135
  msgid "There was an error validating your request. Please try again later."
1136
  msgstr ""
1137
 
1138
- #: classes/class-s2-ajax.php:76 classes/class-s2-ajax.php:106
1139
- #: classes/class-s2-ajax.php:120 classes/class-s2-frontend.php:24
1140
  msgid "A confirmation message is on its way!"
1141
  msgstr ""
1142
 
1143
- #: classes/class-s2-ajax.php:84 classes/class-s2-frontend.php:30
1144
  msgid "Sorry, but that does not look like an email address to me."
1145
  msgstr ""
1146
 
1147
- #: classes/class-s2-ajax.php:86 classes/class-s2-frontend.php:32
1148
  msgid ""
1149
  "Sorry, email addresses at that domain are currently barred due to spam, "
1150
  "please use an alternative email address."
1151
  msgstr ""
1152
 
1153
- #: classes/class-s2-ajax.php:92 classes/class-s2-frontend.php:188
1154
  msgid "Slow down, you move too fast."
1155
  msgstr ""
1156
 
1157
- #: classes/class-s2-ajax.php:98 classes/class-s2-frontend.php:8
1158
  #. Translators: Link to login page
1159
  msgid "To manage your subscription options please <a href=\"%1$s\">login.</a>"
1160
  msgstr ""
1161
 
1162
- #: classes/class-s2-ajax.php:108 classes/class-s2-ajax.php:122
1163
  #: classes/class-s2-frontend.php:34
1164
  msgid "Sorry, there seems to be an error on the server. Please try again later."
1165
  msgstr ""
1166
 
1167
- #: classes/class-s2-ajax.php:112 classes/class-s2-frontend.php:26
1168
  msgid "That email address is already subscribed."
1169
  msgstr ""
1170
 
1171
- #: classes/class-s2-ajax.php:116 classes/class-s2-frontend.php:28
1172
  msgid "That email address is not subscribed."
1173
  msgstr ""
1174
 
1175
- #: classes/class-s2-core.php:546
1176
  msgid "Plain Text Excerpt Preview"
1177
  msgstr ""
1178
 
1179
- #: classes/class-s2-core.php:548
1180
  msgid "Plain Text Full Preview"
1181
  msgstr ""
1182
 
1183
- #: classes/class-s2-core.php:550
1184
  msgid "HTML Excerpt Preview"
1185
  msgstr ""
1186
 
1187
- #: classes/class-s2-core.php:552
1188
  msgid "HTML Full Preview"
1189
  msgstr ""
1190
 
1191
- #: classes/class-s2-core.php:1236
1192
  msgid "Check here to Subscribe to email notifications for new posts"
1193
  msgstr ""
1194
 
1195
- #: classes/class-s2-core.php:1241
1196
  msgid ""
1197
  "By registering with this blog you are also agreeing to receive email "
1198
  "notifications for new posts but you can unsubscribe at anytime"
1199
  msgstr ""
1200
 
1201
- #: classes/class-s2-core.php:1269
1202
  msgid "Check here to Subscribe to notifications for new posts"
1203
  msgstr ""
1204
 
1205
- #: classes/class-s2-core.php:1388
1206
  msgid "Weekly"
1207
  msgstr ""
1208
 
1209
- #: classes/class-s2-core.php:1601 classes/class-s2-core.php:1602
1210
  msgid "Author"
1211
  msgstr ""
1212
 
1213
- #: classes/class-s2-core.php:1608
1214
  msgid "Posted on"
1215
  msgstr ""
1216
 
1217
- #: classes/class-s2-core.php:1635 classes/class-s2-core.php:1636
1218
  msgid "Posted in"
1219
  msgstr ""
1220
 
1221
- #: classes/class-s2-core.php:1649 classes/class-s2-core.php:1650
1222
  msgid "Tagged as"
1223
  msgstr ""
1224
 
1225
- #: classes/class-s2-core.php:1721
1226
  msgid "Digest Email"
1227
  msgstr ""
1228
 
1229
- #: classes/class-s2-core.php:1734
1230
  msgid "Digest Preview"
1231
  msgstr ""
1232
 
@@ -1282,71 +1304,71 @@ msgstr ""
1282
  msgid "(Un)Subscribe to Posts"
1283
  msgstr ""
1284
 
1285
- #: classes/class-s2-form-widget.php:144
1286
  msgid "Title"
1287
  msgstr ""
1288
 
1289
- #: classes/class-s2-form-widget.php:146
1290
  msgid "Div class name"
1291
  msgstr ""
1292
 
1293
- #: classes/class-s2-form-widget.php:148
1294
  msgid "Pre-Content"
1295
  msgstr ""
1296
 
1297
- #: classes/class-s2-form-widget.php:150
1298
  msgid "Post-Content"
1299
  msgstr ""
1300
 
1301
- #: classes/class-s2-form-widget.php:152
1302
  msgid "Text Box Size"
1303
  msgstr ""
1304
 
1305
- #: classes/class-s2-form-widget.php:154
1306
  msgid "Display options"
1307
  msgstr ""
1308
 
1309
- #: classes/class-s2-form-widget.php:155
1310
  msgid "Show complete form"
1311
  msgstr ""
1312
 
1313
- #: classes/class-s2-form-widget.php:156
1314
  msgid "Hide Subscribe button"
1315
  msgstr ""
1316
 
1317
- #: classes/class-s2-form-widget.php:157
1318
  msgid "Hide Unsubscribe button"
1319
  msgstr ""
1320
 
1321
- #: classes/class-s2-form-widget.php:159
1322
  msgid "Show as link"
1323
  msgstr ""
1324
 
1325
- #: classes/class-s2-form-widget.php:162
1326
  msgid "Post form content to page"
1327
  msgstr ""
1328
 
1329
- #: classes/class-s2-form-widget.php:164
1330
  msgid "Use Subscribe2 Default"
1331
  msgstr ""
1332
 
1333
- #: classes/class-s2-form-widget.php:169
1334
  msgid "Use Home Page"
1335
  msgstr ""
1336
 
1337
- #: classes/class-s2-form-widget.php:174
1338
  msgid "Use Referring Page"
1339
  msgstr ""
1340
 
1341
- #: classes/class-s2-form-widget.php:177
1342
  msgid "Disable JavaScript"
1343
  msgstr ""
1344
 
1345
- #: classes/class-s2-form-widget.php:180
1346
  msgid "Disable Anti-spam measures"
1347
  msgstr ""
1348
 
1349
- #: classes/class-s2-form-widget.php:183 gutenberg/gutenberg-translations.php:17
1350
  msgid "Disable wrapping of form buttons"
1351
  msgstr ""
1352
 
@@ -1418,11 +1440,16 @@ msgstr ""
1418
  msgid "Subscription preferences updated."
1419
  msgstr ""
1420
 
 
 
 
 
 
1421
  #: classes/class-s2-frontend.php:12
1422
  #. Translators: Link to Profile page
1423
  msgid ""
1424
  "You may manage your subscription options from your <a "
1425
- "href=\"%1$s\">profile</a>"
1426
  msgstr ""
1427
 
1428
  #: classes/class-s2-frontend.php:20
@@ -1489,50 +1516,50 @@ msgid "[Un]Subscribe to Posts"
1489
  msgstr ""
1490
 
1491
  #: classes/class-s2-list-table-legacy.php:131
1492
- #: classes/class-s2-list-table.php:131
1493
  msgid "Select All"
1494
  msgstr ""
1495
 
1496
  #: classes/class-s2-list-table-legacy.php:183
1497
  #: classes/class-s2-list-table-legacy.php:188
1498
- #: classes/class-s2-list-table.php:186 classes/class-s2-list-table.php:191
1499
  msgid "Delete"
1500
  msgstr ""
1501
 
1502
  #: classes/class-s2-list-table-legacy.php:189
1503
- #: classes/class-s2-list-table.php:192
1504
  msgid "Toggle"
1505
  msgstr ""
1506
 
1507
  #: classes/class-s2-list-table-legacy.php:198
1508
- #: classes/class-s2-list-table.php:201
1509
  msgid "No users were selected."
1510
  msgstr ""
1511
 
1512
  #: classes/class-s2-list-table-legacy.php:211
1513
- #: classes/class-s2-list-table.php:214
1514
  msgid "Address(es) deleted!"
1515
  msgstr ""
1516
 
1517
  #: classes/class-s2-list-table-legacy.php:215
1518
- #: classes/class-s2-list-table.php:218
1519
  msgid "Delete failed! You cannot delete some or all of these users."
1520
  msgstr ""
1521
 
1522
  #: classes/class-s2-list-table-legacy.php:218
1523
- #: classes/class-s2-list-table.php:221
1524
  msgid ""
1525
  "Registered user(s) deleted! Any posts made by these users were assigned to "
1526
  "you."
1527
  msgstr ""
1528
 
1529
  #: classes/class-s2-list-table-legacy.php:242
1530
- #: classes/class-s2-list-table.php:245
1531
  msgid "Status changed!"
1532
  msgstr ""
1533
 
1534
  #: classes/class-s2-list-table-legacy.php:259
1535
- #: classes/class-s2-list-table.php:266
1536
  #. Translators: Pagination
1537
  msgid "%s item"
1538
  msgid_plural "%s items"
@@ -1559,45 +1586,26 @@ msgstr ""
1559
  msgid "Go to the last page"
1560
  msgstr ""
1561
 
1562
- #: classes/class-s2-list-table.php:327
1563
  msgid "First page"
1564
  msgstr ""
1565
 
1566
- #: classes/class-s2-list-table.php:338
1567
  msgid "Previous page"
1568
  msgstr ""
1569
 
1570
- #: classes/class-s2-list-table.php:345 classes/class-s2-list-table.php:349
1571
  msgid "Current Page"
1572
  msgstr ""
1573
 
1574
- #: classes/class-s2-list-table.php:365
1575
  msgid "Next page"
1576
  msgstr ""
1577
 
1578
- #: classes/class-s2-list-table.php:376
1579
  msgid "Last page"
1580
  msgstr ""
1581
 
1582
- #: classes/mo-notice.php:60
1583
- msgid ""
1584
- "Free optin form plugin that will %1$sincrease your email list "
1585
- "subscribers%2$s and keep them engaged with %1$sautomated and schedule "
1586
- "newsletters%2$s."
1587
- msgstr ""
1588
-
1589
- #: classes/mo-notice.php:69
1590
- msgid "Install MailOptin Now for Free!"
1591
- msgstr ""
1592
-
1593
- #: classes/mo-notice.php:74
1594
- msgid "Activate MailOptin Now!"
1595
- msgstr ""
1596
-
1597
- #: classes/mo-notice.php:83
1598
- msgid "Dismiss this notice"
1599
- msgstr ""
1600
-
1601
  #: gutenberg/gutenberg-translations.php:5
1602
  msgid "Subscribe2 HTML"
1603
  msgstr ""
@@ -1690,13 +1698,13 @@ msgstr ""
1690
  #: include/options.php:148
1691
  msgid ""
1692
  "{BLOGNAME} has received a request to {ACTION} for this email address. To "
1693
- "complete your request please click on the link below:\\n"
1694
- "\\n"
1695
- "{LINK}\\n"
1696
- "\\n"
1697
- "If you did not request this, please feel free to disregard this notice!\\n"
1698
- "\\n"
1699
- "Thank you,\\n"
1700
  "{MYNAME}."
1701
  msgstr ""
1702
 
@@ -1707,16 +1715,16 @@ msgstr ""
1707
  #: include/options.php:156
1708
  msgid ""
1709
  "This email address was subscribed for notifications at {BLOGNAME} "
1710
- "({BLOGLINK}) but the subscription remains incomplete.\\n"
1711
- "\\n"
1712
- "If you wish to complete your subscription please click on the link below:\\n"
1713
- "\\n"
1714
- "{LINK}\\n"
1715
- "\\n"
1716
  "If you do not wish to complete your subscription please ignore this email "
1717
- "and your address will be removed from our database.\\n"
1718
- "\\n"
1719
- "Regards,\\n"
1720
  "{MYNAME}"
1721
  msgstr ""
1722
 
@@ -1750,25 +1758,24 @@ msgstr ""
1750
  msgid "Notifies an email list when new entries are posted."
1751
  msgstr ""
1752
 
1753
- #: classes/class-s2-admin.php:557
1754
  msgctxt "Comma Separated Column Header names for CSV Export"
1755
  msgid "User Email,User Type,User Name,Confirm Date,IP"
1756
  msgstr ""
1757
 
1758
  #: classes/class-s2-list-table-legacy.php:75
1759
- #: classes/class-s2-list-table-legacy.php:80 classes/class-s2-list-table.php:75
1760
- #: classes/class-s2-list-table.php:80
1761
  msgctxt "column name"
1762
  msgid "Email"
1763
  msgstr ""
1764
 
1765
- #: classes/class-s2-list-table-legacy.php:81 classes/class-s2-list-table.php:81
1766
  msgctxt "column name"
1767
  msgid "Date"
1768
  msgstr ""
1769
 
1770
  #: classes/class-s2-list-table-legacy.php:333
1771
- #: classes/class-s2-list-table.php:357
1772
  #. Translators: Pagination
1773
  msgctxt "paging"
1774
  msgid "%1$s of %2$s"
1
+ # Copyright (C) 2020 Subscribe2
2
  # This file is distributed under the same license as the Subscribe2 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Subscribe2 10.32\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/subscribe2\n"
7
+ "POT-Creation-Date: 2020-01-19 17:21:19+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "Language: en\n"
149
  msgid "Miscellaneous"
150
  msgstr ""
151
 
152
+ #: admin/settings.php:203 classes/class-s2-admin.php:841
153
+ #: classes/class-s2-list-table-legacy.php:43 classes/class-s2-list-table.php:36
 
 
 
 
 
 
154
  msgid "Edit"
155
  msgstr ""
156
 
157
+ #: admin/settings.php:206 classes/class-s2-admin.php:855
158
  msgid "Update"
159
  msgstr ""
160
 
161
+ #: admin/settings.php:207 classes/class-s2-admin.php:856
162
  msgid "Revert"
163
  msgstr ""
164
 
186
  msgid "Include theme CSS stylesheet in HTML notifications"
187
  msgstr ""
188
 
189
+ #: admin/settings.php:221 admin/settings.php:227 admin/settings.php:233
190
+ #: admin/settings.php:238 admin/settings.php:244 admin/settings.php:382
191
  #: admin/settings.php:388 admin/settings.php:403 admin/settings.php:411
192
  #: admin/settings.php:427 admin/settings.php:434 admin/subscribers.php:328
193
  #: classes/class-s2-forms.php:59 classes/class-s2-forms.php:100
194
  msgid "Yes"
195
  msgstr ""
196
 
197
+ #: admin/settings.php:223 admin/settings.php:229 admin/settings.php:235
198
+ #: admin/settings.php:240 admin/settings.php:246 admin/settings.php:379
199
  #: admin/settings.php:384 admin/settings.php:390 admin/settings.php:405
200
  #: admin/settings.php:413 admin/settings.php:423 admin/settings.php:429
201
  #: admin/settings.php:436 admin/subscribers.php:330
207
  msgid "Send Emails for Pages"
208
  msgstr ""
209
 
210
+ #: admin/settings.php:231
 
 
 
 
211
  msgid "Send Emails for Password Protected Posts"
212
  msgstr ""
213
 
214
+ #: admin/settings.php:236
215
  msgid "Send Emails for Private Posts"
216
  msgstr ""
217
 
218
+ #: admin/settings.php:242
219
  msgid "Include Sticky Posts at the top of all Digest Notifications"
220
  msgstr ""
221
 
222
+ #: admin/settings.php:248
223
  msgid "Send Email From"
224
  msgstr ""
225
 
226
+ #: admin/settings.php:253
227
  msgid "Send Emails"
228
  msgstr ""
229
 
230
+ #: admin/settings.php:257
231
  msgid "For digest notifications, date order for posts is"
232
  msgstr ""
233
 
234
+ #: admin/settings.php:259
235
  msgid "Descending"
236
  msgstr ""
237
 
238
+ #: admin/settings.php:261
239
  msgid "Ascending"
240
  msgstr ""
241
 
242
+ #: admin/settings.php:263
243
  msgid "Add Tracking Parameters to the Permalink"
244
  msgstr ""
245
 
246
+ #: admin/settings.php:265
247
  msgid ""
248
  "eg. "
249
  "utm_source=subscribe2&amp;utm_medium=email&amp;utm_campaign=postnotify&"
250
  "amp;utm_id={ID}&amp;utm_title={TITLE}"
251
  msgstr ""
252
 
253
+ #: admin/settings.php:276
254
  msgid "Notification email (must not be empty)"
255
  msgstr ""
256
 
257
+ #: admin/settings.php:277 admin/settings.php:316 admin/settings.php:321
258
  msgid "Subject Line"
259
  msgstr ""
260
 
261
+ #: admin/settings.php:282
262
  msgid "Send Email Preview"
263
  msgstr ""
264
 
265
+ #: admin/settings.php:283
266
  msgid "Message substitutions"
267
  msgstr ""
268
 
269
+ #: admin/settings.php:285
270
  msgid "IF THE FOLLOWING KEYWORDS ARE ALSO IN YOUR POST THEY WILL BE SUBSTITUTED"
271
  msgstr ""
272
 
273
+ #: admin/settings.php:288
274
+ msgid "the post's title<br>(<i>for per-post emails only</i>)"
275
  msgstr ""
276
 
277
+ #: admin/settings.php:289
278
+ msgid "the post's unformatted title <br>(<i>for per-post emails only</i>)"
279
  msgstr ""
280
 
281
+ #: admin/settings.php:290
282
  msgid ""
283
+ "the excerpt or the entire post<br>(<i>based on the subscriber's "
284
  "preferences</i>)"
285
  msgstr ""
286
 
287
+ #: admin/settings.php:291
288
  msgid ""
289
+ "the excerpt of the post and the time it was posted<br>(<i>for digest emails "
290
+ "only</i>)"
291
  msgstr ""
292
 
293
+ #: admin/settings.php:292
294
+ msgid "a list of post titles<br>(<i>for digest emails only</i>)"
295
  msgstr ""
296
 
297
+ #: admin/settings.php:293
298
  msgid ""
299
+ "a list of post titles followed by links to the articles<br>(<i>for digest "
300
  "emails only</i>)"
301
  msgstr ""
302
 
303
+ #: admin/settings.php:294
304
  msgid ""
305
  "a reference style list of links at the end of the email with corresponding "
306
+ "numbers in the content<br>(<i>for the full content plain text per-post "
307
  "email only</i>)"
308
  msgstr ""
309
 
310
+ #: admin/settings.php:295
311
+ msgid "the post's permalink<br>(<i>for per-post emails only</i>)"
312
  msgstr ""
313
 
314
+ #: admin/settings.php:296
315
  msgid "the post's permalink after conversion by TinyURL"
316
  msgstr ""
317
 
318
+ #: admin/settings.php:297
319
+ msgid "the post's unformatted permalink<br>(<i>for per-post emails only</i>)"
320
  msgstr ""
321
 
322
+ #: admin/settings.php:298
323
+ msgid "the date the post was made<br>(<i>for per-post emails only</i>)"
324
  msgstr ""
325
 
326
+ #: admin/settings.php:299
327
+ msgid "the time the post was made<br>(<i>for per-post emails only</i>)"
328
  msgstr ""
329
 
330
+ #: admin/settings.php:300
331
  msgid "the admin or post author's name"
332
  msgstr ""
333
 
334
+ #: admin/settings.php:301
335
  msgid "the admin or post author's email"
336
  msgstr ""
337
 
338
+ #: admin/settings.php:302
339
  msgid "the post author's name"
340
  msgstr ""
341
 
342
+ #: admin/settings.php:303
343
  msgid ""
344
+ "the generated link to confirm a request<br>(<i>only used in the "
345
  "confirmation email template</i>)"
346
  msgstr ""
347
 
348
+ #: admin/settings.php:305
349
+ msgid ""
350
+ "a generated unsubscribe link<br>(<i>only used in the email notification "
351
+ "template</i>)"
352
+ msgstr ""
353
+
354
+ #: admin/settings.php:307
355
  msgid ""
356
+ "Action performed by LINK in confirmation email<br>(<i>only used in the "
357
  "confirmation email template</i>)"
358
  msgstr ""
359
 
360
+ #: admin/settings.php:308
361
  msgid "the post's assigned categories"
362
  msgstr ""
363
 
364
+ #: admin/settings.php:309
365
  msgid "the post's assigned Tags"
366
  msgstr ""
367
 
368
+ #: admin/settings.php:310
369
  msgid ""
370
+ "the number of posts included in the digest email<br>(<i>for digest emails "
371
  "only</i>)"
372
  msgstr ""
373
 
374
+ #: admin/settings.php:312
375
+ msgid "the post's featured image"
376
+ msgstr ""
377
+
378
  #: admin/settings.php:315
379
  msgid "Subscribe / Unsubscribe confirmation email"
380
  msgstr ""
501
  msgid "Set default Subscribe2 page as"
502
  msgstr ""
503
 
504
+ #: admin/settings.php:452
 
 
 
 
505
  msgid "Show a link to your subscription page in \"meta\"?"
506
  msgstr ""
507
 
508
+ #: admin/settings.php:456
509
  msgid "Show the Subscribe2 button on the Write toolbar?"
510
  msgstr ""
511
 
512
+ #: admin/settings.php:460
513
  msgid "Enable popup style subscription form?"
514
  msgstr ""
515
 
516
+ #: admin/settings.php:464
517
  msgid "Enable Subscribe2 Widget?"
518
  msgstr ""
519
 
520
+ #: admin/settings.php:468
521
  msgid "Enable Subscribe2 Counter Widget?"
522
  msgstr ""
523
 
524
+ #: admin/settings.php:472
525
  msgid "Disable email notifications is checked by default on authoring pages?"
526
  msgstr ""
527
 
528
+ #: admin/settings.php:476
529
  msgid ""
530
  "Use javascript to update IP address in Subscribe2 HTML form data? (useful "
531
  "if caching is enabled)"
532
  msgstr ""
533
 
534
+ #: admin/settings.php:484
535
  msgid "Barred Domains"
536
  msgstr ""
537
 
538
+ #: admin/settings.php:486
539
  msgid ""
540
  "Enter domains to bar for public subscriptions, wildcards (*) and exceptions "
541
  "(!) are allowed"
542
  msgstr ""
543
 
544
+ #: admin/settings.php:487
545
  msgid ""
546
  "Use a new line for each entry and omit the \"@\" symbol, for example "
547
  "!email.com, hotmail.com, yahoo.*"
548
  msgstr ""
549
 
550
+ #: admin/settings.php:490
551
  msgid "Links"
552
  msgstr ""
553
 
554
+ #: admin/settings.php:491
555
  msgid "Plugin Site"
556
  msgstr ""
557
 
558
+ #: admin/settings.php:492
559
  msgid "Plugin Forum"
560
  msgstr ""
561
 
562
+ #: admin/settings.php:493
563
  msgid "Plugin Blog"
564
  msgstr ""
565
 
566
+ #: admin/settings.php:494
567
  msgid "Make a donation via PayPal"
568
  msgstr ""
569
 
570
+ #: admin/settings.php:500
571
  msgid "Submit"
572
  msgstr ""
573
 
574
+ #: admin/settings.php:504
575
  msgid "Reset to Default Settings"
576
  msgstr ""
577
 
578
+ #: admin/settings.php:505
579
  msgid ""
580
  "Use this to reset all options to their defaults. This <strong><em>will "
581
  "not</em></strong> modify your list of subscribers."
582
  msgstr ""
583
 
584
+ #: admin/settings.php:507
585
  msgid "RESET"
586
  msgstr ""
587
 
636
  msgstr ""
637
 
638
  #: admin/subscribers.php:201 classes/class-s2-admin.php:69
639
+ #: classes/class-s2-admin.php:650
640
  msgid "Public Subscribers"
641
  msgstr ""
642
 
643
  #: admin/subscribers.php:202 classes/class-s2-admin.php:76
644
+ #: classes/class-s2-admin.php:654
645
  msgid "Registered Subscribers"
646
  msgstr ""
647
 
741
  msgid "Update Preferences"
742
  msgstr ""
743
 
744
+ #: classes/class-mo-admin-notice.php:62
745
+ #. Translators: Mail Optin admin notice
746
+ msgid ""
747
+ "Free optin form plugin that will %1$sincrease your email list "
748
+ "subscribers%2$s and keep them engaged with %1$sautomated and schedule "
749
+ "newsletters%2$s."
750
+ msgstr ""
751
+
752
+ #: classes/class-mo-admin-notice.php:74
753
+ msgid "Install MailOptin Now for Free!"
754
+ msgstr ""
755
+
756
+ #: classes/class-mo-admin-notice.php:79
757
+ msgid "Activate MailOptin Now!"
758
+ msgstr ""
759
+
760
+ #: classes/class-mo-admin-notice.php:88
761
+ msgid "Dismiss this notice"
762
+ msgstr ""
763
+
764
  #. Author of the plugin/theme
765
  msgid "Subscribe2"
766
  msgstr ""
908
 
909
  #: classes/class-s2-admin.php:138
910
  msgid ""
911
+ "Categories can be made compulsory so emails are always sent to Public and "
912
+ "Registered Subscribers for posts in these categories. They can also be "
913
+ "excluded so that emails are not generated for Subscribers. Registered "
914
+ "Subscribers can be allowed to bypass category exclusions. Excluded "
915
+ "categories take precedence over Compulsory categories."
916
  msgstr ""
917
 
918
  #: classes/class-s2-admin.php:139
1030
  msgid "Donate"
1031
  msgstr ""
1032
 
1033
+ #: classes/class-s2-admin.php:370
1034
  msgid "Subscribe2 Notification Override"
1035
  msgstr ""
1036
 
1038
  msgid "Subscribe2 Preview"
1039
  msgstr ""
1040
 
1041
+ #: classes/class-s2-admin.php:397 gutenberg/gutenberg-translations.php:21
1042
  msgid "Subscribe2 Resend"
1043
  msgstr ""
1044
 
1054
  msgid "Send Preview"
1055
  msgstr ""
1056
 
1057
+ #: classes/class-s2-admin.php:479 gutenberg/gutenberg-translations.php:22
1058
  msgid "Resend the notification email of this post to current subscribers:"
1059
  msgstr ""
1060
 
1061
+ #: classes/class-s2-admin.php:480 gutenberg/gutenberg-translations.php:23
1062
  msgid "Resend Notification"
1063
  msgstr ""
1064
 
1065
+ #: classes/class-s2-admin.php:588
1066
  msgid "Registered User"
1067
  msgstr ""
1068
 
1069
+ #: classes/class-s2-admin.php:593
1070
  msgid "Confirmed Public Subscriber"
1071
  msgstr ""
1072
 
1073
+ #: classes/class-s2-admin.php:595
1074
  msgid "Unconfirmed Public Subscriber"
1075
  msgstr ""
1076
 
1077
+ #: classes/class-s2-admin.php:612 classes/class-s2-forms.php:306
1078
  #: classes/class-s2-forms.php:366
1079
  msgid "Select / Unselect All"
1080
  msgstr ""
1081
 
1082
+ #: classes/class-s2-admin.php:649
1083
  msgid "All Users and Subscribers"
1084
  msgstr ""
1085
 
1086
+ #: classes/class-s2-admin.php:651
1087
  msgid "Confirmed"
1088
  msgstr ""
1089
 
1090
+ #: classes/class-s2-admin.php:652
1091
  msgid "Unconfirmed"
1092
  msgstr ""
1093
 
1094
+ #: classes/class-s2-admin.php:653
1095
  msgid "All Registered Users"
1096
  msgstr ""
1097
 
1098
+ #: classes/class-s2-admin.php:761
1099
  msgid "Post Author"
1100
  msgstr ""
1101
 
1102
+ #: classes/class-s2-admin.php:801
1103
  msgid ""
1104
  "The WordPress cron functions may be disabled on this server. Digest "
1105
  "notifications may not work."
1106
  msgstr ""
1107
 
1108
+ #: classes/class-s2-admin.php:810
1109
  msgid "For each Post"
1110
  msgstr ""
1111
 
1112
+ #: classes/class-s2-admin.php:832
1113
  msgid "Current UTC time is"
1114
  msgstr ""
1115
 
1116
+ #: classes/class-s2-admin.php:834
1117
  msgid "Current blog time is"
1118
  msgstr ""
1119
 
1120
+ #: classes/class-s2-admin.php:836
1121
  msgid "Next email notification will be sent when your blog time is after"
1122
  msgstr ""
1123
 
1124
+ #: classes/class-s2-admin.php:858
1125
  msgid "Attempt to resend the last Digest Notification email"
1126
  msgstr ""
1127
 
1128
+ #: classes/class-s2-admin.php:859
1129
  msgid "Resend Digest"
1130
  msgstr ""
1131
 
1132
+ #: classes/class-s2-admin.php:876
1133
+ msgid "Select a page"
1134
+ msgstr ""
1135
+
1136
+ #: classes/class-s2-admin.php:1147
1137
  msgid "Email subscription"
1138
  msgstr ""
1139
 
1140
+ #: classes/class-s2-admin.php:1149
1141
  msgid "Subscribe / Unsubscribe"
1142
  msgstr ""
1143
 
1144
+ #: classes/class-s2-admin.php:1150
1145
  msgid "Receive notifications"
1146
  msgstr ""
1147
 
1148
+ #: classes/class-s2-admin.php:1151
1149
  msgid "Check if you want to receive email notification when new posts are published"
1150
  msgstr ""
1151
 
1152
+ #: classes/class-s2-ajax.php:42
1153
  msgid "Subscribe to this blog"
1154
  msgstr ""
1155
 
1156
+ #: classes/class-s2-ajax.php:98
1157
  msgid "There was an error validating your request. Please try again later."
1158
  msgstr ""
1159
 
1160
+ #: classes/class-s2-ajax.php:104 classes/class-s2-ajax.php:134
1161
+ #: classes/class-s2-ajax.php:148 classes/class-s2-frontend.php:24
1162
  msgid "A confirmation message is on its way!"
1163
  msgstr ""
1164
 
1165
+ #: classes/class-s2-ajax.php:112 classes/class-s2-frontend.php:30
1166
  msgid "Sorry, but that does not look like an email address to me."
1167
  msgstr ""
1168
 
1169
+ #: classes/class-s2-ajax.php:114 classes/class-s2-frontend.php:32
1170
  msgid ""
1171
  "Sorry, email addresses at that domain are currently barred due to spam, "
1172
  "please use an alternative email address."
1173
  msgstr ""
1174
 
1175
+ #: classes/class-s2-ajax.php:120 classes/class-s2-frontend.php:188
1176
  msgid "Slow down, you move too fast."
1177
  msgstr ""
1178
 
1179
+ #: classes/class-s2-ajax.php:126
1180
  #. Translators: Link to login page
1181
  msgid "To manage your subscription options please <a href=\"%1$s\">login.</a>"
1182
  msgstr ""
1183
 
1184
+ #: classes/class-s2-ajax.php:136 classes/class-s2-ajax.php:150
1185
  #: classes/class-s2-frontend.php:34
1186
  msgid "Sorry, there seems to be an error on the server. Please try again later."
1187
  msgstr ""
1188
 
1189
+ #: classes/class-s2-ajax.php:140 classes/class-s2-frontend.php:26
1190
  msgid "That email address is already subscribed."
1191
  msgstr ""
1192
 
1193
+ #: classes/class-s2-ajax.php:144 classes/class-s2-frontend.php:28
1194
  msgid "That email address is not subscribed."
1195
  msgstr ""
1196
 
1197
+ #: classes/class-s2-core.php:554
1198
  msgid "Plain Text Excerpt Preview"
1199
  msgstr ""
1200
 
1201
+ #: classes/class-s2-core.php:556
1202
  msgid "Plain Text Full Preview"
1203
  msgstr ""
1204
 
1205
+ #: classes/class-s2-core.php:558
1206
  msgid "HTML Excerpt Preview"
1207
  msgstr ""
1208
 
1209
+ #: classes/class-s2-core.php:560
1210
  msgid "HTML Full Preview"
1211
  msgstr ""
1212
 
1213
+ #: classes/class-s2-core.php:1252
1214
  msgid "Check here to Subscribe to email notifications for new posts"
1215
  msgstr ""
1216
 
1217
+ #: classes/class-s2-core.php:1257
1218
  msgid ""
1219
  "By registering with this blog you are also agreeing to receive email "
1220
  "notifications for new posts but you can unsubscribe at anytime"
1221
  msgstr ""
1222
 
1223
+ #: classes/class-s2-core.php:1285
1224
  msgid "Check here to Subscribe to notifications for new posts"
1225
  msgstr ""
1226
 
1227
+ #: classes/class-s2-core.php:1404
1228
  msgid "Weekly"
1229
  msgstr ""
1230
 
1231
+ #: classes/class-s2-core.php:1622 classes/class-s2-core.php:1623
1232
  msgid "Author"
1233
  msgstr ""
1234
 
1235
+ #: classes/class-s2-core.php:1629
1236
  msgid "Posted on"
1237
  msgstr ""
1238
 
1239
+ #: classes/class-s2-core.php:1656 classes/class-s2-core.php:1657
1240
  msgid "Posted in"
1241
  msgstr ""
1242
 
1243
+ #: classes/class-s2-core.php:1670 classes/class-s2-core.php:1671
1244
  msgid "Tagged as"
1245
  msgstr ""
1246
 
1247
+ #: classes/class-s2-core.php:1742
1248
  msgid "Digest Email"
1249
  msgstr ""
1250
 
1251
+ #: classes/class-s2-core.php:1755
1252
  msgid "Digest Preview"
1253
  msgstr ""
1254
 
1304
  msgid "(Un)Subscribe to Posts"
1305
  msgstr ""
1306
 
1307
+ #: classes/class-s2-form-widget.php:143
1308
  msgid "Title"
1309
  msgstr ""
1310
 
1311
+ #: classes/class-s2-form-widget.php:145
1312
  msgid "Div class name"
1313
  msgstr ""
1314
 
1315
+ #: classes/class-s2-form-widget.php:147
1316
  msgid "Pre-Content"
1317
  msgstr ""
1318
 
1319
+ #: classes/class-s2-form-widget.php:149
1320
  msgid "Post-Content"
1321
  msgstr ""
1322
 
1323
+ #: classes/class-s2-form-widget.php:151
1324
  msgid "Text Box Size"
1325
  msgstr ""
1326
 
1327
+ #: classes/class-s2-form-widget.php:153
1328
  msgid "Display options"
1329
  msgstr ""
1330
 
1331
+ #: classes/class-s2-form-widget.php:154
1332
  msgid "Show complete form"
1333
  msgstr ""
1334
 
1335
+ #: classes/class-s2-form-widget.php:155
1336
  msgid "Hide Subscribe button"
1337
  msgstr ""
1338
 
1339
+ #: classes/class-s2-form-widget.php:156
1340
  msgid "Hide Unsubscribe button"
1341
  msgstr ""
1342
 
1343
+ #: classes/class-s2-form-widget.php:158
1344
  msgid "Show as link"
1345
  msgstr ""
1346
 
1347
+ #: classes/class-s2-form-widget.php:161
1348
  msgid "Post form content to page"
1349
  msgstr ""
1350
 
1351
+ #: classes/class-s2-form-widget.php:163
1352
  msgid "Use Subscribe2 Default"
1353
  msgstr ""
1354
 
1355
+ #: classes/class-s2-form-widget.php:168
1356
  msgid "Use Home Page"
1357
  msgstr ""
1358
 
1359
+ #: classes/class-s2-form-widget.php:173
1360
  msgid "Use Referring Page"
1361
  msgstr ""
1362
 
1363
+ #: classes/class-s2-form-widget.php:176
1364
  msgid "Disable JavaScript"
1365
  msgstr ""
1366
 
1367
+ #: classes/class-s2-form-widget.php:179
1368
  msgid "Disable Anti-spam measures"
1369
  msgstr ""
1370
 
1371
+ #: classes/class-s2-form-widget.php:182 gutenberg/gutenberg-translations.php:17
1372
  msgid "Disable wrapping of form buttons"
1373
  msgstr ""
1374
 
1440
  msgid "Subscription preferences updated."
1441
  msgstr ""
1442
 
1443
+ #: classes/class-s2-frontend.php:8
1444
+ #. Translators: Link to login page
1445
+ msgid "To manage your subscription options please <a href=\"%1$s\">login</a>."
1446
+ msgstr ""
1447
+
1448
  #: classes/class-s2-frontend.php:12
1449
  #. Translators: Link to Profile page
1450
  msgid ""
1451
  "You may manage your subscription options from your <a "
1452
+ "href=\"%1$s\">profile</a>."
1453
  msgstr ""
1454
 
1455
  #: classes/class-s2-frontend.php:20
1516
  msgstr ""
1517
 
1518
  #: classes/class-s2-list-table-legacy.php:131
1519
+ #: classes/class-s2-list-table.php:112
1520
  msgid "Select All"
1521
  msgstr ""
1522
 
1523
  #: classes/class-s2-list-table-legacy.php:183
1524
  #: classes/class-s2-list-table-legacy.php:188
1525
+ #: classes/class-s2-list-table.php:167 classes/class-s2-list-table.php:172
1526
  msgid "Delete"
1527
  msgstr ""
1528
 
1529
  #: classes/class-s2-list-table-legacy.php:189
1530
+ #: classes/class-s2-list-table.php:173
1531
  msgid "Toggle"
1532
  msgstr ""
1533
 
1534
  #: classes/class-s2-list-table-legacy.php:198
1535
+ #: classes/class-s2-list-table.php:182
1536
  msgid "No users were selected."
1537
  msgstr ""
1538
 
1539
  #: classes/class-s2-list-table-legacy.php:211
1540
+ #: classes/class-s2-list-table.php:195
1541
  msgid "Address(es) deleted!"
1542
  msgstr ""
1543
 
1544
  #: classes/class-s2-list-table-legacy.php:215
1545
+ #: classes/class-s2-list-table.php:199
1546
  msgid "Delete failed! You cannot delete some or all of these users."
1547
  msgstr ""
1548
 
1549
  #: classes/class-s2-list-table-legacy.php:218
1550
+ #: classes/class-s2-list-table.php:202
1551
  msgid ""
1552
  "Registered user(s) deleted! Any posts made by these users were assigned to "
1553
  "you."
1554
  msgstr ""
1555
 
1556
  #: classes/class-s2-list-table-legacy.php:242
1557
+ #: classes/class-s2-list-table.php:226
1558
  msgid "Status changed!"
1559
  msgstr ""
1560
 
1561
  #: classes/class-s2-list-table-legacy.php:259
1562
+ #: classes/class-s2-list-table.php:247
1563
  #. Translators: Pagination
1564
  msgid "%s item"
1565
  msgid_plural "%s items"
1586
  msgid "Go to the last page"
1587
  msgstr ""
1588
 
1589
+ #: classes/class-s2-list-table.php:308
1590
  msgid "First page"
1591
  msgstr ""
1592
 
1593
+ #: classes/class-s2-list-table.php:319
1594
  msgid "Previous page"
1595
  msgstr ""
1596
 
1597
+ #: classes/class-s2-list-table.php:326 classes/class-s2-list-table.php:330
1598
  msgid "Current Page"
1599
  msgstr ""
1600
 
1601
+ #: classes/class-s2-list-table.php:346
1602
  msgid "Next page"
1603
  msgstr ""
1604
 
1605
+ #: classes/class-s2-list-table.php:357
1606
  msgid "Last page"
1607
  msgstr ""
1608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1609
  #: gutenberg/gutenberg-translations.php:5
1610
  msgid "Subscribe2 HTML"
1611
  msgstr ""
1698
  #: include/options.php:148
1699
  msgid ""
1700
  "{BLOGNAME} has received a request to {ACTION} for this email address. To "
1701
+ "complete your request please click on the link below:\n"
1702
+ "\n"
1703
+ "{LINK}\n"
1704
+ "\n"
1705
+ "If you did not request this, please feel free to disregard this notice!\n"
1706
+ "\n"
1707
+ "Thank you,\n"
1708
  "{MYNAME}."
1709
  msgstr ""
1710
 
1715
  #: include/options.php:156
1716
  msgid ""
1717
  "This email address was subscribed for notifications at {BLOGNAME} "
1718
+ "({BLOGLINK}) but the subscription remains incomplete.\n"
1719
+ "\n"
1720
+ "If you wish to complete your subscription please click on the link below:\n"
1721
+ "\n"
1722
+ "{LINK}\n"
1723
+ "\n"
1724
  "If you do not wish to complete your subscription please ignore this email "
1725
+ "and your address will be removed from our database.\n"
1726
+ "\n"
1727
+ "Regards,\n"
1728
  "{MYNAME}"
1729
  msgstr ""
1730
 
1758
  msgid "Notifies an email list when new entries are posted."
1759
  msgstr ""
1760
 
1761
+ #: classes/class-s2-admin.php:567
1762
  msgctxt "Comma Separated Column Header names for CSV Export"
1763
  msgid "User Email,User Type,User Name,Confirm Date,IP"
1764
  msgstr ""
1765
 
1766
  #: classes/class-s2-list-table-legacy.php:75
1767
+ #: classes/class-s2-list-table-legacy.php:80 classes/class-s2-list-table.php:68
 
1768
  msgctxt "column name"
1769
  msgid "Email"
1770
  msgstr ""
1771
 
1772
+ #: classes/class-s2-list-table-legacy.php:81 classes/class-s2-list-table.php:69
1773
  msgctxt "column name"
1774
  msgid "Date"
1775
  msgstr ""
1776
 
1777
  #: classes/class-s2-list-table-legacy.php:333
1778
+ #: classes/class-s2-list-table.php:338
1779
  #. Translators: Pagination
1780
  msgctxt "paging"
1781
  msgid "%1$s of %2$s"
tinymce/editor-plugin3.js DELETED
@@ -1,121 +0,0 @@
1
- /* global tinymce */
2
-
3
- ( function() {
4
- tinymce.create(
5
- 'tinymce.plugins.Subscribe2Plugin',
6
- {
7
- init: function( ed, url ) {
8
- var i = 0,
9
- pb = '<img src="' + url + '/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',
10
- cls = 'mceSubscribe2',
11
- shortcode = '[subscribe2]',
12
- pbreplaced = [],
13
- pbreplacedcount,
14
- pbRE = new RegExp( /(\[|<!--)subscribe2.*?(\]|-->)/g ),
15
- replacer = function( str ) {
16
- if ( -1 !== str.indexOf( 'class="mceSubscribe2' ) ) {
17
- str = pbreplaced[i];
18
- }
19
- return str;
20
- };
21
-
22
- // Register commands
23
- ed.addCommand(
24
- 'mceSubscribe2',
25
- function() {
26
- ed.execCommand( 'mceInsertContent', 0, pb );
27
- }
28
- );
29
-
30
- // Register buttons
31
- ed.addButton(
32
- 'subscribe2',
33
- {
34
- title: 'Insert Subscribe2 Token',
35
- image: url + '/../include/s2-button.png',
36
- cmd: cls
37
- }
38
- );
39
-
40
- // load the CSS and enable it on the right class
41
- ed.onInit.add(
42
- function() {
43
- ed.dom.loadCSS( url + '/css/content.css' );
44
- if ( ed.theme.onResolveName ) {
45
- ed.theme.onResolveName.add(
46
- function( th, o ) {
47
- if ( 'IMG' === o.node.nodeName && ed.dom.hasClass( o.node, cls ) ) {
48
- o.name = 'subscribe2';
49
- }
50
- }
51
- );
52
- }
53
- }
54
- );
55
-
56
- // allow selection of the image placeholder
57
- ed.onClick.add(
58
- function( ed, e ) {
59
- e = e.target;
60
- if ( 'IMG' === e.nodeName && ed.dom.hasClass( e, cls ) ) {
61
- ed.selection.select( e );
62
- }
63
- }
64
- );
65
-
66
- // re-enable the CSS when the node changes
67
- ed.onNodeChange.add(
68
- function( ed, cm, n ) {
69
- cm.setActive( 'subscribe2', 'IMG' === n.nodeName && ed.dom.hasClass( n, cls ) );
70
- }
71
- );
72
-
73
- // create an array of replaced shortcodes so we have additional parameters
74
- // then swap in the graphic
75
- ed.onBeforeSetContent.add(
76
- function( ed, o ) {
77
- pbreplaced = o.content.match( pbRE );
78
- o.content = o.content.replace( pbRE, pb );
79
- }
80
- );
81
-
82
- // swap back the array of shortcodes to preserve parameters
83
- // replace any other instances with the default shortcode
84
- ed.onPostProcess.add(
85
- function( ed, o ) {
86
- if ( o.get ) {
87
- if ( null !== pbreplaced ) {
88
- pbreplacedcount = pbreplaced.length;
89
- for ( i = 0; i < pbreplacedcount; i++ ) {
90
- o.content = o.content.replace( /<img[^>]+>/, replacer );
91
- }
92
- }
93
- o.content = o.content.replace(
94
- /<img[^>]+>/g,
95
- function( im ) {
96
- if ( -1 !== im.indexOf( 'class="mceSubscribe2' ) ) {
97
- im = shortcode;
98
- }
99
- return im;
100
- }
101
- );
102
- }
103
- }
104
- );
105
- },
106
-
107
- getInfo: function() {
108
- return {
109
- longname: 'Insert Subscribe2 Token',
110
- author: 'Matthew Robinson',
111
- authorurl: 'http://subscribe2.wordpress.com',
112
- infourl: 'http://subscribe2.wordpress.com',
113
- version: tinymce.majorVersion + '.' + tinymce.minorVersion
114
- };
115
- }
116
- }
117
- );
118
-
119
- // Register plugin
120
- tinymce.PluginManager.add( 'subscribe2', tinymce.plugins.Subscribe2Plugin );
121
- } () );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tinymce/editor-plugin3.min.js DELETED
@@ -1 +0,0 @@
1
- tinymce.create("tinymce.plugins.Subscribe2Plugin",{init:function(e,n){var t,c=0,o='<img src="'+n+'/../include/spacer.gif" class="mceSubscribe2 mceItemNoResize" />',s="mceSubscribe2",i=[],r=new RegExp(/(\[|<!--)subscribe2.*?(\]|-->)/g),u=function(e){return-1!==e.indexOf('class="mceSubscribe2')&&(e=i[c]),e};e.addCommand("mceSubscribe2",function(){e.execCommand("mceInsertContent",0,o)}),e.addButton("subscribe2",{title:"Insert Subscribe2 Token",image:n+"/../include/s2-button.png",cmd:s}),e.onInit.add(function(){e.dom.loadCSS(n+"/css/content.css"),e.theme.onResolveName&&e.theme.onResolveName.add(function(n,t){"IMG"===t.node.nodeName&&e.dom.hasClass(t.node,s)&&(t.name="subscribe2")})}),e.onClick.add(function(e,n){"IMG"===(n=n.target).nodeName&&e.dom.hasClass(n,s)&&e.selection.select(n)}),e.onNodeChange.add(function(e,n,t){n.setActive("subscribe2","IMG"===t.nodeName&&e.dom.hasClass(t,s))}),e.onBeforeSetContent.add(function(e,n){i=n.content.match(r),n.content=n.content.replace(r,o)}),e.onPostProcess.add(function(e,n){if(n.get){if(null!==i)for(t=i.length,c=0;c<t;c++)n.content=n.content.replace(/<img[^>]+>/,u);n.content=n.content.replace(/<img[^>]+>/g,function(e){return-1!==e.indexOf('class="mceSubscribe2')&&(e="[subscribe2]"),e})}})},getInfo:function(){return{longname:"Insert Subscribe2 Token",author:"Matthew Robinson",authorurl:"http://subscribe2.wordpress.com",infourl:"http://subscribe2.wordpress.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.PluginManager.add("subscribe2",tinymce.plugins.Subscribe2Plugin);