Subscribe2 - Version 10.20.0

Version Description

Download this release

Release Info

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

Code changes from version 10.19.0 to 10.20.0

ChangeLog.txt CHANGED
@@ -1,3 +1,10 @@
1
= 10.19.0 =
2
3
* Add monetization option for readygraph
1
+ = 10.20.0 =
2
+
3
+ * Bug Fix for readygraph and compatibility with other plugins
4
+ * New code structure for readygraph
5
+ * User can delete the readygraph to completely remove it.
6
+ * Subsequent upgrades wont load readygraph except a plugin is disabled and re-enabled.
7
+
8
= 10.19.0 =
9
10
* Add monetization option for readygraph
ReadMe.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://plugins.readygraph.com/donate/
4
Tags: posts, subscription, email, subscribe, notify, notification
5
Requires at least: 3.3
6
Tested up to: 4.1
7
- Stable tag: 10.19.0
8
License: GPL3
9
10
Sends a list of subscribers emails when you publish new posts. Automate user growth and revenue with ReadyGraph integration.
@@ -143,6 +143,12 @@ After installing this plug-in, you can activate the ReadyGraph features by conne
143
144
You can deactivate the ReadyGraph features by navigating to the upper-right corner of the “ReadyGraph App” page, clicking the drop-down menu with your email address, and disconnecting your ReadyGraph account.
145
146
**Can I delay the sign-up pop-up?**
147
148
Yes, you can delay the pop-up for up to 20 minutes; however, the most effective delay is only a few seconds. That ensures that users are engaged, before showing the pop-up to them.
4
Tags: posts, subscription, email, subscribe, notify, notification
5
Requires at least: 3.3
6
Tested up to: 4.1
7
+ Stable tag: 10.20.0
8
License: GPL3
9
10
Sends a list of subscribers emails when you publish new posts. Automate user growth and revenue with ReadyGraph integration.
143
144
You can deactivate the ReadyGraph features by navigating to the upper-right corner of the “ReadyGraph App” page, clicking the drop-down menu with your email address, and disconnecting your ReadyGraph account.
145
146
+ **How do I reinstall ReadyGraph after I had deleted?**
147
+
148
+ 1. Get the latest plugin update/reinstall the plugin.
149
+ 2. Disable the plugin
150
+ 3. Enable the plugin
151
+
152
**Can I delay the sign-up pop-up?**
153
154
Yes, you can delay the pop-up for up to 20 minutes; however, the most effective delay is only a few seconds. That ensures that users are engaged, before showing the pop-up to them.
admin/send_email.php CHANGED
@@ -96,9 +96,10 @@ echo "<div class=\"wrap\">";
96
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
97
echo "<div id=\"icon-edit\" class=\"icon32\"></div>";
98
}
99
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
100
101
- echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';
102
103
echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
104
echo "<form method=\"post\" enctype=\"multipart/form-data\">\r\n";
96
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
97
echo "<div id=\"icon-edit\" class=\"icon32\"></div>";
98
}
99
+ if( file_exists(plugin_dir_path( __FILE__ ).'/readygraph-extension.php' )) {
100
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
101
102
+ echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';}
103
104
echo "<h2>" . __('Send an email to subscribers', 'subscribe2') . "</h2>\r\n";
105
echo "<form method=\"post\" enctype=\"multipart/form-data\">\r\n";
admin/settings.php CHANGED
@@ -157,9 +157,10 @@ echo "<div class=\"wrap\">";
157
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
158
echo "<div id=\"icon-options-general\" class=\"icon32\"></div>";
159
}
160
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
161
162
- echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';
163
164
$tabs = array('email' => __('Email Settings', 'subscribe2'),
165
'templates' => __('Templates', 'subscribe2'),
157
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
158
echo "<div id=\"icon-options-general\" class=\"icon32\"></div>";
159
}
160
+ if( file_exists(plugin_dir_path( __FILE__ ).'/readygraph-extension.php' )) {
161
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
162
163
+ echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';}
164
165
$tabs = array('email' => __('Email Settings', 'subscribe2'),
166
'templates' => __('Templates', 'subscribe2'),
admin/subscribers.php CHANGED
@@ -183,9 +183,10 @@ echo "<div class=\"wrap\">";
183
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
184
echo "<div id=\"icon-tools\" class=\"icon32\"></div>";
185
}
186
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
187
188
- echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';
189
$tabs = array('public' => __('Public Subscribers', 'subscribe2'), 'registered' => __('Registered Subscribers', 'subscribe2'));
190
echo "<h2 class=\"nav-tab-wrapper\">";
191
foreach ( $tabs as $tab_key => $tab_caption ) {
183
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
184
echo "<div id=\"icon-tools\" class=\"icon32\"></div>";
185
}
186
+ if( file_exists(plugin_dir_path( __FILE__ ).'/readygraph-extension.php' )) {
187
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
188
189
+ echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';}
190
$tabs = array('public' => __('Public Subscribers', 'subscribe2'), 'registered' => __('Registered Subscribers', 'subscribe2'));
191
echo "<h2 class=\"nav-tab-wrapper\">";
192
foreach ( $tabs as $tab_key => $tab_caption ) {
admin/your_subscriptions.php CHANGED
@@ -95,9 +95,10 @@ echo "<div class=\"wrap\">";
95
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
96
echo "<div id=\"icon-users\" class=\"icon32\"></div>";
97
}
98
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
99
100
- echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';
101
102
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
103
if ( isset($_GET['email']) ) {
95
if ( version_compare($GLOBALS['wp_version'], '3.8', '<=') ) {
96
echo "<div id=\"icon-users\" class=\"icon32\"></div>";
97
}
98
+ if( file_exists(plugin_dir_path( __FILE__ ).'/readygraph-extension.php' )) {
99
wp_enqueue_style('s2_rg_admin_template', S2URL . 'extension/readygraph/assets/css/upgrade.css');
100
101
+ echo '<div class="rg_info rg_message"><img src="'.S2URL . 'include/Sign-Alert-icon.png" style="float: left;height: 50px;padding-right: 10px;"><a href="admin.php?page=readygraph-app"><button class="button-warning pure-button" style="float: right; margin-right: 15px;">Connect ReadyGraph</button></a><h3 style="color:white">Grow your site traffic faster: Activate Subscribe2\'s User Growth Engine (ReadyGraph)</h3><p style="color: whitesmoke">Promotion to New Users | Viral Signup Form | Site Update emails | Import Existing Users</p></div>';}
102
103
echo "<h2>" . __('Notification Settings', 'subscribe2') . "</h2>\r\n";
104
if ( isset($_GET['email']) ) {
classes/class-s2-admin.php CHANGED
@@ -5,13 +5,13 @@ class s2_admin extends s2class {
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'));
17
add_action('load-' . $s2user, array(&$this, 'user_help'));
@@ -19,19 +19,19 @@ class s2_admin extends s2class {
19
20
//add_action("admin_print_scripts-$s2readygraph", array(&$this, 'readygraph_js'));
21
22
- $s2subscribers = add_submenu_page($menu_slug, __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'subscribers_menu'));
23
add_action("admin_print_scripts-$s2subscribers", array(&$this, 'checkbox_form_js'));
24
add_action('load-' . $s2subscribers, array(&$this, 'subscribers_help'));
25
26
- $s2settings = add_submenu_page($menu_slug, __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'settings_menu'));
27
add_action("admin_print_scripts-$s2settings", array(&$this, 'checkbox_form_js'));
28
add_action("admin_print_scripts-$s2settings", array(&$this, 'option_form_js'));
29
add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
30
add_action('load-' . $s2settings, array(&$this, 'settings_help'));
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');
5
Hook the menu
6
*/
7
function admin_menu() {
8
+ if( file_exists(dirname(plugin_dir_path( __FILE__ ) ).'/readygraph-extension.php') && (get_option('readygraph_deleted') != "true")) {
9
+ global $s2_menu_slug;
10
+ add_menu_page(__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'),$s2_menu_slug, NULL, S2URL . 'include/email_edit.png');
11
12
+ $s2readygraph = add_submenu_page($s2_menu_slug, __('Readygraph App', 'subscribe2'), __('Readygraph App', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'readygraph'), $s2_menu_slug, array(&$this, 'readygraph_menu'), S2URL . 'include/email_edit.png');
13
14
+ $s2user = add_submenu_page($s2_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'));
17
add_action('load-' . $s2user, array(&$this, 'user_help'));
19
20
//add_action("admin_print_scripts-$s2readygraph", array(&$this, 'readygraph_js'));
21
22
+ $s2subscribers = add_submenu_page($s2_menu_slug, __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'subscribers_menu'));
23
add_action("admin_print_scripts-$s2subscribers", array(&$this, 'checkbox_form_js'));
24
add_action('load-' . $s2subscribers, array(&$this, 'subscribers_help'));
25
26
+ $s2settings = add_submenu_page($s2_menu_slug, __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'settings_menu'));
27
add_action("admin_print_scripts-$s2settings", array(&$this, 'checkbox_form_js'));
28
add_action("admin_print_scripts-$s2settings", array(&$this, 'option_form_js'));
29
add_filter('plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
30
add_action('load-' . $s2settings, array(&$this, 'settings_help'));
31
32
+ $s2mail = add_submenu_page($s2_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($s2_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');
extension/readygraph/admin.php CHANGED
@@ -11,23 +11,9 @@
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
-
15
- function s2_disconnectReadyGraph(){
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
- s2_delete_rg_options();
19
- echo '<div class="updated"><p>We are sorry to see you go. ReadyGraph is now disconnected.</p></div>';
20
- }
21
- function s2_deleteReadyGraph(){
22
- $app_id = get_option('readygraph_application_id');
23
- wp_remote_get( "http://readygraph.com/api/v1/tracking?event=uninstall_readygraph&app_id=$app_id" );
24
- s2_delete_rg_options();
25
- $dir = plugin_dir_path( __FILE__ );
26
- s2_rrmdir($dir);
27
- }
28
29
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "changeaccount")s2_disconnectReadyGraph();
30
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "deleteaccount")s2_deleteReadyGraph();
31
if(isset($_GET["tutorial"]) && $_GET["tutorial"] == "true"){update_option('readygraph_tutorial',"true");}
32
else{update_option('readygraph_tutorial',"false");}
33
if(isset($_GET["readygraph_upgrade_notice"]) && $_GET["readygraph_upgrade_notice"] == "dismiss") {update_option('readygraph_upgrade_notice', 'false');}
@@ -35,36 +21,9 @@ s2_rrmdir($dir);
35
if(isset($_GET["popup_position"]) && $_GET["popup_position"] == "center"){update_option('readygraph_enable_notification', 'true');update_option('readygraph_enable_popup', 'true');}
36
if(isset($_GET["popup_position"]) && $_GET["popup_position"] == "disabled"){update_option('readygraph_enable_notification', 'false');update_option('readygraph_enable_popup', 'false');}
37
if(isset($_GET["popup_delay"])){update_option('readygraph_delay', intval($_GET["popup_delay"]));}
38
- global $main_plugin_title;
39
- if (!get_option('readygraph_access_token') || strlen(get_option('readygraph_access_token')) <= 0) {
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');
47
- if (isset($_POST["readygraph_enable_popup"])) update_option('readygraph_enable_popup', 'true');
48
- update_option('readygraph_enable_sidebar', 'false');
49
- update_option('readygraph_auto_select_all', 'true');
50
- update_option('readygraph_enable_branding', 'false');
51
- update_option('readygraph_send_blog_updates', 'true');
52
- update_option('readygraph_send_real_time_post_updates', 'false');
53
- update_option('readygraph_popup_template', 'default-template');
54
- update_option('readygraph_upgrade_notice', 'true');
55
- update_option('readygraph_tutorial',"true");
56
- $site_url = site_url();
57
- update_option('readygraph_site_url', $site_url);
58
- }
59
- else {
60
- }
61
- if (!get_option('readygraph_plan') || strlen(get_option('readygraph_plan')) <= 0) {
62
- update_option('readygraph_tutorial',"true");
63
- }
64
?>
65
66
- <link rel="stylesheet" type="text/css" href="<?php echo plugins_url( 'assets/css/admin.css', __FILE__ ) ?>">
67
- <script type="text/javascript" src="<?php echo plugins_url( 'assets/js/admin.js', __FILE__ ) ?>"></script>
68
<form method="post" id="myForm">
69
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
70
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
@@ -74,22 +33,38 @@ s2_rrmdir($dir);
74
<input type="hidden" name="readygraph_enable_notification" value="<?php echo get_option('readygraph_enable_notification', 'true') ?>">
75
<input type="hidden" name="readygraph_enable_popup" value="<?php echo get_option('readygraph_enable_popup', 'true') ?>">
76
77
<div class="authenticate" style="display: none;">
78
- <div class="wrap1" style="min-height: 600px;">
79
-
80
- <div id="icon-plugins" class="icon32"></div>
81
- <h2>We've enhanced <?php echo $main_plugin_title ?> with ReadyGraph's User Growth Engine</h2>
82
-
83
- <p style="display:none;color:red;" id="error"></p>
84
- <div class="register-left">
85
<div class="alert" style="margin: 0px auto; padding: 15px; text-align: center;">
86
- <h3>Activate ReadyGraph to get more traffic to your site</h3>
87
<!-- <h3 style="margin-top: 0px; font-weight: 300;"><?php //echo $main_plugin_title ?>, Now with ReadyGraph</h3> -->
88
- <p style="padding: 50px 0px 30px 0px;"><a class="btn btn-primary connect" href="javascript:void(0);" style="font-size: 15px; line-height: 40px; padding: 0 30px;">Connect ReadyGraph</a></p>
89
<!--<p style="padding: 0px 0px;"><a class="btn btn-default skip" href="javascript:void(0);" style="font-size: 10px; line-height: 20px; padding: 0 30px;">Skip ReadyGraph</a></p>-->
90
- <p>Readygraph adds more ways to connect to your users. </p>
91
<p style="text-align: left; padding: 0 20px;">
92
- - For qualifying sites, monetize traffic with optimized, non-intrusive ad units<br>
93
- Get more traffic<br>
94
- Send automatic email digests of all your site posts<br>
95
- Get better deliverablility<br>
@@ -100,27 +75,26 @@ s2_rrmdir($dir);
100
</div>
101
102
</div>
103
-
104
- <div class="register-right">
105
- <div class="form-wrap alert" style="font-size:12px;">
106
- <p><h3>ReadyGraph grows your site</h3></p>
107
- <p>ReadyGraph delivers audience growth and motivates users to come back.</p><br /><p><span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_currency.png"></span><span style="width: 90%;"><b>Maximize Revenue –</b> Compensate yourself for your hardwork with standardized, non-intrusive ad units. Optimized for mobile and web to maximize revenue. Powered by our high quality partner AdsOptimal.</span></span><br /><br />
108
- <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_fb.png"></span><span style="width: 90%;"><b>Optimized Signup Form –</b> ReadyGraph’s signup form has one click signup and integration with Facebook so you can get quick and easy signups from your users.</span></span><br /><br />
109
- <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_heart.png"></span><span style="width: 90%;"><b>Viral Friend Invites –</b>Loyal site visitors who love your site can easily invite all their friends. Readygraph encourages your visitors' friends to come and signup for your site too.</span></span><br /><br />
110
- <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_mail.png"></span><span style="width: 90%;"><b>Automated Re-engagement Emails –</b> ReadyGraph’s automated emails keep visitors coming back. Send a daily or weekly digest of all your new posts and keep them informed about site activity, events, etc.</span></span><br /><br />
111
- <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_chart.png"></span><span style="width: 90%;"><b>Analytics -</b> Track new subscribers, invites, traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data on the cloud so you can access from anywhere.</span></span><br /><br />
112
- <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/ub-icon.png" style="padding: 0 10px;"></span><span style="width: 90%;"><b>Your Site Promoted in UserBase Rankings -</b> Users vote on your latest content and top ranked posts are promoted on UserBase.com to thousands of people.</span></span><br /><br />
113
- If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a> Feel free to check out our <a href="http://readygraph.com/faq/" target="_blank">FAQ</a> for a more comprehensive overview. You can also completely <a class="delete" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("deleteaccount");?>">Delete ReadyGraph</a> if you don't want access to our amazing growth tools. Either way, good luck building a massive userbase!<br/><br/>By connecting to ReadyGraph, you agree to our <a href="http://readygraph.com/tos/" target="_blank">Terms of Service</a> and <a href="http://readygraph.com/privacy/" target="_blank">Privacy Policy</a>.
114
- </p>
115
- </div>
116
- </div>
117
- </div>
118
</div>
119
<div class="authenticating" style="display: none;">
120
<div style="color: #ffffff; width: 350px; margin: 100px auto 0px; padding: 15px; border: solid 1px #2a388f; text-align: center; background-color: #2961cb; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px;">
121
- <h3 style="margin-top: 0px; font-weight: 300;"><?php echo $main_plugin_title ?>, Now with ReadyGraph</h3>
122
<h4 style="padding: 50px 0; line-height: 42px;">Retrieving Your Account..</h4>
123
- <p>Activate Readygraph features to optimize <?php echo $main_plugin_title ?> functionality. Signup For These Benefits:</p>
124
<p style="text-align: left; padding: 0 20px;">
125
- For qualifying sites, monetize traffic with optimized, non-intrusive ad units<br>
126
- Grow your subscribers faster<br>
@@ -132,77 +106,12 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
132
</p>
133
</div>
134
</div>
135
- <style>a.help-tooltip {outline:none; }a.help-tooltip strong {line-height:30px;}a.help-tooltip:hover {text-decoration:none;} a.help-tooltip span { z-index:10;display:none; padding:14px 20px; margin-top:40px; margin-left:-150px; width:300px; line-height:16px;}a.help-tooltip:hover span{ display:inline; position:absolute; border:2px solid #FFF; background:#fff; text-align: justify; z-index:1000000000;}.callout {z-index:1000000000;position:absolute;border:0;top:-14px;left:120px;} /*CSS3 extras*/a.help-tooltip span{ border-radius:2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -moz-box-shadow: 0px 0px 8px 4px #666; -webkit-box-shadow: 0px 0px 8px 4px #666; box-shadow: 0px 0px 8px 4px #666;}</style>
136
<div class="authenticated" style="display: none;">
137
- <div style="background-color: #2691CB; min-width: 90%; height: 50px;margin-right: 1%;">
138
- <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/white-logo.png" style="width: 138px; height: 30px; margin: 10px 0 0 15px; float: left;">
139
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
140
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
141
- <span class="email-address" style="text-shadow: none;"></span> <span class="caret"></span>
142
- </button>
143
- <ul class="dropdown-menu">
144
- <li><a class="change-account" href="#">Change Account</a></li>
145
- <li><a class="disconnect" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("changeaccount");?>">Disconnect</a></li>
146
- <li><a class="delete" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("deleteaccount");?>">Delete ReadyGraph</a></li>
147
- </ul>
148
- </div>
149
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
150
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
151
- <span class="result" style="text-shadow: none;">...</span> <span class="caret"></span>
152
- </button>
153
- <ul class="dropdown-menu">
154
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Insights</a></li>
155
- </ul>
156
- </div>
157
- <div style="clear: both;"></div>
158
- </div>
159
- <!-- write menu code-->
160
161
- <div class="readygraph-nav-menu">
162
- <ul><li>Grow Users
163
- <ul>
164
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=signup-popup">Signup Popup</a></li>
165
- <li><a href="https://readygraph.com/application/insights/" target="_blank">User Statistics</a></li>
166
- <li><a href="#"></a></li>
167
- </ul>
168
- </li>
169
- <li>Email Users
170
- <ul>
171
- <li><a href="https://readygraph.com/application/customize/settings/email/welcome/" target="_blank">Retention Email</a></li>
172
- <li><a href="https://readygraph.com/application/customize/settings/email/invitation/" target="_blank">Invitation Email</a></li>
173
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Custom Email</a></li>
174
- </ul>
175
- </li>
176
- <li>
177
- Engage Users
178
- <ul>
179
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=social-feed">Social Feed</a></li>
180
- <li><a href="#">Social Followers</a></li>
181
- <li><a href="#">Feedback Survey</a></li>
182
- </ul>
183
- </li>
184
- <li>Basic Settings
185
- <ul>
186
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=site-profile">Site Profile</a></li>
187
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=feature-settings">Feature Settings</a></li>
188
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=monetization-settings">Monetization Settings</a></li>
189
- </ul>
190
- </li>
191
- </ul>
192
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
193
- <p><a href="mailto:info@readygraph.com" style="color: #b1c1ca" >Help <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/9.png"/></a></p>
194
- </div>
195
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
196
- <p>
197
- <a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=faq" style="color: #b1c1ca" >FAQ <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/10.png" /></a></p>
198
- </div>
199
- <div class="btn-group" style="">
200
- <p><a href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>" target="_blank" style="color: #b1c1ca" ><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/go-premium.png" height="40px" style="margin:5px" /></a></p>
201
- </div>
202
- </div>
203
<?php if(get_option('readygraph_tutorial') && get_option('readygraph_tutorial') == "true"){ ?>
204
<div class="tutorial-true" style="margin: 5% auto;">
205
- <h3 style="font-weight: normal; text-align: center;"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/check.png"/>Congratulations! <?php echo $main_plugin_title; ?>'s ReadyGraph growth engine is now active.</h3>
206
207
<div style="width: 45%; margin: 1% 1% 0 10%; float: left">
208
<h3 style="font-weight: normal;color: grey;">Step 1: Choose a plan for exposure to more new users!</h3>
@@ -214,9 +123,7 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
214
<h4 class="rg-h4">Content recommendations</h4><p class="rg-icon-content">As a member of our cross promotion network, your users discover valuable content from related sites</p>
215
<div class="rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/round-check.png" class="rg-small-icon"/></div>
216
<h4 class="rg-h4">Full set of growth tools</h4><p class="rg-icon-content">Optimized signup form, viral invites, site update emails, and more!</p>
217
- <?php /* ?><!--<div class="save-changes" style="font-weight: normal; text-align: center;"><a class="btn btn-large btn-warning save-next" href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>" target="_blank" style="margin: 15px">Learn more about Premium</a><br>
218
- <strong>Or take <a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=signup-popup&source=basic-settings">the tutorial</a> to customize your ReadyGraph settings</strong>
219
- </div><?php */ ?> </div>
220
<div style="width: 25%; margin: 1% 5% 0 0; float: left; background: #F0F0F0; border-radius: 15px;padding: 1% 2% 1% 1%"><h4 class="rg-h4">Select your plan</h4>
221
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_free" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Free - Stick with the Basic Plan</strong> </input><br><span style="margin-top: -12px">Basic tools, Promotion if content ranks highly</span></p></div>
222
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_19" style="font-weight: bold; margin: 12px 0" checked></div><p class="rg-icon-content"><strong>Get promoted to 2000 users monthly</strong></input><br><span style="margin-top: -12px">$19/month</span></p></div>
@@ -224,10 +131,7 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
224
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_149" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Get promoted to 100,000 users monthly</strong></input><br><span style="margin-top: -12px">$149/month</span></p></div>
225
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_no" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Don't promote my site</strong></input><br><span style="margin-top: -12px">Opt out of cross promotion network</span></p></div>
226
<div class="rg-icon-thumb" style="margin: 10px;width:100%"><input type="checkbox" id="plan-type" name="plan-type" value="annual" style="font-weight: bold">&nbsp;&nbsp; Save 20% with an annual plan</input></div>
227
- <?php /* ?><button type="button" onclick="subscribe_readygraph()">Form gets submitted</button>
228
- <div class="save-changes" style="font-weight: normal; text-align: center;"><a class="btn btn-large btn-warning save-next" href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>&payment-plan=" target="_blank" style="margin: 15px">Continue</a><br> <?php */ ?>
229
<div class="save-changes" style="font-weight: normal; text-align: center;"><a class="btn btn-large btn-warning save-next" href="#" style="margin: 15px" onclick="subscribe_readygraph()">Continue</a><br>
230
- <?php /* ?><strong>Or take <a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=signup-popup&source=basic-settings">the tutorial</a> to customize your ReadyGraph settings</strong><?php */ ?>
231
</div></div>
232
</div>
233
<?php } else { ?>
@@ -309,8 +213,9 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
309
</div>
310
<?php } ?>
311
</div>
312
</form>
313
- <script type="text/javascript" src="https://readygraph.com/scripts/readygraph.js"></script>
314
<script type="text/javascript" charset="utf-8">
315
function subscribe_readygraph() {
316
var radios = document.getElementsByName("select-plan");
@@ -326,15 +231,10 @@ function subscribe_readygraph() {
326
break;
327
}
328
}
329
-
330
var current_url = document.URL;
331
- <?php if(isset($_GET["tutorial"]) && $_GET["tutorial"] == "true"){ ?>
332
- var new_url = current_url.slice(0, -28);
333
- <?php } else { ?>
334
- var new_url = current_url.slice(0, -16);
335
- <?php } ?>
336
- url = 'https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>&payment_plan='+plan+'&is_annual='+annual+'&redirect_uri='+encodeURIComponent(new_url+'site-profile');
337
- current_url = new_url+'site-profile&readygraph_plan='+plan;
338
if (plan === "promote_free"){
339
window.location.href = current_url;
340
}
@@ -364,376 +264,6 @@ function popup_delay(n){
364
<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); ?>
365
window.location.replace("<?php echo $current_url[0].'&popup_delay=';?>"+n.value);
366
}
367
-
368
- var $ = jQuery;
369
- $(function () {
370
- var settings =
371
- {
372
- 'host': "www.readygraph.com"
373
- , 'clientId': "9838eb84c6da2fc44ab9"
374
- };
375
-
376
- var authHost = "https://" + settings.host;
377
- var resourceHost = "https://" + settings.host;
378
-
379
- // OAuth 2.0 Popup
380
- //
381
- var popupWindow=null;
382
- function openPopup(url)
383
- {
384
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
385
- else popupWindow = window.open(url,"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=515, height=330,top=" + (screen.height - 330)/2 + ",left=" + (screen.width - 515)/2);
386
- }
387
- function parent_disable() {
388
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
389
- }
390
-
391
- $("a.connect").click(function() {
392
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
393
- openPopup(url);
394
- $(document.body).bind('focus', parent_disable);
395
- $(document.body).bind('click', parent_disable);
396
- });
397
- $(".change-account").click(function() {
398
- document.cookie="readygraph_tutorial=true"
399
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
400
- var logout = authHost + '/oauth/logout?redirect=' + encodeURIComponent(url);
401
- openPopup(logout);
402
- $(document.body).bind('focus', parent_disable);
403
- $(document.body).bind('click', parent_disable);
404
- });
405
-
406
- // User Interface
407
- //
408
- $('.template').click(function() {
409
- $('#preview').attr('src', $(this).find('img').attr('src'));
410
- });
411
-
412
- // Manage OAuth 2.0 Redirect
413
- //
414
- var extractCode = function(hash) {
415
- var match = hash.match(/code=(\w+)/);
416
- return !!match && match[1];
417
- };
418
- var extractToken = function(hash) {
419
- var match = hash.match(/access_token=(\w+)/);
420
- return !!match && match[1];
421
- };
422
- var extractError = function(hash) {
423
- var match = hash.match(/error=(\w+)/);
424
- return !!match && match[1];
425
- };
426
-
427
- var code = extractCode(window.location.href);
428
- if (extractError(window.location.href) == 'access_denied') {
429
- window.close();
430
- }
431
- else if(code) {
432
- try { window.opener.setCode(code); }
433
- catch(ex) { }
434
- window.close();
435
- }
436
- else {
437
- $('.rgw-fb-login-button-iframe').hide();
438
- $('div.authenticate').show();
439
-
440
- if ($('[name="readygraph_access_token"]').val()) {
441
- $('.rgw-fb-login-button-iframe').show();
442
- $('div.authenticate').hide();
443
- $('div.authenticating').hide();
444
- $('div.authenticated').show();
445
-
446
- $('.email-address').text($('[name="readygraph_email"]').val());
447
-
448
- window.setup_readygraph($('[name="readygraph_application_id"]').val());
449
- $('.popup-delay').val($('[name="readygraph_delay"]').val());
450
- if ($('[name="readygraph_enable_popup"]').val() == "true"){
451
- $('.signup-popup').val('yes-center');
452
- }
453
- else if ($('[name="readygraph_enable_notification"]').val() == "true"){
454
- $('.signup-popup').val('yes-bottom-right');
455
- }
456
- else{
457
- $('.signup-popup').val('no');
458
- }
459
-
460
- //$('[name="readygraph_ad_format"][value="' + $('[name="_readygraph_ad_format"]').val() + '"]').parent().click();
461
- //$('[name="readygraph_ad_timing"][value="' + $('[name="_readygraph_ad_timing"]').val() + '"]').parent().click();
462
-
463
- //$('[name="readygraph_ad_delay"]').val($('[name="_readygraph_ad_delay"]').val());
464
- //$('[name="readygraph_ad_scroll"]').val($('[name="_readygraph_ad_scroll"]').val());
465
-
466
- $('.result').text('...');
467
- if ($('[name="readygraph_access_token"]').val()) {
468
- $.ajax({
469
- url: resourceHost + '/api/v1/insight_info'
470
- , beforeSend: function (xhr) {
471
- xhr.setRequestHeader('Authorization', "Bearer " + $('[name="readygraph_access_token"]').val());
472
- xhr.setRequestHeader('Accept', "application/json");
473
- }
474
- , method: 'POST'
475
- , success: function (response) {
476
- if (response.data) {
477
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
478
- } else {
479
- $('.result').text('Insight');
480
- }
481
- }
482
- , error: function (response) {
483
- refresh_access_token();
484
- }
485
- });
486
- }
487
- }
488
- }
489
-
490
- // Manage OAuth 2.0 Results
491
- //
492
- function refresh_access_token() {
493
- var refresh_token = $('[name="readygraph_refresh_token"]').val();
494
- if (refresh_token) {
495
- $('div.authenticate').hide();
496
- $('div.authenticating').show();
497
- $('div.authenticated').hide();
498
-
499
- $.ajax({
500
- url: resourceHost + '/oauth/access_token'
501
- , data: {
502
- grant_type: 'refresh_token',
503
- refresh_token: $('[name="readygraph_refresh_token"]').val(),
504
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
505
- client_id: settings.clientId
506
- }
507
- , method: 'POST'
508
- , success: function (response) {
509
- $('[name="readygraph_access_token"]').val(response.access_token);
510
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
511
- window.setAccessToken(response.access_token);
512
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
513
- }
514
- , error: function (response) {
515
- alert('We couldn\'t authenticate your account. Please check your internet connection.');
516
- $('div.authenticate').show();
517
- $('div.authenticating').hide();
518
- $('div.authenticated').hide();
519
- }
520
- });
521
- }
522
- }
523
- window.setCode = function(code) {
524
- $('.rgw-fb-login-button-iframe').hide();
525
- $('div.authenticate').hide();
526
- $('div.authenticating').show();
527
- $('div.authenticated').hide();
528
-
529
- $.ajax({
530
- url: resourceHost + '/oauth/access_token'
531
- , data: {
532
- grant_type: 'authorization_code',
533
- code: code,
534
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
535
- client_id: settings.clientId
536
- }
537
- , method: 'POST'
538
- , success: function (response) {
539
- if (response) {
540
- $('[name="readygraph_access_token"]').val(response.access_token);
541
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
542
- window.setAccessToken(response.access_token);
543
- } else {
544
- $('div.authenticating').hide();
545
- $('div.authenticate').show();
546
- }
547
- }
548
- });
549
- }
550
- window.setAccessToken = function(token) {
551
- $('.rgw-fb-login-button-iframe').hide();
552
- $('div.authenticate').hide();
553
- $('div.authenticating').show();
554
- $('div.authenticated').hide();
555
-
556
- $.ajax({
557
- url: resourceHost + '/api/v1/account_info'
558
- , beforeSend: function (xhr) {
559
- xhr.setRequestHeader('Authorization', "Bearer " + token);
560
- xhr.setRequestHeader('Accept', "application/json");
561
- }
562
- , method: 'POST'
563
- , success: function (response) {
564
- if (response.data) {
565
- $('[name="readygraph_access_token"]').val(token);
566
- $('[name="readygraph_email"]').val(response.data.email);
567
- $('[name="readygraph_application_id"]').val(response.data.application_id);
568
- $('#myForm')[0].submit();
569
- } else {
570
- $('div.authenticating').hide();
571
- $('div.authenticate').show();
572
- $('.rgw-fb-login-button-iframe').hide();
573
- }
574
- }
575
- });
576
- }
577
- });
578
- </script>
579
- <script>
580
- window.setup = false;
581
- window.refresh_readygraph = function() {};
582
- window.setup_readygraph = function(app_id) {
583
- if (window.setup) {
584
- window.refresh_readygraph();
585
- return;
586
- }
587
- window.setup = true;
588
- readygraph.setup({
589
- applicationId: app_id,
590
- isPreview: true,
591
- enableLoginWall: false,
592
- enableDistraction: false,
593
- enableAutoLogin: false,
594
- enableSidebar: false,
595
- enableNotification: false,
596
- enableInvite: false,
597
- enableOpenGraph: false,
598
- enableRgSeo: false
599
- });
600
- readygraph.ready(function() {
601
- readygraph.framework.require(['compact.sdk', 'facebook.sdk'], function() {
602
- var $ = readygraph.framework.jQuery;
603
- $.cookie('RGAuth', null);
604
- readygraph.framework.facebook.logout(function() {
605
- readygraph.framework.require(['invite'], function() {
606
- var VIEW_TYPE = {
607
- LOADING: 0,
608
- LOGIN_REQUIRE: 1,
609
- PERMISSION_REQUIRE: 2,
610
- DEFAULT: 3,
611
- LOGIN_WITH_EMAIL: 4,
612
- SIGNUP_WITH_EMAIL: 5,
613
- IMPORT_WITH_EMAIL: 6,
614
- FINISH: 10
615
- };
616
-
617
- var auth = new readygraph.framework.ui.AuthModel({
618
- dialog: true,
619
- 'inviter_profile_picture': 'https://graph.facebook.com/4/picture?type=normal&width=400&height=400'
620
- });
621
- $('.rg-preview-widget').html('');
622
- $('.rg-preview-widget').append(auth.lightbox.view.$el);
623
- $('.rgw-content').attr('style', 'position: relative !important;');
624
-
625
- var view = VIEW_TYPE.LOGIN_REQUIRE;
626
- auth.on('switch', function() {
627
- if (auth.view.currentView != view) { auth.view.switchView(view); }
628
- else auth.view.render();
629
- if (view == VIEW_TYPE.DEFAULT) {
630
- auth.view.$el.find('.rgw-invite-view').showAndAnimate();
631
- auth.view.$el.find('.rgw-follow-view').hideAndAnimate();
632
- auth.view.$el.commitTransition();
633
- }
634
- });
635
- auth.view.switchView(view);
636
-
637
- $(window).scroll(function() {
638
- $(window).trigger('rgw-invalidate');
639
- });
640
- $('.rg-preview-widget, .content-warp').scroll(function() {
641
- $(window).trigger('rgw-invalidate');
642
- });
643
- $(window).trigger('rgw-invalidate');
644
-
645
- $('.rg-vertical-tab').click(function() {
646
- saveContent(auth, $('.rg-preview-widget-container'), true);
647
-
648
- $('.rg-vertical-tab').removeClass('active');
649
- $(this).addClass('active');
650
- view = VIEW_TYPE[$(this).attr('tab')];
651
- if (auth.view.currentView != view) { auth.view.switchView(view); }
652
-
653
- $('.rg-preview-widget, .content-warp').scrollTop(10000);
654
- });
655
-
656
- enableContentEditable(auth, $('.rg-preview-widget-container'));
657
- restoreContent(auth, $('.rg-preview-widget-container'));
658
-
659
- $('.save').click(function() {
660
- $('.save').css('opacity', 0.4);
661
- saveContent(auth, $('.rg-preview-widget-container'), false);
662
- });
663
-
664
- window.refresh_readygraph = function() {
665
- restoreContent(auth, $('.rg-preview-widget-container'));
666
- }
667
- });
668
- });
669
- });
670
- });
671
- }
672
- function enableContentEditable(model, container) {
673
- model.view.$el.find('[rgw-data-key]').each(function() {
674
- var element = $(this);
675
- if (element.attr('rgw-data-editable') == 'false') return;
676
-
677
- if (element.attr('editing') != null) return;
678
- container.find('.special-button-container button').attr('disabled', 'disabled');
679
- element.text(readygraph.getSettings().get(element.attr('rgw-data-key')));
680
- element.attr('editing', '1');
681
- element.css({
682
- 'border': '2px dashed orange',
683
- 'position': 'relative',
684
- 'top': '-2px',
685
- 'margin-bottom': '-4px',
686
- 'background-color': '#FAFAC5'
687
- });
688
- element.attr('contenteditable', true);
689
- element.bind('paste', function(e) {
690
- e.preventDefault();
691
- });
692
- element.bind('keydown', function() { $('.save').css('opacity', '1.0'); });
693
- });
694
- }
695
- function saveContent(model, container, fake) {
696
- var settings = {};
697
- model.view.$el.find('[rgw-data-key]').each(function() {
698
- var element = $(this);
699
- if (element.attr('rgw-data-editable') == 'false') return;
700
- settings[element.attr('rgw-data-key')] = element.text();
701
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
702
- });
703
- if (!fake) {
704
- $('input[name="readygraph_settings"]').val(JSON.stringify(settings));
705
- $('#myForm')[0].submit();
706
- }
707
- }
708
- function restoreContent(model, container) {
709
- eval('window._TEMP='+$('input[name="readygraph_settings"]').val());
710
- var settings = window._TEMP;
711
- if (settings) {
712
- model.view.$el.find('[rgw-data-key]').each(function() {
713
- var element = $(this);
714
- if (element.attr('rgw-data-editable') == 'false') return;
715
- element.text(settings[element.attr('rgw-data-key')]);
716
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
717
- });
718
- }
719
- }
720
</script>
721
- <style>
722
- /* FOR INLINE WIDGET */
723
- .rgw-overlay {
724
- display: none !important;
725
- }
726
- .rgw-content-frame {
727
- left: 0 !important;
728
- top: 0 !important;
729
- position: relative !important;
730
- margin: 0 auto !important;
731
- border: solid 1px #cccccc;
732
- }
733
- .rgw-preview-warning {
734
- display: none !important;
735
- }
736
- .rgw-content {
737
- position: relative !important;
738
- }
739
- </style>
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
15
+ include("header.php");
16
+ if (!get_option('readygraph_application_id') || strlen(get_option('readygraph_application_id')) <= 0)s2_rg_connect();
17
if(isset($_GET["tutorial"]) && $_GET["tutorial"] == "true"){update_option('readygraph_tutorial',"true");}
18
else{update_option('readygraph_tutorial',"false");}
19
if(isset($_GET["readygraph_upgrade_notice"]) && $_GET["readygraph_upgrade_notice"] == "dismiss") {update_option('readygraph_upgrade_notice', 'false');}
21
if(isset($_GET["popup_position"]) && $_GET["popup_position"] == "center"){update_option('readygraph_enable_notification', 'true');update_option('readygraph_enable_popup', 'true');}
22
if(isset($_GET["popup_position"]) && $_GET["popup_position"] == "disabled"){update_option('readygraph_enable_notification', 'false');update_option('readygraph_enable_popup', 'false');}
23
if(isset($_GET["popup_delay"])){update_option('readygraph_delay', intval($_GET["popup_delay"]));}
24
+ if (!get_option('readygraph_plan') || strlen(get_option('readygraph_plan')) <= 0)update_option('readygraph_tutorial',"true");
25
?>
26
27
<form method="post" id="myForm">
28
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
29
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
33
<input type="hidden" name="readygraph_enable_notification" value="<?php echo get_option('readygraph_enable_notification', 'true') ?>">
34
<input type="hidden" name="readygraph_enable_popup" value="<?php echo get_option('readygraph_enable_popup', 'true') ?>">
35
36
+ <div>
37
<div class="authenticate" style="display: none;">
38
+ <div class="wrap1" style="min-height: 600px;">
39
+ <div id="icon-plugins" class="icon32"></div>
40
+ <h2>Earn Revenue with <?php echo $s2_main_plugin_title ?>'s ReadyGraph Growth Engine</h2>
41
+ <p style="display:none;color:red;" id="error"></p>
42
+ <div class="register-left">
43
<div class="alert" style="margin: 0px auto; padding: 15px; text-align: center;">
44
+ <h3>Make money and grow your site with ReadyGraph</h3>
45
<!-- <h3 style="margin-top: 0px; font-weight: 300;"><?php //echo $main_plugin_title ?>, Now with ReadyGraph</h3> -->
46
+
47
+
48
+ <?php if(get_option('readygraph_enable_monetize') && get_option('readygraph_enable_monetize') == "true") { ?>
49
+ <p style="padding: 20px 0px 10px 0px;"><a class="btn btn-primary connect" href="javascript:void(0);" style="font-size: 18px; padding: 10px 30px;">Growth Features Only<br><span style="font-size: 10px;">Connect ReadyGraph</span></a></p>
50
+
51
+ <p style="padding: 20px 0px 10px 0px;"><a class="btn btn-success" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=monetization-settings" style="font-size: 18px; padding: 20px 85px;">Settings</a></p>
52
+ <h5 style="padding: 0px 0px 20px 0px;font-weight: normal; text-align: center;"><img style="height: 30px;" src="<?php echo plugin_dir_url( __FILE__ );?>assets/check.png"/>Monetization Active</h5>
53
+ <?php } else {?>
54
+ <p style="padding: 20px 0px 10px 0px;">
55
+
56
+ <a class="btn btn-primary monetize" href="javascript:void(0);" style="font-size: 18px; padding: 10px 30px;">Start Earning Revenue<br><span style="font-size: 10px;">Connect ReadyGraph</span></a>
57
+ <span style="width: 100%; display: block;margin: 5px;">
58
+ <input type="checkbox" name="readygraph_monetize" value="1" checked disabled>Activate Monetization<br></span>
59
+ </p>
60
+ <p style="padding: 20px 0px 30px 0px;"><a class="btn btn-default connect" href="javascript:void(0);" style="font-size: 18px; padding: 10px 30px;">Growth Features Only<br><span style="font-size: 10px;">Connect ReadyGraph</span></a></p>
61
+ <?php } ?>
62
+
63
+
64
<!--<p style="padding: 0px 0px;"><a class="btn btn-default skip" href="javascript:void(0);" style="font-size: 10px; line-height: 20px; padding: 0 30px;">Skip ReadyGraph</a></p>-->
65
+ <p>Readygraph maximizes your Growth and Revenue</p>
66
<p style="text-align: left; padding: 0 20px;">
67
+ - Monetize mobile and web traffic with optimized, non-intrusive ad units<br>
68
- Get more traffic<br>
69
- Send automatic email digests of all your site posts<br>
70
- Get better deliverablility<br>
75
</div>
76
77
</div>
78
+ <div class="register-right">
79
+ <div class="form-wrap alert" style="font-size:12px;">
80
+ <p><h3>ReadyGraph grows your site</h3></p>
81
+ <p>ReadyGraph delivers audience growth and motivates users to come back.</p><br /><p><span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_currency.png"></span><span style="width: 90%;"><b>Maximize Revenue –</b> Compensate yourself for your hardwork with standardized, non-intrusive ad units. Optimized for mobile and web to maximize revenue. Powered by our high quality partner AdsOptimal.</span></span><br /><br />
82
+ <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_fb.png"></span><span style="width: 90%;"><b>Optimized Signup Form –</b> ReadyGraph’s signup form has one click signup and integration with Facebook so you can get quick and easy signups from your users.</span></span><br /><br />
83
+ <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_heart.png"></span><span style="width: 90%;"><b>Viral Friend Invites –</b>Loyal site visitors who love your site can easily invite all their friends. Readygraph encourages your visitors' friends to come and signup for your site too.</span></span><br /><br />
84
+ <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_mail.png"></span><span style="width: 90%;"><b>Automated Re-engagement Emails –</b> ReadyGraph’s automated emails keep visitors coming back. Send a daily or weekly digest of all your new posts and keep them informed about site activity, events, etc.</span></span><br /><br />
85
+ <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_chart.png"></span><span style="width: 90%;"><b>Analytics -</b> Track new subscribers, invites, traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data on the cloud so you can access from anywhere.</span></span><br /><br />
86
+ <span style="min-height: 50px;"><span class="rg-signup-icon rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/ub-icon.png" style="padding: 0 10px;"></span><span style="width: 90%;"><b>Your Site Promoted in UserBase Rankings -</b> Users vote on your latest content and top ranked posts are promoted on UserBase.com to thousands of people.</span></span><br /><br />
87
+ If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a> Feel free to check out our <a href="http://readygraph.com/faq/" target="_blank">FAQ</a> for a more comprehensive overview. You can also completely <a class="delete" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("deleteaccount");?>">Delete ReadyGraph</a> if you don't want access to our amazing growth tools. Either way, good luck building a massive userbase!<br/><br/>By connecting to ReadyGraph, you agree to our <a href="http://readygraph.com/tos/" target="_blank">Terms of Service</a> and <a href="http://readygraph.com/privacy/" target="_blank">Privacy Policy</a>.
88
+ </p>
89
+ </div>
90
+ </div>
91
+ </div>
92
</div>
93
<div class="authenticating" style="display: none;">
94
<div style="color: #ffffff; width: 350px; margin: 100px auto 0px; padding: 15px; border: solid 1px #2a388f; text-align: center; background-color: #2961cb; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px;">
95
+ <h3 style="margin-top: 0px; font-weight: 300;"><?php echo $s2_main_plugin_title ?>, Now with ReadyGraph</h3>
96
<h4 style="padding: 50px 0; line-height: 42px;">Retrieving Your Account..</h4>
97
+ <p>Activate Readygraph features to optimize <?php echo $s2_main_plugin_title ?> functionality. Signup For These Benefits:</p>
98
<p style="text-align: left; padding: 0 20px;">
99
- For qualifying sites, monetize traffic with optimized, non-intrusive ad units<br>
100
- Grow your subscribers faster<br>
106
</p>
107
</div>
108
</div>
109
+
110
<div class="authenticated" style="display: none;">
111
112
<?php if(get_option('readygraph_tutorial') && get_option('readygraph_tutorial') == "true"){ ?>
113
<div class="tutorial-true" style="margin: 5% auto;">
114
+ <h3 style="font-weight: normal; text-align: center;"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/check.png"/>Congratulations! <?php echo $s2_main_plugin_title; ?>'s ReadyGraph growth engine is now active.</h3>
115
116
<div style="width: 45%; margin: 1% 1% 0 10%; float: left">
117
<h3 style="font-weight: normal;color: grey;">Step 1: Choose a plan for exposure to more new users!</h3>
123
<h4 class="rg-h4">Content recommendations</h4><p class="rg-icon-content">As a member of our cross promotion network, your users discover valuable content from related sites</p>
124
<div class="rg-icon-thumb"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/round-check.png" class="rg-small-icon"/></div>
125
<h4 class="rg-h4">Full set of growth tools</h4><p class="rg-icon-content">Optimized signup form, viral invites, site update emails, and more!</p>
126
+ </div>
127
<div style="width: 25%; margin: 1% 5% 0 0; float: left; background: #F0F0F0; border-radius: 15px;padding: 1% 2% 1% 1%"><h4 class="rg-h4">Select your plan</h4>
128
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_free" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Free - Stick with the Basic Plan</strong> </input><br><span style="margin-top: -12px">Basic tools, Promotion if content ranks highly</span></p></div>
129
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_19" style="font-weight: bold; margin: 12px 0" checked></div><p class="rg-icon-content"><strong>Get promoted to 2000 users monthly</strong></input><br><span style="margin-top: -12px">$19/month</span></p></div>
131
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_149" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Get promoted to 100,000 users monthly</strong></input><br><span style="margin-top: -12px">$149/month</span></p></div>
132
<div style="margin: 10px;"><div class="rg-icon-thumb"><input type="radio" name="select-plan" value="promote_no" style="font-weight: bold; margin: 12px 0"></div><p class="rg-icon-content"><strong>Don't promote my site</strong></input><br><span style="margin-top: -12px">Opt out of cross promotion network</span></p></div>
133
<div class="rg-icon-thumb" style="margin: 10px;width:100%"><input type="checkbox" id="plan-type" name="plan-type" value="annual" style="font-weight: bold">&nbsp;&nbsp; Save 20% with an annual plan</input></div>
134
<div class="save-changes" style="font-weight: normal; text-align: center;"><a class="btn btn-large btn-warning save-next" href="#" style="margin: 15px" onclick="subscribe_readygraph()">Continue</a><br>
135
</div></div>
136
</div>
137
<?php } else { ?>
213
</div>
214
<?php } ?>
215
</div>
216
+ </div>
217
</form>
218
+
219
<script type="text/javascript" charset="utf-8">
220
function subscribe_readygraph() {
221
var radios = document.getElementsByName("select-plan");
231
break;
232
}
233
}
234
var current_url = document.URL;
235
+ var url_array = document.URL.split( '&' );
236
+ url = 'https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>&payment_plan='+plan+'&is_annual='+annual+'&redirect_uri='+encodeURIComponent(url_array[0]+'&ac=site-profile');
237
+ current_url = url_array[0]+'&ac=site-profile&readygraph_plan='+plan;
238
if (plan === "promote_free"){
239
window.location.href = current_url;
240
}
264
<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); ?>
265
window.location.replace("<?php echo $current_url[0].'&popup_delay=';?>"+n.value);
266
}
267
</script>
268
+
269
+ <?php include("footer.php"); ?>
extension/readygraph/customize-emails.php CHANGED
@@ -11,23 +11,8 @@
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
-
15
- function s2_disconnectReadyGraph(){
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
- s2_delete_rg_options();
19
- }
20
- function s2_deleteReadyGraph(){
21
- $app_id = get_option('readygraph_application_id');
22
- wp_remote_get( "http://readygraph.com/api/v1/tracking?event=uninstall_readygraph&app_id=$app_id" );
23
- s2_delete_rg_options();
24
- $dir = plugin_dir_path( __FILE__ );
25
- s2_rrmdir($dir);
26
- }
27
28
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "changeaccount")s2_disconnectReadyGraph();
29
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "deleteaccount")s2_deleteReadyGraph();
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 = explode("&", $_SERVER['REQUEST_URI']);
@@ -45,128 +30,11 @@ s2_rrmdir($dir);
45
}
46
?>
47
48
- <link rel="stylesheet" type="text/css" href="<?php echo plugins_url( 'assets/css/admin.css', __FILE__ ) ?>">
49
- <script type="text/javascript" src="<?php echo plugins_url( 'assets/js/admin.js', __FILE__ ) ?>"></script>
50
<form method="post" id="myForm">
51
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
52
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
53
<input type="hidden" name="readygraph_email" value="<?php echo get_option('readygraph_email', '') ?>">
54
<input type="hidden" name="readygraph_application_id" value="<?php echo get_option('readygraph_application_id', '') ?>">
55
-
56
- <div class="authenticate" style="display: none;">
57
- <div class="wrap1" style="min-height: 600px;">
58
-
59
- <div id="icon-plugins" class="icon32"></div>
60
- <h2>We've enhanced <?php echo $main_plugin_title ?> with ReadyGraph's User Growth Engine</h2>
61
-
62
- <p style="display:none;color:red;" id="error"></p>
63
- <div class="register-left">
64
- <div class="alert" style="margin: 0px auto; padding: 15px; text-align: center;">
65
- <h3>Activate ReadyGraph to get more traffic to your site</h3>
66
- <!-- <h3 style="margin-top: 0px; font-weight: 300;"><?php //echo $main_plugin_title ?>, Now with ReadyGraph</h3> -->
67
- <p style="padding: 50px 0px 30px 0px;"><a class="btn btn-primary connect" href="javascript:void(0);" style="font-size: 15px; line-height: 40px; padding: 0 30px;">Connect ReadyGraph</a></p>
68
- <!--<p style="padding: 0px 0px;"><a class="btn btn-default skip" href="javascript:void(0);" style="font-size: 10px; line-height: 20px; padding: 0 30px;">Skip ReadyGraph</a></p>-->
69
- <p>Readygraph adds more ways to connect to your users. </p>
70
- <p style="text-align: left; padding: 0 20px;">
71
- - Get more traffic<br>
72
- - Send automatic email digests of all your site posts<br>
73
- - Get better deliverablility<br>
74
- - Track performace and user activity
75
- </p>
76
- </div>
77
-
78
- </div>
79
-
80
- <div class="register-right">
81
- <div class="form-wrap alert" style="font-size:12px;">
82
- <p><h3>ReadyGraph grows your site</h3></p>
83
- <p>ReadyGraph delivers audience growth and motivates users to come back.</p><br /><p><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_fb.png"></span><b>Optimized Signup Form –</b> ReadyGraph’s signup form has one click signup and integration with Facebook so you can get quick and easy signups from your users.<br /><br /><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_heart.png"></span>
84
- <b>Viral Friend Invites –</b>Loyal site visitors who love your site can easily invite all their friends. Readygraph encourages your visitors' friends to come and signup for your site too.<br /><br /><b><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_mail.png"></span>Automated Re-engagement Emails –</b> ReadyGraph’s automated emails keep visitors coming back. Send a daily or weekly digest of all your new posts and keep them informed about site activity, events, etc.<br /><br /><b><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_chart.png"></span>Analytics -</b> Track new subscribers, invites, traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data on the cloud so you can access from anywhere.<br /><br />
85
- If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a></p>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- <div class="authenticating" style="display: none;">
91
- <div style="color: #ffffff; width: 350px; margin: 100px auto 0px; padding: 15px; border: solid 1px #2a388f; text-align: center; background-color: #2961cb; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px;">
92
- <h3 style="margin-top: 0px; font-weight: 300;"><?php echo $main_plugin_title ?>, Now with ReadyGraph</h3>
93
- <h4 style="padding: 50px 0; line-height: 42px;">Retrieving Your Account..</h4>
94
- <p>Activate Readygraph features to optimize <?php echo $main_plugin_title ?> functionality. Signup For These Benefits:</p>
95
- <p style="text-align: left; padding: 0 20px;">
96
- - Grow your subscribers faster<br>
97
- - Engage users with automated email updates<br>
98
- - Enhanced email deliverablility<br>
99
- - Track performace with user-activity analytics
100
- </p>
101
- </div>
102
- </div>
103
- <style>a.help-tooltip {outline:none; }a.help-tooltip strong {line-height:30px;}a.help-tooltip:hover {text-decoration:none;} a.help-tooltip span { z-index:10;display:none; padding:14px 20px; margin-top:40px; margin-left:-150px; width:300px; line-height:16px;}a.help-tooltip:hover span{ display:inline; position:absolute; border:2px solid #FFF; background:#fff; text-align: justify; z-index:1000000000;}.callout {z-index:1000000000;position:absolute;border:0;top:-14px;left:120px;} /*CSS3 extras*/a.help-tooltip span{ border-radius:2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -moz-box-shadow: 0px 0px 8px 4px #666; -webkit-box-shadow: 0px 0px 8px 4px #666; box-shadow: 0px 0px 8px 4px #666;}</style>
104
- <div class="authenticated" style="display: none;">
105
- <div style="background-color: #2961cb; min-width: 90%; height: 50px;margin-right: 1%;">
106
- <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/white-logo.png" style="width: 138px; height: 30px; margin: 10px 0 0 15px; float: left;">
107
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
108
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
109
- <span class="email-address" style="text-shadow: none;"></span> <span class="caret"></span>
110
- </button>
111
- <ul class="dropdown-menu">
112
- <li><a class="change-account" href="#">Change Account</a></li>
113
- <li><a class="disconnect" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("changeaccount");?>">Disconnect</a></li>
114
- <li><a class="delete" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("deleteaccount");?>">Delete ReadyGraph</a></li>
115
- </ul>
116
- </div>
117
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
118
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
119
- <span class="result" style="text-shadow: none;">...</span> <span class="caret"></span>
120
- </button>
121
- <ul class="dropdown-menu">
122
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Insights</a></li>
123
- </ul>
124
- </div>
125
- <div style="clear: both;"></div>
126
- </div>
127
- <!-- write menu code-->
128
-
129
- <div class="readygraph-nav-menu">
130
- <ul><li>Grow Users
131
- <ul>
132
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=signup-popup">Signup Popup</a></li>
133
- <li><a href="https://readygraph.com/application/insights/" target="_blank">User Statistics</a></li>
134
- <li><a href="#"></a></li>
135
- </ul>
136
- </li>
137
- <li>Email Users
138
- <ul>
139
- <li><a href="https://readygraph.com/application/customize/settings/email/welcome/" target="_blank">Retention Email</a></li>
140
- <li><a href="https://readygraph.com/application/customize/settings/email/invitation/" target="_blank">Invitation Email</a></li>
141
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Custom Email</a></li>
142
- </ul>
143
- </li>
144
- <li>
145
- Engage Users
146
- <ul>
147
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=social-feed">Social Feed</a></li>
148
- <li><a href="#">Social Followers</a></li>
149
- <li><a href="#">Feedback Survey</a></li>
150
- </ul>
151
- </li>
152
- <li>Basic Settings
153
- <ul>
154
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=site-profile">Site Profile</a></li>
155
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=feature-settings">Feature Settings</a></li><li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=monetization-settings">Monetization Settings</a></li>
156
- </ul>
157
- </li>
158
- </ul>
159
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
160
- <p><a href="mailto:info@readygraph.com" style="color: #b1c1ca" >Help <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/9.png"/></a></p>
161
- </div>
162
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
163
- <p>
164
- <a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=faq" style="color: #b1c1ca" >FAQ <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/10.png" /></a></p>
165
- </div>
166
- <div class="btn-group" style="">
167
- <p><a href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>" target="_blank" style="color: #b1c1ca" ><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/go-premium.png" height="40px" style="margin:5px" /></a></p>
168
- </div>
169
- </div>
170
<div class="tutorial-true" style="margin: 5% auto;">
171
<h3 style="font-weight: normal; text-align: center;">Next Step: Customize automated emails to engage your userbase</h3>
172
<h4 style="font-weight: normal; text-align: center;">Head over to ReadyGraph.com to customize emails such as:</h4>
@@ -180,378 +48,6 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
180
<a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=basic-settings" style="margin: 15px">Skip, End Tutorial</a>
181
</div></div>
182
</div>
183
-
184
- </div>
185
- </form>
186
- <script type="text/javascript" src="https://readygraph.com/scripts/readygraph.js"></script>
187
- <script type="text/javascript" charset="utf-8">
188
- var $ = jQuery;
189
- $(function () {
190
- var settings =
191
- {
192
- 'host': "www.readygraph.com"
193
- , 'clientId': "9838eb84c6da2fc44ab9"
194
- };
195
196
- var authHost = "https://" + settings.host;
197
- var resourceHost = "https://" + settings.host;
198
-
199
- // OAuth 2.0 Popup
200
- //
201
- var popupWindow=null;
202
- function openPopup(url)
203
- {
204
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
205
- else popupWindow = window.open(url,"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=515, height=330,top=" + (screen.height - 330)/2 + ",left=" + (screen.width - 515)/2);
206
- }
207
- function parent_disable() {
208
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
209
- }
210
-
211
- $("a.connect").click(function() {
212
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
213
- openPopup(url);
214
- $(document.body).bind('focus', parent_disable);
215
- $(document.body).bind('click', parent_disable);
216
- });
217
- $(".change-account").click(function() {
218
- document.cookie="readygraph_tutorial=true"
219
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
220
- var logout = authHost + '/oauth/logout?redirect=' + encodeURIComponent(url);
221
- openPopup(logout);
222
- $(document.body).bind('focus', parent_disable);
223
- $(document.body).bind('click', parent_disable);
224
- });
225
-
226
- // User Interface
227
- //
228
- $('.template').click(function() {
229
- $('#preview').attr('src', $(this).find('img').attr('src'));
230
- });
231
-
232
- // Manage OAuth 2.0 Redirect
233
- //
234
- var extractCode = function(hash) {
235
- var match = hash.match(/code=(\w+)/);
236
- return !!match && match[1];
237
- };
238
- var extractToken = function(hash) {
239
- var match = hash.match(/access_token=(\w+)/);
240
- return !!match && match[1];
241
- };
242
- var extractError = function(hash) {
243
- var match = hash.match(/error=(\w+)/);
244
- return !!match && match[1];
245
- };
246
-
247
- var code = extractCode(window.location.href);
248
- if (extractError(window.location.href) == 'access_denied') {
249
- window.close();
250
- }
251
- else if(code) {
252
- try { window.opener.setCode(code); }
253
- catch(ex) { }
254
- window.close();
255
- }
256
- else {
257
- $('.rgw-fb-login-button-iframe').hide();
258
- $('div.authenticate').show();
259
-
260
- if ($('[name="readygraph_access_token"]').val()) {
261
- $('.rgw-fb-login-button-iframe').show();
262
- $('div.authenticate').hide();
263
- $('div.authenticating').hide();
264
- $('div.authenticated').show();
265
-
266
- $('.email-address').text($('[name="readygraph_email"]').val());
267
-
268
- window.setup_readygraph($('[name="readygraph_application_id"]').val());
269
- $('.delay').val($('[name="readygraph_delay"]').val());
270
- $('.sidebar').val($('[name="readygraph_enable_sidebar"]').val());
271
- $('.notification').val($('[name="readygraph_enable_notification"]').val());
272
- $('.selectAll').val($('[name="readygraph_auto_select_all"]').val());
273
- $('.branding').val($('[name="readygraph_enable_branding"]').val());
274
- $('.blog_updates').val($('[name="readygraph_send_blog_updates"]').val());
275
- $('.real_time_post_update').val($('[name="readygraph_send_real_time_post_updates"]').val());
276
- $('.popup_template').val($('[name="readygraph_popup_template"]').val());
277
-
278
- //$('[name="readygraph_ad_format"][value="' + $('[name="_readygraph_ad_format"]').val() + '"]').parent().click();
279
- //$('[name="readygraph_ad_timing"][value="' + $('[name="_readygraph_ad_timing"]').val() + '"]').parent().click();
280
-
281
- //$('[name="readygraph_ad_delay"]').val($('[name="_readygraph_ad_delay"]').val());
282
- //$('[name="readygraph_ad_scroll"]').val($('[name="_readygraph_ad_scroll"]').val());
283
-
284
- $('.result').text('...');
285
- if ($('[name="readygraph_access_token"]').val()) {
286
- $.ajax({
287
- url: resourceHost + '/api/v1/insight_info'
288
- , beforeSend: function (xhr) {
289
- xhr.setRequestHeader('Authorization', "Bearer " + $('[name="readygraph_access_token"]').val());
290
- xhr.setRequestHeader('Accept', "application/json");
291
- }
292
- , method: 'POST'
293
- , success: function (response) {
294
- if (response.data) {
295
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
296
- } else {
297
- $('.result').text('Insight');
298
- }
299
- }
300
- , error: function (response) {
301
- refresh_access_token();
302
- }
303
- });
304
- }
305
- }
306
- }
307
-
308
- // Manage OAuth 2.0 Results
309
- //
310
- function refresh_access_token() {
311
- var refresh_token = $('[name="readygraph_refresh_token"]').val();
312
- if (refresh_token) {
313
- $('div.authenticate').hide();
314
- $('div.authenticating').show();
315
- $('div.authenticated').hide();
316
-
317
- $.ajax({
318
- url: resourceHost + '/oauth/access_token'
319
- , data: {
320
- grant_type: 'refresh_token',
321
- refresh_token: $('[name="readygraph_refresh_token"]').val(),
322
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
323
- client_id: settings.clientId
324
- }
325
- , method: 'POST'
326
- , success: function (response) {
327
- $('[name="readygraph_access_token"]').val(response.access_token);
328
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
329
- window.setAccessToken(response.access_token);
330
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
331
- }
332
- , error: function (response) {
333
- alert('We couldn\'t authenticate your account. Please check your internet connection.');
334
- $('div.authenticate').show();
335
- $('div.authenticating').hide();
336
- $('div.authenticated').hide();
337
- }
338
- });
339
- }
340
- }
341
- window.setCode = function(code) {
342
- $('.rgw-fb-login-button-iframe').hide();
343
- $('div.authenticate').hide();
344
- $('div.authenticating').show();
345
- $('div.authenticated').hide();
346
-
347
- $.ajax({
348
- url: resourceHost + '/oauth/access_token'
349
- , data: {
350
- grant_type: 'authorization_code',
351
- code: code,
352
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
353
- client_id: settings.clientId
354
- }
355
- , method: 'POST'
356
- , success: function (response) {
357
- if (response) {
358
- $('[name="readygraph_access_token"]').val(response.access_token);
359
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
360
- window.setAccessToken(response.access_token);
361
- } else {
362
- $('div.authenticating').hide();
363
- $('div.authenticate').show();
364
- }
365
- }
366
- });
367
- }
368
- window.setAccessToken = function(token) {
369
- $('.rgw-fb-login-button-iframe').hide();
370
- $('div.authenticate').hide();
371
- $('div.authenticating').show();
372
- $('div.authenticated').hide();
373
-
374
- $.ajax({
375
- url: resourceHost + '/api/v1/account_info'
376
- , beforeSend: function (xhr) {
377
- xhr.setRequestHeader('Authorization', "Bearer " + token);
378
- xhr.setRequestHeader('Accept', "application/json");
379
- }
380
- , method: 'POST'
381
- , success: function (response) {
382
- if (response.data) {
383
- $('[name="readygraph_access_token"]').val(token);
384
- $('[name="readygraph_email"]').val(response.data.email);
385
- $('[name="readygraph_application_id"]').val(response.data.application_id);
386
- $('#myForm')[0].submit();
387
- } else {
388
- $('div.authenticating').hide();
389
- $('div.authenticate').show();
390
- $('.rgw-fb-login-button-iframe').hide();
391
- }
392
- }
393
- });
394
- }
395
- });
396
- </script>
397
- <script>
398
- window.setup = false;
399
- window.refresh_readygraph = function() {};
400
- window.setup_readygraph = function(app_id) {
401
- if (window.setup) {
402
- window.refresh_readygraph();
403
- return;
404
- }
405
- window.setup = true;
406
- readygraph.setup({
407
- applicationId: app_id,
408
- isPreview: true,
409
- enableLoginWall: false,
410
- enableDistraction: false,
411
- enableAutoLogin: false,
412
- enableSidebar: false,
413
- enableNotification: false,
414
- enableInvite: false,
415
- enableOpenGraph: false,
416
- enableRgSeo: false
417
- });
418
- readygraph.ready(function() {
419
- readygraph.framework.require(['compact.sdk', 'facebook.sdk'], function() {
420
- var $ = readygraph.framework.jQuery;
421
- $.cookie('RGAuth', null);
422
- readygraph.framework.facebook.logout(function() {
423
- readygraph.framework.require(['invite'], function() {
424
- var VIEW_TYPE = {
425
- LOADING: 0,
426
- LOGIN_REQUIRE: 1,
427
- PERMISSION_REQUIRE: 2,
428
- DEFAULT: 3,
429
- LOGIN_WITH_EMAIL: 4,
430
- SIGNUP_WITH_EMAIL: 5,
431
- IMPORT_WITH_EMAIL: 6,
432
- FINISH: 10
433
- };
434
-
435
- var auth = new readygraph.framework.ui.AuthModel({
436
- dialog: true,
437
- 'inviter_profile_picture': 'https://graph.facebook.com/4/picture?type=normal&width=400&height=400'
438
- });
439
- $('.rg-preview-widget').html('');
440
- $('.rg-preview-widget').append(auth.lightbox.view.$el);
441
- $('.rgw-content').attr('style', 'position: relative !important;');
442
-
443
- var view = VIEW_TYPE.LOGIN_REQUIRE;
444
- auth.on('switch', function() {
445
- if (auth.view.currentView != view) { auth.view.switchView(view); }
446
- else auth.view.render();
447
- if (view == VIEW_TYPE.DEFAULT) {
448
- auth.view.$el.find('.rgw-invite-view').showAndAnimate();
449
- auth.view.$el.find('.rgw-follow-view').hideAndAnimate();
450
- auth.view.$el.commitTransition();
451
- }
452
- });
453
- auth.view.switchView(view);
454
-
455
- $(window).scroll(function() {
456
- $(window).trigger('rgw-invalidate');
457
- });
458
- $('.rg-preview-widget, .content-warp').scroll(function() {
459
- $(window).trigger('rgw-invalidate');
460
- });
461
- $(window).trigger('rgw-invalidate');
462
-
463
- $('.rg-vertical-tab').click(function() {
464
- saveContent(auth, $('.rg-preview-widget-container'), true);
465
-
466
- $('.rg-vertical-tab').removeClass('active');
467
- $(this).addClass('active');
468
- view = VIEW_TYPE[$(this).attr('tab')];
469
- if (auth.view.currentView != view) { auth.view.switchView(view); }
470
-
471
- $('.rg-preview-widget, .content-warp').scrollTop(10000);
472
- });
473
-
474
- enableContentEditable(auth, $('.rg-preview-widget-container'));
475
- restoreContent(auth, $('.rg-preview-widget-container'));
476
-
477
- $('.save').click(function() {
478
- $('.save').css('opacity', 0.4);
479
- saveContent(auth, $('.rg-preview-widget-container'), false);
480
- });
481
-
482
- window.refresh_readygraph = function() {
483
- restoreContent(auth, $('.rg-preview-widget-container'));
484
- }
485
- });
486
- });
487
- });
488
- });
489
- }
490
- function enableContentEditable(model, container) {
491
- model.view.$el.find('[rgw-data-key]').each(function() {
492
- var element = $(this);
493
- if (element.attr('rgw-data-editable') == 'false') return;
494
-
495
- if (element.attr('editing') != null) return;
496
- container.find('.special-button-container button').attr('disabled', 'disabled');
497
- element.text(readygraph.getSettings().get(element.attr('rgw-data-key')));
498
- element.attr('editing', '1');
499
- element.css({
500
- 'border': '2px dashed orange',
501
- 'position': 'relative',
502
- 'top': '-2px',
503
- 'margin-bottom': '-4px',
504
- 'background-color': '#FAFAC5'
505
- });
506
- element.attr('contenteditable', true);
507
- element.bind('paste', function(e) {
508
- e.preventDefault();
509
- });
510
- element.bind('keydown', function() { $('.save').css('opacity', '1.0'); });
511
- });
512
- }
513
- function saveContent(model, container, fake) {
514
- var settings = {};
515
- model.view.$el.find('[rgw-data-key]').each(function() {
516
- var element = $(this);
517
- if (element.attr('rgw-data-editable') == 'false') return;
518
- settings[element.attr('rgw-data-key')] = element.text();
519
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
520
- });
521
- if (!fake) {
522
- $('input[name="readygraph_settings"]').val(JSON.stringify(settings));
523
- $('#myForm')[0].submit();
524
- }
525
- }
526
- function restoreContent(model, container) {
527
- eval('window._TEMP='+$('input[name="readygraph_settings"]').val());
528
- var settings = window._TEMP;
529
- if (settings) {
530
- model.view.$el.find('[rgw-data-key]').each(function() {
531
- var element = $(this);
532
- if (element.attr('rgw-data-editable') == 'false') return;
533
- element.text(settings[element.attr('rgw-data-key')]);
534
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
535
- });
536
- }
537
- }
538
- </script>
539
- <style>
540
- /* FOR INLINE WIDGET */
541
- .rgw-overlay {
542
- display: none !important;
543
- }
544
- .rgw-content-frame {
545
- left: 0 !important;
546
- top: 0 !important;
547
- position: relative !important;
548
- margin: 0 auto !important;
549
- border: solid 1px #cccccc;
550
- }
551
- .rgw-preview-warning {
552
- display: none !important;
553
- }
554
- .rgw-content {
555
- position: relative !important;
556
- }
557
- </style>
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
+ include("header.php");
15
16
if (!get_option('readygraph_access_token') || strlen(get_option('readygraph_access_token')) <= 0) {
17
//redirect to main page
18
$current_url = explode("&", $_SERVER['REQUEST_URI']);
30
}
31
?>
32
33
<form method="post" id="myForm">
34
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
35
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
36
<input type="hidden" name="readygraph_email" value="<?php echo get_option('readygraph_email', '') ?>">
37
<input type="hidden" name="readygraph_application_id" value="<?php echo get_option('readygraph_application_id', '') ?>">
38
<div class="tutorial-true" style="margin: 5% auto;">
39
<h3 style="font-weight: normal; text-align: center;">Next Step: Customize automated emails to engage your userbase</h3>
40
<h4 style="font-weight: normal; text-align: center;">Head over to ReadyGraph.com to customize emails such as:</h4>
48
<a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=basic-settings" style="margin: 15px">Skip, End Tutorial</a>
49
</div></div>
50
</div>
51
52
+ </form>
53
+ <?php include("footer.php"); ?>
extension/readygraph/deactivate-readygraph.php CHANGED
@@ -11,23 +11,8 @@
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
15
- function s2_disconnectReadyGraph(){
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
- s2_delete_rg_options();
19
- }
20
- function s2_deleteReadyGraph(){
21
- $app_id = get_option('readygraph_application_id');
22
- wp_remote_get( "http://readygraph.com/api/v1/tracking?event=uninstall_readygraph&app_id=$app_id" );
23
- s2_delete_rg_options();
24
- $dir = plugin_dir_path( __FILE__ );
25
- s2_rrmdir($dir);
26
- }
27
-
28
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "changeaccount")s2_disconnectReadyGraph();
29
- if(isset($_GET["action"]) && base64_decode($_GET["action"]) == "deleteaccount")s2_deleteReadyGraph();
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 = explode("&", $_SERVER['REQUEST_URI']);
@@ -40,35 +25,9 @@ s2_rrmdir($dir);
40
if (isset($_POST["readygraph_application_id"])) update_option('readygraph_application_id', $_POST["readygraph_application_id"]);
41
if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
42
if (isset($_POST["retentionemaileditor"])) update_option('readygraph_invite_email', $_POST["retentionemaileditor"]);
43
- /*if (isset($_POST["readygraph_delay"])) {
44
- update_option('readygraph_delay', $_POST["delay"]);
45
- $app_id = get_option('readygraph_application_id');
46
- if ($_POST["delay"] >= 20000) wp_remote_get( "http://readygraph.com/api/v1/tracking?event=popup_delay&app_id=$app_id" );
47
- }
48
- if (isset($_POST["readygraph_enable_notification"])) update_option('readygraph_enable_notification', $_POST["notification"]);
49
- if (isset($_POST["readygraph_enable_sidebar"])) update_option('readygraph_enable_sidebar', $_POST["sidebar"]);
50
- if (isset($_POST["readygraph_auto_select_all"])) update_option('readygraph_auto_select_all', $_POST["selectAll"]);
51
- if (isset($_POST["readygraph_enable_branding"])) update_option('readygraph_enable_branding', $_POST["branding"]);
52
- if (isset($_POST["readygraph_send_blog_updates"])) update_option('readygraph_send_blog_updates', $_POST["blog_updates"]);
53
- if (isset($_POST["readygraph_send_real_time_post_updates"])) update_option('readygraph_send_real_time_post_updates', $_POST["real_time_post_update"]);
54
- if (isset($_POST["readygraph_popup_template"])) update_option('readygraph_popup_template', $_POST["popup_template"]);
55
- /*if (isset($_POST["readygraph_popup_template_background"])) update_option('readygraph_popup_template_background', $_POST["readygraph_popup_template_background"]);
56
- if (isset($_POST["readygraph_popup_template_text"])) update_option('readygraph_popup_template_text', $_POST["readygraph_popup_template_text"]);
57
- if (isset($_POST["readygraph_popup_template_button"])) update_option('readygraph_popup_template_button', $_POST["readygraph_popup_template_button"]);*/
58
-
59
}
60
- if (get_option('readygraph_enable_branding', '') == 'false') {
61
- ?>
62
- <style>
63
- /* FOR INLINE WIDGET */
64
- .rgw-text {
65
- display: none !important;
66
- }
67
- </style>
68
- <?php } ?>
69
70
- <link rel="stylesheet" type="text/css" href="<?php echo plugins_url( 'assets/css/admin.css', __FILE__ ) ?>">
71
- <script type="text/javascript" src="<?php echo plugins_url( 'assets/js/admin.js', __FILE__ ) ?>"></script>
72
<form method="post" id="myForm">
73
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
74
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
@@ -83,124 +42,7 @@ s2_rrmdir($dir);
83
<input type="hidden" name="readygraph_send_blog_updates" value="<?php echo get_option('readygraph_send_blog_updates', 'true') ?>">
84
<input type="hidden" name="readygraph_send_real_time_post_updates" value="<?php echo get_option('readygraph_send_real_time_post_updates', 'false') ?>">
85
<input type="hidden" name="readygraph_popup_template" value="<?php echo get_option('readygraph_popup_template', 'default-template') ?>">
86
- <!--<input type="hidden" name="readygraph_popup_template_background" value="<?php //echo get_option('readygraph_popup_template_background', '') ?>">
87
- <input type="hidden" name="readygraph_popup_template_text" value="<?php //echo get_option('readygraph_popup_template_text', '') ?>">
88
- <input type="hidden" name="readygraph_popup_template_button" value="<?php //echo get_option('readygraph_popup_template_button', '') ?>">-->
89
-
90
- <div class="authenticate" style="display: none;">
91
- <div class="wrap1" style="min-height: 600px;">
92
-
93
- <div id="icon-plugins" class="icon32"></div>
94
- <h2>We've enhanced <?php echo $main_plugin_title ?> with ReadyGraph's User Growth Engine</h2>
95
-
96
- <p style="display:none;color:red;" id="error"></p>
97
- <div class="register-left">
98
- <div class="alert" style="margin: 0px auto; padding: 15px; text-align: center;">
99
- <h3>Activate ReadyGraph to get more traffic to your site</h3>
100
- <!-- <h3 style="margin-top: 0px; font-weight: 300;"><?php //echo $main_plugin_title ?>, Now with ReadyGraph</h3> -->
101
- <p style="padding: 50px 0px 30px 0px;"><a class="btn btn-primary connect" href="javascript:void(0);" style="font-size: 15px; line-height: 40px; padding: 0 30px;">Connect ReadyGraph</a></p>
102
- <!--<p style="padding: 0px 0px;"><a class="btn btn-default skip" href="javascript:void(0);" style="font-size: 10px; line-height: 20px; padding: 0 30px;">Skip ReadyGraph</a></p>-->
103
- <p>Readygraph adds more ways to connect to your users. </p>
104
- <p style="text-align: left; padding: 0 20px;">
105
- - Get more traffic<br>
106
- - Send automatic email digests of all your site posts<br>
107
- - Get better deliverablility<br>
108
- - Track performace and user activity
109
- </p>
110
- </div>
111
-
112
- </div>
113
-
114
- <div class="register-right">
115
- <div class="form-wrap alert" style="font-size:12px;">
116
- <p><h3>ReadyGraph grows your site</h3></p>
117
- <p>ReadyGraph delivers audience growth and motivates users to come back.</p><br /><p><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_fb.png"></span><b>Optimized Signup Form –</b> ReadyGraph’s signup form has one click signup and integration with Facebook so you can get quick and easy signups from your users.<br /><br /><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_heart.png"></span>
118
- <b>Viral Friend Invites –</b>Loyal site visitors who love your site can easily invite all their friends. Readygraph encourages your visitors' friends to come and signup for your site too.<br /><br /><b><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_mail.png"></span>Automated Re-engagement Emails –</b> ReadyGraph’s automated emails keep visitors coming back. Send a daily or weekly digest of all your new posts and keep them informed about site activity, events, etc.<br /><br /><b><span class="rg-signup-icon"><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/icon_chart.png"></span>Analytics -</b> Track new subscribers, invites, traffic, and other key metrics that quantify growth and user engagement. ReadyGraph safely stores user data on the cloud so you can access from anywhere.<br /><br />
119
- If you have questions or concerns contact us anytime at <a href="mailto:info@readygraph.com" target="_blank">info@readygraph.com</a></p>
120
- </div>
121
- </div>
122
- </div>
123
- </div>
124
- <div class="authenticating" style="display: none;">
125
- <div style="color: #ffffff; width: 350px; margin: 100px auto 0px; padding: 15px; border: solid 1px #2a388f; text-align: center; background-color: #2961cb; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px;">
126
- <h3 style="margin-top: 0px; font-weight: 300;"><?php echo $main_plugin_title ?>, Now with ReadyGraph</h3>
127
- <h4 style="padding: 50px 0; line-height: 42px;">Retrieving Your Account..</h4>
128
- <p>Activate Readygraph features to optimize <?php echo $main_plugin_title ?> functionality. Signup For These Benefits:</p>
129
- <p style="text-align: left; padding: 0 20px;">
130
- - Grow your subscribers faster<br>
131
- - Engage users with automated email updates<br>
132
- - Enhanced email deliverablility<br>
133
- - Track performace with user-activity analytics
134
- </p>
135
- </div>
136
- </div>
137
- <style>a.help-tooltip {outline:none; }a.help-tooltip strong {line-height:30px;}a.help-tooltip:hover {text-decoration:none;} a.help-tooltip span { z-index:10;display:none; padding:14px 20px; margin-top:40px; margin-left:-150px; width:300px; line-height:16px;}a.help-tooltip:hover span{ display:inline; position:absolute; border:2px solid #FFF; background:#fff; text-align: justify; z-index:1000000000;}.callout {z-index:1000000000;position:absolute;border:0;top:-14px;left:120px;} /*CSS3 extras*/a.help-tooltip span{ border-radius:2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -moz-box-shadow: 0px 0px 8px 4px #666; -webkit-box-shadow: 0px 0px 8px 4px #666; box-shadow: 0px 0px 8px 4px #666;}</style>
138
- <div class="authenticated" style="display: none;">
139
- <div style="background-color: #2961cb; min-width: 90%; height: 50px;margin-right: 1%;">
140
- <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/white-logo.png" style="width: 138px; height: 30px; margin: 10px 0 0 15px; float: left;">
141
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
142
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
143
- <span class="email-address" style="text-shadow: none;"></span> <span class="caret"></span>
144
- </button>
145
- <ul class="dropdown-menu">
146
- <li><a class="change-account" href="#">Change Account</a></li>
147
- <li><a class="disconnect" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("changeaccount");?>">Disconnect</a></li>
148
- <li><a class="delete" href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&action=<?php echo base64_encode("deleteaccount");?>">Delete ReadyGraph</a></li>
149
- </ul>
150
- </div>
151
- <div class="btn-group pull-right" style="margin: 8px 10px 0 0;">
152
- <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" style="background: transparent; border-color: #ffffff; color: #ffffff; ">
153
- <span class="result" style="text-shadow: none;">...</span> <span class="caret"></span>
154
- </button>
155
- <ul class="dropdown-menu">
156
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Insights</a></li>
157
- </ul>
158
- </div>
159
- <div style="clear: both;"></div>
160
- </div>
161
- <!-- write menu code-->
162
163
- <div class="readygraph-nav-menu">
164
- <ul><li>Grow Users
165
- <ul>
166
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=signup-popup">Signup Popup</a></li>
167
- <li><a href="https://readygraph.com/application/insights/" target="_blank">User Statistics</a></li>
168
- <li><a href="#"></a></li>
169
- </ul>
170
- </li>
171
- <li>Email Users
172
- <ul>
173
- <li><a href="https://readygraph.com/application/customize/settings/email/welcome/" target="_blank">Retention Email</a></li>
174
- <li><a href="https://readygraph.com/application/customize/settings/email/invitation/" target="_blank">Invitation Email</a></li>
175
- <li><a href="http://readygraph.com/application/insights/" target="_blank">Custom Email</a></li>
176
- </ul>
177
- </li>
178
- <li>
179
- Engage Users
180
- <ul>
181
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=social-feed">Social Feed</a></li>
182
- <li><a href="#">Social Followers</a></li>
183
- <li><a href="#">Feedback Survey</a></li>
184
- </ul>
185
- </li>
186
- <li>Basic Settings
187
- <ul>
188
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=site-profile">Site Profile</a></li>
189
- <li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=feature-settings">Feature Settings</a></li><li><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=monetization-settings">Monetization Settings</a></li>
190
- </ul>
191
- </li>
192
- </ul>
193
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
194
- <p><a href="mailto:info@readygraph.com" style="color: #b1c1ca" >Help <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/9.png"/></a></p>
195
- </div>
196
- <div class="btn-group" style="margin: 8px 10px 0 10px;">
197
- <p>
198
- <a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>&ac=faq" style="color: #b1c1ca" >FAQ <img src="<?php echo plugin_dir_url( __FILE__ );?>assets/10.png" /></a></p>
199
- </div>
200
- <div class="btn-group" style="">
201
- <p><a href="https://readygraph.com/accounts/payment/?email=<?php echo get_option('readygraph_email', '') ?>" target="_blank" style="color: #b1c1ca" ><img src="<?php echo plugin_dir_url( __FILE__ );?>assets/go-premium.png" height="40px" style="margin:5px" /></a></p>
202
- </div>
203
- </div>
204
<div style="margin: 0 5%">
205
<h2>Deactivate ReadyGraph</h2>
206
<h3> Uh oh! Are you sure you wish to deactivate ReadyGraph?</h3>
@@ -221,376 +63,5 @@ If you have questions or concerns contact us anytime at <a href="mailto:info@rea
221
<p>&nbsp;</p>
222
<p><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>">Nevermind, I want to keep growing my audience with ReadyGraph</a></p>
223
</div>
224
- </div>
225
</form>
226
- <script type="text/javascript" src="https://readygraph.com/scripts/readygraph.js"></script>
227
- <script type="text/javascript" charset="utf-8">
228
- var $ = jQuery;
229
- $(function () {
230
- var settings =
231
- {
232
- 'host': "www.readygraph.com"
233
- , 'clientId': "9838eb84c6da2fc44ab9"
234
- };
235
-
236
- var authHost = "https://" + settings.host;
237
- var resourceHost = "https://" + settings.host;
238
-
239
- // OAuth 2.0 Popup
240
- //
241
- var popupWindow=null;
242
- function openPopup(url)
243
- {
244
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
245
- else popupWindow = window.open(url,"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=515, height=330,top=" + (screen.height - 330)/2 + ",left=" + (screen.width - 515)/2);
246
- }
247
- function parent_disable() {
248
- if(popupWindow && !popupWindow.closed) popupWindow.focus();
249
- }
250
-
251
- $("a.connect").click(function() {
252
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
253
- openPopup(url);
254
- $(document.body).bind('focus', parent_disable);
255
- $(document.body).bind('click', parent_disable);
256
- });
257
- $(".change-account").click(function() {
258
- var url = authHost + '/oauth/authenticate?client_id=' + settings.clientId + '&redirect_uri=' + encodeURIComponent(location.href.replace('#' + location.hash,"")) + '&response_type=token';
259
- var logout = authHost + '/oauth/logout?redirect=' + encodeURIComponent(url);
260
- openPopup(logout);
261
- $(document.body).bind('focus', parent_disable);
262
- $(document.body).bind('click', parent_disable);
263
- });
264
-
265
- // User Interface
266
- //
267
- $('.template').click(function() {
268
- $('#preview').attr('src', $(this).find('img').attr('src'));
269
- });
270
-
271
- // Manage OAuth 2.0 Redirect
272
- //
273
- var extractCode = function(hash) {
274
- var match = hash.match(/code=(\w+)/);
275
- return !!match && match[1];
276
- };
277
- var extractToken = function(hash) {
278
- var match = hash.match(/access_token=(\w+)/);
279
- return !!match && match[1];
280
- };
281
- var extractError = function(hash) {
282
- var match = hash.match(/error=(\w+)/);
283
- return !!match && match[1];
284
- };
285
-
286
- var code = extractCode(window.location.href);
287
- if (extractError(window.location.href) == 'access_denied') {
288
- window.close();
289
- }
290
- else if(code) {
291
- try { window.opener.setCode(code); }
292
- catch(ex) { }
293
- window.close();
294
- }
295
- else {
296
- $('.rgw-fb-login-button-iframe').hide();
297
- $('div.authenticate').show();
298
-
299
- if ($('[name="readygraph_access_token"]').val()) {
300
- $('.rgw-fb-login-button-iframe').show();
301
- $('div.authenticate').hide();
302
- $('div.authenticating').hide();
303
- $('div.authenticated').show();
304
-
305
- $('.email-address').text($('[name="readygraph_email"]').val());
306
-
307
- window.setup_readygraph($('[name="readygraph_application_id"]').val());
308
- $('.delay').val($('[name="readygraph_delay"]').val());
309
- $('.sidebar').val($('[name="readygraph_enable_sidebar"]').val());
310
- $('.notification').val($('[name="readygraph_enable_notification"]').val());
311
- $('.selectAll').val($('[name="readygraph_auto_select_all"]').val());
312
- $('.branding').val($('[name="readygraph_enable_branding"]').val());
313
- $('.blog_updates').val($('[name="readygraph_send_blog_updates"]').val());
314
- $('.real_time_post_update').val($('[name="readygraph_send_real_time_post_updates"]').val());
315
- $('.popup_template').val($('[name="readygraph_popup_template"]').val());
316
-
317
- //$('[name="readygraph_ad_format"][value="' + $('[name="_readygraph_ad_format"]').val() + '"]').parent().click();
318
- //$('[name="readygraph_ad_timing"][value="' + $('[name="_readygraph_ad_timing"]').val() + '"]').parent().click();
319
-
320
- //$('[name="readygraph_ad_delay"]').val($('[name="_readygraph_ad_delay"]').val());
321
- //$('[name="readygraph_ad_scroll"]').val($('[name="_readygraph_ad_scroll"]').val());
322
-
323
- $('.result').text('...');
324
- if ($('[name="readygraph_access_token"]').val()) {
325
- $.ajax({
326
- url: resourceHost + '/api/v1/insight_info'
327
- , beforeSend: function (xhr) {
328
- xhr.setRequestHeader('Authorization', "Bearer " + $('[name="readygraph_access_token"]').val());
329
- xhr.setRequestHeader('Accept', "application/json");
330
- }
331
- , method: 'POST'
332
- , success: function (response) {
333
- if (response.data) {
334
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
335
- } else {
336
- $('.result').text('Insight');
337
- }
338
- }
339
- , error: function (response) {
340
- refresh_access_token();
341
- }
342
- });
343
- }
344
- }
345
- }
346
-
347
- // Manage OAuth 2.0 Results
348
- //
349
- function refresh_access_token() {
350
- var refresh_token = $('[name="readygraph_refresh_token"]').val();
351
- if (refresh_token) {
352
- $('div.authenticate').hide();
353
- $('div.authenticating').show();
354
- $('div.authenticated').hide();
355
-
356
- $.ajax({
357
- url: resourceHost + '/oauth/access_token'
358
- , data: {
359
- grant_type: 'refresh_token',
360
- refresh_token: $('[name="readygraph_refresh_token"]').val(),
361
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
362
- client_id: settings.clientId
363
- }
364
- , method: 'POST'
365
- , success: function (response) {
366
- $('[name="readygraph_access_token"]').val(response.access_token);
367
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
368
- window.setAccessToken(response.access_token);
369
- $('.result').text(response.data.subscribers + ((response.data.subscribers == 0) ? ' Subscriber' : ' Subscribers'));
370
- }
371
- , error: function (response) {
372
- alert('We couldn\'t authenticate your account. Please check your internet connection.');
373
- $('div.authenticate').show();
374
- $('div.authenticating').hide();
375
- $('div.authenticated').hide();
376
- }
377
- });
378
- }
379
- }
380
- window.setCode = function(code) {
381
- $('.rgw-fb-login-button-iframe').hide();
382
- $('div.authenticate').hide();
383
- $('div.authenticating').show();
384
- $('div.authenticated').hide();
385
-
386
- $.ajax({
387
- url: resourceHost + '/oauth/access_token'
388
- , data: {
389
- grant_type: 'authorization_code',
390
- code: code,
391
- redirect_uri: encodeURIComponent(location.href.replace('#' + location.hash,"")),
392
- client_id: settings.clientId
393
- }
394
- , method: 'POST'
395
- , success: function (response) {
396
- if (response) {
397
- $('[name="readygraph_access_token"]').val(response.access_token);
398
- $('[name="readygraph_refresh_token"]').val(response.refresh_token);
399
- window.setAccessToken(response.access_token);
400
- } else {
401
- $('div.authenticating').hide();
402
- $('div.authenticate').show();
403
- }
404
- }
405
- });
406
- }
407
- window.setAccessToken = function(token) {
408
- $('.rgw-fb-login-button-iframe').hide();
409
- $('div.authenticate').hide();
410
- $('div.authenticating').show();
411
- $('div.authenticated').hide();
412
-
413
- $.ajax({
414
- url: resourceHost + '/api/v1/account_info'
415
- , beforeSend: function (xhr) {
416
- xhr.setRequestHeader('Authorization', "Bearer " + token);
417
- xhr.setRequestHeader('Accept', "application/json");
418
- }
419
- , method: 'POST'
420
- , success: function (response) {
421
- if (response.data) {
422
- $('[name="readygraph_access_token"]').val(token);
423
- $('[name="readygraph_email"]').val(response.data.email);
424
- $('[name="readygraph_application_id"]').val(response.data.application_id);
425
- $('#myForm')[0].submit();
426
- } else {
427
- $('div.authenticating').hide();
428
- $('div.authenticate').show();
429
- $('.rgw-fb-login-button-iframe').hide();
430
- }
431
- }
432
- });
433
- }
434
- });
435
- </script>
436
- <script>
437
- window.setup = false;
438
- window.refresh_readygraph = function() {};
439
- window.setup_readygraph = function(app_id) {
440
- if (window.setup) {
441
- window.refresh_readygraph();
442
- return;
443
- }
444
- window.setup = true;
445
- readygraph.setup({
446
- applicationId: app_id,
447
- isPreview: true,
448
- enableLoginWall: false,
449
- enableDistraction: false,
450
- enableAutoLogin: false,
451
- enableSidebar: false,
452
- enableNotification: false,
453
- enableInvite: false,
454
- enableOpenGraph: false,
455
- enableRgSeo: false
456
- });
457
- readygraph.ready(function() {
458
- readygraph.framework.require(['compact.sdk', 'facebook.sdk'], function() {
459
- var $ = readygraph.framework.jQuery;
460
- $.cookie('RGAuth', null);
461
- readygraph.framework.facebook.logout(function() {
462
- readygraph.framework.require(['invite'], function() {
463
- var VIEW_TYPE = {
464
- LOADING: 0,
465
- LOGIN_REQUIRE: 1,
466
- PERMISSION_REQUIRE: 2,
467
- DEFAULT: 3,
468
- LOGIN_WITH_EMAIL: 4,
469
- SIGNUP_WITH_EMAIL: 5,
470
- IMPORT_WITH_EMAIL: 6,
471
- FINISH: 10
472
- };
473
-
474
- var auth = new readygraph.framework.ui.AuthModel({
475
- dialog: true,
476
- 'inviter_profile_picture': 'https://graph.facebook.com/4/picture?type=normal&width=400&height=400'
477
- });
478
- $('.rg-preview-widget').html('');
479
- $('.rg-preview-widget').append(auth.lightbox.view.$el);
480
- $('.rgw-content').attr('style', 'position: relative !important;');
481
-
482
- var view = VIEW_TYPE.LOGIN_REQUIRE;
483
- auth.on('switch', function() {
484
- if (auth.view.currentView != view) { auth.view.switchView(view); }
485
- else auth.view.render();
486
- if (view == VIEW_TYPE.DEFAULT) {
487
- auth.view.$el.find('.rgw-invite-view').showAndAnimate();
488
- auth.view.$el.find('.rgw-follow-view').hideAndAnimate();
489
- auth.view.$el.commitTransition();
490
- }
491
- });
492
- auth.view.switchView(view);
493
-
494
- $(window).scroll(function() {
495
- $(window).trigger('rgw-invalidate');
496
- });
497
- $('.rg-preview-widget, .content-warp').scroll(function() {
498
- $(window).trigger('rgw-invalidate');
499
- });
500
- $(window).trigger('rgw-invalidate');
501
-
502
- $('.rg-vertical-tab').click(function() {
503
- saveContent(auth, $('.rg-preview-widget-container'), true);
504
-
505
- $('.rg-vertical-tab').removeClass('active');
506
- $(this).addClass('active');
507
- view = VIEW_TYPE[$(this).attr('tab')];
508
- if (auth.view.currentView != view) { auth.view.switchView(view); }
509
-
510
- $('.rg-preview-widget, .content-warp').scrollTop(10000);
511
- });
512
-
513
- enableContentEditable(auth, $('.rg-preview-widget-container'));
514
- restoreContent(auth, $('.rg-preview-widget-container'));
515
-
516
- $('.save').click(function() {
517
- $('.save').css('opacity', 0.4);
518
- saveContent(auth, $('.rg-preview-widget-container'), false);
519
- });
520
-
521
- window.refresh_readygraph = function() {
522
- restoreContent(auth, $('.rg-preview-widget-container'));
523
- }
524
- });
525
- });
526
- });
527
- });
528
- }
529
- function enableContentEditable(model, container) {
530
- model.view.$el.find('[rgw-data-key]').each(function() {
531
- var element = $(this);
532
- if (element.attr('rgw-data-editable') == 'false') return;
533
-
534
- if (element.attr('editing') != null) return;
535
- container.find('.special-button-container button').attr('disabled', 'disabled');
536
- element.text(readygraph.getSettings().get(element.attr('rgw-data-key')));
537
- element.attr('editing', '1');
538
- element.css({
539
- 'border': '2px dashed orange',
540
- 'position': 'relative',
541
- 'top': '-2px',
542
- 'margin-bottom': '-4px',
543
- 'background-color': '#FAFAC5'
544
- });
545
- element.attr('contenteditable', true);
546
- element.bind('paste', function(e) {
547
- e.preventDefault();
548
- });
549
- element.bind('keydown', function() { $('.save').css('opacity', '1.0'); });
550
- });
551
- }
552
- function saveContent(model, container, fake) {
553
- var settings = {};
554
- model.view.$el.find('[rgw-data-key]').each(function() {
555
- var element = $(this);
556
- if (element.attr('rgw-data-editable') == 'false') return;
557
- settings[element.attr('rgw-data-key')] = element.text();
558
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
559
- });
560
- if (!fake) {
561
- $('input[name="readygraph_settings"]').val(JSON.stringify(settings));
562
- $('#myForm')[0].submit();
563
- }
564
- }
565
- function restoreContent(model, container) {
566
- eval('window._TEMP='+$('input[name="readygraph_settings"]').val());
567
- var settings = window._TEMP;
568
- if (settings) {
569
- model.view.$el.find('[rgw-data-key]').each(function() {
570
- var element = $(this);
571
- if (element.attr('rgw-data-editable') == 'false') return;
572
- element.text(settings[element.attr('rgw-data-key')]);
573
- readygraph.getSettings().set(element.attr('rgw-data-key'), element.text());
574
- });
575
- }
576
- }
577
- </script>
578
- <style>
579
- /* FOR INLINE WIDGET */
580
- .rgw-overlay {
581
- display: none !important;
582
- }
583
- .rgw-content-frame {
584
- left: 0 !important;
585
- top: 0 !important;
586
- position: relative !important;
587
- margin: 0 auto !important;
588
- border: solid 1px #cccccc;
589
- }
590
- .rgw-preview-warning {
591
- display: none !important;
592
- }
593
- .rgw-content {
594
- position: relative !important;
595
- }
596
- </style>
11
* @link http://www.readygraph.com
12
* @copyright 2014 Your Name or Company Name
13
*/
14
+ include("header.php");
15
16
if (!get_option('readygraph_access_token') || strlen(get_option('readygraph_access_token')) <= 0) {
17
//redirect to main page
18
$current_url = explode("&", $_SERVER['REQUEST_URI']);
25
if (isset($_POST["readygraph_application_id"])) update_option('readygraph_application_id', $_POST["readygraph_application_id"]);
26
if (isset($_POST["readygraph_settings"])) update_option('readygraph_settings', $_POST["readygraph_settings"]);
27
if (isset($_POST["retentionemaileditor"])) update_option('readygraph_invite_email', $_POST["retentionemaileditor"]);
28
}
29
+ ?>
30
31
<form method="post" id="myForm">
32
<input type="hidden" name="readygraph_access_token" value="<?php echo get_option('readygraph_access_token', '') ?>">
33
<input type="hidden" name="readygraph_refresh_token" value="<?php echo get_option('readygraph_refresh_token', '') ?>">
42
<input type="hidden" name="readygraph_send_blog_updates" value="<?php echo get_option('readygraph_send_blog_updates', 'true') ?>">
43
<input type="hidden" name="readygraph_send_real_time_post_updates" value="<?php echo get_option('readygraph_send_real_time_post_updates', 'false') ?>">
44
<input type="hidden" name="readygraph_popup_template" value="<?php echo get_option('readygraph_popup_template', 'default-template') ?>">
45
46
<div style="margin: 0 5%">
47
<h2>Deactivate ReadyGraph</h2>
48
<h3> Uh oh! Are you sure you wish to deactivate ReadyGraph?</h3>
63
<p>&nbsp;</p>
64
<p><a href="<?php $current_url = explode("&", $_SERVER['REQUEST_URI']); echo $current_url[0];?>">Nevermind, I want to keep growing my audience with ReadyGraph</a></p>
65
</div>
66
</form>
67
+ <?php include("footer.php"); ?>