Subscribe2 - Version 10.11

Version Description

Download this release

Release Info

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

Code changes from version 10.10 to 10.11

ChangeLog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  = Version 10.10 =
2
 
3
  * Send blog updates to readygraph for weekly digest. You can turn it off from readygraph settings page.
1
+ = Version 10.11 =
2
+
3
+ * 2-way synchronization with readygraph popup
4
+ * Performance update for faster javascript load.
5
+ * contact information for readygraph
6
+
7
  = Version 10.10 =
8
 
9
  * Send blog updates to readygraph for weekly digest. You can turn it off from readygraph settings page.
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.10
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.
@@ -62,6 +62,9 @@ Track daily-new subscribers, daily invites, total traffic, and other key metrics
62
  = Newsfeed =
63
 
64
  ReadyGraph’s newsfeed is an optional overlay on your site where your users can engage with others in your community and recommend your content or products to each other. It is like having a social network that engages users embedded on your site. Users can leave comments, ‘like’ comments left by other subscribers and ‘follow’ other subscribers. Subscribers will receive automated email updates based on these actions.
 
 
 
65
  == Installation ==
66
 
67
  = AUTOMATIC INSTALLATION =
@@ -90,6 +93,8 @@ This token will automatically be replaced by dynamic subscription information an
90
 
91
  == Frequently Asked Questions ==
92
 
 
 
93
  [Visit FAQ site](http://subscribe2.wordpress.com/support/faqs/)
94
 
95
  == Screenshots ==
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.11
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.
62
  = Newsfeed =
63
 
64
  ReadyGraph’s newsfeed is an optional overlay on your site where your users can engage with others in your community and recommend your content or products to each other. It is like having a social network that engages users embedded on your site. Users can leave comments, ‘like’ comments left by other subscribers and ‘follow’ other subscribers. Subscribers will receive automated email updates based on these actions.
65
+
66
+ If you have questions or concerns contact us anytime at [info@readygraph.com](mailto:info@readygraph.com)
67
+
68
  == Installation ==
69
 
70
  = AUTOMATIC INSTALLATION =
93
 
94
  == Frequently Asked Questions ==
95
 
96
+ If you have questions or concerns contact us anytime at [info@readygraph.com](mailto:info@readygraph.com)
97
+
98
  [Visit FAQ site](http://subscribe2.wordpress.com/support/faqs/)
99
 
100
  == Screenshots ==
extension/readygraph/admin.php CHANGED
@@ -13,6 +13,8 @@
13
  */
14
 
15
  function changeAccount(){
 
 
16
  delete_option('readygraph_access_token');
17
  delete_option('readygraph_application_id');
18
  delete_option('readygraph_refresh_token');
@@ -47,7 +49,11 @@ wp_clear_scheduled_hook( 'rg_cron_hook' );
47
  if (isset($_POST["readygraph_email"])) update_option('readygraph_email', $_POST["readygraph_email"]);
48
  if (isset($_POST["readygraph_application_id"])) update_option('readygraph_application_id', $_POST["readygraph_application_id"]);
49
  if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
50
- if (isset($_POST["readygraph_delay"])) update_option('readygraph_delay', $_POST["delay"]);
 
 
 
 
51
  if (isset($_POST["readygraph_enable_notification"])) update_option('readygraph_enable_notification', $_POST["notification"]);
52
  if (isset($_POST["readygraph_enable_sidebar"])) update_option('readygraph_enable_sidebar', $_POST["sidebar"]);
53
  if (isset($_POST["readygraph_auto_select_all"])) update_option('readygraph_auto_select_all', $_POST["selectAll"]);
@@ -107,7 +113,7 @@ wp_clear_scheduled_hook( 'rg_cron_hook' );
107
  <p><h3>Signup for these benefits:</h3></p>
108
  <p>ReadyGraph is a tool to automate the growth of your site’s userbase. It is optimized to deliver audience growth and motivate users to consistently revisit your site.</p><br /><p><b>Optimized Signup Form –</b> ReadyGraph’s signup form with intelligent pop-up functionality and one-click login is designed to maximize signup s to your email list.<br /><br />
109
  <b>Viral Friend Invites –</b> ReadyGraph adds a friend invite process to your site’s signup flow. We then power the entire viral loop by sending invitations that encourage your visitors’ friends to signup for your site.<br /><br /><b>Automated Re-engagement Emails –</b> ReadyGraph’s automated email system encourages visitors to return to your site. Users receive optimized emails such as a welcome email, re-engagement email, regular digest with new content from your blog, and social emails. All emails are configurable including the ability to turn on and off individual campaigns.<br /><br /><b>Analytics -</b> Track daily-new subscribers, daily invites, total traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data in the cloud so you can access data from anywhere. <br /><br />
110
- Questions, feel free to email us at nick@readygraph.com</p>
111
  </div>
112
  </div>
113
  </div>
@@ -209,17 +215,18 @@ Questions, feel free to email us at nick@readygraph.com</p>
209
  <select class="selectAll" name="selectAll" class="form-control">
210
  <option value="true">YES</option>
211
  <option value="false">NO</option>
212
- </select></p>
213
  <p>Show Powered by Readygraph on popup:
214
  <select class="branding" name="branding" class="form-control">
215
  <option value="true">YES</option>
216
  <option value="false">NO</option>
217
- </select></p>
218
  <p>Include blog updates in weekly email digest of Readygraph:
219
  <select class="blog_updates" name="blog_updates" class="form-control">
220
  <option value="true">YES</option>
221
  <option value="false">NO</option>
222
- </select></p>
 
223
  </div>
224
  <button type="button" class="btn btn-large btn-warning save" style="float: right;">Save Changes</button>
225
  </td>
13
  */
14
 
15
  function changeAccount(){
16
+ $app_id = get_option('readygraph_application_id');
17
+ wp_remote_get( "http://readygraph.com/api/v1/tracking?event=disconnect_readygraph&app_id=$app_id" );
18
  delete_option('readygraph_access_token');
19
  delete_option('readygraph_application_id');
20
  delete_option('readygraph_refresh_token');
49
  if (isset($_POST["readygraph_email"])) update_option('readygraph_email', $_POST["readygraph_email"]);
50
  if (isset($_POST["readygraph_application_id"])) update_option('readygraph_application_id', $_POST["readygraph_application_id"]);
51
  if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
52
+ if (isset($_POST["readygraph_delay"])) {
53
+ update_option('readygraph_delay', $_POST["delay"]);
54
+ $app_id = get_option('readygraph_application_id');
55
+ if ($_POST["delay"] >= 20000) wp_remote_get( "http://readygraph.com/api/v1/tracking?event=popup_delay&app_id=$app_id" );
56
+ }
57
  if (isset($_POST["readygraph_enable_notification"])) update_option('readygraph_enable_notification', $_POST["notification"]);
58
  if (isset($_POST["readygraph_enable_sidebar"])) update_option('readygraph_enable_sidebar', $_POST["sidebar"]);
59
  if (isset($_POST["readygraph_auto_select_all"])) update_option('readygraph_auto_select_all', $_POST["selectAll"]);
113
  <p><h3>Signup for these benefits:</h3></p>
114
  <p>ReadyGraph is a tool to automate the growth of your site’s userbase. It is optimized to deliver audience growth and motivate users to consistently revisit your site.</p><br /><p><b>Optimized Signup Form –</b> ReadyGraph’s signup form with intelligent pop-up functionality and one-click login is designed to maximize signup s to your email list.<br /><br />
115
  <b>Viral Friend Invites –</b> ReadyGraph adds a friend invite process to your site’s signup flow. We then power the entire viral loop by sending invitations that encourage your visitors’ friends to signup for your site.<br /><br /><b>Automated Re-engagement Emails –</b> ReadyGraph’s automated email system encourages visitors to return to your site. Users receive optimized emails such as a welcome email, re-engagement email, regular digest with new content from your blog, and social emails. All emails are configurable including the ability to turn on and off individual campaigns.<br /><br /><b>Analytics -</b> Track daily-new subscribers, daily invites, total traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data in the cloud so you can access data from anywhere. <br /><br />
116
+ If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a></p>
117
  </div>
118
  </div>
119
  </div>
215
  <select class="selectAll" name="selectAll" class="form-control">
216
  <option value="true">YES</option>
217
  <option value="false">NO</option>
218
+ </select></p><br />
219
  <p>Show Powered by Readygraph on popup:
220
  <select class="branding" name="branding" class="form-control">
221
  <option value="true">YES</option>
222
  <option value="false">NO</option>
223
+ </select></p><br />
224
  <p>Include blog updates in weekly email digest of Readygraph:
225
  <select class="blog_updates" name="blog_updates" class="form-control">
226
  <option value="true">YES</option>
227
  <option value="false">NO</option>
228
+ </select></p><br />
229
+ <p>If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a></p><br />
230
  </div>
231
  <button type="button" class="btn btn-large btn-warning save" style="float: right;">Save Changes</button>
232
  </td>
extension/readygraph/extension.php CHANGED
@@ -168,10 +168,11 @@ function readygraph_client_script_head() {
168
  </style>
169
  <?php } ?>
170
  <script type='text/javascript'>
 
171
  var d = top.document;
172
  var h = d.getElementsByTagName('head')[0], script = d.createElement('script');
173
  script.type = 'text/javascript';
174
- script.src = '//readygraph.com/scripts/readygraph.js';
175
  script.onload = function(e) {
176
  var settings = <?php echo str_replace("\\\"", "\"", get_option('readygraph_settings', '{}')) ?>;
177
  settings['applicationId'] = '<?php echo get_option('readygraph_application_id', '') ?>';
@@ -188,13 +189,22 @@ script.onload = function(e) {
188
  function process(userInfo) {
189
  //<?php echo $readygraph_email_subscribe ?>
190
  //subscribe(userInfo.get('email'), userInfo.get('first_name'), userInfo.get('last_name'));
191
- var email = userInfo.get('email');
192
  var first_name = userInfo.get('first_name');
193
  var last_name = userInfo.get('last_name');
194
-
195
- //alert(email);
196
- //alert(first_name);
197
- //alert(last_name);
 
 
 
 
 
 
 
 
 
198
  }
199
  readygraph.framework.authentication.getUserInfo(function(userInfo) {
200
  if (userInfo.get('uid') != null) {
168
  </style>
169
  <?php } ?>
170
  <script type='text/javascript'>
171
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
172
  var d = top.document;
173
  var h = d.getElementsByTagName('head')[0], script = d.createElement('script');
174
  script.type = 'text/javascript';
175
+ script.src = '//cdn.readygraph.com/scripts/readygraph.js';
176
  script.onload = function(e) {
177
  var settings = <?php echo str_replace("\\\"", "\"", get_option('readygraph_settings', '{}')) ?>;
178
  settings['applicationId'] = '<?php echo get_option('readygraph_application_id', '') ?>';
189
  function process(userInfo) {
190
  //<?php echo $readygraph_email_subscribe ?>
191
  //subscribe(userInfo.get('email'), userInfo.get('first_name'), userInfo.get('last_name'));
192
+ var rg_email = userInfo.get('email');
193
  var first_name = userInfo.get('first_name');
194
  var last_name = userInfo.get('last_name');
195
+ //alert(rg_email);
196
+ //var ajaxurl = 'http://readygraph.arhaminfotech.com/wp-admin/admin-ajax.php';
197
+ //alert('unfinished1');
198
+ jQuery.post(ajaxurl,
199
+ {
200
+ action : 'myajax-submit',
201
+ email : rg_email
202
+ },
203
+ function() {
204
+ //alert( 'finished' );
205
+ }
206
+ );
207
+ //alert('unfinished');
208
  }
209
  readygraph.framework.authentication.getUserInfo(function(userInfo) {
210
  if (userInfo.get('uid') != null) {
readygraph-extension.php CHANGED
@@ -4,7 +4,24 @@
4
  $plugin_slug = basename(dirname(__FILE__));
5
  $menu_slug = 'readygraph-app';
6
  $main_plugin_title = 'Subscribe2';
7
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  // Email Subscription Configuration
9
  //
10
  $url = S2URL;
@@ -76,6 +93,7 @@ EOF;
76
 
77
  add_filter( 'cron_schedules', 'readygraph_cron_intervals' );
78
  add_option('readygraph_connect_notice','true');
 
79
  function readygraph_cron_intervals( $schedules ) {
80
  $schedules['weekly'] = array( // Provide the programmatic name to be used in code
81
  'interval' => 604800, // Intervals are listed in seconds
4
  $plugin_slug = basename(dirname(__FILE__));
5
  $menu_slug = 'readygraph-app';
6
  $main_plugin_title = 'Subscribe2';
7
+ //wp_enqueue_script( 'my-ajax-request', plugin_dir_url( __FILE__ ) . 'assets/js/admin.js', array( 'jquery' ) );
8
+ //wp_localize_script( 'my-ajax-request', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
9
+ add_action( 'wp_ajax_nopriv_myajax-submit', 'myajax_submit' );
10
+ add_action( 'wp_ajax_myajax-submit', 'myajax_submit' );
11
+
12
+ function myajax_submit() {
13
+ global $wpdb;
14
+ $email = $_POST['email'];
15
+ if (class_exists('s2class')){
16
+ $s2class_instance = new s2class();
17
+ $s2class_instance->ip = $_SERVER['REMOTE_ADDR'];
18
+ $s2class_instance->public = $wpdb->prefix . "subscribe2";
19
+ $s2class_instance->add( $email );
20
+ }
21
+ wp_die();
22
+
23
+ }
24
+
25
  // Email Subscription Configuration
26
  //
27
  $url = S2URL;
93
 
94
  add_filter( 'cron_schedules', 'readygraph_cron_intervals' );
95
  add_option('readygraph_connect_notice','true');
96
+ //add_action( 'wp_ajax_add', 'add' );
97
  function readygraph_cron_intervals( $schedules ) {
98
  $schedules['weekly'] = array( // Provide the programmatic name to be used in code
99
  'interval' => 604800, // Intervals are listed in seconds
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.10
7
  Author: Matthew Robinson, tanaylakhani
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.10' );
59
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
60
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
61
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
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.11
7
  Author: Matthew Robinson, tanaylakhani
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.11' );
59
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
60
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
61
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );