Subscribe2 - Version 10.18.5

Version Description

Download this release

Release Info

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

Code changes from version 10.18.4 to 10.18.5

ChangeLog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 10.18.4 =
2
 
3
  * Readygraph premium plan default change
1
+ = 10.18.5 =
2
+
3
+ * Get larger blog post for daily digest
4
+ * Code cleanup
5
+
6
  = 10.18.4 =
7
 
8
  * Readygraph premium plan default change
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: 4.1
7
- Stable tag: 10.18.4
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: 4.1
7
+ Stable tag: 10.18.5
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.
extension/readygraph/site-profile.php CHANGED
@@ -441,11 +441,11 @@ wp_editor( $content, $editor_id, $settings );
441
  var $ = jQuery;
442
  var category = $('[name="readygraph_site_category"]').val();
443
  if (category != ""){
444
- $('.site_category').val(category);
445
  }
446
  var language = $('[name="readygraph_site_language"]').val();
447
  if (language != ""){
448
- $('.site_language').val(language);
449
  }
450
  </script>
451
  <script type="text/javascript" charset="utf-8">
441
  var $ = jQuery;
442
  var category = $('[name="readygraph_site_category"]').val();
443
  if (category != ""){
444
+ $('#site_category').val(category);
445
  }
446
  var language = $('[name="readygraph_site_language"]').val();
447
  if (language != ""){
448
+ $('#site_language').val(language);
449
  }
450
  </script>
451
  <script type="text/javascript" charset="utf-8">
readygraph-extension.php CHANGED
@@ -4,8 +4,7 @@
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_s2-myajax-submit', 's2_myajax_submit' );
10
  add_action( 'wp_ajax_s2-myajax-submit', 's2_myajax_submit' );
11
 
@@ -25,17 +24,7 @@ function s2_myajax_submit() {
25
  // ReadyGraph Engine Hooker
26
  //
27
  include_once('extension/readygraph/extension.php');
28
- /*
29
- function add_readygraph_admin_menu_option()
30
- {
31
- global $plugin_slug, $menu_slug;
32
- append_submenu_page($plugin_slug, 'Readygraph App', __( 'Readygraph App', $plugin_slug), 'administrator', $menu_slug, 'add_readygraph_page');
33
- }
34
-
35
- function add_readygraph_page() {
36
- include_once('extension/readygraph/admin.php');
37
- }
38
- */
39
  function on_plugin_activated_readygraph_s2_redirect(){
40
 
41
  global $menu_slug;
@@ -53,119 +42,7 @@ function s2_myajax_submit() {
53
  add_action('wp_footer', 'readygraph_client_script_head');
54
  add_action('admin_init', 'on_plugin_activated_readygraph_s2_redirect');
55
  add_option('readygraph_connect_notice','true');
56
- /*
57
- add_filter( 'cron_schedules', 'readygraph_s2_cron_intervals' );
58
-
59
- //add_action( 'wp_ajax_add', 'add' );
60
- function readygraph_s2_cron_intervals( $schedules ) {
61
- $schedules['weekly'] = array( // Provide the programmatic name to be used in code
62
- 'interval' => 604800, // Intervals are listed in seconds
63
- 'display' => __('Every Week') // Easy to read display name
64
- );
65
- return $schedules; // Do not forget to give back the list of schedules!
66
- }
67
-
68
-
69
- add_action( 'rg_s2_cron_hook', 'rg_s2_cron_exec' );
70
- $send_blog_updates = get_option('readygraph_send_blog_updates');
71
- if ($send_blog_updates == 'true'){
72
- if( !wp_next_scheduled( 'rg_s2_cron_hook' )) {
73
- wp_schedule_event( time(), 'weekly', 'rg_s2_cron_hook' );
74
- }
75
- }
76
- else
77
- {
78
- //do nothing
79
- }
80
- if ($send_blog_updates == 'false'){
81
- wp_clear_scheduled_hook( 'rg_s2_cron_hook' );
82
- }
83
- function rg_s2_cron_exec() {
84
- // $send_blog_updates = get_option('readygraph_send_blog_updates');
85
- $readygraph_email = get_option('readygraph_email', '');
86
- // wp_mail($readygraph_email, 'Automatic email', 'Hello, this is an automatically scheduled email from WordPress.');
87
- global $wpdb;
88
- $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' and post_modified between date_sub(now(),INTERVAL 1 WEEK) and now() ORDER BY post_modified DESC LIMIT 5";
89
-
90
- global $wpdb;
91
- $recentposts = $wpdb->get_results($query);
92
-
93
- echo "<h2> Recently Updated</h2>";
94
- echo "<ul>";
95
- $postdata = "";
96
- $postdatalinks = "";
97
- $postexcerpts = "";
98
- foreach($recentposts as $post) {
99
- $post_content = get_posts($post->ID);
100
- $postdata .= $post->post_title . ", ";
101
- $postdatalinks .= get_permalink($post->ID) . ", ";
102
- $postexcerpts .= wp_trim_words( $post_content->post_content ) . ", ";
103
- }
104
- $url = 'http://readygraph.com/api/v1/post.json/';
105
- $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'message' => rtrim($postdata, ", "), 'message_link' => rtrim($postdatalinks, ", "), 'message_excerpt' => rtrim($postexcerpts, ", "),'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
106
 
107
- if ( is_wp_error( $response ) ) {
108
- $error_message = $response->get_error_message();
109
- //echo "Something went wrong: $error_message";
110
- } else {
111
- //echo 'Response:<pre>';
112
- //print_r( $response );
113
- //echo '</pre>';
114
- }
115
- echo "</ul>";
116
-
117
- //endif
118
- }
119
-
120
-
121
- add_action( 'rg_s2_daily_cron_hook', 'rg_s2_daily_cron_exec' );
122
- $send_daily_digest = get_option('readygraph_send_daily_digest');
123
- if ($send_daily_digest == 'true'){
124
- if( !wp_next_scheduled( 'rg_s2_daily_cron_hook' )) {
125
- wp_schedule_event( time(), 'daily', 'rg_s2_daily_cron_hook' );
126
- }
127
- }
128
- else
129
- {
130
- //do nothing
131
- }
132
- if ($send_daily_digest == 'false'){
133
- wp_clear_scheduled_hook( 'rg_s2_daily_cron_hook' );
134
- }
135
- function rg_s2_daily_cron_exec() {
136
- global $wpdb;
137
- $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' and post_modified between date_sub(now(),INTERVAL 1 day) and now() ORDER BY post_modified DESC LIMIT 5";
138
-
139
- global $wpdb;
140
- $recentposts = $wpdb->get_results($query);
141
-
142
- echo "<h2> Recently Updated</h2>";
143
- echo "<ul>";
144
- $postdata = "";
145
- $postdatalinks = "";
146
- $postexcerpts = "";
147
- foreach($recentposts as $post) {
148
- $post_content = get_posts($post->ID);
149
- $postdata .= $post->post_title . ", ";
150
- $postdatalinks .= get_permalink($post->ID) . ", ";
151
- $postexcerpts .= wp_trim_words( $post_content->post_content ) . ", ";
152
- }
153
- $url = 'http://readygraph.com/api/v1/post.json/';
154
- $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'message' => rtrim($postdata, ", "), 'message_link' => rtrim($postdatalinks, ", "), 'message_excerpt' => rtrim($postexcerpts, ", "),'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
155
-
156
- if ( is_wp_error( $response ) ) {
157
- $error_message = $response->get_error_message();
158
- //echo "Something went wrong: $error_message";
159
- } else {
160
- //echo 'Response:<pre>';
161
- //print_r( $response );
162
- //echo '</pre>';
163
- }
164
- echo "</ul>";
165
-
166
- //endif
167
- }
168
- */
169
  function rg_s2_popup_options_enqueue_scripts() {
170
  if ( get_option('readygraph_popup_template') == 'default-template' ) {
171
  wp_enqueue_style( 'default-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/default-popup.css' );
@@ -189,23 +66,7 @@ function rg_s2_popup_options_enqueue_scripts() {
189
  wp_enqueue_style( 'yellow-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/yellow-popup.css' );
190
  }
191
  if ( get_option('readygraph_popup_template') == 'custom-template' ) {
192
- /*echo '<style type="text/css">
193
- .rgw-lightbox .rgw-content-frame .rgw-content {
194
- background: '.get_option("readygraph_popup_template_background").' !important;
195
- }
196
-
197
- .rgw-style{
198
- color: '.get_option("readygraph_popup_template_text").' !important;
199
- }
200
- .rgw-style .rgw-dialog-header .rgw-dialog-headline, .rgw-style .rgw-dialog-header .rgw-dialog-headline * {
201
- color: '.get_option("readygraph_popup_template_text").' !important;
202
- }
203
- .rgw-notify .rgw-float-box {
204
- background: '.get_option("readygraph_popup_template_background").' !important;
205
- }
206
- .rgw-notify .rgw-social-status:hover{
207
- background: '.get_option("readygraph_popup_template_background").' !important;
208
- }</style>';*/
209
  wp_enqueue_style( 'custom-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/custom-popup.css' );
210
  }
211
  }
@@ -228,22 +89,21 @@ function s2_post_updated_send_email( $post_id ) {
228
 
229
  $post_title = get_the_title( $post_id );
230
  $post_url = get_permalink( $post_id );
 
231
  $post_content = get_post($post_id);
 
232
  $url = 'http://readygraph.com/api/v1/post.json/';
233
  if (get_option('readygraph_send_real_time_post_updates')=='true'){
234
- $url = 'http://readygraph.com/api/v1/post.json/';
235
- $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'is_realtime'=>1, 'message' => $post_title, 'message_link' => $post_url,'message_excerpt' => wp_trim_words( $post_content->post_content, 100 ),'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
236
  }
237
  else {
238
- $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'message' => $post_title, 'message_link' => $post_url,'message_excerpt' => wp_trim_words( $post_content->post_content, 100 ),'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
239
  }
240
  if ( is_wp_error( $response ) ) {
241
  $error_message = $response->get_error_message();
242
- //echo "Something went wrong: $error_message";
243
  } else {
244
- //echo 'Response:<pre>';
245
- //print_r( $response );
246
- //echo '</pre>';
247
  }
248
  $app_id = get_option('readygraph_application_id');
249
  wp_remote_get( "http://readygraph.com/api/v1/tracking?event=post_created&app_id=$app_id" );
4
  $plugin_slug = basename(dirname(__FILE__));
5
  $menu_slug = 'readygraph-app';
6
  $main_plugin_title = 'Subscribe2';
7
+
 
8
  add_action( 'wp_ajax_nopriv_s2-myajax-submit', 's2_myajax_submit' );
9
  add_action( 'wp_ajax_s2-myajax-submit', 's2_myajax_submit' );
10
 
24
  // ReadyGraph Engine Hooker
25
  //
26
  include_once('extension/readygraph/extension.php');
27
+
 
 
 
 
 
 
 
 
 
 
28
  function on_plugin_activated_readygraph_s2_redirect(){
29
 
30
  global $menu_slug;
42
  add_action('wp_footer', 'readygraph_client_script_head');
43
  add_action('admin_init', 'on_plugin_activated_readygraph_s2_redirect');
44
  add_option('readygraph_connect_notice','true');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  function rg_s2_popup_options_enqueue_scripts() {
47
  if ( get_option('readygraph_popup_template') == 'default-template' ) {
48
  wp_enqueue_style( 'default-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/default-popup.css' );
66
  wp_enqueue_style( 'yellow-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/yellow-popup.css' );
67
  }
68
  if ( get_option('readygraph_popup_template') == 'custom-template' ) {
69
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  wp_enqueue_style( 'custom-template', plugin_dir_url( __FILE__ ) .'extension/readygraph/assets/css/custom-popup.css' );
71
  }
72
  }
89
 
90
  $post_title = get_the_title( $post_id );
91
  $post_url = get_permalink( $post_id );
92
+ $post_image = wp_get_attachment_url(get_post_thumbnail_id($post_id));
93
  $post_content = get_post($post_id);
94
+ $post_excerpt = (isset($post_content->post_excerpt) && (!empty($post_content->post_excerpt))) ? $post_content->post_excerpt : wp_trim_words(strip_tags(strip_shortcodes($post_content->post_content)),500);
95
  $url = 'http://readygraph.com/api/v1/post.json/';
96
  if (get_option('readygraph_send_real_time_post_updates')=='true'){
97
+ $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'is_realtime'=>1, 'message' => $post_title, 'message_link' => $post_url,'message_excerpt' => $post_excerpt,'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
 
98
  }
99
  else {
100
+ $response = wp_remote_post($url, array( 'body' => array('is_wordpress'=>1, 'message' => $post_title, 'message_link' => $post_url,'message_excerpt' => $post_excerpt,'client_key' => get_option('readygraph_application_id'), 'email' => get_option('readygraph_email'))));
101
  }
102
  if ( is_wp_error( $response ) ) {
103
  $error_message = $response->get_error_message();
104
+
105
  } else {
106
+
 
 
107
  }
108
  $app_id = get_option('readygraph_application_id');
109
  wp_remote_get( "http://readygraph.com/api/v1/tracking?event=post_created&app_id=$app_id" );
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.4
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.4' );
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.18.5
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.5' );
59
  define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
60
  define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
61
  define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );