Version Description
Download this release
Release Info
Developer | tanaylakhani |
Plugin | Subscribe2 |
Version | 10.18 |
Comparing to | |
See all releases |
Code changes from version 10.17.2 to 10.18
- ChangeLog.txt +5 -0
- ReadMe.txt +1 -1
- classes/class-s2-admin.php +12 -12
- classes/class-s2-core.php +1 -1
- extension/readygraph/admin.php +1 -1
- extension/readygraph/extension.php +2 -2
- extension/readygraph/go-premium.php +4 -4
- readygraph-extension.php +16 -2
- subscribe2.php +2 -2
ChangeLog.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 10.17.2 =
|
2 |
|
3 |
* Disconnect/Delete Readygraph Link fix
|
1 |
+
= 10.18 =
|
2 |
+
|
3 |
+
* Option to synch current subscriber list
|
4 |
+
* Bug Fixes
|
5 |
+
|
6 |
= 10.17.2 =
|
7 |
|
8 |
* Disconnect/Delete Readygraph Link fix
|
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.
|
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
|
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,36 +5,36 @@ class s2_admin extends s2class {
|
|
5 |
Hook the menu
|
6 |
*/
|
7 |
function admin_menu() {
|
8 |
-
|
9 |
-
|
10 |
-
$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');
|
11 |
-
add_action("admin_print_scripts-$s2user", array(&$this, 'checkbox_form_js'));
|
12 |
-
add_action("admin_print_styles-$s2user", array(&$this, 'user_admin_css'));
|
13 |
-
add_action('load-' . $s2user, array(&$this, 'user_help'));
|
14 |
if( file_exists(dirname(plugin_dir_path( __FILE__ ) ).'/readygraph-extension.php')) {
|
15 |
-
|
16 |
-
$s2readygraph = add_submenu_page('s2', __('Readygraph App', 'subscribe2'), __('Readygraph App', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), $menu_slug, array(&$this, 'readygraph_menu'));
|
17 |
}
|
18 |
else {
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
//add_action("admin_print_scripts-$s2readygraph", array(&$this, 'readygraph_js'));
|
22 |
|
23 |
-
$s2subscribers = add_submenu_page(
|
24 |
add_action("admin_print_scripts-$s2subscribers", array(&$this, 'checkbox_form_js'));
|
25 |
add_action('load-' . $s2subscribers, array(&$this, 'subscribers_help'));
|
26 |
|
27 |
-
$s2settings = add_submenu_page(
|
28 |
add_action("admin_print_scripts-$s2settings", array(&$this, 'checkbox_form_js'));
|
29 |
add_action("admin_print_scripts-$s2settings", array(&$this, 'option_form_js'));
|
30 |
add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
|
31 |
add_action('load-' . $s2settings, array(&$this, 'settings_help'));
|
32 |
|
33 |
-
$s2mail = add_submenu_page(
|
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(
|
38 |
}
|
39 |
else {
|
40 |
}
|
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'));
|
18 |
+
add_action('load-' . $s2user, array(&$this, 'user_help'));
|
19 |
+
|
20 |
|
21 |
//add_action("admin_print_scripts-$s2readygraph", array(&$this, 'readygraph_js'));
|
22 |
|
23 |
+
$s2subscribers = add_submenu_page($menu_slug, __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'subscribers_menu'));
|
24 |
add_action("admin_print_scripts-$s2subscribers", array(&$this, 'checkbox_form_js'));
|
25 |
add_action('load-' . $s2subscribers, array(&$this, 'subscribers_help'));
|
26 |
|
27 |
+
$s2settings = add_submenu_page($menu_slug, __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'settings_menu'));
|
28 |
add_action("admin_print_scripts-$s2settings", array(&$this, 'checkbox_form_js'));
|
29 |
add_action("admin_print_scripts-$s2settings", array(&$this, 'option_form_js'));
|
30 |
add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
|
31 |
add_action('load-' . $s2settings, array(&$this, 'settings_help'));
|
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 |
}
|
classes/class-s2-core.php
CHANGED
@@ -1440,7 +1440,7 @@ class s2class {
|
|
1440 |
|
1441 |
$digest_post_ids[] = $post->ID;
|
1442 |
|
1443 |
-
$post_title = html_entity_decode($post->post_title, ENT_QUOTES);
|
1444 |
('' == $table) ? $table .= "* " . $post_title : $table .= "\r\n* " . $post_title;
|
1445 |
('' == $tablelinks) ? $tablelinks .= "* " . $post_title : $tablelinks .= "\r\n* " . $post_title;
|
1446 |
$message_post .= $post_title;
|
1440 |
|
1441 |
$digest_post_ids[] = $post->ID;
|
1442 |
|
1443 |
+
$post_title = html_entity_decode(__($post->post_title), ENT_QUOTES);
|
1444 |
('' == $table) ? $table .= "* " . $post_title : $table .= "\r\n* " . $post_title;
|
1445 |
('' == $tablelinks) ? $tablelinks .= "* " . $post_title : $tablelinks .= "\r\n* " . $post_title;
|
1446 |
$message_post .= $post_title;
|
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"]);
|
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');
|
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');
|
extension/readygraph/extension.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
// ReadyGraph Extension
|
3 |
//
|
4 |
-
if(!function_exists('
|
5 |
-
function
|
6 |
if (get_option('readygraph_access_token', '') != '') return;
|
7 |
|
8 |
global $hook_suffix, $current_user, $menu_slug;
|
1 |
<?php
|
2 |
// ReadyGraph Extension
|
3 |
//
|
4 |
+
if(!function_exists('add_s2_readygraph_plugin_warning')) {
|
5 |
+
function add_s2_readygraph_plugin_warning() {
|
6 |
if (get_option('readygraph_access_token', '') != '') return;
|
7 |
|
8 |
global $hook_suffix, $current_user, $menu_slug;
|
extension/readygraph/go-premium.php
CHANGED
@@ -30,8 +30,8 @@ s2_rrmdir($dir);
|
|
30 |
global $main_plugin_title;
|
31 |
if (!get_option('readygraph_access_token') || strlen(get_option('readygraph_access_token')) <= 0) {
|
32 |
//redirect to main page
|
33 |
-
|
34 |
-
echo '<script>window.location.replace("'.$current_url
|
35 |
}
|
36 |
else {
|
37 |
if (isset($_POST["readygraph_access_token"])) update_option('readygraph_access_token', $_POST["readygraph_access_token"]);
|
@@ -210,7 +210,7 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
|
|
210 |
</div>
|
211 |
<p><h4 class="rg-h4">ReadyGraph Premium equips your Wordpress site with the industry's most powerful proven growth features. Websites have used our tools to increase their growth rate by upto 70X.</h4></p>
|
212 |
<p><h4 class="rg-h4">Don't keep keep your website a secret! Set your growth to "full-blast" with ReadyGraph.</h4> </p>
|
213 |
-
<p><h4 class="rg-h4"><a href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>">Start A Free Trial Today!</a> </h4></p>
|
214 |
|
215 |
</div>
|
216 |
</div>
|
@@ -286,7 +286,7 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
|
|
286 |
}
|
287 |
else {
|
288 |
$('.rgw-fb-login-button-iframe').hide();
|
289 |
-
$('div.
|
290 |
|
291 |
if ($('[name="readygraph_access_token"]').val()) {
|
292 |
$('.rgw-fb-login-button-iframe').show();
|
30 |
global $main_plugin_title;
|
31 |
if (!get_option('readygraph_access_token') || strlen(get_option('readygraph_access_token')) <= 0) {
|
32 |
//redirect to main page
|
33 |
+
//$current_url = "admin.php?page=readygraph-app";
|
34 |
+
//echo '<script>window.location.replace("'.$current_url.'");</script>';
|
35 |
}
|
36 |
else {
|
37 |
if (isset($_POST["readygraph_access_token"])) update_option('readygraph_access_token', $_POST["readygraph_access_token"]);
|
210 |
</div>
|
211 |
<p><h4 class="rg-h4">ReadyGraph Premium equips your Wordpress site with the industry's most powerful proven growth features. Websites have used our tools to increase their growth rate by upto 70X.</h4></p>
|
212 |
<p><h4 class="rg-h4">Don't keep keep your website a secret! Set your growth to "full-blast" with ReadyGraph.</h4> </p>
|
213 |
+
<p><h4 class="rg-h4"><a target="_blank" href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>">Start A Free Trial Today!</a> </h4></p>
|
214 |
|
215 |
</div>
|
216 |
</div>
|
286 |
}
|
287 |
else {
|
288 |
$('.rgw-fb-login-button-iframe').hide();
|
289 |
+
$('div.authenticated').show();
|
290 |
|
291 |
if ($('[name="readygraph_access_token"]').val()) {
|
292 |
$('.rgw-fb-login-button-iframe').show();
|
readygraph-extension.php
CHANGED
@@ -49,7 +49,7 @@ function s2_myajax_submit() {
|
|
49 |
// remove_action('admin_init', 'on_plugin_activated_redirect');
|
50 |
|
51 |
// add_action('admin_menu', 'add_readygraph_admin_menu_option');
|
52 |
-
add_action('admin_notices', '
|
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');
|
@@ -229,6 +229,7 @@ function s2_post_updated_send_email( $post_id ) {
|
|
229 |
$post_title = get_the_title( $post_id );
|
230 |
$post_url = get_permalink( $post_id );
|
231 |
$post_content = get_post($post_id);
|
|
|
232 |
if (get_option('readygraph_send_real_time_post_updates')=='true'){
|
233 |
$url = 'http://readygraph.com/api/v1/post.json/';
|
234 |
$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'))));
|
@@ -251,7 +252,20 @@ function s2_post_updated_send_email( $post_id ) {
|
|
251 |
}
|
252 |
|
253 |
}
|
|
|
254 |
add_action( 'publish_post', 's2_post_updated_send_email' );
|
255 |
add_action( 'publish_page', 's2_post_updated_send_email' );
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
?>
|
49 |
// remove_action('admin_init', 'on_plugin_activated_redirect');
|
50 |
|
51 |
// add_action('admin_menu', 'add_readygraph_admin_menu_option');
|
52 |
+
add_action('admin_notices', 'add_s2_readygraph_plugin_warning');
|
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');
|
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'))));
|
252 |
}
|
253 |
|
254 |
}
|
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 ";
|
261 |
+
$subscribe2_users = $wpdb->get_results($query);
|
262 |
+
$emails = "";
|
263 |
+
$dates = "";
|
264 |
+
foreach($subscribe2_users as $user) {
|
265 |
+
$emails .= $user->email . ",";
|
266 |
+
$dates .= $user->user_date . ",";
|
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 |
?>
|
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.
|
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.
|
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
|
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' );
|
59 |
define( 'S2PATH', trailingslashit(dirname(__FILE__)) );
|
60 |
define( 'S2DIR', trailingslashit(dirname(plugin_basename(__FILE__))) );
|
61 |
define( 'S2URL', plugin_dir_url(dirname(__FILE__)) . S2DIR );
|