Subscribe To Comments Reloaded - Version 210104

Version Description

Download this release

Release Info

Developer wpkube
Plugin Icon 128x128 Subscribe To Comments Reloaded
Version 210104
Comparing to
See all releases

Code changes from version 200813 to 210104

options/options_template.php CHANGED
@@ -28,6 +28,9 @@ $options = array(
28
  'use_challenge_question' => 'yesno',
29
  'challenge_question' => 'text',
30
  'challenge_answer' => 'text',
 
 
 
31
  );
32
 
33
  // Update options
28
  'use_challenge_question' => 'yesno',
29
  'challenge_question' => 'text',
30
  'challenge_answer' => 'text',
31
+ 'use_captcha' => 'yesno',
32
+ 'captcha_site_key' => 'text',
33
+ 'captcha_secret_key' => 'text',
34
  );
35
 
36
  // Update options
options/stcr_comment_form.php CHANGED
@@ -103,19 +103,19 @@ if ( isset( $_POST['options'] ) ) {
103
  </div>
104
  <?php
105
  // This option will be visible only when the Checkbox option is enable
106
- if ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'checked_by_default' ) == 'yes') :
107
  ?>
108
  <div class="form-group row">
109
- <label for="checked_by_default_value" class="col-sm-3 col-form-label text-right"><?php _e( 'Default Checkbox Value', 'subscribe-to-comments-reloaded' ) ?></label>
110
  <div class="col-sm-7">
111
  <select name="options[checked_by_default_value]" id="checked_by_default_value" class="form-control form-control-select">
112
  <option value="0" <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'checked_by_default_value' ) === '0' ) ? "selected='selected'" : ''; ?>><?php _e( 'All new comments', 'subscribe-to-comments-reloaded' ); ?></option>
113
  <option value="1" <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'checked_by_default_value' ) === '1' ) ? "selected='selected'" : ''; ?>><?php _e( 'Replies to this comment', 'subscribe-to-comments-reloaded' ); ?></option>
114
  </select>
115
  <div class="helpDescription subsOptDescriptions"
116
- data-content="<?php _e( 'Select the default option for the Checkbox. Be careful! Some users might like to be subscribed to all the post.', 'subscribe-to-comments-reloaded' ); ?>"
117
  data-placement="right"
118
- aria-label="<?php _e( 'Select the default option for the Checkbox. Be careful! Some users might like to be subscribed to all the post.', 'subscribe-to-comments-reloaded' ); ?>">
119
  <i class="fas fa-question-circle"></i>
120
  </div>
121
  </div>
103
  </div>
104
  <?php
105
  // This option will be visible only when the Checkbox option is enable
106
+ if ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'enable_advanced_subscriptions' ) == 'no' ) :
107
  ?>
108
  <div class="form-group row">
109
+ <label for="checked_by_default_value" class="col-sm-3 col-form-label text-right"><?php _e( 'Subscription type', 'subscribe-to-comments-reloaded' ) ?></label>
110
  <div class="col-sm-7">
111
  <select name="options[checked_by_default_value]" id="checked_by_default_value" class="form-control form-control-select">
112
  <option value="0" <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'checked_by_default_value' ) === '0' ) ? "selected='selected'" : ''; ?>><?php _e( 'All new comments', 'subscribe-to-comments-reloaded' ); ?></option>
113
  <option value="1" <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'checked_by_default_value' ) === '1' ) ? "selected='selected'" : ''; ?>><?php _e( 'Replies to this comment', 'subscribe-to-comments-reloaded' ); ?></option>
114
  </select>
115
  <div class="helpDescription subsOptDescriptions"
116
+ data-content="<?php _e( 'Select the type of subscription.', 'subscribe-to-comments-reloaded' ); ?>"
117
  data-placement="right"
118
+ aria-label="<?php _e( 'Select the type of subscription.', 'subscribe-to-comments-reloaded' ); ?>">
119
  <i class="fas fa-question-circle"></i>
120
  </div>
121
  </div>
options/stcr_notifications.php CHANGED
@@ -79,9 +79,9 @@ wp_print_scripts( 'quicktags' );
79
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'from_name' ) ); ?>" size="20">
80
 
81
  <div class="helpDescription subsOptDescriptions"
82
- data-content="<?php _e( "Name to use for the 'from' field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>"
83
  data-placement="right"
84
- aria-label="<?php _e( "Name to use for the 'from' field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>">
85
  <i class="fas fa-question-circle"></i>
86
  </div>
87
  </div>
@@ -96,9 +96,9 @@ wp_print_scripts( 'quicktags' );
96
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'from_email' ) ); ?>" size="20">
97
 
98
  <div class="helpDescription subsOptDescriptions"
99
- data-content="<?php _e( "Email address to use for the \"from\" field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>"
100
  data-placement="right"
101
- aria-label="<?php _e( "Email address to use for the \"from\" field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>">
102
  <i class="fas fa-question-circle"></i>
103
  </div>
104
  </div>
@@ -113,9 +113,9 @@ wp_print_scripts( 'quicktags' );
113
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'reply_to' ) ); ?>" size="20">
114
 
115
  <div class="helpDescription subsOptDescriptions"
116
- data-content="<?php _e( "This will be use when the user click reply on their email agent. If not set it will be the same as the Sender email address.", 'subscribe-to-comments-reloaded' ); ?>"
117
  data-placement="right"
118
- aria-label="<?php _e( "This will be use when the user click reply on their email agent. If not set it will be the same as the Sender email address.", 'subscribe-to-comments-reloaded' ); ?>">
119
  <i class="fas fa-question-circle"></i>
120
  </div>
121
  </div>
@@ -132,9 +132,9 @@ wp_print_scripts( 'quicktags' );
132
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'notification_subject' ) ); ?>" size="20">
133
 
134
  <div class="helpDescription subsOptDescriptions"
135
- data-content="<?php _e( "Subject of the notification email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>"
136
  data-placement="right"
137
- aria-label="<?php _e( "Subject of the notification email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>">
138
  <i class="fas fa-question-circle"></i>
139
  </div>
140
  </div>
@@ -145,9 +145,9 @@ wp_print_scripts( 'quicktags' );
145
  <?php _e( 'Notification message', 'subscribe-to-comments-reloaded' ) ?>
146
 
147
  <div class="helpDescription subsOptDescriptions"
148
- data-content="<?php _e( "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link], [comment_gravatar]<p style='color: #156dc7;'><strong>Note: To get a default template clear all the content and save the options.</strong></p>", 'subscribe-to-comments-reloaded' ); ?>"
149
  data-placement="right"
150
- aria-label="<?php _e( "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link], [comment_gravatar]<p style='color: #156dc7;'><strong>Note: To get a default template clear all the content and save the options.</strong></p>", 'subscribe-to-comments-reloaded' ); ?>">
151
  <i class="fas fa-question-circle"></i>
152
  </div>
153
 
@@ -180,9 +180,9 @@ wp_print_scripts( 'quicktags' );
180
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'double_check_subject' ) ); ?>" size="20">
181
 
182
  <div class="helpDescription subsOptDescriptions"
183
- data-content="<?php _e( "Subject of the confirmation email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>"
184
  data-placement="right"
185
- aria-label="<?php _e( "Subject of the confirmation email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>">
186
  <i class="fas fa-question-circle"></i>
187
  </div>
188
  </div>
@@ -193,9 +193,9 @@ wp_print_scripts( 'quicktags' );
193
  <?php _e( 'Double check message', 'subscribe-to-comments-reloaded' ) ?>
194
 
195
  <div class="helpDescription subsOptDescriptions"
196
- data-content="<?php _e( "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]", 'subscribe-to-comments-reloaded' ); ?>"
197
  data-placement="right"
198
- aria-label="<?php _e( "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]", 'subscribe-to-comments-reloaded' ); ?>">
199
  <i class="fas fa-question-circle"></i>
200
  </div>
201
 
@@ -224,9 +224,9 @@ wp_print_scripts( 'quicktags' );
224
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'management_subject' ) ); ?>" size="20">
225
 
226
  <div class="helpDescription subsOptDescriptions"
227
- data-content="<?php _e( "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]", 'subscribe-to-comments-reloaded' ); ?>"
228
  data-placement="right"
229
- aria-label="<?php _e( "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]", 'subscribe-to-comments-reloaded' ); ?>">
230
  <i class="fas fa-question-circle"></i>
231
  </div>
232
  </div>
@@ -245,9 +245,9 @@ wp_print_scripts( 'quicktags' );
245
  <?php _e( 'Management Page message', 'subscribe-to-comments-reloaded' ) ?>
246
 
247
  <div class="helpDescription subsOptDescriptions"
248
- data-content="<?php _e( "Content of the management Page message. Allowed tags: [blog_name].", 'subscribe-to-comments-reloaded' ); ?>"
249
  data-placement="right"
250
- aria-label="<?php _e( "Content of the management Page message. Allowed tags: [blog_name].", 'subscribe-to-comments-reloaded' ); ?>">
251
  <i class="fas fa-question-circle"></i>
252
  </div>
253
  </label>
@@ -281,9 +281,9 @@ wp_print_scripts( 'quicktags' );
281
  <?php _e( 'Management Email message', 'subscribe-to-comments-reloaded' ) ?>
282
 
283
  <div class="helpDescription subsOptDescriptions"
284
- data-content="<?php _e( "Content of the management email message. Allowed tags: [blog_name], [manager_link].", 'subscribe-to-comments-reloaded' ); ?>"
285
  data-placement="right"
286
- aria-label="<?php _e( "Content of the management email message. Allowed tags: [blog_name], [manager_link].", 'subscribe-to-comments-reloaded' ); ?>">
287
  <i class="fas fa-question-circle"></i>
288
  </div>
289
 
@@ -308,9 +308,9 @@ wp_print_scripts( 'quicktags' );
308
  <?php _e( 'One Click Unsubscribe', 'subscribe-to-comments-reloaded' ) ?>
309
 
310
  <div class="helpDescription subsOptDescriptions"
311
- data-content="<?php _e( "Content of the One Click confirmation. Allowed tags: [post_title], [blog_name].", 'subscribe-to-comments-reloaded' ); ?>"
312
  data-placement="right"
313
- aria-label="<?php _e( "Content of the One Click confirmation. Allowed tags: [post_title], [blog_name].", 'subscribe-to-comments-reloaded' ); ?>">
314
  <i class="fas fa-question-circle"></i>
315
  </div>
316
 
79
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'from_name' ) ); ?>" size="20">
80
 
81
  <div class="helpDescription subsOptDescriptions"
82
+ data-content="<?php esc_attr_e( "Name to use for the 'from' field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>"
83
  data-placement="right"
84
+ aria-label="<?php esc_attr_e( "Name to use for the 'from' field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>">
85
  <i class="fas fa-question-circle"></i>
86
  </div>
87
  </div>
96
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'from_email' ) ); ?>" size="20">
97
 
98
  <div class="helpDescription subsOptDescriptions"
99
+ data-content="<?php esc_attr_e( "Email address to use for the \"from\" field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>"
100
  data-placement="right"
101
+ aria-label="<?php esc_attr_e( "Email address to use for the \"from\" field when sending a new notification to the user.", 'subscribe-to-comments-reloaded' ); ?>">
102
  <i class="fas fa-question-circle"></i>
103
  </div>
104
  </div>
113
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'reply_to' ) ); ?>" size="20">
114
 
115
  <div class="helpDescription subsOptDescriptions"
116
+ data-content="<?php esc_attr_e( "This will be use when the user click reply on their email agent. If not set it will be the same as the Sender email address.", 'subscribe-to-comments-reloaded' ); ?>"
117
  data-placement="right"
118
+ aria-label="<?php esc_attr_e( "This will be use when the user click reply on their email agent. If not set it will be the same as the Sender email address.", 'subscribe-to-comments-reloaded' ); ?>">
119
  <i class="fas fa-question-circle"></i>
120
  </div>
121
  </div>
132
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'notification_subject' ) ); ?>" size="20">
133
 
134
  <div class="helpDescription subsOptDescriptions"
135
+ data-content="<?php esc_attr_e( "Subject of the notification email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>"
136
  data-placement="right"
137
+ aria-label="<?php esc_attr_e( "Subject of the notification email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>">
138
  <i class="fas fa-question-circle"></i>
139
  </div>
140
  </div>
145
  <?php _e( 'Notification message', 'subscribe-to-comments-reloaded' ) ?>
146
 
147
  <div class="helpDescription subsOptDescriptions"
148
+ data-content="<?php esc_attr_e( "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link], [comment_gravatar]<p style='color: #156dc7;'><strong>Note: To get a default template clear all the content and save the options.</strong></p>", 'subscribe-to-comments-reloaded' ); ?>"
149
  data-placement="right"
150
+ aria-label="<?php esc_attr_e( "Content of the notification email. Allowed tags: [post_title], [comment_permalink], [comment_author], [comment_content], [post_permalink], [manager_link], [comment_gravatar]<p style='color: #156dc7;'><strong>Note: To get a default template clear all the content and save the options.</strong></p>", 'subscribe-to-comments-reloaded' ); ?>">
151
  <i class="fas fa-question-circle"></i>
152
  </div>
153
 
180
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'double_check_subject' ) ); ?>" size="20">
181
 
182
  <div class="helpDescription subsOptDescriptions"
183
+ data-content="<?php esc_attr_e( "Subject of the confirmation email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>"
184
  data-placement="right"
185
+ aria-label="<?php esc_attr_e( "Subject of the confirmation email. Allowed tag: [post_title]", 'subscribe-to-comments-reloaded' ); ?>">
186
  <i class="fas fa-question-circle"></i>
187
  </div>
188
  </div>
193
  <?php _e( 'Double check message', 'subscribe-to-comments-reloaded' ) ?>
194
 
195
  <div class="helpDescription subsOptDescriptions"
196
+ data-content="<?php esc_attr_e( "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]", 'subscribe-to-comments-reloaded' ); ?>"
197
  data-placement="right"
198
+ aria-label="<?php esc_attr_e( "Content of the confirmation email. Allowed tags: [post_permalink], [confirm_link], [post_title], [manager_link]", 'subscribe-to-comments-reloaded' ); ?>">
199
  <i class="fas fa-question-circle"></i>
200
  </div>
201
 
224
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'management_subject' ) ); ?>" size="20">
225
 
226
  <div class="helpDescription subsOptDescriptions"
227
+ data-content="<?php esc_attr_e( "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]", 'subscribe-to-comments-reloaded' ); ?>"
228
  data-placement="right"
229
+ aria-label="<?php esc_attr_e( "Subject of the mail sent to those who request to access their management page. Allowed tag: [blog_name]", 'subscribe-to-comments-reloaded' ); ?>">
230
  <i class="fas fa-question-circle"></i>
231
  </div>
232
  </div>
245
  <?php _e( 'Management Page message', 'subscribe-to-comments-reloaded' ) ?>
246
 
247
  <div class="helpDescription subsOptDescriptions"
248
+ data-content="<?php esc_attr_e( "Content of the management Page message. Allowed tags: [blog_name].", 'subscribe-to-comments-reloaded' ); ?>"
249
  data-placement="right"
250
+ aria-label="<?php esc_attr_e( "Content of the management Page message. Allowed tags: [blog_name].", 'subscribe-to-comments-reloaded' ); ?>">
251
  <i class="fas fa-question-circle"></i>
252
  </div>
253
  </label>
281
  <?php _e( 'Management Email message', 'subscribe-to-comments-reloaded' ) ?>
282
 
283
  <div class="helpDescription subsOptDescriptions"
284
+ data-content="<?php esc_attr_e( "Content of the management email message. Allowed tags: [blog_name], [manager_link].", 'subscribe-to-comments-reloaded' ); ?>"
285
  data-placement="right"
286
+ aria-label="<?php esc_attr_e( "Content of the management email message. Allowed tags: [blog_name], [manager_link].", 'subscribe-to-comments-reloaded' ); ?>">
287
  <i class="fas fa-question-circle"></i>
288
  </div>
289
 
308
  <?php _e( 'One Click Unsubscribe', 'subscribe-to-comments-reloaded' ) ?>
309
 
310
  <div class="helpDescription subsOptDescriptions"
311
+ data-content="<?php esc_attr_e( "Content of the One Click confirmation. Allowed tags: [post_title], [blog_name].", 'subscribe-to-comments-reloaded' ); ?>"
312
  data-placement="right"
313
+ aria-label="<?php esc_attr_e( "Content of the One Click confirmation. Allowed tags: [post_title], [blog_name].", 'subscribe-to-comments-reloaded' ); ?>">
314
  <i class="fas fa-question-circle"></i>
315
  </div>
316
 
options/stcr_options.php CHANGED
@@ -28,6 +28,9 @@ $options = array(
28
  'use_challenge_question' => 'yesno',
29
  'challenge_question' => 'text',
30
  'challenge_answer' => 'text',
 
 
 
31
  );
32
 
33
  if ( array_key_exists( "generate_key", $_POST ) ) {
@@ -524,9 +527,9 @@ wp_print_scripts( 'quicktags' );
524
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'challenge_question', 'What is 1 + 2?' ) ); ?>">
525
 
526
  <div class="helpDescription subsOptDescriptions"
527
- data-content="<?php _e( "The question shown to visitor when subscribing.", 'subscribe-to-comments-reloaded' ); ?>"
528
  data-placement="right"
529
- aria-label="<?php _e( "The question shown to visitor when subscribing", 'subscribe-to-comments-reloaded' ); ?>">
530
  <i class="fas fa-question-circle"></i>
531
  </div>
532
  </div>
@@ -549,6 +552,71 @@ wp_print_scripts( 'quicktags' );
549
  </div>
550
  </div>
551
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  <div class="form-group row">
553
  <label for="unique_key" class="col-sm-3 col-form-label text-right">
554
  <?php _e( 'StCR Unique Key', 'subscribe-to-comments-reloaded' ) ?></label>
28
  'use_challenge_question' => 'yesno',
29
  'challenge_question' => 'text',
30
  'challenge_answer' => 'text',
31
+ 'use_captcha' => 'yesno',
32
+ 'captcha_site_key' => 'text',
33
+ 'captcha_secret_key' => 'text',
34
  );
35
 
36
  if ( array_key_exists( "generate_key", $_POST ) ) {
527
  value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'challenge_question', 'What is 1 + 2?' ) ); ?>">
528
 
529
  <div class="helpDescription subsOptDescriptions"
530
+ data-content="<?php _e( "The question shown to visitor when subscribing without commenting or when requesting a subscription management link.", 'subscribe-to-comments-reloaded' ); ?>"
531
  data-placement="right"
532
+ aria-label="<?php _e( "The question shown to visitor when subscribing without commenting or when requesting a subscription management link", 'subscribe-to-comments-reloaded' ); ?>">
533
  <i class="fas fa-question-circle"></i>
534
  </div>
535
  </div>
552
  </div>
553
  </div>
554
 
555
+ <?php /* captcha options start */ ?>
556
+
557
+ <div class="form-group row">
558
+ <label for="use_captcha" class="col-sm-3 col-form-label text-right">
559
+ <?php _e( 'Enable Google reCAPTCHA', 'subscribe-to-comments-reloaded' ) ?>
560
+ </label>
561
+ <div class="col-sm-7">
562
+ <div class="switch">
563
+ <input type="radio" class="switch-input" name="options[use_captcha]"
564
+ value="yes" id="use_captcha-yes" <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'use_captcha', 'no' ) == 'yes' ) ? ' checked' : ''; ?> />
565
+ <label for="use_captcha-yes" class="switch-label switch-label-off">
566
+ <?php _e( 'Yes', 'subscribe-to-comments-reloaded' ) ?>
567
+ </label>
568
+ <input type="radio" class="switch-input" name="options[use_captcha]" value="no" id="use_captcha-no"
569
+ <?php echo ( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'use_captcha', 'no' ) == 'no' ) ? ' checked' : ''; ?> />
570
+ <label for="use_captcha-no" class="switch-label switch-label-on">
571
+ <?php _e( 'No', 'subscribe-to-comments-reloaded' ) ?>
572
+ </label>
573
+ <span class="switch-selection"></span>
574
+ </div>
575
+ <div class="helpDescription subsOptDescriptions"
576
+ data-content="<?php _e( "Shown to visitor when subscribing without commenting or when requesting a subscription management link.", 'subscribe-to-comments-reloaded' ); ?>"
577
+ data-placement="right"
578
+ aria-label="<?php _e( "Shown to visitor when subscribing without commenting or when requesting a subscription management link.", 'subscribe-to-comments-reloaded' ); ?>">
579
+ <i class="fas fa-question-circle"></i>
580
+ </div>
581
+ </div>
582
+ </div>
583
+
584
+ <div class="form-group row">
585
+ <label for="captcha_site_key" class="col-sm-3 col-form-label text-right">
586
+ <?php _e( 'reCAPTCHA site key', 'subscribe-to-comments-reloaded' ) ?></label>
587
+ <div class="col-sm-7">
588
+ <input type="text" name="options[captcha_site_key]" id="captcha_site_key"
589
+ class="form-control form-control-input-3"
590
+ value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'captcha_site_key', '' ) ); ?>">
591
+
592
+ <div class="helpDescription subsOptDescriptions"
593
+ data-content="<?php _e( "The site key for Google reCAPTCHA.", 'subscribe-to-comments-reloaded' ); ?>"
594
+ data-placement="right"
595
+ aria-label="<?php _e( "The site key for Google reCAPTCHA.", 'subscribe-to-comments-reloaded' ); ?>">
596
+ <i class="fas fa-question-circle"></i>
597
+ </div>
598
+ </div>
599
+ </div>
600
+
601
+ <div class="form-group row">
602
+ <label for="captcha_secret_key" class="col-sm-3 col-form-label text-right">
603
+ <?php _e( 'reCAPTCHA secret key', 'subscribe-to-comments-reloaded' ) ?></label>
604
+ <div class="col-sm-7">
605
+ <input type="text" name="options[captcha_secret_key]" id="captcha_secret_key"
606
+ class="form-control form-control-input-3"
607
+ value="<?php echo esc_attr( $wp_subscribe_reloaded->stcr->utils->stcr_get_menu_options( 'captcha_secret_key', '' ) ); ?>">
608
+
609
+ <div class="helpDescription subsOptDescriptions"
610
+ data-content="<?php _e( "The secret key for Google reCAPTCHA.", 'subscribe-to-comments-reloaded' ); ?>"
611
+ data-placement="right"
612
+ aria-label="<?php _e( "The secret key for Google reCAPTCHA.", 'subscribe-to-comments-reloaded' ); ?>">
613
+ <i class="fas fa-question-circle"></i>
614
+ </div>
615
+ </div>
616
+ </div>
617
+
618
+ <?php /* captcha options end */ ?>
619
+
620
  <div class="form-group row">
621
  <label for="unique_key" class="col-sm-3 col-form-label text-right">
622
  <?php _e( 'StCR Unique Key', 'subscribe-to-comments-reloaded' ) ?></label>
readme.txt CHANGED
@@ -7,7 +7,7 @@ Requires at least: 4.0
7
  Requires PHP: 5.6
8
  Requires MySQL: 5.6
9
  Tested up to: 5.6
10
- Stable tag: 200813
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -22,7 +22,6 @@ Subscribe to Comments Reloaded is a robust plugin that enables commenters to sig
22
  * MySQL 5.x or higher
23
 
24
  ## Main Features
25
- * Does not modify Wordpress core tables
26
  * Easily manage and search among your subscriptions
27
  * Imports Mark Jaquith's Subscribe To Comments (and its clones) data
28
  * Messages are fully customizable, no poEdit required (and you can use HTML!) with a Rich Text Editor - WYSIWYG
@@ -64,9 +63,6 @@ Just deactivate and activate the plugin and you are all set. The default value w
64
  = Aaargh! Were did all my subscriptions go? =
65
  No panic. If you upgraded from 1.6 or earlier to 2.0+, you need to deactivate/activate StCR, in order to update the DB structure. After the version 180212 a fix was applied so that you can see all the subscriptions.
66
 
67
- = How do I create a 'real' management page? =
68
- Please refer to [this page](https://github.com/stcr/subscribe-to-comments-reloaded/wiki/KB#create-a-real-management-page) for a detailed step-by-step description on how to do that
69
-
70
  = Can I customize the layout of the management page? =
71
  Yes, each HTML tag has a CSS class or ID that you can use to change its position or look-and-feel.
72
 
@@ -99,6 +95,15 @@ Just go to the Options Panel and click the generate button. By generating a new
99
  7. Manage the subscriptions on the Frontend Side.
100
 
101
  == Changelog ==
 
 
 
 
 
 
 
 
 
102
  = v200813 =
103
  * **Fix** Error when permanently deleting a post/page/... (related to WP 5.5 change in the "delete_post" hook coming with a 2nd parameter)
104
 
@@ -260,26 +265,4 @@ Just go to the Options Panel and click the generate button. By generating a new
260
 
261
  == Language Localization ==
262
 
263
- Subscribe to Comments Reloaded can speak your language! If you want to provide a localized file in your
264
- language, use the template files (.pot) you'll find inside the `langs` folder,
265
- and [contact me](http://subscribe-reloaded.com/contact/) once your
266
- localization is ready. Currently, we support the following languages:
267
-
268
- * Danish - [Torben Bendixen](http://www.freelancekonsulenten.dk/)
269
- * Dutch - [Martijn Chel](http://mcpnetwork.nl/),[Muratje](http://www.muromedia.nl/)
270
- * French - [Anthony](http://imnotgeek.com/), Goormand, Maxime
271
- * German - [derhenry](http://www.derhenry.net/2010/subscribe-to-comments-reloaded/), [Stefan](http://www.beedy.de/)
272
- * Indonesian - [The Masked Cat](http://themaskedcat.tk)
273
- * Italian - myself
274
- * Norwegian - [Odd Henriksen](http://www.oddhenriksen.net/)
275
- * Polish - [Robert Koeseling](http://www.katalogpodkastow.pl), [Filip Cierpich](http://keepmind.eu/)
276
- * Portuguese, Brazil - [Ronaldo Richieri](http://richieri.com), [ClassiNoiva](http://www.classinoiva.com.br), [Luciano](http://litemind.com/)
277
- * Portuguese, Portugal
278
- * Russian - [Marika Bukvonka](http://violetnotes.com)
279
- * Serbian - [Anna Swedziol](http://www.sneg.iz.rs/)
280
- * Spanish - [TodoWordPress team](http://www.todowp.org/), [Juan Luis Perez](http://www.juanluperez.com/), [Iván Ridao Freitas](http://ivanrf.com/)
281
- * Turkish - [MaD, Kali](http://www.dusunsel.com/)
282
- * Hebrew - [Ahrale Shrem](http://atar4u.com/), [Eitan Caspi](http://fudie.net/)
283
- * Hungarian - [László Tavaszi]
284
- * Czech - [Daniel Král](http://www.danielkral.cz/)
285
- * Persian - [Javad Hoseini-Nopendar](http://www.irannopendar.com/), [omid020](https://github.com/omid020)
7
  Requires PHP: 5.6
8
  Requires MySQL: 5.6
9
  Tested up to: 5.6
10
+ Stable tag: 210104
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
22
  * MySQL 5.x or higher
23
 
24
  ## Main Features
 
25
  * Easily manage and search among your subscriptions
26
  * Imports Mark Jaquith's Subscribe To Comments (and its clones) data
27
  * Messages are fully customizable, no poEdit required (and you can use HTML!) with a Rich Text Editor - WYSIWYG
63
  = Aaargh! Were did all my subscriptions go? =
64
  No panic. If you upgraded from 1.6 or earlier to 2.0+, you need to deactivate/activate StCR, in order to update the DB structure. After the version 180212 a fix was applied so that you can see all the subscriptions.
65
 
 
 
 
66
  = Can I customize the layout of the management page? =
67
  Yes, each HTML tag has a CSS class or ID that you can use to change its position or look-and-feel.
68
 
95
  7. Manage the subscriptions on the Frontend Side.
96
 
97
  == Changelog ==
98
+ = v210104 =
99
+ * **New** Google reCAPTCHA now available for the "subscribe without commenting" and "request management subscription" form (WP admin > StCR > Options)
100
+ * **Improvement** When using the checkbox (not the select box from advanced subscription) you can now select the subscription type (all or replies) (WP admin > StCR > Comment Form)
101
+ * **Improvement** [comment_author] can now be used in the Notification subject (WP admin > StCR > Notifications)
102
+ * **Improvement** Replaced final instances of jQuery code to be raw JavaScript (not rely on jQuery)
103
+ * **Fix** The form to "request management link" will now check if that email is a subscriber before sending a link
104
+ * **Fix** Issue with broken option tooltips on Notifications settings page
105
+ * **Tweak** Removed HTML comments around the plugin's output on the frontend
106
+
107
  = v200813 =
108
  * **Fix** Error when permanently deleting a post/page/... (related to WP 5.5 change in the "delete_post" hook coming with a 2nd parameter)
109
 
265
 
266
  == Language Localization ==
267
 
268
+ If you would like to help out translating the plugin to your language you can do so through the [official WordPress plugin translation system](https://translate.wordpress.org/projects/wp-plugins/subscribe-to-comments-reloaded/)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
subscribe-to-comments-reloaded.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Subscribe to Comments Reloaded
4
  * Description: Subscribe to Comments Reloaded is a robust plugin that enables commenters to sign up for e-mail notifications. It includes a full-featured subscription manager that your commenters can use to unsubscribe to certain posts or suspend all notifications.
5
- * Version: 200813
6
  * Author: WPKube
7
  * Author URI: http://wpkube.com/
8
  * License: GPL-2.0+
2
  /**
3
  * Plugin Name: Subscribe to Comments Reloaded
4
  * Description: Subscribe to Comments Reloaded is a robust plugin that enables commenters to sign up for e-mail notifications. It includes a full-featured subscription manager that your commenters can use to unsubscribe to certain posts or suspend all notifications.
5
+ * Version: 210104
6
  * Author: WPKube
7
  * Author URI: http://wpkube.com/
8
  * License: GPL-2.0+
templates/request-management-link.php CHANGED
@@ -16,6 +16,38 @@ $valid_all = true;
16
  $valid_email = true;
17
  $valid_challenge = true;
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  // get email if user known
20
  if ( isset( $current_user ) && $current_user->ID > 0 ) {
21
  $current_user_email = $current_user->data->user_email;
@@ -57,8 +89,19 @@ if ( ! empty( $email ) ) {
57
  $valid_all = false;
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
60
  if ( $valid_all ) {
61
-
62
  // Send management link
63
  $subject = html_entity_decode( stripslashes( get_option( 'subscribe_reloaded_management_subject', 'Manage your subscriptions on [blog_name]' ) ), ENT_QUOTES, 'UTF-8' );
64
  $page_message = html_entity_decode( stripslashes( get_option( 'subscribe_reloaded_management_content', '' ) ), ENT_QUOTES, 'UTF-8' );
@@ -146,6 +189,7 @@ if ( ! empty( $email ) ) {
146
  <p>
147
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
148
  </p>
 
149
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
150
  <?php else : ?>
151
  <p>
@@ -153,6 +197,7 @@ if ( ! empty( $email ) ) {
153
  <input id='subscribe_reloaded_email' type="email" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
154
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
155
  </p>
 
156
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
157
  <?php endif; ?>
158
 
@@ -194,6 +239,7 @@ if( ! $valid_all ) {
194
  <p>
195
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
196
  </p>
 
197
  <p class="notice-email-error" style='color: #f55252;font-weight:bold;'></p>
198
  <?php else : ?>
199
  <p>
@@ -201,6 +247,7 @@ if( ! $valid_all ) {
201
  <input id='subscribe_reloaded_email' type="email" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
202
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
203
  </p>
 
204
  <p class="notice-email-error" style='color: #f55252;font-weight:bold;'></p>
205
  <?php endif; ?>
206
 
@@ -212,6 +259,10 @@ if( ! $valid_all ) {
212
  <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
213
  <?php endif; ?>
214
 
 
 
 
 
215
  </fieldset>
216
  </form>
217
  <?php
16
  $valid_email = true;
17
  $valid_challenge = true;
18
 
19
+ // google recaptcha
20
+ $valid_captcha = true;
21
+ $captcha_output = '';
22
+ $use_captcha = get_option( 'subscribe_reloaded_use_captcha', 'no' );
23
+ $captcha_site_key = get_option( 'subscribe_reloaded_captcha_site_key', '' );
24
+ $captcha_secret_key = get_option( 'subscribe_reloaded_captcha_secret_key', '' );
25
+
26
+ // google recaptcha confirm
27
+ if ( $use_captcha == 'yes' ) {
28
+ $captcha_output .= '<div class="g-recaptcha" data-sitekey="' . $captcha_site_key . '"></div>';
29
+ if ( isset( $_POST['g-recaptcha-response'] ) ) {
30
+ $captcha = $_POST['g-recaptcha-response'];
31
+ $captcha_result = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array(
32
+ 'method' => 'POST',
33
+ 'body' => array(
34
+ 'secret' => $captcha_secret_key,
35
+ 'response' => $captcha,
36
+ )
37
+ ));
38
+ if ( is_wp_error( $captcha_result ) ) {
39
+ $valid_captcha = false;
40
+ } else {
41
+ $captcha_response = json_decode( $captcha_result['body'], true );
42
+ if ( ! $captcha_response['success'] ) {
43
+ $valid_captcha = false;
44
+ }
45
+ }
46
+ } else {
47
+ $valid_captcha = false;
48
+ }
49
+ }
50
+
51
  // get email if user known
52
  if ( isset( $current_user ) && $current_user->ID > 0 ) {
53
  $current_user_email = $current_user->data->user_email;
89
  $valid_all = false;
90
  }
91
 
92
+ // email is not subscribed
93
+ if ( ! $wp_subscribe_reloaded->stcr->utils->get_subscriber_key( $stcr_post_email ) ) {
94
+ $valid_email = false;
95
+ $valid_all = false;
96
+ }
97
+
98
+ // captcha is not valid
99
+ if ( ! $valid_captcha ) {
100
+ $valid_all = false;
101
+ }
102
+
103
  if ( $valid_all ) {
104
+
105
  // Send management link
106
  $subject = html_entity_decode( stripslashes( get_option( 'subscribe_reloaded_management_subject', 'Manage your subscriptions on [blog_name]' ) ), ENT_QUOTES, 'UTF-8' );
107
  $page_message = html_entity_decode( stripslashes( get_option( 'subscribe_reloaded_management_content', '' ) ), ENT_QUOTES, 'UTF-8' );
189
  <p>
190
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
191
  </p>
192
+ <?php echo $captcha_output; ?>
193
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
194
  <?php else : ?>
195
  <p>
197
  <input id='subscribe_reloaded_email' type="email" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
198
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
199
  </p>
200
+ <?php echo $captcha_output; ?>
201
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
202
  <?php endif; ?>
203
 
239
  <p>
240
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
241
  </p>
242
+ <?php echo $captcha_output; ?>
243
  <p class="notice-email-error" style='color: #f55252;font-weight:bold;'></p>
244
  <?php else : ?>
245
  <p>
247
  <input id='subscribe_reloaded_email' type="email" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
248
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php _e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
249
  </p>
250
+ <?php echo $captcha_output; ?>
251
  <p class="notice-email-error" style='color: #f55252;font-weight:bold;'></p>
252
  <?php endif; ?>
253
 
259
  <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
260
  <?php endif; ?>
261
 
262
+ <?php if ( ! $valid_captcha ) : ?>
263
+ <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
264
+ <?php endif; ?>
265
+
266
  </fieldset>
267
  </form>
268
  <?php
templates/subscribe.php CHANGED
@@ -13,6 +13,38 @@ $valid_all = true;
13
  $valid_email = true;
14
  $valid_challenge = true;
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  // get user email
17
  if ( isset($current_user) && $current_user->ID > 0 ) {
18
  $current_user_email = $current_user->data->user_email;
@@ -49,6 +81,11 @@ if ( ! empty( $email ) ) {
49
  $valid_email = false;
50
  $valid_all = false;
51
  }
 
 
 
 
 
52
 
53
  // email is valid
54
  if ( $valid_all ) {
@@ -164,11 +201,15 @@ if ( ! empty( $email ) ) {
164
  <p>
165
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
166
  </p>
 
167
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
168
  <?php else : ?>
169
- <label for="sre"><?php _e( 'Email', 'subscribe-to-comments-reloaded' ) ?></label>
170
- <input id='sre' type="text" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
171
- <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
 
 
 
172
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
173
  <?php endif; ?>
174
  </div>
@@ -207,11 +248,13 @@ if ( ! $valid_all ) {
207
  <p>
208
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
209
  </p>
 
210
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
211
  <?php else : ?>
212
  <label for="sre"><?php _e( 'Email', 'subscribe-to-comments-reloaded' ) ?></label>
213
  <input id='sre' type="text" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
214
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
 
215
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
216
  <?php endif; ?>
217
 
@@ -223,6 +266,10 @@ if ( ! $valid_all ) {
223
  <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
224
  <?php endif; ?>
225
 
 
 
 
 
226
  </fieldset>
227
  </form>
228
  <?php
13
  $valid_email = true;
14
  $valid_challenge = true;
15
 
16
+ // google recaptcha
17
+ $valid_captcha = true;
18
+ $captcha_output = '';
19
+ $use_captcha = get_option( 'subscribe_reloaded_use_captcha', 'no' );
20
+ $captcha_site_key = get_option( 'subscribe_reloaded_captcha_site_key', '' );
21
+ $captcha_secret_key = get_option( 'subscribe_reloaded_captcha_secret_key', '' );
22
+
23
+ // google recaptcha confirm
24
+ if ( $use_captcha == 'yes' ) {
25
+ $captcha_output .= '<div class="g-recaptcha" data-sitekey="' . $captcha_site_key . '"></div>';
26
+ if ( isset( $_POST['g-recaptcha-response'] ) ) {
27
+ $captcha = $_POST['g-recaptcha-response'];
28
+ $captcha_result = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array(
29
+ 'method' => 'POST',
30
+ 'body' => array(
31
+ 'secret' => $captcha_secret_key,
32
+ 'response' => $captcha,
33
+ )
34
+ ));
35
+ if ( is_wp_error( $captcha_result ) ) {
36
+ $valid_captcha = false;
37
+ } else {
38
+ $captcha_response = json_decode( $captcha_result['body'], true );
39
+ if ( ! $captcha_response['success'] ) {
40
+ $valid_captcha = false;
41
+ }
42
+ }
43
+ } else {
44
+ $valid_captcha = false;
45
+ }
46
+ }
47
+
48
  // get user email
49
  if ( isset($current_user) && $current_user->ID > 0 ) {
50
  $current_user_email = $current_user->data->user_email;
81
  $valid_email = false;
82
  $valid_all = false;
83
  }
84
+
85
+ // captcha is not valid
86
+ if ( ! $valid_captcha ) {
87
+ $valid_all = false;
88
+ }
89
 
90
  // email is valid
91
  if ( $valid_all ) {
201
  <p>
202
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
203
  </p>
204
+ <?php echo $captcha_output; ?>
205
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
206
  <?php else : ?>
207
+ <p>
208
+ <label for="sre"><?php _e( 'Email', 'subscribe-to-comments-reloaded' ) ?></label>
209
+ <input id='sre' type="text" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
210
+ <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
211
+ </p>
212
+ <?php echo $captcha_output; ?>
213
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
214
  <?php endif; ?>
215
  </div>
248
  <p>
249
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
250
  </p>
251
+ <?php echo $captcha_output; ?>
252
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
253
  <?php else : ?>
254
  <label for="sre"><?php _e( 'Email', 'subscribe-to-comments-reloaded' ) ?></label>
255
  <input id='sre' type="text" class="subscribe-form-field" name="sre" value="<?php echo esc_attr( $email ); ?>" size="22" required />
256
  <input name="submit" type="submit" class="subscribe-form-button" value="<?php esc_attr_e( 'Send', 'subscribe-to-comments-reloaded' ) ?>" />
257
+ <?php echo $captcha_output; ?>
258
  <p class="notice-email-error" style='color: #f55252;font-weight:bold; display: none;'></p>
259
  <?php endif; ?>
260
 
266
  <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
267
  <?php endif; ?>
268
 
269
+ <?php if ( ! $valid_captcha ) : ?>
270
+ <p style='color: #f55252;font-weight:bold;'><i class="fa fa-exclamation-triangle"></i> <?php _e("Challenge answer is not correct", 'subscribe-to-comments-reloaded') ?></p>
271
+ <?php endif; ?>
272
+
273
  </fieldset>
274
  </form>
275
  <?php
utils/stcr_utils.php CHANGED
@@ -620,13 +620,37 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_utils') )
620
  * @author reedyseth
621
  */
622
  public function register_plugin_scripts() {
 
623
  $stcr_font_awesome_css = plugins_url( 'subscribe-to-comments-reloaded/includes/css/font-awesome.min.css' );
624
  // Font Awesome
625
- if( get_option( 'subscribe_reloaded_enable_font_awesome' ) == "yes" )
626
- {
627
  wp_register_style( 'stcr-font-awesome', $stcr_font_awesome_css );
628
  wp_enqueue_style('stcr-font-awesome');
629
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  }
631
  /**
632
  * Enqueue `style for plugin pages
620
  * @author reedyseth
621
  */
622
  public function register_plugin_scripts() {
623
+
624
  $stcr_font_awesome_css = plugins_url( 'subscribe-to-comments-reloaded/includes/css/font-awesome.min.css' );
625
  // Font Awesome
626
+ if ( get_option( 'subscribe_reloaded_enable_font_awesome' ) == "yes" ) {
 
627
  wp_register_style( 'stcr-font-awesome', $stcr_font_awesome_css );
628
  wp_enqueue_style('stcr-font-awesome');
629
  }
630
+
631
+ // google recaptcha
632
+ if ( get_option( 'subscribe_reloaded_use_captcha', 'no' ) == 'yes' ) {
633
+
634
+ // management page permalink
635
+ $manager_page_permalink = get_option( 'subscribe_reloaded_manager_page', '/comment-subscriptions/' );
636
+ if ( function_exists( 'qtrans_convertURL' ) ) {
637
+ $manager_page_permalink = qtrans_convertURL( $manager_page_permalink );
638
+ }
639
+
640
+ // management page permalink fallback
641
+ if ( empty( $manager_page_permalink ) ) {
642
+ $manager_page_permalink = '/comment-subscriptions/';
643
+ }
644
+
645
+ // remove the ending slash so both variations (with and without slash) work in the strpos check below
646
+ $manager_page_permalink = rtrim( $manager_page_permalink, '/' );
647
+
648
+ // if we are on the management page, add the script
649
+ if ( strpos( $_SERVER["REQUEST_URI"], $manager_page_permalink ) !== false ) {
650
+ wp_enqueue_script( 'stcr-google-recaptcha', 'https://www.google.com/recaptcha/api.js' );
651
+ }
652
+ }
653
+
654
  }
655
  /**
656
  * Enqueue `style for plugin pages
wp_subscribe_reloaded.php CHANGED
@@ -8,7 +8,7 @@ if ( ! function_exists( 'add_action' ) ) {
8
  }
9
 
10
  // globals
11
- define( __NAMESPACE__.'\\VERSION','200813' );
12
  define( __NAMESPACE__.'\\DEVELOPMENT', false );
13
  define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
14
 
@@ -1436,6 +1436,7 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded') ) {
1436
 
1437
  // replace tags with their actual values
1438
  $subject = str_replace( '[post_title]', $post->post_title, $subject );
 
1439
  $subject = str_replace( '[blog_name]' , get_bloginfo('name'), $subject );
1440
  $message = str_replace( '[post_permalink]', $post_permalink, $message );
1441
  $message = str_replace( '[comment_permalink]', $comment_permalink, $message );
@@ -1632,14 +1633,10 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded') ) {
1632
  if( get_option('subscribe_reloaded_stcr_position') == 'yes' ) {
1633
  $output .= "<style type='text/css'>.stcr-hidden{display: none !important;}</style>";
1634
  $output .= "<div class='stcr-form stcr-hidden'>";
1635
- $output .= "<!-- Subscribe to Comments Reloaded version ". $wp_subscribe_reloaded->stcr->current_version . " -->";
1636
- $output .= "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
1637
- $output .= "<!-- Subscribe to comments Reloaded MP: '" . get_option( "subscribe_reloaded_manager_page" ) . "' -->";
1638
  $output .= "</div>";
1639
  } else {
1640
- $output .= "<!-- Subscribe to Comments Reloaded version ". $wp_subscribe_reloaded->stcr->current_version . " -->";
1641
- $output .= "<!-- Subscribe to comments Reloaded MP: '" . get_option( "subscribe_reloaded_manager_page" ) . "' -->";
1642
- $output .= "<!-- BEGIN: subscribe to comments reloaded -->" . $html_to_show . "<!-- END: subscribe to comments reloaded -->";
1643
  }
1644
 
1645
  // echo or return
@@ -1717,8 +1714,10 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded') ) {
1717
  */
1718
  public function move_form_with_js() {
1719
 
1720
- if( get_option('subscribe_reloaded_stcr_position') == 'yes' ) {
1721
- $output .= "<script type='text/javascript'>jQuery(document).ready(function($){var stcr_form=$('div.stcr-form');stcr_form.prevUntil('form').each(function(){var _this=$(this);if(_this.find(':input[type=\"submit\"]').length){stcr_form.remove(),_this.before(stcr_form);$('div.stcr-form').removeClass('stcr-hidden');return false;}})});</script>";
 
 
1722
  }
1723
 
1724
  echo $output;
8
  }
9
 
10
  // globals
11
+ define( __NAMESPACE__.'\\VERSION','210104' );
12
  define( __NAMESPACE__.'\\DEVELOPMENT', false );
13
  define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
14
 
1436
 
1437
  // replace tags with their actual values
1438
  $subject = str_replace( '[post_title]', $post->post_title, $subject );
1439
+ $subject = str_replace( '[comment_author]', $comment->comment_author, $subject );
1440
  $subject = str_replace( '[blog_name]' , get_bloginfo('name'), $subject );
1441
  $message = str_replace( '[post_permalink]', $post_permalink, $message );
1442
  $message = str_replace( '[comment_permalink]', $comment_permalink, $message );
1633
  if( get_option('subscribe_reloaded_stcr_position') == 'yes' ) {
1634
  $output .= "<style type='text/css'>.stcr-hidden{display: none !important;}</style>";
1635
  $output .= "<div class='stcr-form stcr-hidden'>";
1636
+ $output .= $html_to_show;
 
 
1637
  $output .= "</div>";
1638
  } else {
1639
+ $output .= $html_to_show;
 
 
1640
  }
1641
 
1642
  // echo or return
1714
  */
1715
  public function move_form_with_js() {
1716
 
1717
+ $output = '';
1718
+
1719
+ if ( get_option('subscribe_reloaded_stcr_position') == 'yes' ) {
1720
+ $output .= "<script type='text/javascript'>document.addEventListener('DOMContentLoaded',function(){let e=document.querySelectorAll('div.stcr-form')[0],t=document.querySelectorAll('#commentform input[type=submit]')[0];t.parentNode.insertBefore(e,t),e.classList.remove('stcr-hidden')});</script>";
1721
  }
1722
 
1723
  echo $output;