ClickFunnels - Version 2.0.10

Version Description

Download this release

Release Info

Developer clickfunnels.com
Plugin Icon 128x128 ClickFunnels
Version 2.0.10
Comparing to
See all releases

Code changes from version 2.0.9 to 2.0.10

Files changed (3) hide show
  1. clickfunnels.php +106 -11
  2. footer.php +1 -1
  3. readme.txt +5 -1
clickfunnels.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ClickFunnels
4
  * Plugin URI: https://www.clickfunnels.com
5
  * Description: Connect to your ClickFunnels account with simple authorization key and show any ClickFunnels page as your homepage or as 404 error pages or simply choose any of your pages and make clean URLs to your ClickFunnels pages. Don't have an account? <a target="_blank" href="https://www.clickfunnels.com">Sign up for your 2 week <em>free</em> trial now.</a>
6
- * Version: 2.0.9
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
@@ -32,7 +32,83 @@ class ClickFunnels {
32
  if ( get_option( 'permalink_structure' ) == '' ) {
33
  $this->add_notice( 'ClickFunnels needs <a href="options-permalink.php">permalinks</a> enabled!', 0 );
34
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  public function updated_message( $messages ) {
37
  $post_id = get_the_ID();
38
  // make sure this is one of our pages
@@ -64,7 +140,7 @@ class ClickFunnels {
64
  }
65
  public function do_redirects() {
66
  global $page;
67
- header('Content-Type: text/html; charset=utf-8');
68
  $current = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
69
  // remove parameters
70
  $current = explode( "?", $current );
@@ -105,9 +181,16 @@ class ClickFunnels {
105
  $page = $this->get_clickgate();
106
  $cookiename = "_cf_clickgate_now";
107
  if ( !empty( $page['post_id'] ) ) {
108
- if (!$_COOKIE["clickgate_shown_$thepage[1]"]) {
 
 
 
 
 
 
109
  setcookie("clickgate_shown_$thepage[1]","seen",2147483647); // php cookies cannot go past year 2038
110
  echo do_shortcode("[clickfunnels_clickgate url='$thepage[7]']");
 
111
  }
112
  }
113
  }
@@ -115,15 +198,27 @@ class ClickFunnels {
115
  }
116
 
117
  else if ( $cf_options['clickgate']['page_id']) {
118
- $page = $this->get_clickgate();
119
- $cookiename = "_cf_clickgate_now";
120
- if ( !empty( $page['post_id'] ) ) {
121
- $thepage = explode( "{#}", $page['page_id'] );
122
- if (!$_COOKIE["clickgate_shown_$thepage[1]"]) {
123
- setcookie("clickgate_shown_$thepage[1]","seen",2147483647);
124
- echo do_shortcode("[clickfunnels_clickgate url='$thepage[7]']");
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
- }
 
127
  }
128
 
129
  }
3
  * Plugin Name: ClickFunnels
4
  * Plugin URI: https://www.clickfunnels.com
5
  * Description: Connect to your ClickFunnels account with simple authorization key and show any ClickFunnels page as your homepage or as 404 error pages or simply choose any of your pages and make clean URLs to your ClickFunnels pages. Don't have an account? <a target="_blank" href="https://www.clickfunnels.com">Sign up for your 2 week <em>free</em> trial now.</a>
6
+ * Version: 2.0.10
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
32
  if ( get_option( 'permalink_structure' ) == '' ) {
33
  $this->add_notice( 'ClickFunnels needs <a href="options-permalink.php">permalinks</a> enabled!', 0 );
34
  }
35
+
36
+ add_action( 'init', array( $this, 'remove_cookie' ) );
37
+ add_action( 'do_feed_rss', array($this, 'do_feed_rss'), 1);
38
+ add_action( 'do_feed_rss2', array($this, 'do_feed_rss'), 1);
39
+ add_action( 'wp_footer', array($this, 'add_custom_close_script'));
40
+ }
41
+
42
+ function add_custom_close_script(){
43
+
44
+ $cf_options = get_option( "cf_options" );
45
+ if ( $cf_options['clickgate']['page_id']):
46
+ $page = $this->get_clickgate();
47
+ if ( !empty( $page['post_id'] ) ):
48
+ $thepage = explode( "{#}", $page['page_id'] );
49
+ print_r($thepage);
50
+ echo '<script>
51
+
52
+ var timerId = setTimeout(function tick() {
53
+ var $iframe = jQuery(\'iframe[src^="' . $thepage[7] . '"]\'); //[src]
54
+
55
+ if( $iframe.length == 0 ){
56
+
57
+ var query = window.location.search.substring(1);
58
+ var vars = query.split("&");
59
+ for (var i=0; i < vars.length; i++) {
60
+ var pair = vars[i].split("=");
61
+ if(pair[0] == "redirect_to"){
62
+ window.location.replace( pair[1] );
63
+ }
64
+ }
65
+ }
66
+ timerId = setTimeout(tick, 2000);
67
+ }, 5000);
68
+
69
+ </script>';
70
+
71
+ endif;
72
+ endif;
73
+ }
74
+
75
+ public function remove_cookie(){
76
+ if(isset($_GET['remcook']) and $_GET['remcook'] == 1):
77
+ $cf_options = get_option( "cf_options" );
78
+ if ( $cf_options['clickgate']['page_id']):
79
+ $page = $this->get_clickgate();
80
+ if ( !empty( $page['post_id'] ) ):
81
+ $thepage = explode( "{#}", $page['page_id'] );
82
+ setcookie("clickgate_shown_$thepage[1]", "", -3600);
83
+ unset($_COOKIE["clickgate_shown_$thepage[1]"]);
84
+ endif;
85
+ endif;
86
+ endif;
87
  }
88
+
89
+ public function do_feed_rss(){
90
+ $cf_options = get_option( "cf_options" );
91
+ if ( $cf_options['clickgate']['page_id']):
92
+ $page = $this->get_clickgate();
93
+ if ( !empty( $page['post_id'] ) ):
94
+ $thepage = explode( "{#}", $page['page_id'] );
95
+
96
+ if(!isset($_COOKIE["clickgate_shown_$thepage[1]"])):
97
+ header( 'Location: ' . add_query_arg(
98
+ array('redirect_to' => add_query_arg( null, null),
99
+ 'remcook' => '1'),
100
+ home_url()
101
+ )
102
+ );
103
+ exit();
104
+ endif;
105
+
106
+ endif;
107
+ endif;
108
+
109
+ return;
110
+ }
111
+
112
  public function updated_message( $messages ) {
113
  $post_id = get_the_ID();
114
  // make sure this is one of our pages
140
  }
141
  public function do_redirects() {
142
  global $page;
143
+ //header('Content-Type: text/html; charset=utf-8');
144
  $current = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
145
  // remove parameters
146
  $current = explode( "?", $current );
181
  $page = $this->get_clickgate();
182
  $cookiename = "_cf_clickgate_now";
183
  if ( !empty( $page['post_id'] ) ) {
184
+ if(is_feed()){
185
+
186
+ setcookie("clickgate_shown_$thepage[1]","seen",-2147483647);
187
+ unset($_COOKIE["clickgate_shown_$thepage[1]"]);
188
+
189
+ } elseif (!$_COOKIE["clickgate_shown_$thepage[1]"]) {
190
+
191
  setcookie("clickgate_shown_$thepage[1]","seen",2147483647); // php cookies cannot go past year 2038
192
  echo do_shortcode("[clickfunnels_clickgate url='$thepage[7]']");
193
+
194
  }
195
  }
196
  }
198
  }
199
 
200
  else if ( $cf_options['clickgate']['page_id']) {
201
+
202
+ if(!is_feed()):
203
+
204
+ $page = $this->get_clickgate();
205
+ $cookiename = "_cf_clickgate_now";
206
+ if ( !empty( $page['post_id'] ) ) {
207
+ $thepage = explode( "{#}", $page['page_id'] );
208
+ if(is_feed()){
209
+
210
+ setcookie("clickgate_shown_$thepage[1]","seen",-2147483647);
211
+ unset($_COOKIE["clickgate_shown_$thepage[1]"]);
212
+
213
+ } elseif (!$_COOKIE["clickgate_shown_$thepage[1]"]) {
214
+
215
+ setcookie("clickgate_shown_$thepage[1]","seen",2147483647);
216
+ echo do_shortcode("[clickfunnels_clickgate url='$thepage[7]']");
217
+
218
+ }
219
  }
220
+
221
+ endif;
222
  }
223
 
224
  }
footer.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="copyrightInfo">
2
- <p><strong style="float: right;font-weight: 600;font-size: 11px;text-align: right;">Running Version 2.0.9</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
1
  <div class="copyrightInfo">
2
+ <p><strong style="float: right;font-weight: 600;font-size: 11px;text-align: right;">Running Version 2.0.10</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Author URI: https://profiles.wordpress.org/clickfunnelscom
6
  Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
7
  Requires at least: 3.0
8
  Tested up to: 4.4.1
9
- Stable tag: 2.0.9
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
@@ -100,6 +100,10 @@ By re-selecting the page it will ping the server which should refresh your page.
100
 
101
  Stay current with the latest version of the plugin:
102
 
 
 
 
 
103
  = Version 2.0.9 =
104
 
105
  * Add warning if there is no funnels in client account
6
  Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
7
  Requires at least: 3.0
8
  Tested up to: 4.4.1
9
+ Stable tag: 2.0.10
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
100
 
101
  Stay current with the latest version of the plugin:
102
 
103
+ = Version 2.0.10 =
104
+
105
+ * RSS clickgate fix
106
+
107
  = Version 2.0.9 =
108
 
109
  * Add warning if there is no funnels in client account