Subscribe To Comments Reloaded - Version 190529

Version Description

Download this release

Release Info

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

Code changes from version 190523 to 190529

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.2
10
- Stable tag: 190523
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -100,6 +100,10 @@ Just go to the Options Panel and click the generate button. By generating a new
100
 
101
  == Changelog ==
102
 
 
 
 
 
103
  = v190523 =
104
  * **Fix** Remove the old system information functionality
105
 
7
  Requires PHP: 5.6
8
  Requires MySQL: 5.6
9
  Tested up to: 5.2
10
+ Stable tag: 190529
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
100
 
101
  == Changelog ==
102
 
103
+ = v190529 =
104
+ * **Fix** Issue with being unable to dismiss admin notices shown by StCR
105
+ * **Fix** Virtual management page was still being shown even when disabled
106
+
107
  = v190523 =
108
  * **Fix** Remove the old system information functionality
109
 
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: 190523
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: 190529
6
  * Author: WPKube
7
  * Author URI: http://wpkube.com/
8
  * License: GPL-2.0+
utils/stcr_utils.php CHANGED
@@ -548,19 +548,23 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_utils') )
548
  */
549
  public function register_admin_scripts( $hook ) {
550
 
 
 
 
 
 
 
 
 
 
 
551
  // check if we're on our pages
552
  if ( strpos( $hook, 'stcr' ) !== false ) {
553
-
554
- // paths
555
- $stcr_admin_js = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/js/stcr-admin.js';
556
- $stcr_admin_css = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/css/stcr-admin-style.css';
557
 
558
- // scripts
559
- wp_register_script('stcr-admin-js', $stcr_admin_js, array( 'jquery' ) );
560
  wp_enqueue_script('stcr-admin-js');
561
 
562
- // styles
563
- wp_register_style( 'stcr-admin-style', $stcr_admin_css );
564
  wp_enqueue_style('stcr-admin-style');
565
 
566
  }
@@ -710,12 +714,16 @@ if( ! class_exists('\\'.__NAMESPACE__.'\\stcr_utils') )
710
  $notices = get_option( 'subscribe_reloaded_deferred_admin_notices' );
711
  foreach ( $notices as $key => $notice ) {
712
  if ( $key == $_name ) {
713
- $notices[ $key ] = array(
714
- "status" => $_status,
715
- "message" => $notice['message'],
716
- "type" => $notice['type'],
717
- "nonce" => $_nonce
718
- );
 
 
 
 
719
  }
720
  }
721
  update_option( 'subscribe_reloaded_deferred_admin_notices', $notices );
548
  */
549
  public function register_admin_scripts( $hook ) {
550
 
551
+ // paths
552
+ $stcr_admin_js = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/js/stcr-admin.js';
553
+ $stcr_admin_css = ( is_ssl() ? str_replace( 'http://', 'https://', WP_PLUGIN_URL ) : WP_PLUGIN_URL ) . '/subscribe-to-comments-reloaded/includes/css/stcr-admin-style.css';
554
+
555
+ // register scripts
556
+ wp_register_script('stcr-admin-js', $stcr_admin_js, array( 'jquery' ) );
557
+
558
+ // rergister styles
559
+ wp_register_style( 'stcr-admin-style', $stcr_admin_css );
560
+
561
  // check if we're on our pages
562
  if ( strpos( $hook, 'stcr' ) !== false ) {
 
 
 
 
563
 
564
+ // enqueue scripts
 
565
  wp_enqueue_script('stcr-admin-js');
566
 
567
+ // enqueue styles
 
568
  wp_enqueue_style('stcr-admin-style');
569
 
570
  }
714
  $notices = get_option( 'subscribe_reloaded_deferred_admin_notices' );
715
  foreach ( $notices as $key => $notice ) {
716
  if ( $key == $_name ) {
717
+ if ( $_status == 'read' ) {
718
+ unset( $notices[$key] );
719
+ } else {
720
+ $notices[ $key ] = array(
721
+ "status" => $_status,
722
+ "message" => $notice['message'],
723
+ "type" => $notice['type'],
724
+ "nonce" => $_nonce
725
+ );
726
+ }
727
  }
728
  }
729
  update_option( 'subscribe_reloaded_deferred_admin_notices', $notices );
wp_subscribe_reloaded.php CHANGED
@@ -6,7 +6,7 @@ if ( ! function_exists( 'add_action' ) ) {
6
  exit;
7
  }
8
 
9
- define( __NAMESPACE__.'\\VERSION','190523' );
10
  define( __NAMESPACE__.'\\DEVELOPMENT', true );
11
  define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
12
 
@@ -83,20 +83,25 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
83
 
84
  // Provide content for the management page using WP filters
85
  if ( ! is_admin() ) {
 
 
86
  $manager_page_permalink = get_option( 'subscribe_reloaded_manager_page', '/comment-subscriptions/' );
87
  if ( function_exists( 'qtrans_convertURL' ) ) {
88
  $manager_page_permalink = qtrans_convertURL( $manager_page_permalink );
89
- }
90
  if ( empty( $manager_page_permalink ) ) {
91
  // Manager page can't be empty, set it to default.
92
  $manager_page_permalink = '/comment-subscriptions/';
93
  }
94
 
 
95
  if ( ( strpos( $_SERVER["REQUEST_URI"], $manager_page_permalink ) !== false ) ) {
96
  add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 );
97
- }
 
98
  // Enqueue plugin scripts
99
- $this->utils->hook_plugin_scripts();
 
100
  } else {
101
  // Hook for WPMU - New blog created
102
  add_action( 'wpmu_new_blog', array( $this, 'new_blog' ), 10, 1 );
@@ -512,15 +517,19 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
512
  * Displays the appropriate management page
513
  */
514
  public function subscribe_reloaded_manage( $_posts = '', $_query = '' ) {
 
515
  global $current_user;
516
  $stcr_unique_key = get_option( "subscribe_reloaded_unique_key" );
517
  $date = date_i18n( 'Y-m-d H:i:s' );
518
  $error_exits = false;
519
  $email = '';
 
520
 
521
- if ( ! isset( $_posts ) && ! empty( $_posts ) ) {
 
522
  return $_posts;
523
  }
 
524
  try {
525
 
526
  $post_ID = !empty($_POST['srp']) ? intval($_POST['srp']) : (!empty($_GET['srp']) ? intval($_GET['srp']) : 0);
@@ -579,9 +588,6 @@ if(!class_exists('\\'.__NAMESPACE__.'\\wp_subscribe_reloaded')) {
579
  }
580
  }
581
 
582
-
583
-
584
-
585
  if ($error_exits) {
586
  $include_post_content = include WP_PLUGIN_DIR . '/subscribe-to-comments-reloaded/templates/key_expired.php';
587
  } else {
6
  exit;
7
  }
8
 
9
+ define( __NAMESPACE__.'\\VERSION','190529' );
10
  define( __NAMESPACE__.'\\DEVELOPMENT', true );
11
  define( __NAMESPACE__.'\\SLUG', "subscribe-to-comments-reloaded" );
12
 
83
 
84
  // Provide content for the management page using WP filters
85
  if ( ! is_admin() ) {
86
+
87
+ // The URL to the front-end subscription management page
88
  $manager_page_permalink = get_option( 'subscribe_reloaded_manager_page', '/comment-subscriptions/' );
89
  if ( function_exists( 'qtrans_convertURL' ) ) {
90
  $manager_page_permalink = qtrans_convertURL( $manager_page_permalink );
91
+ }
92
  if ( empty( $manager_page_permalink ) ) {
93
  // Manager page can't be empty, set it to default.
94
  $manager_page_permalink = '/comment-subscriptions/';
95
  }
96
 
97
+ // If current URL matches the subscription URL, filter it
98
  if ( ( strpos( $_SERVER["REQUEST_URI"], $manager_page_permalink ) !== false ) ) {
99
  add_filter( 'the_posts', array( $this, 'subscribe_reloaded_manage' ), 10, 2 );
100
+ }
101
+
102
  // Enqueue plugin scripts
103
+ $this->utils->hook_plugin_scripts();
104
+
105
  } else {
106
  // Hook for WPMU - New blog created
107
  add_action( 'wpmu_new_blog', array( $this, 'new_blog' ), 10, 1 );
517
  * Displays the appropriate management page
518
  */
519
  public function subscribe_reloaded_manage( $_posts = '', $_query = '' ) {
520
+
521
  global $current_user;
522
  $stcr_unique_key = get_option( "subscribe_reloaded_unique_key" );
523
  $date = date_i18n( 'Y-m-d H:i:s' );
524
  $error_exits = false;
525
  $email = '';
526
+ $virtual_page_enabled = get_option( 'subscribe_reloaded_manager_page_enabled', 'yes' );
527
 
528
+ // if something exists at this URL and virtual page disabled, abort mission
529
+ if ( ! empty( $_posts ) && $virtual_page_enabled == 'no' ) {
530
  return $_posts;
531
  }
532
+
533
  try {
534
 
535
  $post_ID = !empty($_POST['srp']) ? intval($_POST['srp']) : (!empty($_GET['srp']) ? intval($_GET['srp']) : 0);
588
  }
589
  }
590
 
 
 
 
591
  if ($error_exits) {
592
  $include_post_content = include WP_PLUGIN_DIR . '/subscribe-to-comments-reloaded/templates/key_expired.php';
593
  } else {