Subscribe2 - Version 10.18.1

Version Description

Download this release

Release Info

Developer tanaylakhani
Plugin Icon 128x128 Subscribe2
Version 10.18.1
Comparing to
See all releases

Code changes from version 10.18 to 10.18.1

ChangeLog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 10.18 =
2
 
3
  * Option to synch current subscriber list
1
+ = 10.18.1 =
2
+
3
+ * Bug Fixes
4
+
5
  = 10.18 =
6
 
7
  * Option to synch current subscriber list
ReadMe.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_butt
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
- Stable tag: 10.18
8
  License: GPL3
9
 
10
  Sends a list of subscribers an email notification when new posts are published to your blog. Automate user growth through ReadyGraph integration.
4
  Tags: posts, subscription, email, subscribe, notify, notification
5
  Requires at least: 3.3
6
  Tested up to: 3.9.1
7
+ Stable tag: 10.18.1
8
  License: GPL3
9
 
10
  Sends a list of subscribers an email notification when new posts are published to your blog. Automate user growth through ReadyGraph integration.
classes/class-s2-admin.php CHANGED
@@ -5,13 +5,12 @@ class s2_admin extends s2class {
5
  Hook the menu
6
  */
7
  function admin_menu() {
 
8
  global $menu_slug;
9
  add_menu_page(__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'),$menu_slug, NULL, S2URL . 'include/email_edit.png');
10
- if( file_exists(dirname(plugin_dir_path( __FILE__ ) ).'/readygraph-extension.php')) {
11
  $s2readygraph = add_submenu_page($menu_slug, __('Readygraph App', 'subscribe2'), __('Readygraph App', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), $menu_slug, array(&$this, 'readygraph_menu'), S2URL . 'include/email_edit.png');
12
- }
13
- else {
14
- }
15
  $s2user = add_submenu_page($menu_slug, __('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', array(&$this, 'user_menu'));
16
  add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
17
  add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
@@ -32,11 +31,30 @@ class s2_admin extends s2class {
32
 
33
  $s2mail = add_submenu_page($menu_slug, __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));
34
  add_action('load-' . $s2mail, array(&$this, 'mail_help'));
35
- if( file_exists(dirname(plugin_dir_path( __FILE__ ) ).'/readygraph-extension.php')) {
36
- global $menu_slug;
37
- $s2readygraph = add_submenu_page($menu_slug, __('Go Premium', 'subscribe2'), __('Go Premium', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), 'readygraph-go-premium', array(&$this, 'readygraph_premium'));
38
  }
39
- else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
  $s2nonce = wp_hash('subscribe2');
42
  } // end admin_menu()
5
  Hook the menu
6
  */
7
  function admin_menu() {
8
+ if( file_exists(dirname(plugin_dir_path( __FILE__ ) ).'/readygraph-extension.php')) {
9
  global $menu_slug;
10
  add_menu_page(__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'),$menu_slug, NULL, S2URL . 'include/email_edit.png');
11
+
12
  $s2readygraph = add_submenu_page($menu_slug, __('Readygraph App', 'subscribe2'), __('Readygraph App', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), $menu_slug, array(&$this, 'readygraph_menu'), S2URL . 'include/email_edit.png');
13
+
 
 
14
  $s2user = add_submenu_page($menu_slug, __('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', array(&$this, 'user_menu'));
15
  add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
16
  add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
31
 
32
  $s2mail = add_submenu_page($menu_slug, __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));
33
  add_action('load-' . $s2mail, array(&$this, 'mail_help'));
34
+ $s2readygraph = add_submenu_page($menu_slug, __('Go Premium', 'subscribe2'), __('Go Premium', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), 'readygraph-go-premium', array(&$this, 'readygraph_premium'));
 
 
35
  }
36
+ else {
37
+ add_menu_page(__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', NULL, S2URL . 'include/email_edit.png');
38
+
39
+ $s2user = add_submenu_page('s2', __('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', array(&$this, 'user_menu'), S2URL . 'include/email_edit.png');
40
+ add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
41
+ add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
42
+ add_action('load-' . $s2user, array(&$this, 'user_help'));
43
+
44
+ //add_action("admin_print_scripts-$s2readygraph", array(&$this, 'readygraph_js'));
45
+
46
+ $s2subscribers = add_submenu_page('s2', __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'subscribers_menu'));
47
+ add_action("admin_print_scripts-$s2subscribers", array(&$this, 'checkbox_form_js'));
48
+ add_action('load-' . $s2subscribers, array(&$this, 'subscribers_help'));
49
+
50
+ $s2settings = add_submenu_page('s2', __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'settings_menu'));
51
+ add_action("admin_print_scripts-$s2settings", array(&$this, 'checkbox_form_js'));
52
+ add_action("admin_print_scripts-$s2settings", array(&$this, 'option_form_js'));
53
+ add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
54
+ add_action('load-' . $s2settings, array(&$this, 'settings_help'));
55
+
56
+ $s2mail = add_submenu_page('s2', __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));
57
+ add_action('load-' . $s2mail, array(&$this, 'mail_help'));
58
  }
59
  $s2nonce = wp_hash('subscribe2');
60
  } // end admin_menu()
extension/readygraph/admin.php CHANGED
@@ -40,7 +40,7 @@ s2_rrmdir($dir);
40
  if (isset($_POST["readygraph_access_token"])) update_option('readygraph_access_token', $_POST["readygraph_access_token"]);
41
  if (isset($_POST["readygraph_refresh_token"])) update_option('readygraph_refresh_token', $_POST["readygraph_refresh_token"]);
42
  if (isset($_POST["readygraph_email"])) update_option('readygraph_email', $_POST["readygraph_email"]);
43
- if (isset($_POST["readygraph_application_id"])){ update_option('readygraph_application_id', $_POST["readygraph_application_id"]);s2_wordpress_sync_users($_POST["readygraph_application_id"]);}
44
  if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
45
  if (isset($_POST["readygraph_delay"])) update_option('readygraph_delay', 10000);
46
  if (isset($_POST["readygraph_enable_notification"])) update_option('readygraph_enable_notification', 'true');
@@ -88,6 +88,7 @@ s2_rrmdir($dir);
88
  - Send automatic email digests of all your site posts<br>
89
  - Get better deliverablility<br>
90
  - Track performace and user activity
 
91
  </p>
92
  </div>
93
 
40
  if (isset($_POST["readygraph_access_token"])) update_option('readygraph_access_token', $_POST["readygraph_access_token"]);
41
  if (isset($_POST["readygraph_refresh_token"])) update_option('readygraph_refresh_token', $_POST["readygraph_refresh_token"]);
42
  if (isset($_POST["readygraph_email"])) update_option('readygraph_email', $_POST["readygraph_email"]);
43
+ if (isset($_POST["readygraph_application_id"])){ update_option('readygraph_application_id', $_POST["readygraph_application_id"]);/*s2_wordpress_sync_users($_POST["readygraph_application_id"]);*/}
44
  if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
45
  if (isset($_POST["readygraph_delay"])) update_option('readygraph_delay', 10000);
46
  if (isset($_POST["readygraph_enable_notification"])) update_option('readygraph_enable_notification', 'true');
88
  - Send automatic email digests of all your site posts<br>
89
  - Get better deliverablility<br>
90
  - Track performace and user activity
91
+ - Automatically synchs with your current subscriber list
92
  </p>
93
  </div>
94
 
readygraph-extension.php CHANGED
@@ -255,6 +255,20 @@ function s2_post_updated_send_email( $post_id ) {
255
 
256
  add_action( 'publish_post', 's2_post_updated_send_email' );
257
  add_action( 'publish_page', 's2_post_updated_send_email' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  function s2_wordpress_sync_users( $app_id ){
259
  global $wpdb;
260
  $query = "SELECT email as email, date as user_date FROM {$wpdb->prefix}subscribe2 ";
@@ -267,5 +281,7 @@ function s2_wordpress_sync_users( $app_id ){
267
  }
268
  $url = 'https://readygraph.com/api/v1/wordpress-sync-enduser/';
269
  $response = wp_remote_post($url, array( 'body' => array('app_id' => $app_id, 'email' => rtrim($emails, ", "), 'user_registered' => rtrim($dates, ", "))));
 
 
270
  }
271
  ?>
255
 
256
  add_action( 'publish_post', 's2_post_updated_send_email' );
257
  add_action( 'publish_page', 's2_post_updated_send_email' );
258
+
259
+ if(get_option('s2_wordpress_sync_users')){}
260
+ else{
261
+ add_action('plugins_loaded', 'rg_s2_get_version');
262
+ }
263
+ function rg_s2_get_version() {
264
+ if(get_option('s2_wordpress_sync_users') && get_option('s2_wordpress_sync_users') == "true")
265
+ {}
266
+ else {
267
+ if(get_option('readygraph_application_id') && strlen(get_option('readygraph_application_id')) > 0){
268
+ s2_wordpress_sync_users(get_option('readygraph_application_id'));
269
+ }
270
+ }
271
+ }
272
  function s2_wordpress_sync_users( $app_id ){
273
  global $wpdb;
274
  $query = "SELECT email as email, date as user_date FROM {$wpdb->prefix}subscribe2 ";
281
  }
282
  $url = 'https://readygraph.com/api/v1/wordpress-sync-enduser/';
283
  $response = wp_remote_post($url, array( 'body' => array('app_id' => $app_id, 'email' => rtrim($emails, ", "), 'user_registered' => rtrim($dates, ", "))));
284
+ update_option('s2_wordpress_sync_users',"true");
285
+ remove_action('plugins_loaded', 'rg_s2_get_version');
286
  }
287
  ?>
subscribe2.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
- Version: 10.18
7
  Author: Matthew Robinson, Tanay Lakhani
8
  Author URI: http://subscribe2.wordpress.com
9
  Licence: GPL3
@@ -55,7 +55,7 @@ if ( is_plugin_active_for_network(plugin_basename(__FILE__)) ) {
55
 
56
  // our version number. Don't touch this or any line below
57
  // unless you know exactly what you are doing
58
- define( 'S2VERSION', '10.18' );
59
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
60
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
61
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
@@ -125,4 +125,5 @@ delete_option('readygraph_send_real_time_post_updates');
125
  delete_option('readygraph_popup_template');
126
  delete_option('readygraph_upgrade_notice');
127
  }
 
128
  ?>
3
  Plugin Name: Subscribe2
4
  Plugin URI: http://subscribe2.wordpress.com
5
  Description: Notifies an email list when new entries are posted.
6
+ Version: 10.18.1
7
  Author: Matthew Robinson, Tanay Lakhani
8
  Author URI: http://subscribe2.wordpress.com
9
  Licence: GPL3
55
 
56
  // our version number. Don't touch this or any line below
57
  // unless you know exactly what you are doing
58
+ define( 'S2VERSION', '10.18.1' );
59
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
60
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
61
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
125
  delete_option('readygraph_popup_template');
126
  delete_option('readygraph_upgrade_notice');
127
  }
128
+
129
  ?>