WP Subscribe - Version 1.2.10

Version Description

  • Changed admin notices
Download this release

Release Info

Developer MyThemeShop
Plugin Icon 128x128 WP Subscribe
Version 1.2.10
Comparing to
See all releases

Code changes from version 1.2.9 to 1.2.10

assets/js/wp-subscribe-admin.js CHANGED
@@ -195,4 +195,18 @@ Author URI: http://mythemeshop.com/
195
  e.preventDefault();
196
  });
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }( jQuery ) );
195
  e.preventDefault();
196
  });
197
 
198
+ jQuery(document).on('click', '.wpsubscribe-dismiss-notice', function(e){
199
+ e.preventDefault();
200
+ jQuery(this).parent().remove();
201
+ jQuery.ajax({
202
+ type: "POST",
203
+ url: ajaxurl,
204
+ data: {
205
+ action: 'mts_dismiss_wpsubscribe_notice',
206
+ dismiss: jQuery(this).data('ignore')
207
+ }
208
+ });
209
+ return false;
210
+ });
211
+
212
  }( jQuery ) );
includes/wps-widget.php CHANGED
@@ -78,15 +78,12 @@ class wp_subscribe extends WP_Widget {
78
  * @return void
79
  */
80
  function enqueue_scripts() {
81
-
82
- $screen = get_current_screen();
83
- $current_filter = current_filter();
84
-
85
- if ( 'widgets' === $screen->id || 'customize_controls_enqueue_scripts' === $current_filter ) {
86
-
87
- wp_enqueue_style( 'wp-subscribe-options', wps()->plugin_url() . '/assets/css/wp-subscribe-options.css' );
88
- wp_enqueue_script( 'wp-subscribe-admin', wps()->plugin_url() . '/assets/js/wp-subscribe-admin.js', array( 'jquery' ) );
89
- }
90
  }
91
 
92
  /**
78
  * @return void
79
  */
80
  function enqueue_scripts() {
81
+ $screen = get_current_screen();
82
+ $current_filter = current_filter();
83
+ if ( 'widgets' === $screen->id || 'customize_controls_enqueue_scripts' === $current_filter ) {
84
+ wp_enqueue_style( 'wp-subscribe-options', wps()->plugin_url() . '/assets/css/wp-subscribe-options.css' );
85
+ }
86
+ wp_enqueue_script( 'wp-subscribe-admin', wps()->plugin_url() . '/assets/js/wp-subscribe-admin.js', array( 'jquery' ) );
 
 
 
87
  }
88
 
89
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ Creator's website link: http://mythemeshop.com/plugins/wp-subscribe/
4
  Tags: subscribe, subscription, subscription box, newsletter, subscribe widget, mailchimp, aweber, feedburner,
5
  Requires at least: 4.0
6
  Tested up to: 4.9.1
7
- Stable tag: 1.2.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -82,6 +82,9 @@ Please disable all plugins and check if plugin is working properly. Then you can
82
 
83
  == Changelog ==
84
 
 
 
 
85
  = 1.2.9 =
86
  * Updated admin notices
87
 
4
  Tags: subscribe, subscription, subscription box, newsletter, subscribe widget, mailchimp, aweber, feedburner,
5
  Requires at least: 4.0
6
  Tested up to: 4.9.1
7
+ Stable tag: 1.2.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
82
 
83
  == Changelog ==
84
 
85
+ = 1.2.10 =
86
+ * Changed admin notices
87
+
88
  = 1.2.9 =
89
  * Updated admin notices
90
 
wp-subscribe.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Subscribe
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-subscribe/
5
  * Description: WP Subscribe is a simple but powerful subscription plugin which supports MailChimp, Aweber and Feedburner.
6
- * Version: 1.2.9
7
  * Author: MyThemeShop
8
  * Author URI: http://mythemeshop.com/
9
  * Text Domain: wp-subscribe
@@ -27,7 +27,7 @@ if( ! class_exists('MTS_WP_Subscribe') ) :
27
  * Plugin Version
28
  * @var string
29
  */
30
- private $version = '1.2.9';
31
 
32
  /**
33
  * Hold an instance of MTS_WP_Subscribe class
@@ -111,7 +111,7 @@ if( ! class_exists('MTS_WP_Subscribe') ) :
111
 
112
  /* Display a notice */
113
  $this->add_action('admin_notices', 'wp_subscribe_admin_notice');
114
- $this->add_action('admin_init', 'wp_subscribe_admin_notice_ignore');
115
  }
116
 
117
  public function wp_subscribe_admin_notice() {
@@ -121,7 +121,7 @@ if( ! class_exists('MTS_WP_Subscribe') ) :
121
  /* Only show the notice 2 days after plugin activation */
122
  if ( ! get_user_meta($user_id, 'wp_subscribe_ignore_notice') && time() >= (get_option( 'wp_subscribe_activated', 0 ) + (2 * 24 * 60 * 60)) ) {
123
  echo '<div class="updated notice-info wp-subscribe-notice" id="wpsubscribe-notice" style="position:relative;">';
124
- printf(__('<p>Like WP Subscribe plugin? You will LOVE <a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro!</strong></a></p><a class="notice-dismiss" href="%1$s"></a>', 'wp-subscribe'), '?wp_subscribe_admin_notice_ignore=0');
125
  echo "</div>";
126
  }
127
  /* Other notice appears right after activating */
@@ -133,7 +133,7 @@ if( ! class_exists('MTS_WP_Subscribe') ) :
133
  echo '<p>';
134
  _e('Thank you for trying WP Subscribe. We hope you will like it.', 'wp-subscribe');
135
  echo '</p>';
136
- echo '<a class="notice-dismiss" href="?wp_subscribe_admin_notice_ignore=0"></a>';
137
  echo "</div>";
138
  }
139
  }
@@ -142,10 +142,10 @@ if( ! class_exists('MTS_WP_Subscribe') ) :
142
  global $current_user;
143
  $user_id = $current_user->ID;
144
  /* If user clicks to ignore the notice, add that to their user meta */
145
- if ( isset($_GET['wp_subscribe_admin_notice_ignore']) ) {
146
- if ( '0' == $_GET['wp_subscribe_admin_notice_ignore'] ) {
147
  add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
148
- } elseif ( '1' == $_GET['wp_subscribe_admin_notice_ignore'] ) {
149
  add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
150
  }
151
  }
3
  * Plugin Name: WP Subscribe
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-subscribe/
5
  * Description: WP Subscribe is a simple but powerful subscription plugin which supports MailChimp, Aweber and Feedburner.
6
+ * Version: 1.2.10
7
  * Author: MyThemeShop
8
  * Author URI: http://mythemeshop.com/
9
  * Text Domain: wp-subscribe
27
  * Plugin Version
28
  * @var string
29
  */
30
+ private $version = '1.2.10';
31
 
32
  /**
33
  * Hold an instance of MTS_WP_Subscribe class
111
 
112
  /* Display a notice */
113
  $this->add_action('admin_notices', 'wp_subscribe_admin_notice');
114
+ $this->add_action('wp_ajax_mts_dismiss_wpsubscribe_notice', 'wp_subscribe_admin_notice_ignore');
115
  }
116
 
117
  public function wp_subscribe_admin_notice() {
121
  /* Only show the notice 2 days after plugin activation */
122
  if ( ! get_user_meta($user_id, 'wp_subscribe_ignore_notice') && time() >= (get_option( 'wp_subscribe_activated', 0 ) + (2 * 24 * 60 * 60)) ) {
123
  echo '<div class="updated notice-info wp-subscribe-notice" id="wpsubscribe-notice" style="position:relative;">';
124
+ echo __('<p>Like WP Subscribe plugin? You will LOVE <a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro!</strong></a></p><a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="0" href="#"></a>', 'wp-subscribe');
125
  echo "</div>";
126
  }
127
  /* Other notice appears right after activating */
133
  echo '<p>';
134
  _e('Thank you for trying WP Subscribe. We hope you will like it.', 'wp-subscribe');
135
  echo '</p>';
136
+ echo '<a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="1" href="#"></a>';
137
  echo "</div>";
138
  }
139
  }
142
  global $current_user;
143
  $user_id = $current_user->ID;
144
  /* If user clicks to ignore the notice, add that to their user meta */
145
+ if ( isset($_POST['dismiss']) ) {
146
+ if ( '0' == $_POST['dismiss'] ) {
147
  add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
148
+ } elseif ( '1' == $_POST['dismiss'] ) {
149
  add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
150
  }
151
  }