ClickFunnels - Version 1.0.9

Version Description

Download this release

Release Info

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

Code changes from version 1.0.8 to 1.0.9

Files changed (13) hide show
  1. CF_API.php +106 -31
  2. access.php +17 -12
  3. admin.php +1 -1
  4. admin_testing.php +0 -1
  5. cf-template.php +14 -0
  6. clickfunnels.php +236 -15
  7. css/admin.css +305 -0
  8. footer.php +1 -1
  9. geobg.png +0 -0
  10. js/admin.js +18 -7
  11. logo.png +0 -0
  12. readme.txt +11 -2
  13. support.php +65 -17
CF_API.php CHANGED
@@ -17,44 +17,119 @@ class CF_API {
17
  }
18
  return $funnels;
19
  }
20
- public function get_page_html( $funnel_id, $position = 0, $meta = "" ) {
21
  global $wp_query;
22
  if ($wp_query->is_404) {
23
  $wp_query->is_404 = false;
24
  }
25
  header("HTTP/1.1 200 OK");
26
- $newHTML = '<!DOCTYPE html>
 
 
 
27
  <html>
28
- <head>
29
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
30
- <meta content="utf-8" http-equiv="encoding">
31
- <!-- Powered by ClickFunnels.com -->
32
- <script>
33
- function getParameterByName(name) {
34
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
35
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
36
- results = regex.exec(location.search);
37
- return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
38
- }
39
- $preview = getParameterByName("preview");
40
- console.log($preview);
41
- if( $preview == "" ){
42
- // do nothing
43
- } else if( $preview == "control" ){
44
- document.cookie = "lander-ab-tests-240861=lander_control";
45
- } else{
46
- document.cookie = "lander-ab-tests-240861=lander_" + $preview;
47
- }
48
- </script>
49
- <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
50
- <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$position.'.js"></script>
51
- '.urldecode( $meta ).'
52
- <style>#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
53
- <meta name="nodo-proxy" content="html">
54
- </head>
55
- <body>
56
- </body>
 
 
 
 
 
57
  </html>';
 
 
58
  return $newHTML;
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
17
  }
18
  return $funnels;
19
  }
20
+ public function get_page_html( $funnel_id, $position = 0, $meta = "", $title = "", $desc = "", $social = "", $cf_iframe_url = "" ) {
21
  global $wp_query;
22
  if ($wp_query->is_404) {
23
  $wp_query->is_404 = false;
24
  }
25
  header("HTTP/1.1 200 OK");
26
+
27
+
28
+
29
+ $newHTML = '<!DOCTYPE html>
30
  <html>
31
+ <head>
32
+ <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
33
+ <meta content="utf-8" http-equiv="encoding">
34
+ <!-- Powered by ClickFunnels.com -->
35
+ <script>
36
+ function getParameterByName(name) {
37
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
38
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
39
+ results = regex.exec(location.search);
40
+ return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
41
+ }
42
+ $preview = getParameterByName("preview");
43
+ console.log($preview);
44
+ if( $preview == "" ){
45
+ // do nothing
46
+ } else if( $preview == "control" ){
47
+ document.cookie = "lander-ab-tests-240861=lander_control";
48
+ } else{
49
+ document.cookie = "lander-ab-tests-240861=lander_" + $preview;
50
+ }
51
+ </script>
52
+ <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
53
+ <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$position.'.js"></script>
54
+ '.urldecode( $meta ).'
55
+ <meta content="'.$title.'" property="og:title">
56
+ <meta content="'.$desc.'" property="og:description">
57
+ <meta content="'.$social.'" property="og:image">
58
+ <meta property="og:url" content="'.$cf_iframe_url.'">
59
+ <meta property="og:type" content="website">
60
+ <style>#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
61
+ <meta name="nodo-proxy" content="html">
62
+ </head>
63
+ <body>
64
+ </body>
65
  </html>';
66
+
67
+
68
  return $newHTML;
69
  }
70
+
71
+ public function get_page_iframe( $cf_iframe_url, $meta = "", $title = "", $desc = "", $social = "" ) {
72
+ global $wp_query;
73
+ if ($wp_query->is_404) {
74
+ $wp_query->is_404 = false;
75
+ }
76
+ header("HTTP/1.1 200 OK");
77
+
78
+
79
+
80
+ $baseURL = '<base target="_blank" />';
81
+ $iframeVersion = '<!DOCTYPE html>
82
+ <html>
83
+ <head>
84
+ <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
85
+ <meta content="utf-8" http-equiv="encoding">
86
+ <!-- Powered by ClickFunnels.com iFrame -->
87
+ '.urldecode( $meta ).'
88
+ <meta content="'.$title.'" property="og:title">
89
+ <meta content="'.$desc.'" property="og:description">
90
+ <meta content="'.$social.'" property="og:image">
91
+ <meta property="og:url" content="'.$cf_iframe_url.'">
92
+ <meta property="og:type" content="website">
93
+ <style>
94
+ * {
95
+ margin: 0 !important;
96
+ padding: 0 !important;
97
+ }
98
+ .container {
99
+ position: relative;
100
+ width: 100%;
101
+ height: 100%;
102
+ }
103
+ .video {
104
+ position: absolute;
105
+ top: 0;
106
+ left: 0;
107
+ width: 100%;
108
+ height: 100%;
109
+ }
110
+ </style>
111
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
112
+ <script>
113
+ $("body").ready(function () {
114
+ $(".socialheader_desc").attr("content", $("meta[name=description]").attr("content"));
115
+ $(".socialheader_title").attr("content", $("title").text());
116
+ $(".video").load(function () {
117
+ $(this).height($(document).height());
118
+ });
119
+ $( window ).resize(function() {
120
+ $(".video").height($(window).height());
121
+ });
122
+ $(".video").contents().find("head").append("hey");
123
+ });
124
+ </script>
125
+ </head>
126
+ <body>
127
+ <div class="container">
128
+ <iframe class="video" width="100%" height="100%" src="'.$cf_iframe_url.'" frameborder="0" allowfullscreen></iframe>
129
+ </div>
130
+ </body>
131
+ </html>';
132
+
133
+ return $iframeVersion;
134
+ }
135
  }
access.php CHANGED
@@ -1,3 +1,4 @@
 
1
  <style>
2
  .api {
3
  width: 780px;
@@ -23,7 +24,7 @@
23
  margin-bottom: 17px;
24
  }
25
  .apiHeader {
26
- background: #39464E url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
27
  border-bottom: 3px solid rgba(0,0,0,0.25);
28
  padding: 10px;
29
  padding-top: 15px;
@@ -31,7 +32,6 @@
31
  border-top-left-radius: 5px;
32
  }
33
  .apiHeader img {
34
- width: 200px;
35
  float: left;
36
  margin-left: 10px;
37
  }
@@ -43,7 +43,6 @@
43
  }
44
  .apiSubHeader {
45
  background-color: #0166AE;
46
- background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>);
47
  border-bottom: 3px solid rgba(0,0,0,0.25);
48
  color: #fff;
49
  padding: 20px;
@@ -125,6 +124,7 @@
125
  text-transform: uppercase;
126
  text-decoration: none;
127
  font-size: 14px;
 
128
  }
129
  .apiHeader a:hover {
130
  border: 2px solid #1D81C8;
@@ -136,26 +136,30 @@
136
  }
137
 
138
  #apiFooter {
139
- background: #F1F1F1;
140
-
141
- padding: 10px 14px;
142
- border-bottom-left-radius: 5px;
143
- border-bottom-right-radius: 5px;
 
 
 
144
  }
145
  #apiFooter a:hover {
146
  text-decoration: none;
147
  }
 
148
  #apiSettings {
149
  padding: 10px 25px;
150
  padding-top: 20px;
151
- border: 10px solid #F1F1F1;
152
  }
153
  </style>
154
  <link href="<?php echo plugins_url( 'css/font-awesome.css', __FILE__ ); ?>" rel="stylesheet">
155
  <div class="api postbox">
156
  <div class="apiHeader">
157
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
158
- <a href="https://www.clickfunnels.com/users/sign_in" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
159
  <br clear="all">
160
  </div>
161
  <div class="apiSubHeader">
@@ -203,9 +207,10 @@
203
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
204
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'post-new.php?post_type=clickfunnels' );?>"><i class="fa fa-plus-circle"></i> Add New</a>
205
  <a href="edit.php?post_type=clickfunnels&page=clickfunnels_support" class="button button-default" style="float: left"><i class="fa fa-life-ring"></i> Support</a>
206
- <button class="button-primary" style="float: right;margin-top: 5px;"><i class="fa fa-check-circle"></i> Save Settings</button>
207
- <br clear="both" /><br>
208
  </div>
 
209
  </form>
210
  <?php include('footer.php'); ?>
211
 
1
+
2
  <style>
3
  .api {
4
  width: 780px;
24
  margin-bottom: 17px;
25
  }
26
  .apiHeader {
27
+ background: #39464E repeat;
28
  border-bottom: 3px solid rgba(0,0,0,0.25);
29
  padding: 10px;
30
  padding-top: 15px;
32
  border-top-left-radius: 5px;
33
  }
34
  .apiHeader img {
 
35
  float: left;
36
  margin-left: 10px;
37
  }
43
  }
44
  .apiSubHeader {
45
  background-color: #0166AE;
 
46
  border-bottom: 3px solid rgba(0,0,0,0.25);
47
  color: #fff;
48
  padding: 20px;
124
  text-transform: uppercase;
125
  text-decoration: none;
126
  font-size: 14px;
127
+ margin-top: 5px !important;
128
  }
129
  .apiHeader a:hover {
130
  border: 2px solid #1D81C8;
136
  }
137
 
138
  #apiFooter {
139
+ background: #fafafa;
140
+ border-radius: 4px;
141
+ border: 1px solid #ddd;
142
+ margin-right: 120px;
143
+ border-bottom: 2px solid #ddd;
144
+ padding: 10px 10px;
145
+ margin: 0 auto;
146
+ width: 735px;
147
  }
148
  #apiFooter a:hover {
149
  text-decoration: none;
150
  }
151
+
152
  #apiSettings {
153
  padding: 10px 25px;
154
  padding-top: 20px;
155
+ border: 10px solid #fff;
156
  }
157
  </style>
158
  <link href="<?php echo plugins_url( 'css/font-awesome.css', __FILE__ ); ?>" rel="stylesheet">
159
  <div class="api postbox">
160
  <div class="apiHeader">
161
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
162
+ <a href="https://www.clickfunnels.com/login" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
163
  <br clear="all">
164
  </div>
165
  <div class="apiSubHeader">
207
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
208
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'post-new.php?post_type=clickfunnels' );?>"><i class="fa fa-plus-circle"></i> Add New</a>
209
  <a href="edit.php?post_type=clickfunnels&page=clickfunnels_support" class="button button-default" style="float: left"><i class="fa fa-life-ring"></i> Support</a>
210
+ <button class="button-primary" style="float: right;margin-top: 0px;"><i class="fa fa-check-circle"></i> Save Settings</button>
211
+ <br clear="both" />
212
  </div>
213
+ <br clear="both" />
214
  </form>
215
  <?php include('footer.php'); ?>
216
 
admin.php CHANGED
@@ -1 +1 @@
1
- <?php
2
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
3
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
4
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
5
  $thepage = explode( "{#}", $cf_page );
6
  $savedData = $cf_page;
7
  }
8
  else {
9
  $thepage = explode( "{#}", $cf_page['page_id'] );
10
  $savedData = $cf_page['page_id'];
11
  }
12
  $cf_options = get_option( "cf_options" );
13
  jQuery(document).ready(function(){
14
  // Set Correct Options
15
  var thefunnel = jQuery('#cf_thefunnel').val();
16
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
17
  jQuery('#cf_thepage').find('option').remove().end();
18
  jQuery('#loading').fadeIn();
19
  jQuery.getJSON(specificFunnel, function(data) {
20
  setTimeout(function() {
21
  jQuery('#loading').fadeOut();
22
  }, 2000);
23
  var is_selected = "";
24
  jQuery.each(data.funnel_steps, function() {
25
  if (this.pages != ''){
26
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
27
  is_selected = "selected";
28
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
29
  } else {
30
  is_selected = "";
31
  }
32
  if ( this.wp_friendly == true && this.pages != '' ) {
33
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'" '+is_selected+'>'+ this.name +'</option>');
34
  }
35
  }
36
  });
37
  }).done(function() {
38
  jQuery('#loading').fadeOut();
39
  })
40
  .fail(function() {
41
  jQuery('#loading').fadeOut();
42
  })
43
  .always(function() {
44
  jQuery('#loading').fadeOut();
45
  });
46
  // Change Funnel Populate Dropdown
47
  jQuery( '#cf_thefunnel' ).change(function() {
48
  jQuery('#loading').fadeIn();
49
  var thefunnel = jQuery(this).val();
50
  var totalPages = 0;
51
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
52
  jQuery('#cf_thepage').find('option').remove().end();
53
  jQuery.getJSON(specificFunnel, function(data) {
54
  setTimeout(function() {
55
  jQuery('#loading').fadeOut();
56
  }, 2000);
57
  // alert( specificFunnel);
58
  jQuery.each(data.funnel_steps, function() {
59
  if( this.wp_friendly == true && this.pages != '' ) {
60
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'">'+ this.name +'</option>');
61
  totalPages += 1;
62
  }
63
  });
64
  }).done(function() {
65
  jQuery('#loading').fadeOut();
66
  })
67
  .fail(function() {
68
  jQuery('#loading').fadeOut();
69
  })
70
  .always(function() {
71
  jQuery('#loading').fadeOut();
72
  });
73
  setTimeout(function() {
74
  if (totalPages == 0) {
75
  jQuery('#noPageWarning').fadeIn();
76
  }
77
  else {
78
  jQuery('#noPageWarning').hide();
79
  }
80
  var theposition = jQuery('#cf_thepage').val();
81
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
82
  var myString = thefunnel+'{#}'+theposition;
83
  var arr = myString.split('{#}');
84
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
85
  var do_ping = function() {
86
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
87
  }).catch(function(error) {
88
  });
89
  };
90
  do_ping();
91
  }, 3000);
92
  });
93
  var request_image = function(url) {
94
  return new Promise(function(resolve, reject) {
95
  var img = new Image();
96
  img.onload = function() { resolve(img); };
97
  img.onerror = function() { reject(url); };
98
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
99
  });
100
  };
101
  /**
102
  * Pings a url.
103
  * @param {String} url
104
  * @return {Promise} promise that resolves to a ping (ms, float).
105
  */
106
  var ping = function(url) {
107
  return new Promise(function(resolve, reject) {
108
  var start = (new Date()).getTime();
109
  var response = function() {
110
  var delta = ((new Date()).getTime() - start);
111
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
112
  delta /= 4;
113
  resolve(delta);
114
  };
115
  request_image(url).then(response).catch(response);
116
  // Set a timeout for max-pings, 5s.
117
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
118
  });
119
  };
120
  // Select New Page
121
  jQuery( '#cf_thepage' ).change(function() {
122
  jQuery('#loading').fadeOut();
123
  var thefunnel = jQuery('#cf_thefunnel').val();
124
  var theposition = jQuery(this).val();
125
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
126
  var myString = thefunnel+'{#}'+theposition;
127
  var arr = myString.split('{#}');
128
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
129
  var do_ping = function() {
130
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
131
  }).catch(function(error) {
132
  });
133
  };
134
  do_ping();
135
  });
136
  // Fade Out Message
137
  setTimeout(function() {
138
  jQuery('#message').fadeOut();
139
  }, 3500);
140
  // Savings
141
  jQuery('#publish').click(function() {
142
  jQuery('#saving').fadeIn();
143
  });
144
  jQuery('#delete').on('click', function () {
145
  return confirm('Are you sure you want to delete this page?');
146
  });
147
  jQuery('#cf_slug').bind('keyup keypress blur', function()
148
  {
149
  var myStr = jQuery(this).val()
150
  myStr=myStr.toLowerCase();
151
  myStr=myStr.replace(/\s/g , "-");
152
  jQuery('#cf_slug').val(myStr);
153
  });
154
  // Check Null and Resave v1.0.6
155
  <?php if ($thepage[1] == 'null') { ?>
156
  jQuery('#autosaving').fadeIn();
157
  setTimeout(function() {
158
  jQuery('form').submit();
159
  }, 2000);
160
  <?php } ?>
161
  });
162
  display: none !important;
163
  }
164
  #side-sortables {
165
  display: none !important;
166
  }
167
  #clickfunnels_meta_box {
168
  width: 780px !important;
169
  border-radius: 5px;
170
  }
171
  .button:active, .button:hover, .button:focus {
172
  outline: none !important;
173
  box-shadow: none !important;
174
  }
175
  #message {
176
  width: 752px;
177
  margin-bottom: 0;
178
  }
179
  .apiHeader {
180
  background: #39464E url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
181
  border-bottom: 3px solid rgba(0,0,0,0.25);
182
  padding: 10px;
183
  padding-top: 15px;
184
  border-top-left-radius: 5px;
185
  border-top-right-radius: 5px;
186
  clear: both;
187
  }
188
  .apiHeader img {
189
  width: 200px;
190
  float: left;
191
  margin-left: 10px;
192
  }
193
  .apiHeader a {
194
  float: right;
195
  display: block;
196
  color: #fff;
197
  font-size: 13px;
198
  text-decoration: none;
199
  margin-right: 5px !important;
200
  background-color: rgba(0, 0, 0, .3);
201
  border: 2px solid #2b2e30;
202
  color: #afbbc8 !important;
203
  font-weight: 700;
204
  -webkit-border-radius: 4px;
205
  -moz-border-radius: 4px;
206
  border-radius: 4px;
207
  padding: 7px;
208
  padding-left: 12px;
209
  padding-right: 12px;
210
  margin-top: 0px !important;
211
  text-transform: uppercase;
212
  text-decoration: none;
213
  font-size: 14px;
214
  }
215
  .apiHeader a:hover {
216
  border: 2px solid #1D81C8;
217
  background-color: rgba(0, 0, 0, .6);
218
  color: #fff !important;
219
  }
220
  .apiSubHeader {
221
  background-color: #0166AE;
222
  background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>);
223
  border-bottom: 3px solid rgba(0,0,0,0.25);
224
  color: #fff;
225
  padding: 15px 18px;
226
  }
227
  .apiSubHeader h2 {
228
  margin: 0 !important;
229
  padding: 0 !important;
230
  color: #fff;
231
  font-weight: bold;
232
  font-size: 17px;
233
  text-shadow: 1px 1px 0 #0367AE;
234
  }
235
  .apiSubHeader a.editThisPage {
236
  float: right;
237
  padding: 5px 10px;
238
  color: #fff;
239
  text-shadow: 1px 1px 0 #0367AE;
240
  text-decoration: none;
241
  padding-top: 15px;
242
  margin-top: 6px;
243
  font-size: 14px;
244
  border: 2px solid #1D81C8;
245
  background-color: #054B7C;
246
  color: #fff !important;
247
  font-weight: 700;
248
  -webkit-border-radius: 4px;
249
  -moz-border-radius: 4px;
250
  border-radius: 4px;
251
  padding: 7px;
252
  padding-left: 12px;
253
  padding-right: 12px;
254
  text-transform: uppercase;
255
  text-decoration: none;
256
  font-size: 12px;
257
  }
258
  .apiSubHeader a.editThisPage i {
259
  margin-right: 4px;
260
  }
261
  .apiSubHeader a.editThisPage:hover {
262
  border: 2px solid #FFB700;
263
  text-shadow: 1px 1px 0 #222;
264
  background-color: rgba(0, 0, 0, .6);
265
  color: #fff !important;
266
  }
267
  .apiSubHeader a{
268
  text-shadow: 1px 1px 0 #0367AE;
269
  color: #fff;
270
  text-decoration: none;
271
  font-size: 12px;
272
  opacity: .8;
273
  }
274
  .apiSubHeader a:hover {
275
  opacity: 1;
276
  }
277
  .inside {
278
  padding: 0 !important;
279
  margin-top: 0 !important;
280
  border-radius: 5px !important;
281
  }
282
  .inside h2 {
283
  display: block !important;
284
  }
285
  #postbox-container-2 {
286
  margin-top: -20px !important;
287
  }
288
  body #poststuff .hndle.ui-sortable-handle {
289
  display: none !important;
290
  }
291
  body #poststuff .handlediv {
292
  display: none !important;
293
  }
294
  #loading {
295
  float: left;
296
  margin-left: 10px;
297
  display: none;
298
  margin-top: 6px;
299
  color: #999;
300
  }
301
  #apiFooter {
302
  background: #F1F1F1;
303
  padding: 20px 0;
304
  padding-bottom: 10px;
305
  }
306
  #apiFooter a:hover {
307
  text-decoration: none;
308
  }
309
  .bootstrap-wp {
310
  overflow: hidden;
311
  border: 10px solid #F1F1F1;
312
  }
313
  .deleteButton {
314
  padding: 5px;
315
  float: left;
316
  color: #777 !important;
317
  font-size: 13px;
318
  }
319
  body .cf_header .btn {
320
  font-size: 13px !important;
321
  padding: 8px 15px;
322
  }
323
  body .btn-selected {
324
  background-color: #0166AE !important;
325
  background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) !important;
326
  text-shadow: 1px 1px 0 #034E82 !important;
327
  font-family: Arial !important;
328
  color: #ffffff !important;
329
  border: solid #1f628d 1px !important;
330
  text-decoration: none !important;
331
  transition: none !important;
332
  }
333
  body label {
334
  font-size: 11px;
335
  opacity: .8;
336
  }
337
  body label i {
338
  padding-left: 10px;
339
  }
340
  .helpinfo {
341
  padding: 20px 40px;
342
  background: #fafafa;
343
  border-top: 1px solid #f2f2f2;
344
  margin: 0 0px;
345
  margin-top: -20px;
346
  margin-bottom: -20px;
347
  }
348
  .helpinfo h4 {
349
  color: #3B474F;
350
  font-size: 15px;
351
  font-weight: 700;
352
  padding-bottom: 10px;
353
  padding-top: 5px;
354
  }
355
  .helpinfo p {
356
  color: #888;
357
  font-weight: 300;
358
  font-size: 12px;
359
  line-height: 19px;
360
  letter-spacing: 1px;
361
  padding-bottom: 0;
362
  }
363
  .helpinfo h4 i {
364
  margin-right: 4px;
365
  }
366
  #message {
367
  width: 758px;
368
  padding: 10px 10px;
369
  display: block;
370
  z-index: 99999;
371
  position: relative;
372
  color: #fff;
373
  border: 1px solid #024D82;
374
  border-bottom: 2px solid #024D82;
375
  text-shadow: 1px 1px 0 #024D82;
376
  padding: 0 10px;
377
  font-size: 16px;
378
  margin-bottom: 0;
379
  border-radius: 5px;
380
  background: #1069AC url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
381
  }
382
  .noAPI {
383
  padding: 10px;
384
  border-bottom: 2px solid #c93f2b;
385
  background: #E64D37;
386
  }
387
  .noAPI h4 {
388
  margin: 0;
389
  padding: 0;
390
  color: #fff;
391
  }
392
  .noAPI h4 a {
393
  color: #fff;
394
  font-weight: normal;
395
  }
396
  .input-xlarge {
397
  }
398
  .control-group {
399
  padding-left: 25px
400
  }
401
  #autosaving {
402
  display: none;
403
  width: 780px;
404
  height: 310px;
405
  position: absolute;
406
  z-index: 2222;
407
  top: 145px;
408
  color: #fff;
409
  left: 0;
410
  padding-top: 160px;
411
  text-align: center;
412
  border-bottom-right-radius: 5px;
413
  border-bottom-left-radius: 5px;
414
  background: rgba(0, 0, 0, .8);
415
  }
416
  #autosaving h2 {
417
  color: #fff;
418
  font-weight: 600;
419
  text-shadow: 0 0 2p
420
  x #000;
421
  margin-top: 0;
422
  }
423
  #autosaving h4 {
424
  color: #fff;
425
  font-size: 13px;
426
  letter-spacing: 1px;
427
  font-weight: 300;
428
  margin-bottom: 5px;
429
  text-shadow: 0 0 2px #000;
430
  }
431
  #autosaving h1 {
432
  color: #fff;
433
  margin-top: 0;
434
  font-size: 58px;
435
  font-weight: 800;
436
  text-shadow: 0 0 2px #000;
437
  }
438
  if ( $cf_page != "" ) {
439
  $json = cf_get_file_contents( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ) );
440
  $cf_funnels_pages = json_decode( $json );
441
  }
442
  <h4><i class="fa fa-times"></i> Uh oh, your page did not save correctly.</h4>
443
  <h2>Saving and Reloading...</h2>
444
  <h1><i class="fa fa-cog fa-spin"></i></h1>
445
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
446
  <a href="https://www.clickfunnels.com/users/sign_in" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
447
  <br clear="all">
448
  <?php if ( !empty( $_GET['action'] ) ) { ?>
449
  <?php if ( $cf_type=='p' ) {?>
450
  <a style="margin-right: -3px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
451
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
452
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
453
  <h2><?php foreach ( $cf_funnels as $key=>$funnel ) { ?>
454
  <?php if ( $cf_thefunnel == $funnel->id ) { echo $funnel->name; } } ?></h2>
455
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank"> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?></a>
456
  <?php }?>
457
  <?php if ( $cf_type=='hp' ) {?>
458
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
459
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
460
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
461
  <h2>Set as Home Page</h2>
462
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?></a>
463
  <?php }?>
464
  <?php if ( $cf_type=='np' ) {?>
465
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
466
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
467
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>/invalid-url-404-testing" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
468
  <h2>Set as 404 Page</h2>
469
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url</a>
470
  <?php }?>
471
  <?php if ( $cf_type=='' ) {?>
472
  <h2>Page Undefined - Create New Page</h2>
473
  <?php }?>
474
  <?php } else { ?>
475
  <h2 style="font-size: 17px;">Add ClickFunnels Page to Your Blog</h2>
476
  <?php } ?>
477
  <h4>You haven't setup your API settings. <a href="../wp-admin/edit.php?post_type=clickfunnels&page=cf_api">Click here to setup now.</a></h4>
478
  <div class="bootstrap-wp" style=" border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
479
  <div class="row-fluid form-horizontal">
480
  <br>
481
  <div class="control-group" style="margin-left: 0px; margin-bottom: 20px;">
482
  <div data-target="cf_type" class="btn-group multichoice cf_header">
483
  <a data-value="p" class="btn <?php if ( $cf_type=='p' ) {?> active btn-selected<?php }?>">Regular Page</a>
484
  <a data-value="hp" class="btn <?php if ( $cf_type=='hp' ) {?> active btn-selected<?php }?>">Home Page</a>
485
  <a data-value="np" class="btn <?php if ( $cf_type=='np' ) {?> active btn-selected<?php }?>">404 Page</a>
486
  </div>
487
  <input type="hidden" id="cf_type" name="cf_type"/>
488
  </div>
489
  <br>
490
  <div class="control-group">
491
  <label class="control-label" for="cf_thefunnel"> Choose Funnel <i class="fa fa-caret-square-o-down"></i></label>
492
  <div class="controls">
493
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
494
  <?php if ( empty( $cf_funnels ) ) { ?>
495
  <option value="0">No Funnels Found</option>
496
  <?php }
497
  else {
498
  foreach ( $cf_funnels as $key=>$funnel ) { ?>
499
  <option value="<?php echo $funnel->id;?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
500
  <?php
501
  }
502
  } ?>
503
  </select>
504
  </div>
505
  </div>
506
  <div class="control-group">
507
  <label class="control-label" for="cf_thepage"> Choose Page <i class="fa fa-file-o"></i></label>
508
  <div class="controls">
509
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
510
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
511
  <option value="0">No Pages Found</option>
512
  <?php }
513
  else {
514
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
515
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
516
  <?php
517
  }
518
  }
519
  ?>
520
  </select>
521
  <i class="fa fa-spinner fa-spin" id="loading"></i>
522
  </div>
523
  <div id="noPageWarning" style="font-size: 11px; margin-left: 160px;padding-top: 10px;display: none;width: 100%; clear: both"><em>You have no pages for this funnel. <a href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>" target="_blank">Click to add new page.</a></em></div>
524
  </div>
525
  <div class="control-group" id="hiddenStuff" style="display: none">
526
  <div class="controls">
527
  <strong>Funnel ID: <span style="font-weight: normal"><?php echo $thepage[0]; ?></span> <br></strong>
528
  <strong>Page Key: <span style="font-weight: normal"><?php echo $thepage[1]; ?></span><br></strong>
529
  <strong>Page ID: <span style="font-weight: normal"><?php echo $thepage[2]; ?></span><br></strong>
530
  <strong>Funnel Step ID: <span style="font-weight: normal"><?php echo $thepage[3]; ?></span><br></strong>
531
  <strong>Meta: <span style="font-weight: normal"><?php echo $thepage[4]; ?></span><br></strong>
532
  <strong>Post ID: <span style="font-weight: normal"><?php echo $thepage[5]; ?></span><br></strong>
533
  <strong>Page Name: <span style="font-weight: normal"><?php echo $thepage[6]; ?></span><br></strong>
534
  <input type="text" name="cf_thefunnel" id="cf_data" value="<?php echo $savedData; ?>" style="width: 400px; padding: 7px; height: 50px; font-size: 18px;" />
535
  </div>
536
  </div>
537
  <?php if ( $cf_type!="p" ) $display ="display:none"; else $display="";?>
538
  <div class="cf_url control-group" style="<?php echo $display;?>" >
539
  <label class="control-label" for="cf_slug"> Custom URL <i class="fa fa-external-link"></i></label>
540
  <div id="cf-wp-path" class="controls ">
541
  <div class="input-prepend">
542
  <span class="add-on" style="font-size: 13px;padding: 4px 10px; background: #ECEEEF; color: #777; text-shadow: none; border: 1px solid #ccc"><?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/</span><input style="height:28px;width: 150px !important" type="textbox" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" name="cf_slug" id="cf_slug" class="input-xlarge">
543
  <div style="color:red; display:none" id="cf_invalid_slug" style="width: 90%" >You must enter an URL</div>
544
  </div>
545
  </div>
546
  </div>
547
  <br><br>
548
  <div class="p_text helpinfo" <?php if ( $cf_type!='p' ) {?> style="display: none" <?php }?>>
549
  <h4><i class="fa fa-question-circle"></i> Set as a Page</h4>
550
  <p>Choose any ClickFunnels page to be shown using a custom URL just select any funnel to refresh the list of pages. Create a custom URL and hit 'Save/Publish' to start sending traffic. <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Need more help?</a> </p>
551
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
552
  </div>
553
  <div class="hp_text helpinfo" <?php if ( $cf_type!='hp' ) {?> style="display: none" <?php }?>>
554
  <h4><i class="fa fa-question-circle"></i> Set as Home Page</h4>
555
  <p> Replace your homepage with a specific ClickFunnels page. You can show any page that you want, this will replace any other homepage settings you may have.</p>
556
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
557
  </div>
558
  <div class="np_text helpinfo" <?php if ( $cf_type!='np' ) {?> style="display: none" <?php }?>>
559
  <h4><i class="fa fa-question-circle"></i> Set as 404 Page</h4>
560
  <p> Show a specific page to be shown on any "Page not Found" such as a misspelled URL or a deleted blog post. Very good place for a squeeze page to get the most out of your traffic.</p>
561
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
562
  </div>
563
  <br>
564
  <div class="row-fluid" id="apiFooter">
565
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
566
  <button id="publish" name="publish" disabled class="button button-primary " style="float: right;">
567
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
568
  </button>
569
  <?php } else { ?>
570
  <button id="publish" name="publish" class="button button-primary " style="float: right;">
571
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
572
  </button>
573
  <?php } ?>
574
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 5px;">
575
  <i class="fa fa-spinner fa-spin"></i>
576
  <span>Saving...</span>
577
  </div>
578
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
579
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=cf_api' );?>"><i class="fa fa-cog"></i> Settings</a>
580
  <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>" class="button button-default" style="float: left;margin-right: 10px"><i class="fa fa-life-ring"></i> Support</a>
581
  <?php if ( !empty( $delete_link ) ) {?>
582
  <a class="button button-secondary" id="delete" type="submit" href="<?php echo $delete_link;?>"><i class="fa fa-trash"></i> Delete Page</a>
583
  <?php }?>
584
  </div>
585
  </div>
586
  </div>
587
  (function($) {
588
  setTimeout(function() {
589
  $('#cf_thepage').trigger( "change" );
590
  }, 1500);
591
  })(jQuery);
 
592
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
593
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
594
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
595
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
596
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
597
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
598
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
599
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
600
  $thepage = explode( "{#}", $cf_page );
601
  $savedData = $cf_page;
602
  }
603
  else {
604
  $thepage = explode( "{#}", $cf_page['page_id'] );
605
  $savedData = $cf_page['page_id'];
606
  }
607
  $cf_options = get_option( "cf_options" );
608
  jQuery(document).ready(function(){
609
  // Set Correct Options
610
  var thefunnel = jQuery('#cf_thefunnel').val();
611
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
612
  jQuery('#cf_thepage').find('option').remove().end();
613
  jQuery('#loading').fadeIn();
614
  jQuery.getJSON(specificFunnel, function(data) {
615
  setTimeout(function() {
616
  jQuery('#loading').fadeOut();
617
  }, 2000);
618
  var is_selected = "";
619
  jQuery.each(data.funnel_steps, function() {
620
  if (this.pages != ''){
621
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
622
  is_selected = "selected";
623
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
624
  } else {
625
  is_selected = "";
626
  }
627
  if ( this.wp_friendly == true && this.pages != '' ) {
628
  jQuery('#iframeURL').val('https://'+this.pages[0].url);
629
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'{#}'+this.pages[0].url+'" '+is_selected+'>'+ this.name +'</option>');
630
  }
631
  }
632
  });
633
  }).done(function() {
634
  jQuery('#loading').fadeOut();
635
  var savedMeta = jQuery('#cf_thepage').val();
636
  if(savedMeta != undefined || savedMeta != null){
637
  savedMeta = savedMeta.split('{#}');
638
  jQuery('#jsmeta').val(savedMeta[3]);
639
  <?php if ( !empty( $_GET['action'] ) ) { ?>
640
  if (savedMeta[3] != jQuery('#oldmeta').val()){
641
  jQuery('#metaalreadyupdated').hide();
642
  jQuery('#showupdatemetalink').show();
643
  }
644
  <?php } ?>
645
  }
646
  <?php if ( empty( $_GET['action'] ) ) { ?>
647
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
648
  <?php } ?>
649
  })
650
  .fail(function() {
651
  jQuery('#loading').fadeOut();
652
  })
653
  .always(function() {
654
  jQuery('#loading').fadeOut();
655
  });
656
  // Change Funnel Populate Dropdown
657
  jQuery( '#cf_thefunnel' ).change(function() {
658
  jQuery('#loading').fadeIn();
659
  var thefunnel = jQuery(this).val();
660
  var totalPages = 0;
661
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
662
  jQuery('#cf_thepage').find('option').remove().end();
663
  jQuery.getJSON(specificFunnel, function(data) {
664
  setTimeout(function() {
665
  jQuery('#loading').fadeOut();
666
  }, 2000);
667
  // alert( specificFunnel);
668
  jQuery.each(data.funnel_steps, function() {
669
  if( this.wp_friendly == true && this.pages != '' ) {
670
  jQuery('#iframeURL').val('https://'+this.pages[0].url);
671
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'{#}'+this.pages[0].url+'">'+ this.name +'</option>');
672
 
673
  totalPages += 1;
674
  }
675
  });
676
 
677
  }).done(function() {
678
  jQuery('#loading').fadeOut();
679
  var savedMeta = jQuery('#cf_thepage').val();
680
  if(savedMeta != undefined || savedMeta != null){
681
  savedMeta = savedMeta.split('{#}');
682
  jQuery('#previewiframe').attr('src', 'https://'+savedMeta[6]+'?preview=true');
683
  }
684
 
685
  if (totalPages == 0) {
686
  jQuery('#noPageWarning').fadeIn();
687
  jQuery('#cf_thepage').fadeOut();
688
  }
689
  else {
690
  jQuery('#noPageWarning').hide();
691
  jQuery('#cf_thepage').fadeIn();
692
  }
693
  var theposition = jQuery('#cf_thepage').val();
694
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
695
  var myString = thefunnel+'{#}'+theposition;
696
  var arr = myString.split('{#}');
697
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
698
  var do_ping = function() {
699
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
700
  }).catch(function(error) {
701
  });
702
  };
703
  do_ping();
704
  })
705
  .fail(function() {
706
  jQuery('#loading').fadeOut();
707
  })
708
  .always(function() {
709
  jQuery('#loading').fadeOut();
710
  });
711
  setTimeout(function() {
712
 
713
  }, 3000);
714
 
715
  });
716
  var request_image = function(url) {
717
  return new Promise(function(resolve, reject) {
718
  var img = new Image();
719
  img.onload = function() { resolve(img); };
720
  img.onerror = function() { reject(url); };
721
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
722
  });
723
  };
724
  /**
725
  * Pings a url.
726
  * @param {String} url
727
  * @return {Promise} promise that resolves to a ping (ms, float).
728
  */
729
  var ping = function(url) {
730
  return new Promise(function(resolve, reject) {
731
  var start = (new Date()).getTime();
732
  var response = function() {
733
  var delta = ((new Date()).getTime() - start);
734
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
735
  delta /= 4;
736
  resolve(delta);
737
  };
738
  request_image(url).then(response).catch(response);
739
  // Set a timeout for max-pings, 5s.
740
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
741
  });
742
  };
743
  function replaceText(inputText, tagName, tagReplace) {
744
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
745
  return inputText.replace(regExp, tagReplace);
746
  }
747
  // Select New Page
748
  jQuery( '#cf_thepage' ).change(function() {
749
  jQuery('#loading').fadeOut();
750
  var thefunnel = jQuery('#cf_thefunnel').val();
751
  var theposition = jQuery(this).val();
752
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
753
  if(theposition != undefined || theposition != null){
754
  var myString = thefunnel+'{#}'+theposition;
755
  var arr = myString.split('{#}');
756
  var arr2 = theposition.split('{#}');
757
  // Iframe
758
  jQuery('#iframeURL').val('https://'+arr2[6]);
759
  var myStr = arr2[3];
760
  // Browser title
761
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
762
 
763
  jQuery('#seoTitle').val(subStr[1].replace(/%20/g, ' '));
764
 
765
  // SEO Desc
766
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
767
  jQuery('#seoDesc').val(subStr[1].replace(/%20/g, ' '));
768
  // SEO Share Image
769
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
770
  jQuery('#seosocial').val(subStr[1]);
771
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
772
  var do_ping = function() {
773
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
774
  }).catch(function(error) {
775
  });
776
  };
777
  do_ping();
778
  jQuery('#previewiframe').attr('src', 'https://'+arr[7]+'?preview=true');
779
  }
780
 
781
  });
782
  // Fade Out Message
783
  setTimeout(function() {
784
  jQuery('#message').fadeOut();
785
  }, 3500);
786
  // Savings
787
  jQuery('#publish').click(function() {
788
  jQuery('#saving').fadeIn();
789
  });
790
  jQuery('#delete').on('click', function () {
791
  return confirm('Are you sure you want to delete this page?');
792
  });
793
  jQuery('#cf_slug').bind('keyup keypress blur', function()
794
  {
795
  var myStr = jQuery(this).val()
796
  myStr=myStr.toLowerCase();
797
  myStr=myStr.replace(/\s/g , "-");
798
  jQuery('#cf_slug').val(myStr);
799
  });
800
  // Check Null and Resave v1.0.6
801
  <?php if ($thepage[1] == 'null') { ?>
802
  // jQuery('#autosaving').fadeIn();
803
  // setTimeout(function() {
804
  // jQuery('form').submit();
805
  // }, 2000);
806
  <?php } ?>
807
  jQuery('#showupdatemetalink').click(function() {
808
  jQuery('form').submit();
809
  });
810
 
811
  });
812
  if ( $cf_page != "" ) {
813
  $json = cf_get_file_contents( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ) );
814
  $cf_funnels_pages = json_decode( $json );
815
  }
816
  <h4><i class="fa fa-times"></i> Uh oh, your page did not save correctly.</h4>
817
  <h2>Saving and Reloading...</h2>
818
  <h1><i class="fa fa-cog fa-spin"></i></h1>
819
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
820
  <a href="https://www.app.clickfunnels.com/funnels" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
821
  <br clear="all">
822
  <?php if ( !empty( $_GET['action'] ) ) { ?>
823
  <?php if ( $cf_type=='p' ) {?>
824
  <a style="margin-right: -3px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Open Editor</a>
825
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> View Funnel</a>
826
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> Preview</a>
827
  <h2><?php foreach ( $cf_funnels as $key=>$funnel ) { ?>
828
  <?php if ( $cf_thefunnel == $funnel->id ) { if(strlen($funnel->name) > 30) { echo substr($funnel->name,0,30).'...'; } else { echo $funnel->name;} } } ?></h2>
829
 
830
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank"> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?></a>
831
  <?php }?>
832
  <?php if ( $cf_type=='hp' ) {?>
833
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
834
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
835
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
836
  <h2>Set as Home Page</h2>
837
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?></a>
838
  <?php }?>
839
  <?php if ( $cf_type=='np' ) {?>
840
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
841
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
842
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>/invalid-url-404-testing" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
843
  <h2>Set as 404 Page</h2>
844
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url</a>
845
  <?php }?>
846
  <?php if ( $cf_type=='' ) {?>
847
  <h2>Page Undefined - Try saving your page again.</h2>
848
  <?php }?>
849
  <?php if ( $cf_type=='noapi' ) {?>
850
  <h2>No API Fallback</h2>
851
  <?php }?>
852
  <?php } else { ?>
853
  <h2 style="font-size: 17px;">Add ClickFunnels Page to Your Blog</h2>
854
  <?php } ?>
855
  <h4>You haven't setup your API settings. <a href="../wp-admin/edit.php?post_type=clickfunnels&page=cf_api">Click here to setup now.</a></h4>
856
  <iframe src="<?php echo $cf_iframe_url; ?>" style="width: 1280px;height: 750px;-ms-zoom: 0.20; -moz-transform: scale(0.20); -moz-transform-origin: 0 0; -o-transform: scale(0.20); -o-transform-origin: 0 0; -webkit-transform: scale(0.20); -webkit-transform-origin: 0 0;" frameborder="0" id="previewiframe"></iframe>
857
  </div>
858
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
859
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
860
  <div class="bootstrap-wp" style=" border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
861
  <div class="row-fluid form-horizontal">
862
  <br>
863
  <a style="float: right;position:relative;z-index: 999999;margin-right: 8px" class="btn pageSettings">Page Settings</a>
864
 
865
  <div class="control-group" style="margin-left: -10px; margin-bottom: 20px !important">
866
  <div data-target="cf_type" class="btn-group multichoice cf_header">
867
  <a data-value="p" class="btn <?php if ( $cf_type=='p' || $cf_type=='') {?> active btn-selected<?php }?>">Regular Page</a>
868
  <a data-value="hp" class="btn <?php if ( $cf_type=='hp' ) {?> active btn-selected<?php }?>">Home Page</a>
869
  <a data-value="np" class="btn <?php if ( $cf_type=='np' ) {?> active btn-selected<?php }?>">404 Page</a>
870
  <!-- <a data-value="shortcode" class="btn <?php if ( $cf_type=='shortcode' ) {?> active btn-selected<?php }?>">Shortcode</a> -->
871
  </div>
872
  <input type="hidden" id="cf_type" name="cf_type"/>
873
  </div>
874
  <div class="control-group cf_uses_api" style="">
875
  <label class="control-label" for="cf_thefunnel"> Choose Funnel <i class="fa fa-filter"></i></label>
876
  <div class="controls">
877
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
878
  <?php if ( empty( $cf_funnels ) ) { ?>
879
  <option value="0">No Funnels Found</option>
880
  <?php }
881
  else {
882
  foreach ( $cf_funnels as $key=>$funnel ) { ?>
883
  <option value="<?php echo $funnel->id;?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
884
  <?php
885
  }
886
  } ?>
887
  </select>
888
  </div>
889
  </div>
890
  <div class="control-group cf_uses_api">
891
  <label class="control-label" for="cf_thepage"> Choose Page <i class="fa fa-file-o"></i></label>
892
  <div class="controls">
893
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
894
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
895
  <option value="0">No Pages Found</option>
896
  <?php }
897
  else {
898
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
899
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
900
  <?php
901
  }
902
  }
903
  ?>
904
  </select>
905
  <i class="fa fa-spinner fa-spin" id="loading"></i>
906
  </div>
907
  <div id="noPageWarning" style="font-size: 11px; margin-left: 160px;margin-top: -33px;float: left;padding-top: 10px;display: none;width: 100%; clear: both"><em>No compatible pages found for this funnel.</em></div>
908
  </div>
909
  <div class="control-group cf_no_api" >
910
  <label class="control-label" for="cf_iframe_check"> ClickFunnels URL <i class="fa fa-globe"></i></label>
911
  <div class="controls">
912
  <input type="text" class="input-xlarge" id="iframeURL" style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
913
  </div>
914
  </div>
915
  <div class="control-group cf_no_api" >
916
  <label class="control-label" for="cf_iframe_check"> Website Title <i class="fa fa-globe"></i></label>
917
  <div class="controls">
918
  <input type="text" class="input-xlarge" id="seoTitle" style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
919
  </div>
920
  </div>
921
  <div class="control-group cf_no_api" >
922
  <label class="control-label" for="cf_iframe_check"> Description <i class="fa fa-globe"></i></label>
923
  <div class="controls">
924
  <input type="text" class="input-xlarge" id="seoDesc" style="height: 30px;" value="<?php echo $cf_seo_desc; ?>" name="cf_seo_desc" />
925
  </div>
926
  </div>
927
  <div class="control-group cf_no_api" >
928
  <label class="control-label" for="cf_iframe_check"> Social Image URL <i class="fa fa-globe"></i></label>
929
  <div class="controls">
930
  <input type="text" class="input-xlarge" id="seosocial" style="height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
931
  </div>
932
  </div>
933
 
934
 
935
  <div class="control-group cf_uses_api" >
936
  <label class="control-label" for="cf_iframe_check"> Enable Split Tests <i class="fa fa-bar-chart"></i></label>
937
  <div class="controls">
938
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
939
  <option value="off">Just Show Selected Page</option>
940
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Enable Split Tests and Custom Code</option>
941
  </select>
942
  <!-- <small style="float: left;font-size: 11px;padding: 5px;margin-left: 6px"><a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">What is this?</a></small> -->
943
  </div>
944
  </div>
945
  <?php if ( !empty( $_GET['action'] ) ) { ?>
946
  <div class="control-group cf_uses_api" style="margin-bottom: 20px">
947
  <label class="control-label" for="cf_iframe_check"> Meta Data <i class="fa fa-info"></i></label>
948
  <a href="#" style="margin-left: 20px;margin-top: 5px;display: block;float: left;display: none" id="showupdatemetalink"><i class="fa fa-refresh"></i> Meta Data is Out Dated -- Click to Update</a>
949
  <span style="margin-left: 20px;margin-top: 5px;display: block;float: left" id="metaalreadyupdated"><i class="fa fa-check"></i> Meta Data is Up to Date</span>
950
  </div>
951
  <?php } else { ?>
952
  <div class="control-group cf_uses_api" style="margin-bottom: 20px">
953
  <label class="control-label" for="cf_iframe_check"> Meta Data <i class="fa fa-info"></i></label>
954
 
955
  <span style="margin-left: 20px;margin-top: 5px;display: block;float: left" id="metaalreadyupdated"><i class="fa fa-check"></i> Meta Data is Up to Date</span>
956
  </div>
957
  <?php } ?>
958
  <?php if ( $cf_type!="p" ) $display ="display:none"; else $display="";?>
959
  <div class="cf_url control-group" style="<?php echo $display;?>" >
960
  <label class="control-label" for="cf_slug"> Custom URL <i class="fa fa-globe"></i></label>
961
  <div id="cf-wp-path" class="controls ">
962
  <div class="input-prepend">
963
  <span class="add-on" style="font-size: 13px;padding: 4px 10px; background: #ECEEEF; color: #777; text-shadow: none; border: 1px solid #ccc"><?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/</span><input style="height:28px;width: 150px !important" type="textbox" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" name="cf_slug" id="cf_slug" class="input-xlarge">
964
  <div style="color:red; display:none" id="cf_invalid_slug" style="width: 90%" >You must enter an URL</div>
965
  </div>
966
  </div>
967
  </div>
968
 
969
 
970
 
971
  <style>
972
  #hiddenStuff {display: none}
973
  </style>
974
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block" <?php } ?>>
975
  <div class="controls">
976
  <strong>Funnel ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[0]; ?>" /> <br></strong>
977
  <strong>Page Key: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[1]; ?>" /><br></strong>
978
  <strong>Page ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[2]; ?>" /><br></strong>
979
  <strong>Funnel Step ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[3]; ?>" /><br></strong>
980
  <strong>Saved Meta: <input type="text" style="font-weight: normal;width: 300px;" id="oldmeta" value="<?php echo $thepage[4]; ?>" /><br></strong>
981
  <strong>JS Meta: <input type="text" style="font-weight: normal;width: 300px;" id="jsmeta" value="" /><br></strong>
982
  <strong>Post ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[5]; ?>" /><br></strong>
983
  <strong>Page Name: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[6]; ?>" /><br></strong>
984
  <strong>Use iframe?: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $cf_iframe_check; ?>" /><br></strong>
985
  <strong>Iframe URL: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $cf_iframe_url; ?>" /><br></strong>
986
  <textarea name="cf_thefunnel" id="cf_data" style="width: 400px;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
987
  </div>
988
  </div>
989
 
990
  <!-- <div style="background: #fafafa;border-top: 1px solid #eee;padding: 10px;text-align: center;margin: 10px 0px;margin-bottom: 20px" >
991
  <strong style="color: #777"> Running split tests or custom code on your page? Check here
992
  <input type="checkbox" id="useIframe" value="on" <?php if( $cf_iframe_check == 'on') { ?>checked <?php } ?> style="margin: 0 3px;width: 18px;height: 18px;" name="cf_iframe_check"> to activate settings.</strong>
993
  <small style="display: block;font-size: 11px;opacity: .5"><a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Why do you have to activate settings?</a></small>
994
  <input type="text" style="display: none;" id="iframeURL" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
995
  </div> -->
996
  <!-- <div class="p_text helpinfo" <?php if ( $cf_type!='p' ) {?> style="display: none" <?php }?>>
997
  <h4><i class="fa fa-question-circle"></i> Set as a Page</h4>
998
  <p>Choose any ClickFunnels page to be shown using a custom URL just select any funnel to refresh the list of pages. Create a custom URL and hit 'Save/Publish' to start sending traffic. <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Need more help?</a> </p>
999
  <p style="font-size: 11px;opacity: .7;"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1000
  </div>
1001
  <div class="hp_text helpinfo" <?php if ( $cf_type!='hp' ) {?> style="display: none" <?php }?>>
1002
  <h4><i class="fa fa-question-circle"></i> Set as Home Page</h4>
1003
  <p> Replace your homepage with a specific ClickFunnels page. You can show any page that you want, this will replace any other homepage settings you may have.</p>
1004
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1005
  </div>
1006
  <div class="np_text helpinfo" <?php if ( $cf_type!='np' ) {?> style="display: none" <?php }?>>
1007
  <h4><i class="fa fa-question-circle"></i> Set as 404 Page</h4>
1008
  <p> Show a specific page to be shown on any "Page not Found" such as a misspelled URL or a deleted blog post. Very good place for a squeeze page to get the most out of your traffic.</p>
1009
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1010
  </div> -->
1011
  <div class="row-fluid" id="apiFooter">
1012
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
1013
  <button id="publish" name="publish" disabled class="button button-primary " style="float: right; ">
1014
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
1015
  </button>
1016
  <?php } else { ?>
1017
  <button id="publish" name="publish" class="button button-primary " style="float: right; ">
1018
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
1019
  </button>
1020
  <?php } ?>
1021
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 5px;">
1022
  <i class="fa fa-spinner fa-spin"></i>
1023
  <span>Saving...</span>
1024
  </div>
1025
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
1026
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=cf_api' );?>"><i class="fa fa-cog"></i> Settings</a>
1027
  <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>" class="button button-default" style="float: left;margin-right: 10px"><i class="fa fa-life-ring"></i> Support</a>
1028
  <?php if ( !empty( $delete_link ) ) {?>
1029
  <a class="button button-secondary" id="delete" type="submit" href="<?php echo $delete_link;?>"><i class="fa fa-trash"></i> Delete Page</a>
1030
  <?php }?>
1031
  </div>
1032
  </div>
1033
  </div>
1034
  (function($) {
1035
  setTimeout(function() {
1036
  $('#cf_thepage').trigger( "change" );
1037
  }, 1500);
1038
  })(jQuery);
 
1
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
2
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
3
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
4
  $thepage = explode( "{#}", $cf_page );
5
  $savedData = $cf_page;
6
  }
7
  else {
8
  $thepage = explode( "{#}", $cf_page['page_id'] );
9
  $savedData = $cf_page['page_id'];
10
  }
11
  $cf_options = get_option( "cf_options" );
12
  jQuery(document).ready(function(){
13
  // Set Correct Options
14
  var thefunnel = jQuery('#cf_thefunnel').val();
15
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
16
  jQuery('#cf_thepage').find('option').remove().end();
17
  jQuery('#loading').fadeIn();
18
  jQuery.getJSON(specificFunnel, function(data) {
19
  setTimeout(function() {
20
  jQuery('#loading').fadeOut();
21
  }, 2000);
22
  var is_selected = "";
23
  jQuery.each(data.funnel_steps, function() {
24
  if (this.pages != ''){
25
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
26
  is_selected = "selected";
27
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
28
  } else {
29
  is_selected = "";
30
  }
31
  if ( this.wp_friendly == true && this.pages != '' ) {
32
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'" '+is_selected+'>'+ this.name +'</option>');
33
  }
34
  }
35
  });
36
  }).done(function() {
37
  jQuery('#loading').fadeOut();
38
  })
39
  .fail(function() {
40
  jQuery('#loading').fadeOut();
41
  })
42
  .always(function() {
43
  jQuery('#loading').fadeOut();
44
  });
45
  // Change Funnel Populate Dropdown
46
  jQuery( '#cf_thefunnel' ).change(function() {
47
  jQuery('#loading').fadeIn();
48
  var thefunnel = jQuery(this).val();
49
  var totalPages = 0;
50
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
51
  jQuery('#cf_thepage').find('option').remove().end();
52
  jQuery.getJSON(specificFunnel, function(data) {
53
  setTimeout(function() {
54
  jQuery('#loading').fadeOut();
55
  }, 2000);
56
  // alert( specificFunnel);
57
  jQuery.each(data.funnel_steps, function() {
58
  if( this.wp_friendly == true && this.pages != '' ) {
59
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'">'+ this.name +'</option>');
60
  totalPages += 1;
61
  }
62
  });
63
  }).done(function() {
64
  jQuery('#loading').fadeOut();
65
  })
66
  .fail(function() {
67
  jQuery('#loading').fadeOut();
68
  })
69
  .always(function() {
70
  jQuery('#loading').fadeOut();
71
  });
72
  setTimeout(function() {
73
  if (totalPages == 0) {
74
  jQuery('#noPageWarning').fadeIn();
75
  }
76
  else {
77
  jQuery('#noPageWarning').hide();
78
  }
79
  var theposition = jQuery('#cf_thepage').val();
80
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
81
  var myString = thefunnel+'{#}'+theposition;
82
  var arr = myString.split('{#}');
83
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
84
  var do_ping = function() {
85
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
86
  }).catch(function(error) {
87
  });
88
  };
89
  do_ping();
90
  }, 3000);
91
  });
92
  var request_image = function(url) {
93
  return new Promise(function(resolve, reject) {
94
  var img = new Image();
95
  img.onload = function() { resolve(img); };
96
  img.onerror = function() { reject(url); };
97
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
98
  });
99
  };
100
  /**
101
  * Pings a url.
102
  * @param {String} url
103
  * @return {Promise} promise that resolves to a ping (ms, float).
104
  */
105
  var ping = function(url) {
106
  return new Promise(function(resolve, reject) {
107
  var start = (new Date()).getTime();
108
  var response = function() {
109
  var delta = ((new Date()).getTime() - start);
110
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
111
  delta /= 4;
112
  resolve(delta);
113
  };
114
  request_image(url).then(response).catch(response);
115
  // Set a timeout for max-pings, 5s.
116
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
117
  });
118
  };
119
  // Select New Page
120
  jQuery( '#cf_thepage' ).change(function() {
121
  jQuery('#loading').fadeOut();
122
  var thefunnel = jQuery('#cf_thefunnel').val();
123
  var theposition = jQuery(this).val();
124
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
125
  var myString = thefunnel+'{#}'+theposition;
126
  var arr = myString.split('{#}');
127
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
128
  var do_ping = function() {
129
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
130
  }).catch(function(error) {
131
  });
132
  };
133
  do_ping();
134
  });
135
  // Fade Out Message
136
  setTimeout(function() {
137
  jQuery('#message').fadeOut();
138
  }, 3500);
139
  // Savings
140
  jQuery('#publish').click(function() {
141
  jQuery('#saving').fadeIn();
142
  });
143
  jQuery('#delete').on('click', function () {
144
  return confirm('Are you sure you want to delete this page?');
145
  });
146
  jQuery('#cf_slug').bind('keyup keypress blur', function()
147
  {
148
  var myStr = jQuery(this).val()
149
  myStr=myStr.toLowerCase();
150
  myStr=myStr.replace(/\s/g , "-");
151
  jQuery('#cf_slug').val(myStr);
152
  });
153
  // Check Null and Resave v1.0.6
154
  <?php if ($thepage[1] == 'null') { ?>
155
  jQuery('#autosaving').fadeIn();
156
  setTimeout(function() {
157
  jQuery('form').submit();
158
  }, 2000);
159
  <?php } ?>
160
  });
161
  display: none !important;
162
  }
163
  #side-sortables {
164
  display: none !important;
165
  }
166
  #clickfunnels_meta_box {
167
  width: 780px !important;
168
  border-radius: 5px;
169
  }
170
  .button:active, .button:hover, .button:focus {
171
  outline: none !important;
172
  box-shadow: none !important;
173
  }
174
  #message {
175
  width: 752px;
176
  margin-bottom: 0;
177
  }
178
  .apiHeader {
179
  background: #39464E url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
180
  border-bottom: 3px solid rgba(0,0,0,0.25);
181
  padding: 10px;
182
  padding-top: 15px;
183
  border-top-left-radius: 5px;
184
  border-top-right-radius: 5px;
185
  clear: both;
186
  }
187
  .apiHeader img {
188
  width: 200px;
189
  float: left;
190
  margin-left: 10px;
191
  }
192
  .apiHeader a {
193
  float: right;
194
  display: block;
195
  color: #fff;
196
  font-size: 13px;
197
  text-decoration: none;
198
  margin-right: 5px !important;
199
  background-color: rgba(0, 0, 0, .3);
200
  border: 2px solid #2b2e30;
201
  color: #afbbc8 !important;
202
  font-weight: 700;
203
  -webkit-border-radius: 4px;
204
  -moz-border-radius: 4px;
205
  border-radius: 4px;
206
  padding: 7px;
207
  padding-left: 12px;
208
  padding-right: 12px;
209
  margin-top: 0px !important;
210
  text-transform: uppercase;
211
  text-decoration: none;
212
  font-size: 14px;
213
  }
214
  .apiHeader a:hover {
215
  border: 2px solid #1D81C8;
216
  background-color: rgba(0, 0, 0, .6);
217
  color: #fff !important;
218
  }
219
  .apiSubHeader {
220
  background-color: #0166AE;
221
  background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>);
222
  border-bottom: 3px solid rgba(0,0,0,0.25);
223
  color: #fff;
224
  padding: 15px 18px;
225
  }
226
  .apiSubHeader h2 {
227
  margin: 0 !important;
228
  padding: 0 !important;
229
  color: #fff;
230
  font-weight: bold;
231
  font-size: 17px;
232
  text-shadow: 1px 1px 0 #0367AE;
233
  }
234
  .apiSubHeader a.editThisPage {
235
  float: right;
236
  padding: 5px 10px;
237
  color: #fff;
238
  text-shadow: 1px 1px 0 #0367AE;
239
  text-decoration: none;
240
  padding-top: 15px;
241
  margin-top: 6px;
242
  font-size: 14px;
243
  border: 2px solid #1D81C8;
244
  background-color: #054B7C;
245
  color: #fff !important;
246
  font-weight: 700;
247
  -webkit-border-radius: 4px;
248
  -moz-border-radius: 4px;
249
  border-radius: 4px;
250
  padding: 7px;
251
  padding-left: 12px;
252
  padding-right: 12px;
253
  text-transform: uppercase;
254
  text-decoration: none;
255
  font-size: 12px;
256
  }
257
  .apiSubHeader a.editThisPage i {
258
  margin-right: 4px;
259
  }
260
  .apiSubHeader a.editThisPage:hover {
261
  border: 2px solid #FFB700;
262
  text-shadow: 1px 1px 0 #222;
263
  background-color: rgba(0, 0, 0, .6);
264
  color: #fff !important;
265
  }
266
  .apiSubHeader a{
267
  text-shadow: 1px 1px 0 #0367AE;
268
  color: #fff;
269
  text-decoration: none;
270
  font-size: 12px;
271
  opacity: .8;
272
  }
273
  .apiSubHeader a:hover {
274
  opacity: 1;
275
  }
276
  .inside {
277
  padding: 0 !important;
278
  margin-top: 0 !important;
279
  border-radius: 5px !important;
280
  }
281
  .inside h2 {
282
  display: block !important;
283
  }
284
  #postbox-container-2 {
285
  margin-top: -20px !important;
286
  }
287
  body #poststuff .hndle.ui-sortable-handle {
288
  display: none !important;
289
  }
290
  body #poststuff .handlediv {
291
  display: none !important;
292
  }
293
  #loading {
294
  float: left;
295
  margin-left: 10px;
296
  display: none;
297
  margin-top: 6px;
298
  color: #999;
299
  }
300
  #apiFooter {
301
  background: #F1F1F1;
302
  padding: 20px 0;
303
  padding-bottom: 10px;
304
  }
305
  #apiFooter a:hover {
306
  text-decoration: none;
307
  }
308
  .bootstrap-wp {
309
  overflow: hidden;
310
  border: 10px solid #F1F1F1;
311
  }
312
  .deleteButton {
313
  padding: 5px;
314
  float: left;
315
  color: #777 !important;
316
  font-size: 13px;
317
  }
318
  body .cf_header .btn {
319
  font-size: 13px !important;
320
  padding: 8px 15px;
321
  }
322
  body .btn-selected {
323
  background-color: #0166AE !important;
324
  background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) !important;
325
  text-shadow: 1px 1px 0 #034E82 !important;
326
  font-family: Arial !important;
327
  color: #ffffff !important;
328
  border: solid #1f628d 1px !important;
329
  text-decoration: none !important;
330
  transition: none !important;
331
  }
332
  body label {
333
  font-size: 11px;
334
  opacity: .8;
335
  }
336
  body label i {
337
  padding-left: 10px;
338
  }
339
  .helpinfo {
340
  padding: 20px 40px;
341
  background: #fafafa;
342
  border-top: 1px solid #f2f2f2;
343
  margin: 0 0px;
344
  margin-top: -20px;
345
  margin-bottom: -20px;
346
  }
347
  .helpinfo h4 {
348
  color: #3B474F;
349
  font-size: 15px;
350
  font-weight: 700;
351
  padding-bottom: 10px;
352
  padding-top: 5px;
353
  }
354
  .helpinfo p {
355
  color: #888;
356
  font-weight: 300;
357
  font-size: 12px;
358
  line-height: 19px;
359
  letter-spacing: 1px;
360
  padding-bottom: 0;
361
  }
362
  .helpinfo h4 i {
363
  margin-right: 4px;
364
  }
365
  #message {
366
  width: 758px;
367
  padding: 10px 10px;
368
  display: block;
369
  z-index: 99999;
370
  position: relative;
371
  color: #fff;
372
  border: 1px solid #024D82;
373
  border-bottom: 2px solid #024D82;
374
  text-shadow: 1px 1px 0 #024D82;
375
  padding: 0 10px;
376
  font-size: 16px;
377
  margin-bottom: 0;
378
  border-radius: 5px;
379
  background: #1069AC url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
380
  }
381
  .noAPI {
382
  padding: 10px;
383
  border-bottom: 2px solid #c93f2b;
384
  background: #E64D37;
385
  }
386
  .noAPI h4 {
387
  margin: 0;
388
  padding: 0;
389
  color: #fff;
390
  }
391
  .noAPI h4 a {
392
  color: #fff;
393
  font-weight: normal;
394
  }
395
  .input-xlarge {
396
  }
397
  .control-group {
398
  padding-left: 25px
399
  }
400
  #autosaving {
401
  display: none;
402
  width: 780px;
403
  height: 310px;
404
  position: absolute;
405
  z-index: 2222;
406
  top: 145px;
407
  color: #fff;
408
  left: 0;
409
  padding-top: 160px;
410
  text-align: center;
411
  border-bottom-right-radius: 5px;
412
  border-bottom-left-radius: 5px;
413
  background: rgba(0, 0, 0, .8);
414
  }
415
  #autosaving h2 {
416
  color: #fff;
417
  font-weight: 600;
418
  text-shadow: 0 0 2p
419
  x #000;
420
  margin-top: 0;
421
  }
422
  #autosaving h4 {
423
  color: #fff;
424
  font-size: 13px;
425
  letter-spacing: 1px;
426
  font-weight: 300;
427
  margin-bottom: 5px;
428
  text-shadow: 0 0 2px #000;
429
  }
430
  #autosaving h1 {
431
  color: #fff;
432
  margin-top: 0;
433
  font-size: 58px;
434
  font-weight: 800;
435
  text-shadow: 0 0 2px #000;
436
  }
437
  if ( $cf_page != "" ) {
438
  $json = cf_get_file_contents( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ) );
439
  $cf_funnels_pages = json_decode( $json );
440
  }
441
  <h4><i class="fa fa-times"></i> Uh oh, your page did not save correctly.</h4>
442
  <h2>Saving and Reloading...</h2>
443
  <h1><i class="fa fa-cog fa-spin"></i></h1>
444
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
445
  <a href="https://www.clickfunnels.com/users/sign_in" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
446
  <br clear="all">
447
  <?php if ( !empty( $_GET['action'] ) ) { ?>
448
  <?php if ( $cf_type=='p' ) {?>
449
  <a style="margin-right: -3px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
450
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
451
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
452
  <h2><?php foreach ( $cf_funnels as $key=>$funnel ) { ?>
453
  <?php if ( $cf_thefunnel == $funnel->id ) { echo $funnel->name; } } ?></h2>
454
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank"> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?></a>
455
  <?php }?>
456
  <?php if ( $cf_type=='hp' ) {?>
457
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
458
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
459
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
460
  <h2>Set as Home Page</h2>
461
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?></a>
462
  <?php }?>
463
  <?php if ( $cf_type=='np' ) {?>
464
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
465
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
466
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>/invalid-url-404-testing" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
467
  <h2>Set as 404 Page</h2>
468
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url</a>
469
  <?php }?>
470
  <?php if ( $cf_type=='' ) {?>
471
  <h2>Page Undefined - Create New Page</h2>
472
  <?php }?>
473
  <?php } else { ?>
474
  <h2 style="font-size: 17px;">Add ClickFunnels Page to Your Blog</h2>
475
  <?php } ?>
476
  <h4>You haven't setup your API settings. <a href="../wp-admin/edit.php?post_type=clickfunnels&page=cf_api">Click here to setup now.</a></h4>
477
  <div class="bootstrap-wp" style=" border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
478
  <div class="row-fluid form-horizontal">
479
  <br>
480
  <div class="control-group" style="margin-left: 0px; margin-bottom: 20px;">
481
  <div data-target="cf_type" class="btn-group multichoice cf_header">
482
  <a data-value="p" class="btn <?php if ( $cf_type=='p' ) {?> active btn-selected<?php }?>">Regular Page</a>
483
  <a data-value="hp" class="btn <?php if ( $cf_type=='hp' ) {?> active btn-selected<?php }?>">Home Page</a>
484
  <a data-value="np" class="btn <?php if ( $cf_type=='np' ) {?> active btn-selected<?php }?>">404 Page</a>
485
  </div>
486
  <input type="hidden" id="cf_type" name="cf_type"/>
487
  </div>
488
  <br>
489
  <div class="control-group">
490
  <label class="control-label" for="cf_thefunnel"> Choose Funnel <i class="fa fa-caret-square-o-down"></i></label>
491
  <div class="controls">
492
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
493
  <?php if ( empty( $cf_funnels ) ) { ?>
494
  <option value="0">No Funnels Found</option>
495
  <?php }
496
  else {
497
  foreach ( $cf_funnels as $key=>$funnel ) { ?>
498
  <option value="<?php echo $funnel->id;?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
499
  <?php
500
  }
501
  } ?>
502
  </select>
503
  </div>
504
  </div>
505
  <div class="control-group">
506
  <label class="control-label" for="cf_thepage"> Choose Page <i class="fa fa-file-o"></i></label>
507
  <div class="controls">
508
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
509
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
510
  <option value="0">No Pages Found</option>
511
  <?php }
512
  else {
513
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
514
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
515
  <?php
516
  }
517
  }
518
  ?>
519
  </select>
520
  <i class="fa fa-spinner fa-spin" id="loading"></i>
521
  </div>
522
  <div id="noPageWarning" style="font-size: 11px; margin-left: 160px;padding-top: 10px;display: none;width: 100%; clear: both"><em>You have no pages for this funnel. <a href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>" target="_blank">Click to add new page.</a></em></div>
523
  </div>
524
  <div class="control-group" id="hiddenStuff" style="display: none">
525
  <div class="controls">
526
  <strong>Funnel ID: <span style="font-weight: normal"><?php echo $thepage[0]; ?></span> <br></strong>
527
  <strong>Page Key: <span style="font-weight: normal"><?php echo $thepage[1]; ?></span><br></strong>
528
  <strong>Page ID: <span style="font-weight: normal"><?php echo $thepage[2]; ?></span><br></strong>
529
  <strong>Funnel Step ID: <span style="font-weight: normal"><?php echo $thepage[3]; ?></span><br></strong>
530
  <strong>Meta: <span style="font-weight: normal"><?php echo $thepage[4]; ?></span><br></strong>
531
  <strong>Post ID: <span style="font-weight: normal"><?php echo $thepage[5]; ?></span><br></strong>
532
  <strong>Page Name: <span style="font-weight: normal"><?php echo $thepage[6]; ?></span><br></strong>
533
  <input type="text" name="cf_thefunnel" id="cf_data" value="<?php echo $savedData; ?>" style="width: 400px; padding: 7px; height: 50px; font-size: 18px;" />
534
  </div>
535
  </div>
536
  <?php if ( $cf_type!="p" ) $display ="display:none"; else $display="";?>
537
  <div class="cf_url control-group" style="<?php echo $display;?>" >
538
  <label class="control-label" for="cf_slug"> Custom URL <i class="fa fa-external-link"></i></label>
539
  <div id="cf-wp-path" class="controls ">
540
  <div class="input-prepend">
541
  <span class="add-on" style="font-size: 13px;padding: 4px 10px; background: #ECEEEF; color: #777; text-shadow: none; border: 1px solid #ccc"><?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/</span><input style="height:28px;width: 150px !important" type="textbox" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" name="cf_slug" id="cf_slug" class="input-xlarge">
542
  <div style="color:red; display:none" id="cf_invalid_slug" style="width: 90%" >You must enter an URL</div>
543
  </div>
544
  </div>
545
  </div>
546
  <br><br>
547
  <div class="p_text helpinfo" <?php if ( $cf_type!='p' ) {?> style="display: none" <?php }?>>
548
  <h4><i class="fa fa-question-circle"></i> Set as a Page</h4>
549
  <p>Choose any ClickFunnels page to be shown using a custom URL just select any funnel to refresh the list of pages. Create a custom URL and hit 'Save/Publish' to start sending traffic. <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Need more help?</a> </p>
550
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
551
  </div>
552
  <div class="hp_text helpinfo" <?php if ( $cf_type!='hp' ) {?> style="display: none" <?php }?>>
553
  <h4><i class="fa fa-question-circle"></i> Set as Home Page</h4>
554
  <p> Replace your homepage with a specific ClickFunnels page. You can show any page that you want, this will replace any other homepage settings you may have.</p>
555
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
556
  </div>
557
  <div class="np_text helpinfo" <?php if ( $cf_type!='np' ) {?> style="display: none" <?php }?>>
558
  <h4><i class="fa fa-question-circle"></i> Set as 404 Page</h4>
559
  <p> Show a specific page to be shown on any "Page not Found" such as a misspelled URL or a deleted blog post. Very good place for a squeeze page to get the most out of your traffic.</p>
560
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> Changes made to the page in editor may take up to 30 seconds to appear on WordPress page.</p>
561
  </div>
562
  <br>
563
  <div class="row-fluid" id="apiFooter">
564
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
565
  <button id="publish" name="publish" disabled class="button button-primary " style="float: right;">
566
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
567
  </button>
568
  <?php } else { ?>
569
  <button id="publish" name="publish" class="button button-primary " style="float: right;">
570
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
571
  </button>
572
  <?php } ?>
573
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 5px;">
574
  <i class="fa fa-spinner fa-spin"></i>
575
  <span>Saving...</span>
576
  </div>
577
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
578
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=cf_api' );?>"><i class="fa fa-cog"></i> Settings</a>
579
  <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>" class="button button-default" style="float: left;margin-right: 10px"><i class="fa fa-life-ring"></i> Support</a>
580
  <?php if ( !empty( $delete_link ) ) {?>
581
  <a class="button button-secondary" id="delete" type="submit" href="<?php echo $delete_link;?>"><i class="fa fa-trash"></i> Delete Page</a>
582
  <?php }?>
583
  </div>
584
  </div>
585
  </div>
586
  (function($) {
587
  setTimeout(function() {
588
  $('#cf_thepage').trigger( "change" );
589
  }, 1500);
590
  })(jQuery);
591
+ <?php
592
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
593
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
594
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
595
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
596
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
597
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
598
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
599
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
600
  $thepage = explode( "{#}", $cf_page );
601
  $savedData = $cf_page;
602
  }
603
  else {
604
  $thepage = explode( "{#}", $cf_page['page_id'] );
605
  $savedData = $cf_page['page_id'];
606
  }
607
  $cf_options = get_option( "cf_options" );
608
  jQuery(document).ready(function(){
609
  // Set Correct Options
610
  var thefunnel = jQuery('#cf_thefunnel').val();
611
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
612
  jQuery('#cf_thepage').find('option').remove().end();
613
  jQuery('#loading').fadeIn();
614
  jQuery.getJSON(specificFunnel, function(data) {
615
  setTimeout(function() {
616
  jQuery('#loading').fadeOut();
617
  }, 2000);
618
  var is_selected = "";
619
  jQuery.each(data.funnel_steps, function() {
620
  if (this.pages != ''){
621
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
622
  is_selected = "selected";
623
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
624
  } else {
625
  is_selected = "";
626
  }
627
  if ( this.wp_friendly == true && this.pages != '' ) {
628
  jQuery('#iframeURL').val('https://'+this.pages[0].url);
629
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'{#}'+this.pages[0].url+'" '+is_selected+'>'+ this.name +'</option>');
630
  }
631
  }
632
  });
633
  }).done(function() {
634
  jQuery('#loading').fadeOut();
635
  var savedMeta = jQuery('#cf_thepage').val();
636
  if(savedMeta != undefined || savedMeta != null){
637
  savedMeta = savedMeta.split('{#}');
638
  jQuery('#jsmeta').val(savedMeta[3]);
639
  <?php if ( !empty( $_GET['action'] ) ) { ?>
640
  if (savedMeta[3] != jQuery('#oldmeta').val()){
641
  jQuery('#metaalreadyupdated').hide();
642
  jQuery('#showupdatemetalink').show();
643
  }
644
  <?php } ?>
645
  }
646
  <?php if ( empty( $_GET['action'] ) ) { ?>
647
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
648
  <?php } ?>
649
  })
650
  .fail(function() {
651
  jQuery('#loading').fadeOut();
652
  })
653
  .always(function() {
654
  jQuery('#loading').fadeOut();
655
  });
656
  // Change Funnel Populate Dropdown
657
  jQuery( '#cf_thefunnel' ).change(function() {
658
  jQuery('#loading').fadeIn();
659
  var thefunnel = jQuery(this).val();
660
  var totalPages = 0;
661
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thefunnel+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
662
  jQuery('#cf_thepage').find('option').remove().end();
663
  jQuery.getJSON(specificFunnel, function(data) {
664
  setTimeout(function() {
665
  jQuery('#loading').fadeOut();
666
  }, 2000);
667
  // alert( specificFunnel);
668
  jQuery.each(data.funnel_steps, function() {
669
  if( this.wp_friendly == true && this.pages != '' ) {
670
  jQuery('#iframeURL').val('https://'+this.pages[0].url);
671
  jQuery('#cf_thepage').append('<option value="' + this.pages[0].key + '{#}' + this.pages[0].id + '{#}' + this.pages[0].funnel_step_id + '{#}' + encodeURI(this.pages[0].metatags) + '{#}<?php echo get_the_ID(); ?>{#}' + this.name +'{#}'+this.pages[0].url+'">'+ this.name +'</option>');
672
 
673
  totalPages += 1;
674
  }
675
  });
676
 
677
  }).done(function() {
678
  jQuery('#loading').fadeOut();
679
  var savedMeta = jQuery('#cf_thepage').val();
680
  if(savedMeta != undefined || savedMeta != null){
681
  savedMeta = savedMeta.split('{#}');
682
  jQuery('#previewiframe').attr('src', 'https://'+savedMeta[6]+'?preview=true');
683
  }
684
 
685
  if (totalPages == 0) {
686
  jQuery('#noPageWarning').fadeIn();
687
  jQuery('#cf_thepage').fadeOut();
688
  }
689
  else {
690
  jQuery('#noPageWarning').hide();
691
  jQuery('#cf_thepage').fadeIn();
692
  }
693
  var theposition = jQuery('#cf_thepage').val();
694
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
695
  var myString = thefunnel+'{#}'+theposition;
696
  var arr = myString.split('{#}');
697
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
698
  var do_ping = function() {
699
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
700
  }).catch(function(error) {
701
  });
702
  };
703
  do_ping();
704
  })
705
  .fail(function() {
706
  jQuery('#loading').fadeOut();
707
  })
708
  .always(function() {
709
  jQuery('#loading').fadeOut();
710
  });
711
  setTimeout(function() {
712
 
713
  }, 3000);
714
 
715
  });
716
  var request_image = function(url) {
717
  return new Promise(function(resolve, reject) {
718
  var img = new Image();
719
  img.onload = function() { resolve(img); };
720
  img.onerror = function() { reject(url); };
721
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
722
  });
723
  };
724
  /**
725
  * Pings a url.
726
  * @param {String} url
727
  * @return {Promise} promise that resolves to a ping (ms, float).
728
  */
729
  var ping = function(url) {
730
  return new Promise(function(resolve, reject) {
731
  var start = (new Date()).getTime();
732
  var response = function() {
733
  var delta = ((new Date()).getTime() - start);
734
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
735
  delta /= 4;
736
  resolve(delta);
737
  };
738
  request_image(url).then(response).catch(response);
739
  // Set a timeout for max-pings, 5s.
740
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
741
  });
742
  };
743
  function replaceText(inputText, tagName, tagReplace) {
744
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
745
  return inputText.replace(regExp, tagReplace);
746
  }
747
  // Select New Page
748
  jQuery( '#cf_thepage' ).change(function() {
749
  jQuery('#loading').fadeOut();
750
  var thefunnel = jQuery('#cf_thefunnel').val();
751
  var theposition = jQuery(this).val();
752
  jQuery('#cf_data').val(thefunnel+'{#}'+theposition);
753
  if(theposition != undefined || theposition != null){
754
  var myString = thefunnel+'{#}'+theposition;
755
  var arr = myString.split('{#}');
756
  var arr2 = theposition.split('{#}');
757
  // Iframe
758
  jQuery('#iframeURL').val('https://'+arr2[6]);
759
  var myStr = arr2[3];
760
  // Browser title
761
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
762
 
763
  jQuery('#seoTitle').val(subStr[1].replace(/%20/g, ' '));
764
 
765
  // SEO Desc
766
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
767
  jQuery('#seoDesc').val(subStr[1].replace(/%20/g, ' '));
768
  // SEO Share Image
769
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
770
  jQuery('#seosocial').val(subStr[1]);
771
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
772
  var do_ping = function() {
773
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {
774
  }).catch(function(error) {
775
  });
776
  };
777
  do_ping();
778
  jQuery('#previewiframe').attr('src', 'https://'+arr[7]+'?preview=true');
779
  }
780
 
781
  });
782
  // Fade Out Message
783
  setTimeout(function() {
784
  jQuery('#message').fadeOut();
785
  }, 3500);
786
  // Savings
787
  jQuery('#publish').click(function() {
788
  jQuery('#saving').fadeIn();
789
  });
790
  jQuery('#delete').on('click', function () {
791
  return confirm('Are you sure you want to delete this page?');
792
  });
793
  jQuery('#cf_slug').bind('keyup keypress blur', function()
794
  {
795
  var myStr = jQuery(this).val()
796
  myStr=myStr.toLowerCase();
797
  myStr=myStr.replace(/\s/g , "-");
798
  jQuery('#cf_slug').val(myStr);
799
  });
800
  // Check Null and Resave v1.0.6
801
  <?php if ($thepage[1] == 'null') { ?>
802
  // jQuery('#autosaving').fadeIn();
803
  // setTimeout(function() {
804
  // jQuery('form').submit();
805
  // }, 2000);
806
  <?php } ?>
807
  jQuery('#showupdatemetalink').click(function() {
808
  jQuery('form').submit();
809
  });
810
 
811
  });
812
  if ( $cf_page != "" ) {
813
  $json = cf_get_file_contents( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ) );
814
  $cf_funnels_pages = json_decode( $json );
815
  }
816
  <h4><i class="fa fa-times"></i> Uh oh, your page did not save correctly.</h4>
817
  <h2>Saving and Reloading...</h2>
818
  <h1><i class="fa fa-cog fa-spin"></i></h1>
819
  <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
820
  <a href="https://www.app.clickfunnels.com/funnels" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
821
  <br clear="all">
822
  <?php if ( !empty( $_GET['action'] ) ) { ?>
823
  <?php if ( $cf_type=='p' ) {?>
824
  <a style="margin-right: -3px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Open Editor</a>
825
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> View Funnel</a>
826
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> Preview</a>
827
  <h2><?php foreach ( $cf_funnels as $key=>$funnel ) { ?>
828
  <?php if ( $cf_thefunnel == $funnel->id ) { if(strlen($funnel->name) > 30) { echo substr($funnel->name,0,30).'...'; } else { echo $funnel->name;} } } ?></h2>
829
 
830
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank"> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?></a>
831
  <?php }?>
832
  <?php if ( $cf_type=='hp' ) {?>
833
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
834
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
835
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
836
  <h2>Set as Home Page</h2>
837
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?></a>
838
  <?php }?>
839
  <?php if ( $cf_type=='np' ) {?>
840
  <a href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> Launch in Editor</a>
841
  <a style="margin-right: 10px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-cogs"></i> Edit Funnel</a>
842
  <a style="margin-right: 10px;" href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/<?php echo $cf_slug; ?>/invalid-url-404-testing" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> View Page</a>
843
  <h2>Set as 404 Page</h2>
844
  <a href="<?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url" title="View Page" target="_blank"><i class="fa fa-search"></i> <?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/invalid-url</a>
845
  <?php }?>
846
  <?php if ( $cf_type=='' ) {?>
847
  <h2>Page Undefined - Try saving your page again.</h2>
848
  <?php }?>
849
  <?php if ( $cf_type=='noapi' ) {?>
850
  <h2>No API Fallback</h2>
851
  <?php }?>
852
  <?php } else { ?>
853
  <h2 style="font-size: 17px;">Add ClickFunnels Page to Your Blog</h2>
854
  <?php } ?>
855
  <h4>You haven't setup your API settings. <a href="../wp-admin/edit.php?post_type=clickfunnels&page=cf_api">Click here to setup now.</a></h4>
856
  <iframe src="<?php echo $cf_iframe_url; ?>" style="width: 1280px;height: 750px;-ms-zoom: 0.20; -moz-transform: scale(0.20); -moz-transform-origin: 0 0; -o-transform: scale(0.20); -o-transform-origin: 0 0; -webkit-transform: scale(0.20); -webkit-transform-origin: 0 0;" frameborder="0" id="previewiframe"></iframe>
857
  </div>
858
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
859
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
860
  <div class="bootstrap-wp" style=" border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
861
  <div class="row-fluid form-horizontal">
862
  <br>
863
  <a style="float: right;position:relative;z-index: 999999;margin-right: 8px" class="btn pageSettings">Page Settings</a>
864
 
865
  <div class="control-group" style="margin-left: -10px; margin-bottom: 20px !important">
866
  <div data-target="cf_type" class="btn-group multichoice cf_header">
867
  <a data-value="p" class="btn <?php if ( $cf_type=='p' || $cf_type=='') {?> active btn-selected<?php }?>">Regular Page</a>
868
  <a data-value="hp" class="btn <?php if ( $cf_type=='hp' ) {?> active btn-selected<?php }?>">Home Page</a>
869
  <a data-value="np" class="btn <?php if ( $cf_type=='np' ) {?> active btn-selected<?php }?>">404 Page</a>
870
  <!-- <a data-value="shortcode" class="btn <?php if ( $cf_type=='shortcode' ) {?> active btn-selected<?php }?>">Shortcode</a> -->
871
  </div>
872
  <input type="hidden" id="cf_type" name="cf_type"/>
873
  </div>
874
  <div class="control-group cf_uses_api" style="">
875
  <label class="control-label" for="cf_thefunnel"> Choose Funnel <i class="fa fa-filter"></i></label>
876
  <div class="controls">
877
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
878
  <?php if ( empty( $cf_funnels ) ) { ?>
879
  <option value="0">No Funnels Found</option>
880
  <?php }
881
  else {
882
  foreach ( $cf_funnels as $key=>$funnel ) { ?>
883
  <option value="<?php echo $funnel->id;?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
884
  <?php
885
  }
886
  } ?>
887
  </select>
888
  </div>
889
  </div>
890
  <div class="control-group cf_uses_api">
891
  <label class="control-label" for="cf_thepage"> Choose Page <i class="fa fa-file-o"></i></label>
892
  <div class="controls">
893
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
894
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
895
  <option value="0">No Pages Found</option>
896
  <?php }
897
  else {
898
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
899
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
900
  <?php
901
  }
902
  }
903
  ?>
904
  </select>
905
  <i class="fa fa-spinner fa-spin" id="loading"></i>
906
  </div>
907
  <div id="noPageWarning" style="font-size: 11px; margin-left: 160px;margin-top: -33px;float: left;padding-top: 10px;display: none;width: 100%; clear: both"><em>No compatible pages found for this funnel.</em></div>
908
  </div>
909
  <div class="control-group cf_no_api" >
910
  <label class="control-label" for="cf_iframe_check"> ClickFunnels URL <i class="fa fa-globe"></i></label>
911
  <div class="controls">
912
  <input type="text" class="input-xlarge" id="iframeURL" style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
913
  </div>
914
  </div>
915
  <div class="control-group cf_no_api" >
916
  <label class="control-label" for="cf_iframe_check"> Website Title <i class="fa fa-globe"></i></label>
917
  <div class="controls">
918
  <input type="text" class="input-xlarge" id="seoTitle" style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
919
  </div>
920
  </div>
921
  <div class="control-group cf_no_api" >
922
  <label class="control-label" for="cf_iframe_check"> Description <i class="fa fa-globe"></i></label>
923
  <div class="controls">
924
  <input type="text" class="input-xlarge" id="seoDesc" style="height: 30px;" value="<?php echo $cf_seo_desc; ?>" name="cf_seo_desc" />
925
  </div>
926
  </div>
927
  <div class="control-group cf_no_api" >
928
  <label class="control-label" for="cf_iframe_check"> Social Image URL <i class="fa fa-globe"></i></label>
929
  <div class="controls">
930
  <input type="text" class="input-xlarge" id="seosocial" style="height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
931
  </div>
932
  </div>
933
 
934
 
935
  <div class="control-group cf_uses_api" >
936
  <label class="control-label" for="cf_iframe_check"> Enable Split Tests <i class="fa fa-bar-chart"></i></label>
937
  <div class="controls">
938
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
939
  <option value="off">Just Show Selected Page</option>
940
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Enable Split Tests and Custom Code</option>
941
  </select>
942
  <!-- <small style="float: left;font-size: 11px;padding: 5px;margin-left: 6px"><a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">What is this?</a></small> -->
943
  </div>
944
  </div>
945
  <?php if ( !empty( $_GET['action'] ) ) { ?>
946
  <div class="control-group cf_uses_api" style="margin-bottom: 20px">
947
  <label class="control-label" for="cf_iframe_check"> Meta Data <i class="fa fa-info"></i></label>
948
  <a href="#" style="margin-left: 20px;margin-top: 5px;display: block;float: left;display: none" id="showupdatemetalink"><i class="fa fa-refresh"></i> Meta Data is Out Dated -- Click to Update</a>
949
  <span style="margin-left: 20px;margin-top: 5px;display: block;float: left" id="metaalreadyupdated"><i class="fa fa-check"></i> Meta Data is Up to Date</span>
950
  </div>
951
  <?php } else { ?>
952
  <div class="control-group cf_uses_api" style="margin-bottom: 20px">
953
  <label class="control-label" for="cf_iframe_check"> Meta Data <i class="fa fa-info"></i></label>
954
 
955
  <span style="margin-left: 20px;margin-top: 5px;display: block;float: left" id="metaalreadyupdated"><i class="fa fa-check"></i> Meta Data is Up to Date</span>
956
  </div>
957
  <?php } ?>
958
  <?php if ( $cf_type!="p" ) $display ="display:none"; else $display="";?>
959
  <div class="cf_url control-group" style="<?php echo $display;?>" >
960
  <label class="control-label" for="cf_slug"> Custom URL <i class="fa fa-globe"></i></label>
961
  <div id="cf-wp-path" class="controls ">
962
  <div class="input-prepend">
963
  <span class="add-on" style="font-size: 13px;padding: 4px 10px; background: #ECEEEF; color: #777; text-shadow: none; border: 1px solid #ccc"><?php echo get_option( 'clickfunnels_siteURL' ) ; ?>/</span><input style="height:28px;width: 150px !important" type="textbox" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" name="cf_slug" id="cf_slug" class="input-xlarge">
964
  <div style="color:red; display:none" id="cf_invalid_slug" style="width: 90%" >You must enter an URL</div>
965
  </div>
966
  </div>
967
  </div>
968
 
969
 
970
 
971
  <style>
972
  #hiddenStuff {display: none}
973
  </style>
974
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block" <?php } ?>>
975
  <div class="controls">
976
  <strong>Funnel ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[0]; ?>" /> <br></strong>
977
  <strong>Page Key: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[1]; ?>" /><br></strong>
978
  <strong>Page ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[2]; ?>" /><br></strong>
979
  <strong>Funnel Step ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[3]; ?>" /><br></strong>
980
  <strong>Saved Meta: <input type="text" style="font-weight: normal;width: 300px;" id="oldmeta" value="<?php echo $thepage[4]; ?>" /><br></strong>
981
  <strong>JS Meta: <input type="text" style="font-weight: normal;width: 300px;" id="jsmeta" value="" /><br></strong>
982
  <strong>Post ID: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[5]; ?>" /><br></strong>
983
  <strong>Page Name: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $thepage[6]; ?>" /><br></strong>
984
  <strong>Use iframe?: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $cf_iframe_check; ?>" /><br></strong>
985
  <strong>Iframe URL: <input type="text" style="font-weight: normal;width: 300px;" value="<?php echo $cf_iframe_url; ?>" /><br></strong>
986
  <textarea name="cf_thefunnel" id="cf_data" style="width: 400px;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
987
  </div>
988
  </div>
989
 
990
  <!-- <div style="background: #fafafa;border-top: 1px solid #eee;padding: 10px;text-align: center;margin: 10px 0px;margin-bottom: 20px" >
991
  <strong style="color: #777"> Running split tests or custom code on your page? Check here
992
  <input type="checkbox" id="useIframe" value="on" <?php if( $cf_iframe_check == 'on') { ?>checked <?php } ?> style="margin: 0 3px;width: 18px;height: 18px;" name="cf_iframe_check"> to activate settings.</strong>
993
  <small style="display: block;font-size: 11px;opacity: .5"><a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Why do you have to activate settings?</a></small>
994
  <input type="text" style="display: none;" id="iframeURL" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
995
  </div> -->
996
  <!-- <div class="p_text helpinfo" <?php if ( $cf_type!='p' ) {?> style="display: none" <?php }?>>
997
  <h4><i class="fa fa-question-circle"></i> Set as a Page</h4>
998
  <p>Choose any ClickFunnels page to be shown using a custom URL just select any funnel to refresh the list of pages. Create a custom URL and hit 'Save/Publish' to start sending traffic. <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>">Need more help?</a> </p>
999
  <p style="font-size: 11px;opacity: .7;"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1000
  </div>
1001
  <div class="hp_text helpinfo" <?php if ( $cf_type!='hp' ) {?> style="display: none" <?php }?>>
1002
  <h4><i class="fa fa-question-circle"></i> Set as Home Page</h4>
1003
  <p> Replace your homepage with a specific ClickFunnels page. You can show any page that you want, this will replace any other homepage settings you may have.</p>
1004
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1005
  </div>
1006
  <div class="np_text helpinfo" <?php if ( $cf_type!='np' ) {?> style="display: none" <?php }?>>
1007
  <h4><i class="fa fa-question-circle"></i> Set as 404 Page</h4>
1008
  <p> Show a specific page to be shown on any "Page not Found" such as a misspelled URL or a deleted blog post. Very good place for a squeeze page to get the most out of your traffic.</p>
1009
  <p style="font-size: 11px;opacity: .7"><i class="fa fa-exclamation-triangle"></i> If you change META data in editor, refresh page and hit 'Save Changes' to update meta data.</p>
1010
  </div> -->
1011
  <div class="row-fluid" id="apiFooter">
1012
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
1013
  <button id="publish" name="publish" disabled class="button button-primary " style="float: right; ">
1014
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
1015
  </button>
1016
  <?php } else { ?>
1017
  <button id="publish" name="publish" class="button button-primary " style="float: right; ">
1018
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-save'></i> Save Changes"; } else { echo "<i class='fa fa-save'></i> Publish Page"; } ?>
1019
  </button>
1020
  <?php } ?>
1021
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 5px;">
1022
  <i class="fa fa-spinner fa-spin"></i>
1023
  <span>Saving...</span>
1024
  </div>
1025
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
1026
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=cf_api' );?>"><i class="fa fa-cog"></i> Settings</a>
1027
  <a href="<?php echo admin_url( 'edit.php?post_type=clickfunnels&page=clickfunnels_support' );?>" class="button button-default" style="float: left;margin-right: 10px"><i class="fa fa-life-ring"></i> Support</a>
1028
  <?php if ( !empty( $delete_link ) ) {?>
1029
  <a class="button button-secondary" id="delete" type="submit" href="<?php echo $delete_link;?>"><i class="fa fa-trash"></i> Delete Page</a>
1030
  <?php }?>
1031
  </div>
1032
  </div>
1033
  </div>
1034
  (function($) {
1035
  setTimeout(function() {
1036
  $('#cf_thepage').trigger( "change" );
1037
  }, 1500);
1038
  })(jQuery);
admin_testing.php CHANGED
@@ -23,7 +23,6 @@
23
  #checkPHPStuff {
24
  padding: 10px 15px;
25
  background: #272822;
26
- background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>);
27
  border-bottom: 3px solid rgba(0,0,0,0.25);
28
  color: #D3D3C9;
29
  border-radius: 5px;
23
  #checkPHPStuff {
24
  padding: 10px 15px;
25
  background: #272822;
 
26
  border-bottom: 3px solid rgba(0,0,0,0.25);
27
  color: #D3D3C9;
28
  border-radius: 5px;
cf-template.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ * {
3
+ margin: 0 !important;
4
+ padding: 0 !important;
5
+ }
6
+ </style>
7
+ <?php
8
+ $key_1_value = get_post_meta( get_the_ID(), '_my_meta_value_key', true );
9
+ // Check if the custom field has a value.
10
+ if ( ! empty( $key_1_value ) ) {
11
+ echo '<iframe width="100%" height="100%" src="'.$key_1_value.'" frameborder="0" allowfullscreen></iframe>';
12
+ }
13
+
14
+ ?>
clickfunnels.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Plugin Name: ClickFunnels
4
- * Plugin URI: http://clickfunnels.com
5
- * Description: Connect your ClickFunnel pages to your blog. Create new pages, connect to homepage or 404 pages.
6
- * Version: 1.0.8
7
- * Author: Etison, LLC
8
- * Author URI: http://clickfunnels.com
9
  */
10
  define( "CF_URL", plugin_dir_url( __FILE__ ) );
11
  define( "CF_PATH", plugin_dir_path( __FILE__ ) );
@@ -62,6 +62,7 @@ class ClickFunnels {
62
  // remove parameters
63
  $current = explode( "?", $current );
64
  $current = $current[0];
 
65
  $home_url = get_home_url()."/";
66
  $slug = str_replace( $home_url, "", $current );
67
  $slug= rtrim( $slug, '/' );
@@ -71,13 +72,13 @@ class ClickFunnels {
71
  // echo $thepage[0] . "<br/> position:"; // funnel ID
72
  // echo $thepage[1]; // page position
73
 
74
- echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4] );
75
  exit();
76
  } else if ( is_404() ) {
77
  $page = $this->get_404();
78
  if ( !empty( $page['post_id'] ) ) {
79
  $thepage = explode( "{#}", $page['page_id'] );
80
- echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4] );
81
  exit();
82
  }
83
  else if (get_option( 'clickfunnels_404Redirect' ) == 'yesRedirect') {
@@ -88,10 +89,11 @@ class ClickFunnels {
88
  $page = $this->get_home();
89
  if ( !empty( $page['post_id'] ) ) {
90
  $thepage = explode( "{#}", $page['page_id'] );
91
- echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4] );
92
  exit();
93
  }
94
  }
 
95
  }
96
  public function fill_columns( $column ) {
97
  $id = get_the_ID();
@@ -111,16 +113,28 @@ class ClickFunnels {
111
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
112
  echo "[ Incorrect API ] <a href='../wp-admin/edit.php?post_type=clickfunnels&page=cf_api'>Setup API Settings</a>";
113
  } else {
114
- echo '<strong><a href="' . $url .'">' . $this->get_funnel_name( $funnel_id ) . '</a></strong>' ;
 
 
 
 
 
 
115
  }
116
  }
117
  if ( 'cf_thepage' == $column ) {
118
  $pagename = explode("{#}", $cf_thepage);
119
- echo $pagename[5];
 
 
 
 
 
 
120
  }
121
  if ( 'cf_openinEditor' == $column ) {
122
  $pagename = explode("{#}", $cf_thepage);
123
- echo "<a href='https://www.clickfunnels.com/pages/$pagename[1]' target='_blank'>Edit</a>";
124
  }
125
 
126
  switch ( $cf_type ) {
@@ -180,14 +194,20 @@ class ClickFunnels {
180
  return $cf_funnels;
181
  }
182
  }
183
- public function get_page_html( $funnel_id, $position, $meta ) {
184
  $page_html = get_transient( "cf_page_html_{$funnel_id}" );
185
- if ( !empty( $page_html ) ) {
 
186
  return $page_html;
187
  }
188
  else {
189
- $page_html = $this->api->get_page_html( $funnel_id, $position, $meta );
190
- return $page_html;
 
 
 
 
 
191
  }
192
  }
193
  public function save_meta( $post_id, $post ) {
@@ -203,12 +223,22 @@ class ClickFunnels {
203
  $cf_slug = $_POST['cf_slug'];
204
  $cf_thefunnel = $_POST['cf_thefunnel'];
205
  $cf_seo_tags = $_POST['cf_seo_tags'];
 
 
 
 
 
206
  update_post_meta( $post_id, "cf_type", $cf_type );
207
  update_post_meta( $post_id, "cf_page", $cf_page );
208
  update_post_meta( $post_id, "cf_thepage", $cf_thepage );
209
  update_post_meta( $post_id, "cf_slug", $cf_slug );
210
  update_post_meta( $post_id, "cf_thefunnel", $cf_thefunnel );
211
  update_post_meta( $post_id, "cf_seo_tags", $cf_seo_tags );
 
 
 
 
 
212
  $cf_options = get_option( "cf_options" );
213
  unset( $cf_options['pages'][$cf_slug] );
214
  update_option( "cf_options", $cf_options );
@@ -275,6 +305,7 @@ class ClickFunnels {
275
  public function add_columns( $columns ) {
276
  $new_columns = array();
277
  $new_columns['cb'] = $columns['cb'];
 
278
  $new_columns['cf_post_name'] = "Funnel";
279
  $new_columns['cf_thepage'] = "Page";
280
 
@@ -470,3 +501,193 @@ function cf_get_file_contents ($url) {
470
  }
471
  return $url_get_contents_data;
472
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
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: 1.0.9
7
+ * Author: Etison, LLC
8
+ * Author URI: https://www.clickfunnels.com
9
  */
10
  define( "CF_URL", plugin_dir_url( __FILE__ ) );
11
  define( "CF_PATH", plugin_dir_path( __FILE__ ) );
62
  // remove parameters
63
  $current = explode( "?", $current );
64
  $current = $current[0];
65
+ $post_id = get_the_ID();
66
  $home_url = get_home_url()."/";
67
  $slug = str_replace( $home_url, "", $current );
68
  $slug= rtrim( $slug, '/' );
72
  // echo $thepage[0] . "<br/> position:"; // funnel ID
73
  // echo $thepage[1]; // page position
74
 
75
+ echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4], $thepage[5] );
76
  exit();
77
  } else if ( is_404() ) {
78
  $page = $this->get_404();
79
  if ( !empty( $page['post_id'] ) ) {
80
  $thepage = explode( "{#}", $page['page_id'] );
81
+ echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4], $thepage[5] );
82
  exit();
83
  }
84
  else if (get_option( 'clickfunnels_404Redirect' ) == 'yesRedirect') {
89
  $page = $this->get_home();
90
  if ( !empty( $page['post_id'] ) ) {
91
  $thepage = explode( "{#}", $page['page_id'] );
92
+ echo $this->get_page_html( $thepage[0], $thepage[1], $thepage[4], $thepage[5] );
93
  exit();
94
  }
95
  }
96
+
97
  }
98
  public function fill_columns( $column ) {
99
  $id = get_the_ID();
113
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
114
  echo "[ Incorrect API ] <a href='../wp-admin/edit.php?post_type=clickfunnels&page=cf_api'>Setup API Settings</a>";
115
  } else {
116
+ if ($this->get_funnel_name( $funnel_id ) != '') {
117
+ echo '<strong><a href="' . $url .'">' . $this->get_funnel_name( $funnel_id ) . '</a></strong>' ;
118
+ }
119
+ else {
120
+ echo '<strong><a href="' . $url .'">Undefined Page</a></strong>' ;
121
+ }
122
+
123
  }
124
  }
125
  if ( 'cf_thepage' == $column ) {
126
  $pagename = explode("{#}", $cf_thepage);
127
+ if ($pagename[5] != '') {
128
+ echo $pagename[5];
129
+ }
130
+ else {
131
+ echo 'undefined';
132
+ }
133
+
134
  }
135
  if ( 'cf_openinEditor' == $column ) {
136
  $pagename = explode("{#}", $cf_thepage);
137
+ echo "<a href='https://www.clickfunnels.com/pages/$pagename[1]' target='_blank'>Open in Editor</a>";
138
  }
139
 
140
  switch ( $cf_type ) {
194
  return $cf_funnels;
195
  }
196
  }
197
+ public function get_page_html( $funnel_id, $position, $meta, $postid ) {
198
  $page_html = get_transient( "cf_page_html_{$funnel_id}" );
199
+ if (get_post_meta( $postid, "cf_iframe_check", true ) == 'on') {
200
+ $page_html = $this->api->get_page_iframe( get_post_meta( $postid, "cf_iframe_url", true ), $meta, get_post_meta( $postid, "cf_seo_title", true ), get_post_meta( $postid, "cf_seo_desc", true ), get_post_meta( $postid, "cf_seo_image", true ) );
201
  return $page_html;
202
  }
203
  else {
204
+ if ( !empty( $page_html ) ) {
205
+ return $page_html;
206
+ }
207
+ else {
208
+ $page_html = $this->api->get_page_html( $funnel_id, $position, $meta, get_post_meta( $postid, "cf_seo_title", true ), get_post_meta( $postid, "cf_seo_desc", true), get_post_meta( $postid, "cf_seo_image", true ), get_post_meta( $postid, "cf_iframe_url", true ) );
209
+ return $page_html;
210
+ }
211
  }
212
  }
213
  public function save_meta( $post_id, $post ) {
223
  $cf_slug = $_POST['cf_slug'];
224
  $cf_thefunnel = $_POST['cf_thefunnel'];
225
  $cf_seo_tags = $_POST['cf_seo_tags'];
226
+ $cf_iframe_check = $_POST['cf_iframe_check'];
227
+ $cf_iframe_url = $_POST['cf_iframe_url'];
228
+ $cf_seo_title = $_POST['cf_seo_title'];
229
+ $cf_seo_desc = $_POST['cf_seo_desc'];
230
+ $cf_seo_image = $_POST['cf_seo_image'];
231
  update_post_meta( $post_id, "cf_type", $cf_type );
232
  update_post_meta( $post_id, "cf_page", $cf_page );
233
  update_post_meta( $post_id, "cf_thepage", $cf_thepage );
234
  update_post_meta( $post_id, "cf_slug", $cf_slug );
235
  update_post_meta( $post_id, "cf_thefunnel", $cf_thefunnel );
236
  update_post_meta( $post_id, "cf_seo_tags", $cf_seo_tags );
237
+ update_post_meta( $post_id, "cf_iframe_check", $cf_iframe_check );
238
+ update_post_meta( $post_id, "cf_iframe_url", $cf_iframe_url );
239
+ update_post_meta( $post_id, "cf_seo_title", $cf_seo_title );
240
+ update_post_meta( $post_id, "cf_seo_desc", $cf_seo_desc );
241
+ update_post_meta( $post_id, "cf_seo_image", $cf_seo_image );
242
  $cf_options = get_option( "cf_options" );
243
  unset( $cf_options['pages'][$cf_slug] );
244
  update_option( "cf_options", $cf_options );
305
  public function add_columns( $columns ) {
306
  $new_columns = array();
307
  $new_columns['cb'] = $columns['cb'];
308
+
309
  $new_columns['cf_post_name'] = "Funnel";
310
  $new_columns['cf_thepage'] = "Page";
311
 
501
  }
502
  return $url_get_contents_data;
503
  }
504
+
505
+
506
+
507
+
508
+
509
+ // class PageTemplater {
510
+
511
+ // /**
512
+ // * A reference to an instance of this class.
513
+ // */
514
+ // private static $instance;
515
+
516
+ // /**
517
+ // * The array of templates that this plugin tracks.
518
+ // */
519
+ // protected $templates;
520
+
521
+
522
+ // /**
523
+ // * Returns an instance of this class.
524
+ // */
525
+ // public static function get_instance() {
526
+
527
+ // if( null == self::$instance ) {
528
+ // self::$instance = new PageTemplater();
529
+ // }
530
+
531
+ // return self::$instance;
532
+
533
+ // }
534
+
535
+ // /**
536
+ // * Initializes the plugin by setting filters and administration functions.
537
+ // */
538
+ // private function __construct() {
539
+
540
+ // $this->templates = array();
541
+
542
+
543
+ // // Add a filter to the attributes metabox to inject template into the cache.
544
+ // add_filter(
545
+ // 'page_attributes_dropdown_pages_args',
546
+ // array( $this, 'register_project_templates' )
547
+ // );
548
+
549
+
550
+ // // Add a filter to the save post to inject out template into the page cache
551
+ // add_filter(
552
+ // 'wp_insert_post_data',
553
+ // array( $this, 'register_project_templates' )
554
+ // );
555
+
556
+
557
+ // // Add a filter to the template include to determine if the page has our
558
+ // // template assigned and return it's path
559
+ // add_filter(
560
+ // 'template_include',
561
+ // array( $this, 'view_project_template')
562
+ // );
563
+
564
+
565
+ // // Add your templates to this array.
566
+ // $this->templates = array(
567
+ // 'cf-template.php' => 'ClickFunnels Page',
568
+ // );
569
+
570
+ // }
571
+
572
+
573
+ // /**
574
+ // * Adds our template to the pages cache in order to trick WordPress
575
+ // * into thinking the template file exists where it doens't really exist.
576
+ // *
577
+ // */
578
+
579
+ // public function register_project_templates( $atts ) {
580
+
581
+ // // Create the key used for the themes cache
582
+ // $cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );
583
+
584
+ // // Retrieve the cache list.
585
+ // // If it doesn't exist, or it's empty prepare an array
586
+ // $templates = wp_get_theme()->get_page_templates();
587
+ // if ( empty( $templates ) ) {
588
+ // $templates = array();
589
+ // }
590
+
591
+ // // New cache, therefore remove the old one
592
+ // wp_cache_delete( $cache_key , 'themes');
593
+
594
+ // // Now add our template to the list of templates by merging our templates
595
+ // // with the existing templates array from the cache.
596
+ // $templates = array_merge( $templates, $this->templates );
597
+
598
+ // // Add the modified cache to allow WordPress to pick it up for listing
599
+ // // available templates
600
+ // wp_cache_add( $cache_key, $templates, 'themes', 1800 );
601
+
602
+ // return $atts;
603
+
604
+ // }
605
+
606
+ // /**
607
+ // * Checks if the template is assigned to the page
608
+ // */
609
+ // public function view_project_template( $template ) {
610
+
611
+ // global $post;
612
+
613
+ // if (!isset($this->templates[get_post_meta(
614
+ // $post->ID, '_wp_page_template', true
615
+ // )] ) ) {
616
+
617
+ // return $template;
618
+
619
+ // }
620
+
621
+ // $file = plugin_dir_path(__FILE__). get_post_meta(
622
+ // $post->ID, '_wp_page_template', true
623
+ // );
624
+
625
+ // // Just to be safe, we check if the file exist first
626
+ // if( file_exists( $file ) ) {
627
+ // return $file;
628
+ // }
629
+ // else { echo $file; }
630
+
631
+ // return $template;
632
+
633
+ // }
634
+
635
+
636
+ // }
637
+ // add_action( 'plugins_loaded', array( 'PageTemplater', 'get_instance' ) );
638
+
639
+
640
+ // function myplugin_add_meta_box() {
641
+ // $screens = array( 'page' );
642
+ // global $post;
643
+ // if(!empty($post))
644
+ // {
645
+ // $pageTemplate = get_post_meta($post->ID, '_wp_page_template', true);
646
+ // if($pageTemplate == 'cf-template.php' )
647
+ // {
648
+ // foreach ( $screens as $screen ) {
649
+ // add_meta_box(
650
+ // 'myplugin_sectionid',
651
+ // __( 'ClickFunnels Page Settings', 'myplugin_textdomain' ),
652
+ // 'myplugin_meta_box_callback',
653
+ // $screen
654
+ // );
655
+ // }
656
+ // }
657
+ // }
658
+ // }
659
+ // add_action( 'add_meta_boxes', 'myplugin_add_meta_box' );
660
+ // function myplugin_meta_box_callback( $post ) {
661
+ // wp_nonce_field( 'myplugin_save_meta_box_data', 'myplugin_meta_box_nonce' );
662
+ // $value = get_post_meta( $post->ID, '_my_meta_value_key', true );
663
+ // echo '<label for="myplugin_new_field">';
664
+ // _e( 'ClickFunnels URL:', 'myplugin_textdomain' );
665
+ // echo '</label> ';
666
+ // echo '<input type="text" id="myplugin_new_field" name="myplugin_new_field" value="' . esc_attr( $value ) . '" size="25" />';
667
+ // }
668
+ // function myplugin_save_meta_box_data( $post_id ) {
669
+ // if ( ! isset( $_POST['myplugin_meta_box_nonce'] ) ) {
670
+ // return;
671
+ // }
672
+ // if ( ! wp_verify_nonce( $_POST['myplugin_meta_box_nonce'], 'myplugin_save_meta_box_data' ) ) {
673
+ // return;
674
+ // }
675
+ // if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
676
+ // return;
677
+ // }
678
+ // if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {
679
+ // if ( ! current_user_can( 'edit_page', $post_id ) ) {
680
+ // return;
681
+ // }
682
+ // } else {
683
+ // if ( ! current_user_can( 'edit_post', $post_id ) ) {
684
+ // return;
685
+ // }
686
+ // }
687
+ // if ( ! isset( $_POST['myplugin_new_field'] ) ) {
688
+ // return;
689
+ // }
690
+ // $my_data = sanitize_text_field( $_POST['myplugin_new_field'] );
691
+ // update_post_meta( $post_id, '_my_meta_value_key', $my_data );
692
+ // }
693
+ // add_action( 'save_post', 'myplugin_save_meta_box_data' );
css/admin.css ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wrap h2 {
2
+ display: none !important;
3
+ }
4
+ #side-sortables {
5
+ display: none !important;
6
+ }
7
+ #clickfunnels_meta_box {
8
+ width: 780px !important;
9
+ border-radius: 5px;
10
+ }
11
+ .button:active, .button:hover, .button:focus {
12
+ outline: none !important;
13
+ box-shadow: none !important;
14
+ }
15
+ #message {
16
+ width: 752px;
17
+ margin-bottom: 0;
18
+ }
19
+
20
+ .apiHeader {
21
+ background: #39464E ;
22
+ border-bottom: 3px solid rgba(0,0,0,0.25);
23
+ padding: 10px;
24
+ padding-top: 15px;
25
+ border-top-left-radius: 5px;
26
+ border-top-right-radius: 5px;
27
+ clear: both;
28
+ }
29
+ .apiHeader img {
30
+ float: left;
31
+ margin-left: 10px !important;
32
+ }
33
+ .apiHeader a {
34
+ float: right;
35
+ display: block;
36
+ color: #fff;
37
+ font-size: 13px;
38
+ text-decoration: none;
39
+ margin-right: 5px !important;
40
+ background-color: rgba(0, 0, 0, .3);
41
+ border: 2px solid #2b2e30;
42
+ color: #afbbc8 !important;
43
+ font-weight: 700;
44
+ -webkit-border-radius: 4px;
45
+ -moz-border-radius: 4px;
46
+ border-radius: 4px;
47
+ padding: 7px;
48
+ padding-left: 12px;
49
+ padding-right: 12px;
50
+ margin-top: 0px !important;
51
+ text-transform: uppercase;
52
+ text-decoration: none;
53
+ font-size: 14px;
54
+ margin-top: 5px !important;
55
+ }
56
+ .apiHeader a:hover {
57
+ border: 2px solid #1D81C8;
58
+ background-color: rgba(0, 0, 0, .6);
59
+ color: #fff !important;
60
+ }
61
+ .apiSubHeader {
62
+ background-color: #0166AE;
63
+ border-bottom: 3px solid rgba(0,0,0,0.25);
64
+ color: #fff;
65
+ padding: 15px 18px;
66
+ }
67
+ .apiSubHeader h2 {
68
+ margin: 0 !important;
69
+ padding: 0 !important;
70
+ color: #fff;
71
+ font-weight: bold;
72
+ font-size: 17px;
73
+ text-shadow: 1px 1px 0 #0367AE;
74
+ }
75
+ .apiSubHeader a.editThisPage {
76
+ float: right;
77
+ padding: 5px 10px;
78
+ color: #fff;
79
+ text-shadow: 1px 1px 0 #0367AE;
80
+ text-decoration: none;
81
+ padding-top: 15px;
82
+ margin-top: 6px;
83
+ font-size: 14px;
84
+ border: 2px solid #1D81C8;
85
+ background-color: #054B7C;
86
+ color: #fff !important;
87
+ font-weight: 700;
88
+ -webkit-border-radius: 4px;
89
+ -moz-border-radius: 4px;
90
+ border-radius: 4px;
91
+ padding: 7px;
92
+ padding-left: 12px;
93
+ padding-right: 12px;
94
+ text-transform: uppercase;
95
+ text-decoration: none;
96
+ font-size: 12px;
97
+ }
98
+ .apiSubHeader a.editThisPage i {
99
+ margin-right: 4px;
100
+ }
101
+ .apiSubHeader a.editThisPage:hover {
102
+ border: 2px solid #FFB700;
103
+ text-shadow: 1px 1px 0 #222;
104
+ background-color: rgba(0, 0, 0, .6);
105
+ color: #fff !important;
106
+ }
107
+ .apiSubHeader a{
108
+ text-shadow: 1px 1px 0 #0367AE;
109
+ color: #fff;
110
+ text-decoration: none;
111
+ font-size: 12px;
112
+ opacity: .8;
113
+ }
114
+ .apiSubHeader a:hover {
115
+ opacity: 1;
116
+ }
117
+ .inside {
118
+ padding: 0 !important;
119
+ margin-top: 0 !important;
120
+ border-radius: 5px !important;
121
+ }
122
+ .inside h2 {
123
+ display: block !important;
124
+ }
125
+ #postbox-container-2 {
126
+ margin-top: -20px !important;
127
+ }
128
+ body #poststuff .hndle.ui-sortable-handle {
129
+ display: none !important;
130
+ }
131
+ body #poststuff .handlediv {
132
+ display: none !important;
133
+ }
134
+ #loading {
135
+ float: left;
136
+ margin-left: 5px;
137
+ display: none;
138
+ margin-top: 6px;
139
+ color: #999;
140
+ }
141
+ #apiFooter {
142
+ background: #fafafa;
143
+ border-radius: 4px;
144
+ border: 1px solid #ddd;
145
+ margin-right: 120px;
146
+ border-bottom: 2px solid #ddd;
147
+ padding: 10px 10px;
148
+ width: 735px;
149
+ padding-bottom: 10px;
150
+ }
151
+ #apiFooter a:hover {
152
+ text-decoration: none;
153
+ }
154
+ .bootstrap-wp {
155
+ overflow: hidden;
156
+ border: 10px solid #fff;
157
+ padding-top: none;
158
+ }
159
+ .deleteButton {
160
+ padding: 5px;
161
+ float: left;
162
+ color: #777 !important;
163
+ font-size: 13px;
164
+ }
165
+ body .cf_header .btn {
166
+ font-size: 13px !important;
167
+ padding: 8px 15px;
168
+ }
169
+ body .btn-selected {
170
+ background-color: #0166AE !important;
171
+
172
+ text-shadow: 1px 1px 0 #034E82 !important;
173
+ font-family: Arial !important;
174
+ color: #ffffff !important;
175
+ border: solid #1f628d 1px !important;
176
+ text-decoration: none !important;
177
+ transition: none !important;
178
+ }
179
+ body label {
180
+ font-size: 11px;
181
+ opacity: .8;
182
+ }
183
+ body label i {
184
+ padding-left: 10px;
185
+ }
186
+ .helpinfo {
187
+ padding: 20px 40px;
188
+ background: #fff;
189
+ border-top: 1px solid #f2f2f2;
190
+ margin: 0 0px;
191
+ margin-top: -20px;
192
+ margin-bottom: -20px;
193
+ }
194
+ .helpinfo h4 {
195
+ color: #3B474F;
196
+ font-size: 15px;
197
+ font-weight: 700;
198
+ padding-bottom: 10px;
199
+ padding-top: 5px;
200
+ }
201
+ .helpinfo p {
202
+ color: #888;
203
+ font-weight: 300;
204
+ font-size: 12px;
205
+ line-height: 19px;
206
+ letter-spacing: 1px;
207
+ padding-bottom: 0;
208
+ }
209
+ .helpinfo h4 i {
210
+ margin-right: 4px;
211
+ }
212
+ #message {
213
+ width: 758px;
214
+ padding: 10px 10px;
215
+ display: block;
216
+ z-index: 99999;
217
+ position: relative;
218
+ color: #fff;
219
+ border: 1px solid #024D82;
220
+ border-bottom: 2px solid #024D82;
221
+ text-shadow: 1px 1px 0 #024D82;
222
+ padding: 0 10px;
223
+ font-size: 16px;
224
+ margin-bottom: 0;
225
+ border-radius: 5px;
226
+ background: #1069AC ;
227
+ }
228
+ .noAPI {
229
+ padding: 10px;
230
+ border-bottom: 2px solid #c93f2b;
231
+ background: #E64D37;
232
+ }
233
+ .noAPI h4 {
234
+ margin: 0;
235
+ padding: 0;
236
+ color: #fff;
237
+ }
238
+ .noAPI h4 a {
239
+ color: #fff;
240
+ font-weight: normal;
241
+ }
242
+ .input-xlarge {
243
+
244
+ }
245
+ .control-group {
246
+ padding-left: 25px
247
+ }
248
+ #autosaving {
249
+ display: none;
250
+ width: 780px;
251
+ height: 310px;
252
+ position: absolute;
253
+ z-index: 2222;
254
+ top: 145px;
255
+ color: #fff;
256
+ left: 0;
257
+ padding-top: 160px;
258
+ text-align: center;
259
+ border-bottom-right-radius: 5px;
260
+ border-bottom-left-radius: 5px;
261
+ background: rgba(0, 0, 0, .8);
262
+ }
263
+ #autosaving h2 {
264
+ color: #fff;
265
+ font-weight: 600;
266
+ text-shadow: 0 0 2p
267
+ x #000;
268
+ margin-top: 0;
269
+ }
270
+ #autosaving h4 {
271
+ color: #fff;
272
+ font-size: 13px;
273
+ letter-spacing: 1px;
274
+ font-weight: 300;
275
+ margin-bottom: 5px;
276
+ text-shadow: 0 0 2px #000;
277
+ }
278
+ #autosaving h1 {
279
+ color: #fff;
280
+ margin-top: 0;
281
+ font-size: 58px;
282
+ font-weight: 800;
283
+ text-shadow: 0 0 2px #000;
284
+ }
285
+ .wrap h1:first-child {
286
+ display: none;
287
+ }
288
+ .bootstrap-wp .form-horizontal .controls {
289
+ margin-left: 151px;
290
+ }
291
+ .bootstrap-wp .form-horizontal .control-label {
292
+ float: left;
293
+ width: 140px;
294
+ padding-top: 5px;
295
+ text-align: right;
296
+ }
297
+ .bootstrap-wp .input-xlarge {
298
+ width: 290px !important;
299
+ }
300
+ .cf_no_api {
301
+ display: none;
302
+ }
303
+ input.input-xlarge {
304
+ padding: 7px !important;
305
+ }
footer.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="copyrightInfo">
2
- <p><strong style="float: right;margin-right: 20px;font-weight: 200">Running version 1.0.8</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
1
  <div class="copyrightInfo">
2
+ <p><strong style="float: right;margin-right: 20px;font-weight: 200">Running version 1.0.9</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
geobg.png DELETED
Binary file
js/admin.js CHANGED
@@ -8,24 +8,35 @@ jQuery(document).ready(function(){
8
  switch(jQuery(this).data("value")){
9
  case "p":
10
  jQuery(this).addClass("btn-selected");
 
 
 
11
  jQuery(".cf_url").show();
12
- jQuery(".helpinfo").hide();
13
- jQuery(".p_text").show();
14
  break;
15
  case "hp":
16
  jQuery(this).addClass("btn-selected");
17
  jQuery(".cf_url").hide();
18
- jQuery(".helpinfo").hide();
19
- jQuery(".hp_text").show();
 
20
  break;
21
  case "np":
22
  jQuery(this).addClass("btn-selected");
23
  jQuery(".cf_url").hide();
24
- jQuery(".helpinfo").hide();
25
- jQuery(".np_text").show();
26
- break;
 
 
27
  }
28
  })
 
 
 
 
 
 
29
  jQuery("#publish").click(function(e){
30
  if(jQuery("#cf_slug").val()=="" && jQuery(".btn.active").data("value")=="p")
31
  {
8
  switch(jQuery(this).data("value")){
9
  case "p":
10
  jQuery(this).addClass("btn-selected");
11
+
12
+ jQuery(".cf_uses_api").show();
13
+ jQuery(".cf_no_api").hide();
14
  jQuery(".cf_url").show();
15
+ jQuery('.pageSettings').removeClass('active btn-selected');
 
16
  break;
17
  case "hp":
18
  jQuery(this).addClass("btn-selected");
19
  jQuery(".cf_url").hide();
20
+ jQuery(".cf_uses_api").show();
21
+ jQuery(".cf_no_api").hide();
22
+ jQuery('.pageSettings').removeClass('active btn-selected');
23
  break;
24
  case "np":
25
  jQuery(this).addClass("btn-selected");
26
  jQuery(".cf_url").hide();
27
+ jQuery(".cf_no_api").hide();
28
+ jQuery(".cf_uses_api").show();
29
+ jQuery('.pageSettings').removeClass('active btn-selected');
30
+ break;
31
+
32
  }
33
  })
34
+ jQuery('.pageSettings').click(function() {
35
+ jQuery(this).toggleClass("active btn-selected");
36
+ jQuery(".cf_url").toggle();
37
+ jQuery(".cf_uses_api").toggle();
38
+ jQuery(".cf_no_api").toggle();
39
+ });
40
  jQuery("#publish").click(function(e){
41
  if(jQuery("#cf_slug").val()=="" && jQuery(".btn.active").data("value")=="p")
42
  {
logo.png CHANGED
Binary file
readme.txt CHANGED
@@ -5,8 +5,8 @@ Plugin URI: http://clickfunnels.com/
5
  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.2
9
- Stable tag: 1.0.8
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
@@ -98,6 +98,15 @@ By re-selecting the page it will ping the server which should refresh your page.
98
 
99
  Stay current with the latest version of the plugin:
100
 
 
 
 
 
 
 
 
 
 
101
  = Version 1.0.8 =
102
 
103
  * Fixed bug for 'no template selected' causing certain pages not show
5
  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.3.1
9
+ Stable tag: 1.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
 
98
 
99
  Stay current with the latest version of the plugin:
100
 
101
+ = Version 1.0.9 =
102
+
103
+ * Added mini preview of chosen page
104
+ * Added 'publish' status for for ClickFunnels pages
105
+ * Added meta data status check
106
+ * Added ClickFunnels URL and editable meta data
107
+ * Enable split tests & custom code option
108
+
109
+
110
  = Version 1.0.8 =
111
 
112
  * Fixed bug for 'no template selected' causing certain pages not show
support.php CHANGED
@@ -23,7 +23,7 @@
23
  margin-bottom: 17px;
24
  }
25
  .apiHeader {
26
- background: #39464E url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>) repeat;
27
  border-bottom: 3px solid rgba(0,0,0,0.25);
28
  padding: 10px;
29
  padding-top: 15px;
@@ -31,19 +31,18 @@
31
  border-top-left-radius: 5px;
32
  }
33
  .apiHeader img {
34
- width: 200px;
35
  float: left;
36
  margin-left: 10px;
37
  }
38
  .apiHeader a {
39
  float: right;
40
  display: block;
41
- margin-top: 2px !important;
42
  margin-right: 1px !important;
 
43
  }
44
  .apiSubHeader {
45
  background-color: #0166AE;
46
- background-image: url(<?php echo plugins_url( 'geobg.png', __FILE__ ); ?>);
47
  border-bottom: 3px solid rgba(0,0,0,0.25);
48
  color: #fff;
49
  padding: 20px;
@@ -134,6 +133,7 @@
134
  text-transform: uppercase;
135
  text-decoration: none;
136
  font-size: 14px;
 
137
  }
138
  .apiHeader a:hover {
139
  border: 2px solid #1D81C8;
@@ -163,6 +163,7 @@
163
  font-size: 15px;
164
  margin-bottom: 0;
165
  font-weight: 500;
 
166
  }
167
  #faq h4 i {
168
  margin-right: 5px;
@@ -175,6 +176,36 @@
175
  padding-bottom: 20px;
176
  opacity: .7
177
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  </style>
179
  <link href="<?php echo plugins_url( 'css/font-awesome.css', __FILE__ ); ?>" rel="stylesheet">
180
  <div class="api postbox">
@@ -191,28 +222,45 @@
191
  <p style="opacity: .7">Quickly find out about all the features to get the most out of using WordPress to show your ClickFunnels pages. You can also go to the <a href="https://support.clickfunnels.com/support/home" target="_blank">knowledge base</a> to learn more about ClickFunnels.</p>
192
  <hr style="border: none; border-bottom: 1px solid #ECEEEF; margin: 20px 0">
193
  <div id="faq">
194
- <h4><i class="fa fa-question-circle"></i> How and where do I get Authentication Key?</h4>
195
- <p>To access your Authentication Token go to your ClickFunnels Members area and choose <a href="https://app.clickfunnels.com/users/edit" target="_blank">My Account > Settings</a> and you will find your <em>unique</em> authenication key. </p>
196
-
197
- <h4><i class="fa fa-question-circle"></i> What is a Custom URL?</h4>
198
- <p>A custom URL is the web address that will point to your ClickFunnels page. For example, "www.mydomain.com/signup" could point to any of your ClickFunnels pages such as an opt-in page.</p>
199
-
200
- <h4><i class="fa fa-question-circle"></i> How do I Set Homepage or 404 Page?</h4>
201
- <p>To set a page to show as the home page just select any of your ClickFunnels pages (within the plugin) and select "Home Page" and hit save. <em>You can only have one page set to Home page or 404 page at a time.</em></p>
202
-
203
- <h4><i class="fa fa-question-circle"></i> Do I Need a ClickFunnels Account?</h4>
204
- <p><strong>Yes.</strong> A clickfunnels account is required to use this plugin. If you are not already a member you can <a href="https://clickfunnels.com/" target="_blank">sign up for your account</a> and transform the way you run your online business.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  </div>
206
- <br clear="both">
207
  </div>
208
  <div id="apiFooter">
209
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
210
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'post-new.php?post_type=clickfunnels' );?>"><i class="fa fa-plus-circle"></i> Add New</a>
211
  <a href="edit.php?post_type=clickfunnels&page=cf_api" class="button button-default" style="float: left"><i class="fa fa-cog"></i> Settings</a>
212
  <a href="https://support.clickfunnels.com/support/home" target="_blank" class="button button-primary" style="float: right"><i class="fa fa-life-ring"></i> Visit Knowledge Base</a>
 
213
 
214
- <br clear="both" /><br>
215
  </div>
 
216
  <?php include('footer.php'); ?>
217
  </div>
218
 
23
  margin-bottom: 17px;
24
  }
25
  .apiHeader {
26
+ background: #39464E ;
27
  border-bottom: 3px solid rgba(0,0,0,0.25);
28
  padding: 10px;
29
  padding-top: 15px;
31
  border-top-left-radius: 5px;
32
  }
33
  .apiHeader img {
 
34
  float: left;
35
  margin-left: 10px;
36
  }
37
  .apiHeader a {
38
  float: right;
39
  display: block;
40
+ margin-top: 8px !important;
41
  margin-right: 1px !important;
42
+ margin-top: 7px !important;
43
  }
44
  .apiSubHeader {
45
  background-color: #0166AE;
 
46
  border-bottom: 3px solid rgba(0,0,0,0.25);
47
  color: #fff;
48
  padding: 20px;
133
  text-transform: uppercase;
134
  text-decoration: none;
135
  font-size: 14px;
136
+ margin-top: 5px !important;
137
  }
138
  .apiHeader a:hover {
139
  border: 2px solid #1D81C8;
163
  font-size: 15px;
164
  margin-bottom: 0;
165
  font-weight: 500;
166
+ color: #3E474F;
167
  }
168
  #faq h4 i {
169
  margin-right: 5px;
176
  padding-bottom: 20px;
177
  opacity: .7
178
  }
179
+
180
+ #apiFooter {
181
+ background: #fafafa;
182
+ border-radius: 4px;
183
+ border: 1px solid #ddd;
184
+ margin-right: 120px;
185
+ border-bottom: 2px solid #ddd;
186
+ padding: 10px 10px;
187
+ margin: 0 auto;
188
+ width: 735px;
189
+ }
190
+ #apiFooter a:hover {
191
+ text-decoration: none;
192
+ }
193
+
194
+ #apiSettings {
195
+ padding: 10px 25px;
196
+ padding-top: 20px;
197
+ border: 10px solid #fff;
198
+ }
199
+ .faqInner {
200
+ background: #fff;
201
+ padding: 10px;
202
+ padding-bottom: 0;
203
+ border: 1px solid #fafafa;
204
+ }
205
+ .faqInner:nth-child(even) {
206
+ background: #fafafa;
207
+ border: 1px solid #eee;
208
+ }
209
  </style>
210
  <link href="<?php echo plugins_url( 'css/font-awesome.css', __FILE__ ); ?>" rel="stylesheet">
211
  <div class="api postbox">
222
  <p style="opacity: .7">Quickly find out about all the features to get the most out of using WordPress to show your ClickFunnels pages. You can also go to the <a href="https://support.clickfunnels.com/support/home" target="_blank">knowledge base</a> to learn more about ClickFunnels.</p>
223
  <hr style="border: none; border-bottom: 1px solid #ECEEEF; margin: 20px 0">
224
  <div id="faq">
225
+ <div class="faqInner">
226
+ <h4><i class="fa fa-question-circle"></i> How and where do I get Authentication Key?</h4>
227
+ <p>To access your Authentication Token go to your ClickFunnels Members area and choose <a href="https://app.clickfunnels.com/users/edit" target="_blank">My Account > Settings</a> and you will find your <em>unique</em> authenication key. </p>
228
+ </div>
229
+ <div class="faqInner">
230
+ <h4><i class="fa fa-question-circle"></i> Why Do I Enable Split Tests and Custom Code?</h4>
231
+ <p>By enabling the split tests and custom code dropdown you are showing your page inside of an iframe to work with custom code such as EasyVideoPlayer or display split tests inside your page. </p>
232
+ </div>
233
+ <div class="faqInner">
234
+ <h4><i class="fa fa-question-circle"></i> What Pages Work with Wordpress Plugin?</h4>
235
+ <p>Optin Pages, Sales Pages, Webinar Pages, Thank You Pages and Miscellaenus Pages Work. </p>
236
+ </div>
237
+ <div class="faqInner">
238
+ <h4><i class="fa fa-question-circle"></i> What Pages <strong>Do Not</strong> Work with Wordpress Plugin?</h4>
239
+ <p>Pages containing sensitive data such as Membership Pages or Order Pages.</p>
240
+ </div>
241
+ <div class="faqInner">
242
+ <h4><i class="fa fa-question-circle"></i> What is a Custom URL?</h4>
243
+ <p>A custom URL is the web address that will point to your ClickFunnels page. For example, "www.mydomain.com/signup" could point to any of your ClickFunnels pages such as an opt-in page.</p>
244
+ </div>
245
+ <div class="faqInner">
246
+ <h4><i class="fa fa-question-circle"></i> How do I Set Homepage or 404 Page?</h4>
247
+ <p>To set a page to show as the home page just select any of your ClickFunnels pages (within the plugin) and select "Home Page" and hit save. <em>You can only have one page set to Home page or 404 page at a time.</em></p>
248
+ </div>
249
+ <div class="faqInner">
250
+ <h4><i class="fa fa-question-circle"></i> Do I Need a ClickFunnels Account?</h4>
251
+ <p><strong>Yes.</strong> A clickfunnels account is required to use this plugin. If you are not already a member you can <a href="https://clickfunnels.com/" target="_blank">sign up for your account</a> and transform the way you run your online business.</p>
252
+ </div>
253
  </div>
 
254
  </div>
255
  <div id="apiFooter">
256
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'edit.php?post_type=clickfunnels' );?>"><i class="fa fa-file-text-o"></i> Pages</a>
257
  <a class="button button-secondary" style="float: left; margin-right: 10px" type="submit" href="<?php echo admin_url( 'post-new.php?post_type=clickfunnels' );?>"><i class="fa fa-plus-circle"></i> Add New</a>
258
  <a href="edit.php?post_type=clickfunnels&page=cf_api" class="button button-default" style="float: left"><i class="fa fa-cog"></i> Settings</a>
259
  <a href="https://support.clickfunnels.com/support/home" target="_blank" class="button button-primary" style="float: right"><i class="fa fa-life-ring"></i> Visit Knowledge Base</a>
260
+ <br clear="both" />
261
 
 
262
  </div>
263
+ <br clear="both" />
264
  <?php include('footer.php'); ?>
265
  </div>
266