ClickFunnels - Version 2.0.2

Version Description

Download this release

Release Info

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

Code changes from version 2.0.1 to 2.0.2

Files changed (14) hide show
  1. CF_API.php +27 -18
  2. admin.php +1 -1
  3. admin_testing.php +0 -84
  4. cf-template.php +0 -14
  5. clickfunnels.php +93 -9
  6. css/admin.css +18 -18
  7. footer.php +1 -1
  8. geobg.png +0 -0
  9. js/admin.js +0 -53
  10. js/hidedraft.js +0 -3
  11. post_shortcode.php +32 -15
  12. readme.md +0 -178
  13. readme.txt +9 -3
  14. support.php +0 -280
CF_API.php CHANGED
@@ -17,6 +17,14 @@ class CF_API {
17
  $content = $response['body'];
18
  }
19
  $funnels = json_decode( $content );
 
 
 
 
 
 
 
 
20
  }
21
  return $funnels;
22
  }
@@ -35,7 +43,7 @@ public function get_page_html( $funnel_id, $pagekey = 0, $meta = "", $title = ""
35
  if ($favicon_choice == 'default') {
36
  $favicon_url = '';
37
  $favicon_js = '$("link[rel=\'icon\']").remove();';
38
- }
39
  else {
40
  $favicon_url = '<link href="'.$favicon.'" rel="shortcut icon" type="image/x-icon" />';
41
  $favicon_js = '$("link[rel=\'icon\']").attr(\'href\',\''.$favicon.'\');';
@@ -48,14 +56,14 @@ $newHTML = '<!DOCTYPE html>
48
  '.$$favicon_url.'
49
  <meta name="nodo-proxy" content="html">
50
  <!-- Meta Data -->
51
- <title>'.$title.'</title>
52
  <meta content="utf-8" http-equiv="encoding">
53
- <meta content="'.$desc.'" name="description">
54
- <meta content="'.$keywords.'" name="keywords">
55
  <!-- Open Graph -->
56
- <meta content="'.$author.'" name="author">
57
- <meta content="'.$title.'" property="og:title">
58
- <meta content="'.$desc.'" property="og:description">
59
  <meta content="'.$social.'" property="og:image">
60
  <meta property="og:url" content="'.$slug.'">
61
  <meta property="og:type" content="website">
@@ -63,8 +71,9 @@ $newHTML = '<!DOCTYPE html>
63
  '.$tracking.'
64
  <!-- Load ClickFunnels Javscript API -->
65
  <style type="text/css">#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
66
- <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
67
- <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$pagekey.'.js"></script>
 
68
  <script type="text/javascript">
69
  // Clean up duplicate meta data
70
  '.$favicon_js.'
@@ -96,7 +105,7 @@ if($slug == '') {
96
  if ($favicon_choice == 'default') {
97
  $favicon_url = '';
98
  $favicon_js = '$("link[rel=\'icon\']").remove();';
99
- }
100
  else {
101
  $favicon_url = '<link href="'.$favicon.'" rel="shortcut icon" type="image/x-icon" />';
102
  $favicon_js = '$("link[rel=\'icon\']").attr(\'href\',\''.$favicon.'\');';
@@ -109,14 +118,14 @@ $iframeVersion = '<!DOCTYPE html>
109
  '.$favicon_url.'
110
  <meta name="nodo-proxy" content="html">
111
  <!-- Meta Data -->
112
- <title>'.$title.'</title>
113
  <meta content="utf-8" http-equiv="encoding">
114
- <meta content="'.$desc.'" name="description">
115
- <meta content="'.$keywords.'" name="keywords">
116
  <!-- Open Graph -->
117
- <meta content="'.$author.'" name="author">
118
- <meta content="'.$title.'" property="og:title">
119
- <meta content="'.$desc.'" property="og:description">
120
  <meta content="'.$social.'" property="og:image">
121
  <meta property="og:url" content="'.$slug.'">
122
  <meta property="og:type" content="website">
@@ -180,8 +189,8 @@ $newHTML = '<!DOCTYPE html>
180
  <head>
181
  <!-- Load ClickFunnels Javscript API -->
182
  <style>#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
183
- <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
184
- <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$position.'.js"></script>
185
  <script>
186
  // Clean up duplicate meta data
187
  $(".metaTagTop").remove();
17
  $content = $response['body'];
18
  }
19
  $funnels = json_decode( $content );
20
+
21
+ if ($funnels == '') {
22
+ $response = get_file_content( $new_url );
23
+ if( is_array($response) ) {
24
+ $content = $response['body'];
25
+ }
26
+ $funnels = json_decode( $content );
27
+ }
28
  }
29
  return $funnels;
30
  }
43
  if ($favicon_choice == 'default') {
44
  $favicon_url = '';
45
  $favicon_js = '$("link[rel=\'icon\']").remove();';
46
+ }
47
  else {
48
  $favicon_url = '<link href="'.$favicon.'" rel="shortcut icon" type="image/x-icon" />';
49
  $favicon_js = '$("link[rel=\'icon\']").attr(\'href\',\''.$favicon.'\');';
56
  '.$$favicon_url.'
57
  <meta name="nodo-proxy" content="html">
58
  <!-- Meta Data -->
59
+ <title>'.urldecode($title).'</title>
60
  <meta content="utf-8" http-equiv="encoding">
61
+ <meta content="'.urldecode($desc).'" name="description">
62
+ <meta content="'.urldecode($keywords).'" name="keywords">
63
  <!-- Open Graph -->
64
+ <meta content="'.urldecode($author).'" name="author">
65
+ <meta content="'.urldecode($title).'" property="og:title">
66
+ <meta content="'.urldecode($desc).'" property="og:description">
67
  <meta content="'.$social.'" property="og:image">
68
  <meta property="og:url" content="'.$slug.'">
69
  <meta property="og:type" content="website">
71
  '.$tracking.'
72
  <!-- Load ClickFunnels Javscript API -->
73
  <style type="text/css">#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
74
+ <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
75
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
76
+ <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$pagekey.'.js"></script>
77
  <script type="text/javascript">
78
  // Clean up duplicate meta data
79
  '.$favicon_js.'
105
  if ($favicon_choice == 'default') {
106
  $favicon_url = '';
107
  $favicon_js = '$("link[rel=\'icon\']").remove();';
108
+ }
109
  else {
110
  $favicon_url = '<link href="'.$favicon.'" rel="shortcut icon" type="image/x-icon" />';
111
  $favicon_js = '$("link[rel=\'icon\']").attr(\'href\',\''.$favicon.'\');';
118
  '.$favicon_url.'
119
  <meta name="nodo-proxy" content="html">
120
  <!-- Meta Data -->
121
+ <title>'.urldecode($title).'</title>
122
  <meta content="utf-8" http-equiv="encoding">
123
+ <meta content="'.urldecode($desc).'" name="description">
124
+ <meta content="'.urldecode($keywords).'" name="keywords">
125
  <!-- Open Graph -->
126
+ <meta content="'.urldecode($author).'" name="author">
127
+ <meta content="'.urldecode($title).'" property="og:title">
128
+ <meta content="'.urldecode($desc).'" property="og:description">
129
  <meta content="'.$social.'" property="og:image">
130
  <meta property="og:url" content="'.$slug.'">
131
  <meta property="og:type" content="website">
189
  <head>
190
  <!-- Load ClickFunnels Javscript API -->
191
  <style>#IntercomDefaultWidget{display:none;}#Intercom{display:none;}</style>
192
+ <link href="https://assets3.clickfunnels.com/assets/lander.css" media="screen" rel="stylesheet"/>
193
+ <script type="text/javascript" src="https://static.clickfunnels.com/clickfunnels/landers/tmp/'.$position.'.js"></script>
194
  <script>
195
  // Clean up duplicate meta data
196
  $(".metaTagTop").remove();
admin.php CHANGED
@@ -1 +1 @@
1
- <style>.hndle {display: none !important}</style>
2
  if(!get_option( 'clickfunnels_api_email')) {
3
  update_option( 'clickfunnels_api_email', '');
4
  }
5
  if(!get_option( 'clickfunnels_api_auth')) {
6
  update_option( 'clickfunnels_api_auth', '');
7
  }
8
  if(!get_option( 'clickfunnels_siteURL')) {
9
  update_option( 'clickfunnels_siteURL', '');
10
  }
11
  if(!get_option( 'clickfunnels_404Redirect')) {
12
  update_option( 'clickfunnels_404Redirect', '');
13
  }
14
  if(!get_option( 'clickfunnels_agency_group_tag')) {
15
  update_option( 'clickfunnels_agency_group_tag', '');
16
  }
17
  if(!get_option( 'clickfunnels_agency_api_details')) {
18
  update_option( 'clickfunnels_agency_api_details', '');
19
  }
20
  if(!get_option( 'clickfunnels_agency_reset_data')) {
21
  update_option( 'clickfunnels_agency_reset_data', '');
22
  }
23
  if(!get_option( 'clickfunnels_agency_hide_settings')) {
24
  update_option( 'clickfunnels_agency_hide_settings', '');
25
  }
26
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
27
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
28
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
29
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
30
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
31
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
32
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
33
  $cf_page_url = get_post_meta( $_GET['post'], "cf_page_url", true );
34
  $cf_favicon = get_post_meta( $_GET['post'], "cf_favicon", true );
35
  $cf_author = get_post_meta( $_GET['post'], "cf_author", true );
36
  $cf_keywords = get_post_meta( $_GET['post'], "cf_keywords", true );
37
  $cf_head_tracking = get_post_meta( $_GET['post'], "cf_head_tracking", true );
38
  $cf_footer_tracking = get_post_meta( $_GET['post'], "cf_footer_tracking", true );
39
  $cf_wptracking_code = get_post_meta( $_GET['post'], "cf_wptracking_code", true );
40
  $cf_favicon_choice = get_post_meta( $_GET['post'], "cf_favicon_choice", true );
41
  $cf_slug= get_post_meta( $_GET['post'], 'cf_slug', true );
42
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
43
  $thepage = explode( "{#}", $cf_page );
44
  $savedData = $cf_page;
45
  }
46
  else {
47
  $thepage = explode( "{#}", $cf_page['page_id'] );
48
  $savedData = $cf_page['page_id'];
49
  }
50
  $cf_options = get_option( "cf_options" );
51
  // populate funnels option field
52
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
53
  }
54
  else {
55
  if ($cf_page != "") {
56
  $response = wp_remote_get( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
57
  if( is_array($response) ) {
58
  $json = $response['body']; // use the content
59
  }
60
  $cf_funnels_pages = json_decode( $json );
61
  }
62
  }
63
  jQuery(document).ready(function(){
64
  jQuery('.draft').hide();
65
  console.log("%cClickFunnels WordPress Plugin", "background: #0166AE; color: white; font-size: 23px");
66
  console.log("%cEditing anything inside the console is for developers only. Do not paste in any code given to you by anyone. Use with caution. Visit for support: https://support.clickfunnels.com/", "color: #888; font-size: 16px");
67
  // Set Correct Options
68
  var thenewdata = jQuery('#cf_thefunnel').val();
69
  var thenewdata = thenewdata.split('{#}');
70
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
71
  jQuery('#cf_thepage').find('option').remove().end();
72
  // alert(specificFunnel);
73
  // alert(thenewdata);
74
  jQuery('#loading').fadeIn();
75
  var favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
76
  <?php if ( empty( $_GET['action'] ) ) { ?>
77
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
78
  <?php } ?>
79
  jQuery.getJSON(specificFunnel, function(data) {
80
  setTimeout(function() {
81
  jQuery('#loading').fadeOut();
82
  }, 2000);
83
  var is_selected = "";
84
  if (data.favicon){
85
  favicon = data.favicon;
86
  }
87
  else {
88
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
89
  }
90
  jQuery.each(data.funnel_steps, function() {
91
  if (this.pages != ''){
92
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
93
  is_selected = "selected";
94
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
95
  } else {
96
  is_selected = "";
97
  }
98
  if ( this.wp_friendly == true && this.pages != '' ) {
99
  jQuery('#iframeURL').val(this.pages[0].published_url);
100
  if (data.favicon){
101
  jQuery('#cf_favicon').val(favicon);
102
  jQuery('#faviconPreview').attr('src', favicon);
103
  } else {
104
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
105
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
106
  }
107
  // Check if has split tests
108
  var splittestkeys = 'none';
109
  if (this.pages.length == 2) {
110
  splittestkeys = '2';
111
  }
112
  else if (this.pages.length == 3) {
113
  splittestkeys = '3';
114
  }
115
  // Ping All Pages in Funnel (to refresh split tests / api)
116
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
117
  pageKey = this.pages[0].key;
118
  jQuery('#headTracking').val(this.pages[0].head_tag);
119
  jQuery('#footerTracking').val(this.pages[0].body_tag);
120
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
121
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
122
  jQuery('#cf_thepage').append('<option value="' + pageKey + '{#}' + 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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'" '+is_selected+'>'+ this.name +'</option>');
123
  }
124
  }
125
  });
126
  }).done(function() {
127
  jQuery('#loading').fadeOut();
128
  var savedMeta = jQuery('#cf_thepage').val();
129
  if(savedMeta != undefined || savedMeta != null){
130
  savedMeta = savedMeta.split('{#}');
131
  <?php if ( !empty( $_GET['action'] ) ) { ?>
132
  jQuery('#cf_thepage').trigger('change');
133
  <?php } ?>
134
  }
135
  })
136
  .fail(function(jqXHR) {
137
  jQuery('#loading').fadeOut();
138
  jQuery('.badAPI').show();
139
  })
140
  .always(function() {
141
  jQuery('#loading').fadeOut();
142
  });
143
  // Change Funnel Populate Dropdown
144
  jQuery( '#cf_thefunnel' ).change(function() {
145
  jQuery('.choosePageBox').fadeIn();
146
  jQuery('.cftablink').removeClass('disabledLink');
147
  jQuery('#publish').removeClass('disabledLink');
148
  jQuery('#loading').fadeIn();
149
  var thenewdata = jQuery(this).val();
150
  var thenewdata = thenewdata.split('{#}');
151
  var totalPages = 0;
152
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
153
  // alert(specificFunnel);
154
  jQuery('#cf_thepage').find('option').remove().end();
155
  jQuery.getJSON(specificFunnel, function(data) {
156
  setTimeout(function() {
157
  jQuery('#loading').fadeOut();
158
  }, 2000);
159
  if (data.favicon){
160
  favicon = data.favicon;
161
  }
162
  else {
163
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
164
  }
165
  // alert( specificFunnel);
166
  jQuery.each(data.funnel_steps, function() {
167
  if( this.wp_friendly == true && this.pages != '' ) {
168
  // Ping All Pages in Funnel (to refresh split tests / api)
169
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
170
  // Check if has split tests
171
  var splittestkeys = 'none';
172
  if (this.pages.length == 2) {
173
  splittestkeys = '2';
174
  }
175
  else if (this.pages.length == 3) {
176
  splittestkeys = '3';
177
  }
178
  jQuery('#iframeURL').val(this.pages[0].published_url);
179
  jQuery('#cf_funnelwide_tracking_head').val(favicon);
180
  if (data.favicon){
181
  jQuery('#cf_favicon').val(favicon);
182
  jQuery('#faviconPreview').attr('src', favicon);
183
  } else {
184
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
185
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
186
  }
187
  // Tracking Codes
188
  jQuery('#headTracking').val(this.pages[0].head_tag);
189
  jQuery('#footerTracking').val(this.pages[0].body_tag);
190
  jQuery('#fw_headerTracking').val(thenewdata[1]);
191
  jQuery('#fw_footerTracking').val(thenewdata[2]);
192
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
193
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
194
  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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'">'+ this.name +'</option>');
195
  totalPages += 1;
196
  }
197
  });
198
  }).done(function() {
199
  jQuery('#loading').fadeOut();
200
  var savedMeta = jQuery('#cf_thepage').val();
201
  jQuery('#cf_thepage').trigger('change');
202
  if (totalPages == 0) {
203
  jQuery('#cf_thepage').hide();
204
  jQuery('#runningSplitTests').hide();
205
  jQuery('#noPageWarning').fadeIn();
206
  }
207
  else {
208
  jQuery('#noPageWarning').hide();
209
  jQuery('#cf_thepage').fadeIn();
210
  }
211
  var theposition = jQuery('#cf_thepage').val();
212
  var thefunnel = jQuery('#cf_thefunnel').val();
213
  thefunnel = thefunnel.split('{#}');
214
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
215
  var myString = thefunnel[0]+'{#}'+theposition;
216
  var arr = myString.split('{#}');
217
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
218
  var do_ping = function() {
219
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {}).catch(function(error) {});
220
  };
221
  do_ping();
222
  })
223
  .fail(function() {
224
  jQuery('#loading').fadeOut();
225
  })
226
  .always(function() {
227
  jQuery('#loading').fadeOut();
228
  });
229
  });
230
  var request_image = function(url) {
231
  return new Promise(function(resolve, reject) {
232
  var img = new Image();
233
  img.onload = function() { resolve(img); };
234
  img.onerror = function() { reject(url); };
235
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
236
  });
237
  };
238
  /**
239
  * Pings a url.
240
  * @param {String} url
241
  * @return {Promise} promise that resolves to a ping (ms, float).
242
  */
243
  var ping = function(url) {
244
  return new Promise(function(resolve, reject) {
245
  var start = (new Date()).getTime();
246
  var response = function() {
247
  var delta = ((new Date()).getTime() - start);
248
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
249
  delta /= 4;
250
  resolve(delta);
251
  };
252
  request_image(url).then(response).catch(response);
253
  // Set a timeout for max-pings, 5s.
254
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
255
  });
256
  };
257
  function replaceText(inputText, tagName, tagReplace) {
258
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
259
  return inputText.replace(regExp, tagReplace);
260
  }
261
  // Select New Page
262
  jQuery( '#cf_thepage' ).change(function() {
263
  jQuery('#loading').fadeOut();
264
  var thefunnel = jQuery('#cf_thefunnel').val();
265
  thefunnel = thefunnel.split('{#}');
266
  var theposition = jQuery(this).val();
267
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
268
  if(theposition != undefined || theposition != null){
269
  var myString = thefunnel[0]+'{#}'+theposition;
270
  var arr = myString.split('{#}');
271
  var arr2 = theposition.split('{#}');
272
  jQuery('#iframeURL').val(arr2[6]);
273
  <?php if ($cf_favicon_choice == '') { ?>
274
  if (arr2[7] !== ''){
275
  jQuery('#cf_favicon').val(arr2[7]);
276
  jQuery('#faviconPreview').attr('src', arr2[7]);
277
  } else {
278
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
279
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
280
  }
281
  <?php } else { ?>
282
  if (arr2[7] !== ''){
283
  jQuery('#cf_favicon').val(arr2[7]);
284
  jQuery('#faviconPreview').hide();
285
  jQuery('#metaPreview strong').hide();
286
  } else {
287
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
288
  jQuery('#faviconPreview').hide();
289
  jQuery('#metaPreview strong').hide();
290
  }
291
  <?php } ?>
292
  // Tracking Code
293
  jQuery('#headTracking').val(decodeURIComponent(arr2[8]));
294
  jQuery('#footerTracking').val(decodeURIComponent(arr2[9]));
295
  var thenewdata = jQuery('#cf_thefunnel').val();
296
  var thenewdata = thenewdata.split('{#}');
297
  jQuery('#fw_headTracking').val(thenewdata[1]);
298
  jQuery('#fw_footerTracking').val(thenewdata[2]);
299
  // Check if has split tests
300
  if (arr2[11] == 2) {
301
  var splittestkeys = '1 Active Split Test';
302
  jQuery('#runningSplitTests').show();
303
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
304
  }
305
  else if (arr2[11] == 3) {
306
  var splittestkeys = '2 Active Split Tests';
307
  jQuery('#runningSplitTests').show();
308
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
309
  }
310
  else {
311
  jQuery('#runningSplitTests').hide();
312
  }
313
  var myStr = arr2[3];
314
  // Browser title
315
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
316
  jQuery('.seoTitle').val(subStr[1].replace(/%20/g, ' '));
317
  jQuery('#metaPreview h3').text(subStr[1].replace(/%20/g, ' '));
318
  jQuery('#opengraphPreview h3').text(subStr[1].replace(/%20/g, ' '));
319
  var authorname = myStr.match('author%22%20content=%22(.*)%22%3E%3');
320
  jQuery('#seoAuthor').val(authorname[1].replace(/%20/g, ' '));
321
  jQuery('#theAuthor').html('| '+authorname[1].replace(/%20/g, ' '));
322
  var keywordsmeta = myStr.match('keywords%22%20content=%22(.*)%22%3E%3');
323
  var keywords = keywordsmeta[1].replace(/%20/g, ' ').split('%');
324
  jQuery('#seoKeywords').val(keywords[0]);
325
  // SEO Desc
326
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
327
  jQuery('.seoDesc').val(subStr[1].replace(/%20/g, ' '));
328
  jQuery('#metaPreview p').text(subStr[1].replace(/%20/g, ' '));
329
  jQuery('#opengraphPreview p').text(subStr[1].replace(/%20/g, ' '));
330
  // SEO Share Image
331
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
332
  jQuery('#seosocial').val(subStr[1]);
333
  if (subStr[1] != ''){
334
  jQuery('#seosocialimage').show();
335
  jQuery('#seosocialimage').attr('src', subStr[1]);
336
  } else {
337
  jQuery('#seosocialimage').hide();
338
  }
339
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
340
  <?php if ( !empty( $_GET['updatemeta']) ) { ?>
341
  setTimeout(function() {
342
  jQuery('#publish').trigger('click');
343
  }, 4000);
344
  <?php } ?>
345
  }
346
  });
347
  // Savings
348
  jQuery('#publish').click(function() {
349
  if (jQuery(this).hasClass('disabledLink')=== true) {
350
  }
351
  else {
352
  jQuery('#saving').fadeIn();
353
  if (jQuery('#cf_slug').val() == '' && jQuery('.cf_header').val() == 'p') {
354
  jQuery('.selectapagelink').trigger('click');
355
  jQuery('#customurlError').fadeIn();
356
  jQuery('#cf_slug').focus();
357
  jQuery('#saving').fadeOut();
358
  }
359
  else {
360
  saveNow = 'yes';
361
  jQuery('.used_slug').each(function () {
362
  if (jQuery(this).html() == jQuery('#cf_slug').val()) {
363
  jQuery('#customurlError_duplicate').fadeIn();
364
  jQuery('#saving').fadeOut();
365
  saveNow = 'no!';
366
  }
367
  });
368
  if (saveNow == 'yes') {
369
  jQuery('form').submit();
370
  }
371
  }
372
  }
373
  });
374
  jQuery('.showupdatemetalink').click(function() {
375
  jQuery('form').submit();
376
  });
377
  if (jQuery(this).hasClass('disabledLink')=== true) {
378
  }
379
  else {
380
  jQuery('.cftabs').hide();
381
  jQuery('.cftablink').removeClass('active');
382
  jQuery(this).addClass('active');
383
  var tab = jQuery(this).attr('data-tab');
384
  jQuery('#'+tab).show();
385
  }
386
  str = str.replace(/^\s+|\s+$/g, ''); // trim
387
  str = str.toLowerCase();
388
  // remove accents, swap ñ for n, etc
389
  var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
390
  var to = "aaaaeeeeiiiioooouuuunc------";
391
  for (var i=0, l=from.length ; i<l ; i++) {
392
  str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
393
  }
394
  str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
395
  .replace(/\s+/g, '-') // collapse whitespace and replace by -
396
  .replace(/-+/g, '-'); // collapse dashes
397
  return str;
398
  {
399
  var myStr = jQuery(this).val()
400
  myStr=myStr.toLowerCase();
401
  myStr=myStr.replace(/\s/g , "-");
402
  jQuery('#cf_slug').val(myStr);
403
  slug = jQuery(this).val();
404
  customSlug = slug;
405
  customSlug = string_to_slug(customSlug);
406
  jQuery(this).val(customSlug);
407
  jQuery('.customSlugText').text(customSlug);
408
  newurl = jQuery('#cfslugurl').text();
409
  jQuery('#cfslugurl').attr('href', newurl);
410
  jQuery('#cf_page_url').val('<?php echo get_home_url(); ?>/'+myStr);
411
  jQuery('#customurlError').hide();
412
  jQuery('#customurlError_duplicate').hide();
413
  jQuery('#publish').removeClass('disabledLink');
414
  jQuery('.used_slug').each(function () {
415
  if (jQuery(this).html() == customSlug) {
416
  jQuery('#customurlError_duplicate').fadeIn();
417
  jQuery('#publish').addClass('disabledLink');
418
  }
419
  });
420
  if ('' == customSlug) {
421
  jQuery('#customurlError').fadeIn();
422
  jQuery('#publish').addClass('disabledLink');
423
  }
424
  });
425
  if (jQuery(this).val() == 'clickgate') {
426
  jQuery('.cf_url').hide();
427
  jQuery('.clickgateinfo').show();
428
  jQuery('#publish').removeClass('disabledLink');
429
  }
430
  else if (jQuery(this).val() == 'hp') {
431
  jQuery('.cf_url').hide();
432
  jQuery('#publish').removeClass('disabledLink');
433
  }
434
  else if (jQuery(this).val() == 'np') {
435
  jQuery('.cf_url').hide();
436
  jQuery('#publish').removeClass('disabledLink');
437
  }
438
  else {
439
  jQuery('.cf_url').show();
440
  jQuery('.clickgateinfo').hide();
441
  jQuery('#cf_slug').trigger('keyup');
442
  }
443
  });
444
  <?php
445
  // check all CF page slugs
446
  $posts = get_posts(array(
447
  'post_type' => 'clickfunnels',
448
  'post_status' => 'publish',
449
  'fields' => 'ids'
450
  )
451
  );
452
  foreach($posts as $p){
453
  $slug = get_post_meta($p,"cf_slug",true);
454
  if ($slug != $cf_slug) {
455
  echo "<li class='used_slug'>$slug</li>";
456
  }
457
  }
458
  foreach( get_posts('numberposts=-1') as $post ) {
459
  echo "<li class='used_slug'>$post->post_name</li>";
460
  }
461
  foreach( get_pages('numberposts=-1') as $post ) {
462
  echo "<li class='used_slug'>$post->post_name</li>";
463
  }
464
  ?>
465
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
466
  <?php $hideforUpdateMeta = 'display: none !important'; ?>
467
  <style>.bootstrap-wp, .copyrightInfo {display: none; }</style>
468
  <span style="margin: 10px;" class="compatCheck compatwarning">Updating Your Meta Data... <strong><i class="fa fa-spinner fa-spin"></i> Please wait just a moment.</strong></span>
469
  <input type="hidden" name="meta_redirect" value='yes'>
470
  <?php } else { ?>
471
  <h2>
472
  <?php
473
  if ( !empty( $_GET['action'] ) && $cf_funnels ) {
474
  $blankpage = 'no';
475
  foreach ( $cf_funnels as $key=>$funnel ) {
476
  if ( $cf_thefunnel == $funnel->id ) {
477
  $lengthofheadline = 40;
478
  if ( $cf_type=='hp' || $cf_type=='np' || $cf_type=='clickgate' ) { $lengthofheadline = 19; }
479
  if (strlen($thepage[6]) > $lengthofheadline) {
480
  echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...';
481
  $check = '1';
482
  }
483
  else {
484
  if(strlen($thepage[6]) > $lengthofheadline) { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...'; }
485
  else { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.$thepage[6];}
486
  $check = '1';
487
  }
488
  }
489
  else {
490
  $blankpage = 'yes';
491
  }
492
  }
493
  $cf_options = get_option( "cf_options" );
494
  $homeCheck = $cf_options['home'];
495
  $postid = get_the_ID();
496
  if ($cf_page == '' && $cf_type == '' && $blankpage = 'yes' && $homeCheck['post_id'] != $postid && $cf_thepage != '') {
497
  echo 'Requires Custom URL';
498
  }
499
  } else {
500
  echo '<i class="fa fa-plus-square" style="margin-right: 5px"></i> Add New Page';
501
  }
502
  ?>
503
  <?php if ($cf_type == 'clickgate') { ?>
504
  ClickGate Popup
505
  <?php } ?> -->
506
  </h2>
507
  <?php if ( !empty( $_GET['action'] ) ) { ?>
508
  <a style="margin-right: 0;margin-top: -33px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> EDITOR</a>
509
  <a style="margin-right: 10px;margin-top: -33px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-filter"></i> FUNNEL</a>
510
  <a style="margin-right: 10px;margin-top: -33px;" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> PREVIEW</a>
511
  <?php if ( $cf_type=='p' ) {?>
512
  <?php }?>
513
  <?php if ( $cf_type=='hp' ) {?>
514
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-home"></i> Set as Home Page</span>
515
  <?php }?>
516
  <?php if ( $cf_type=='np' ) {?>
517
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-exclamation-triangle"></i> Set as 404 Page</span>
518
  <?php }?>
519
  <?php if ( $cf_type=='clickgate' ) {?>
520
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-external-link"></i> Set as ClickGate</span>
521
  <?php }?>
522
  <?php }?>
523
  <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>
524
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
525
  <input type="hidden" name="meta_redirect" value='yes'>
526
  <?php } ?>
527
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
528
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
529
  <div class="bootstrap-wp"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
530
  <div id="app_sidebar">
531
  <a href="#" data-tab="tab1" class="cftablink selectapagelink active">Select Page</a>
532
  <a href="#" data-tab="tab2" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Meta Data</a>
533
  <a href="#" data-tab="tab4" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Open Graph</a>
534
  <a href="#" data-tab="tab6" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Tracking Code</a>
535
  <a href="#" data-tab="tab3" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Settings</a>
536
  </div>
537
  <div id="app_main" class="col-sm-7 row-fluid form-horizontal">
538
  <div id="tab6" class="cftabs" style="display: none">
539
  <!-- Tracking Code -->
540
  <h2>Tracking Code</h2>
541
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel.</em></p>
542
  <hr style="margin-left: 51px">
543
  <div class="control-group" >
544
  <label class="control-label" for="cf_iframe_check"> WordPress Only Tracking Code </label>
545
  <div class="controls">
546
  <textarea class="input-xlarge wpfooterTracking" id="wpfooterTracking" style="height: 80px;" name="cf_wptracking_code"><?php echo $cf_wptracking_code; ?></textarea>
547
  </div>
548
  </div>
549
  <hr style="margin-left: 51px">
550
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> You can add your own custom tracking code for only this WordPress page, meaning your original page will not have this tracking code.</em></p>
551
  <hr style="margin-left: 51px">
552
  <div class="control-group" >
553
  <label class="control-label" for="cf_iframe_check"> Header Tracking </label>
554
  <div class="controls">
555
  <textarea class="input-xlarge headTracking" id="headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
556
  </div>
557
  </div>
558
  <div class="control-group" >
559
  <label class="control-label" for="cf_iframe_check"> Footer Tracking </label>
560
  <div class="controls">
561
  <textarea class="input-xlarge footerTracking" id="footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
562
  </div>
563
  </div>
564
  <hr style="margin-left: 51px">
565
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Funnel wide tracking is set inside the Funnel Settings in the ClickFunnels app.</em></p>
566
  <hr style="margin-left: 51px">
567
  <div class="control-group" >
568
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Header Tracking </label>
569
  <div class="controls">
570
  <textarea class="input-xlarge fw_headTracking" id="fw_headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
571
  </div>
572
  </div>
573
  <div class="control-group" >
574
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Footer Tracking </label>
575
  <div class="controls">
576
  <textarea class="input-xlarge fw_footerTracking" id="fw_footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
577
  </div>
578
  </div>
579
  </div>
580
  <div id="tab1" class="cftabs">
581
  <!-- Select a Page / Funnel -->
582
  <h2>Select a Page</h2>
583
  <div class="control-group cf_uses_api clearfix" style="">
584
  <label class="control-label" for="cf_thefunnel"> Choose Funnel </label>
585
  <div class="controls">
586
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
587
  <?php if ( empty( $cf_funnels ) ) { ?>
588
  <option value="0">No Funnels Found</option>
589
  <?php }
590
  else {
591
  // Agency Gate Check
592
  $agency_group_tag = get_option('clickfunnels_agency_group_tag');
593
  foreach ( $cf_funnels as $key=>$funnel ) {
594
  if ($agency_group_tag != 'off') {
595
  if ($funnel->group_tag || $funnel->group_tag != '') {
596
  $group_tag = str_replace("'", '{replace}', $funnel->group_tag);
597
  $group_tag = str_replace("\"", '{replace}', $funnel->group_tag);
598
  if ($agency_group_tag == $group_tag) { ?>
599
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
600
  <?php }
601
  } else {
602
  if ($agency_group_tag == 'ungrouped') { ?>
603
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
604
  <?php }
605
  }
606
  }
607
  else { ?>
608
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
609
  <?php }
610
  }
611
  } ?>
612
  </select>
613
  </div>
614
  </div>
615
  <div class="control-group choosePageBox clearfix" style="<?php if ( empty( $_GET['action'] ) ) { echo "display: none"; } ?>">
616
  <label class="control-label" for="cf_thepage">
617
  Choose Page <span id="loading"><i class="fa fa-spinner"></i> <em style="margin-left: 5px;font-size: 11px;">Loading Pages...</em></span>
618
  <div id="runningSplitTests" style="font-size: 11px;opacity: .8;float: right;padding-top: 5px;color: #555;margin-right: 26px;display: none;clear: both">
619
  <!-- Number of Split Tests -->
620
  </div>
621
  </label>
622
  <div class="controls">
623
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
624
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
625
  <option value="0">No Pages Found</option>
626
  <?php }
627
  else {
628
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
629
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
630
  <?php
631
  }
632
  }
633
  ?>
634
  </select>
635
  </div>
636
  <div id="noPageWarning" style="font-size: 11px; margin-left: 28px; margin-top: -13px;float: left;padding-top: 14px;display: none;width: 100%; clear: both">
637
  <strong style="font-size: 13px;display: block;">No compatible pages found. </strong>
638
  <em style="display: block">Membership pages and order pages are not available through plugin.</em>
639
  </div>
640
  <br clear="all">
641
  </div>
642
  <?php if ( $cf_type!="p" && $check == '1') $display ="display:none"; else $display="";?>
643
  <?php if ( $cf_type == '') $display ="display:block"; ?>
644
  <div class="cf_url control-group clearfix" style="<?php echo $display;?>" >
645
  <label class="control-label" for="cf_slug"> Custom Slug</label>
646
  <div id="cf-wp-path" class="controls ">
647
  <input style="padding:10px;"type="text" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" placeholder="your-path-here" name="cf_slug" id="cf_slug" class="input-xlarge">
648
  <?php if ( $cf_type == '' ) $display ="display:block;"; else $display="";?>
649
  <div id="customurlError" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
650
  Add a path before saving.
651
  </div>
652
  <div id="customurlError_duplicate" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
653
  Slug already taken
654
  </div>
655
  </div>
656
  <p class="infoHelp" style="padding-left: 25px;margin-top: 13px;"><span><i class="fa fa-globe" style="margin-right: 3px"></i>
657
  <?php if ( !empty( $_GET['action'] ) ) { ?>
658
  <a style="font-weight: bold;text-decoration: none; padding-bottom: 3px;" id="cfslugurl" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" target="_blank"><?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></a>
659
  <?php } else { ?>
660
  <span style="font-weight: bold;text-decoration: none; padding-bottom: 3px;"> <?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></span>
661
  <?php } ?>
662
  </span></p>
663
  <input type="text" style="display: none" class="input-xlarge" style="height: 30px;" value="<?php echo $cf_page_url; ?>" name="cf_page_url" id="cf_page_url" />
664
  </div>
665
  </div>
666
  <div id="tab2" class="cftabs" style="display: none">
667
  <!-- Meta Data -->
668
  <h2>Meta Data</h2>
669
  <div id="metaPreview">
670
  <h5>PREVIEW</h5>
671
  <img src="<?php echo $cf_favicon; ?>" id="faviconPreview" style="width: 18px;margin-left: 10px;margin-bottom: 5px;float: left;" />
672
  <strong>FAVICON</strong>
673
  <h3><?php echo $cf_seo_title; ?></h3>
674
  <span><?php echo get_home_url() ; ?>/<em style="font-style: normal" class="customSlugText"><?php echo $cf_slug; ?></em></span>
675
  <p><?php echo $cf_seo_desc; ?></p>
676
  </div>
677
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
678
  <hr style="margin-left: 51px">
679
  <div class="control-group" >
680
  <label class="control-label" for="cf_iframe_check"> Website Title </label>
681
  <div class="controls">
682
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
683
  </div>
684
  </div>
685
  <div class="control-group" >
686
  <label class="control-label" for="cf_iframe_check"> Description </label>
687
  <div class="controls">
688
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
689
  </div>
690
  </div>
691
  <div class="control-group" >
692
  <label class="control-label" for="cf_iframe_check"> Keywords </label>
693
  <div class="controls">
694
  <input type="text" class="input-xlarge" id="seoKeywords" readonly="readonly"style="height: 30px;" value="<?php echo $cf_keywords; ?>" name="cf_keywords" />
695
  </div>
696
  </div>
697
  <div class="control-group" >
698
  <label class="control-label" for="cf_iframe_check"> Favicon </label>
699
  <div class="controls">
700
  <input type="text" class="input-xlarge" readonly="readonly"id="cf_favicon" style="height: 30px;" value="<?php echo $cf_favicon; ?>" name="cf_favicon" />
701
  </div>
702
  </div>
703
  <div class="control-group" >
704
  <label class="control-label" for="cf_favicon_choice"> Choose Favicon to Show </label>
705
  <div class="controls">
706
  <select name="cf_favicon_choice" id="cf_favicon_choice" class="cf_favicon_choice" style="width: 100% !important">
707
  <option value="" <?php if($cf_favicon_choice == ''){ echo 'selected'; } ?>>Show ClickFunnels Page Favicon</option>
708
  <option value="default"<?php if($cf_favicon_choice == 'default'){ echo 'selected'; } ?>>Show Default WordPress Favicon</option>
709
  </select>
710
  </div>
711
  </div>
712
  </div>
713
  <div id="tab3" class="cftabs" style="display: none">
714
  <!-- Page Settings -->
715
  <h2>Page Settings</h2>
716
  <div class="innerTab">
717
  <div class="control-group ">
718
  <label class="control-label" for="cf_type"> Choose Page Type</label>
719
  <select name="cf_type" id="cf_type" class="cf_header" style="width: 100% !important">
720
  <option value="p" <?php if($cf_type == 'p'){ echo 'selected'; } ?>>Regular Page</option>
721
  <option value="hp"<?php if($cf_type == 'hp'){ echo 'selected'; } ?>>Set as Home Page</option>
722
  <option value="np"<?php if($cf_type == 'np'){ echo 'selected'; } ?>>Set as 404 Page</option>
723
  <option value="clickgate"<?php if($cf_type == 'clickgate'){ echo 'selected'; } ?>>Set as ClickGate</option>
724
  </select>
725
  </div>
726
  </div>
727
  <?php if ( $cf_type == 'clickgate') $display ="display:block;"; else $display="";?>
728
  <p class="infoHelp clickgateinfo" style="color: #8A6D3B;display: none; <?php echo $display; ?>"><i class="fa fa-star" style="margin-right: 3px"></i> <strong>ClickGate will show this page at the top of any page or post that your visitors land on and will cookie them to show only page only once.</strong></em></p>
729
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Choose to make this a regular page with a path (custom URL) or show this page as the Home Page for your blog. You can also set this page as a 404 page for any old, mispelled or deleted paths. <em>(only one page can be set as a Home, 404 or ClickGate at a time)</em></p>
730
  <hr style="margin-left: 51px">
731
  <div class="control-group cf_uses_api" >
732
  <label class="control-label" for="cf_iframe_check"> Show Page Inside of Iframe</label>
733
  <div class="controls">
734
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
735
  <option value="off">No, show page using ClickFunnels API.</option>
736
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Yes, show page using an iframe.</option>
737
  </select>
738
  </div>
739
  </div>
740
  <br style="clear: both">
741
  <p class="infoHelp" style="margin-top: 15px"><i class="fa fa-question-circle" style="margin-right: 3px"></i> If you have custom code on your page that is not working, choose to show your page inside an iframe to fix any custom code issues. If your page is showing up blank use the iframe option and submit a support ticket.</p>
742
  <hr style="margin-left: 51px">
743
  <div class="control-group" style="display: block">
744
  <label class="control-label" for="cf_iframe_check"> ClickFunnels Page URL <small>(reference only)</small></label>
745
  <div class="controls">
746
  <input type="text" class="input-xlarge" id="iframeURL" readonly="readonly"style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
747
  </div>
748
  </div>
749
  </div>
750
  <div id="tab4" class="cftabs" style="display: none">
751
  <!-- Extra Settings -->
752
  <h2>Open Graph</h2>
753
  <div id="opengraphPreview">
754
  <h5>PREVIEW</h5>
755
  <img style="<?php if ($cf_seo_image == '') { echo 'display: none;'; } ?>" src="<?php echo $cf_seo_image; ?>" id="seosocialimage">
756
  <h3><?php echo $cf_seo_title; ?></h3>
757
  <p><?php echo $cf_seo_desc; ?></p>
758
  <span><?php echo get_home_url() ; ?> <em id="theAuthor"><?php echo '| '.$cf_author; ?></em></span>
759
  </div>
760
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
761
  <hr style="margin-left: 51px">
762
  <div class="control-group" >
763
  <label class="control-label" for="cf_iframe_check"> Title </label>
764
  <div class="controls">
765
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" />
766
  </div>
767
  </div>
768
  <div class="control-group" >
769
  <label class="control-label" for="cf_iframe_check"> Description </label>
770
  <div class="controls">
771
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
772
  </div>
773
  </div>
774
  <div class="control-group" >
775
  <label class="control-label" for="cf_iframe_check"> Author </label>
776
  <div class="controls">
777
  <input type="text" class="input-xlarge" id="seoAuthor" readonly="readonly"style="height: 30px;" value="<?php echo $cf_author; ?>" name="cf_author" />
778
  </div>
779
  </div>
780
  <div class="control-group" >
781
  <label class="control-label" for="cf_iframe_check"> Social Image URL </label>
782
  <div class="controls">
783
  <input type="text" class="input-xlarge" id="seosocial" readonly="readonly" style=" height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
784
  </div>
785
  </div>
786
  </div>
787
  <div id="savePage">
788
  <div style="width: 100%">
789
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
790
  <a href="#" id="publish" name="publish" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" disabled style="float: right; ">
791
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-check-circle'></i> Update Page"; } else { echo "<i class='fa fa-check-circle'></i> Save and Publish"; } ?>
792
  </a>
793
  <?php } else { ?>
794
  <a href="#" id="publish" name="publish" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" style="float: right; ">
795
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-check-circle'></i> Update Page"; } else { echo "<i class='fa fa-check-circle'></i> Save and Publish"; } ?>
796
  </a>
797
  <?php } ?>
798
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 9px;margin-right: 4px;font-size: 15px;">
799
  <i class="fa fa-spinner fa-spin"></i>
800
  <span>Saving...</span>
801
  </div>
802
  </div>
803
  </div>
804
  <style>
805
  #hiddenStuff {display: none}
806
  </style>
807
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block;clear: both;" <?php } ?>>
808
  <style>
809
  #hiddenStuff input {
810
  display:block;margin-top: 5px;margin-bottom: 5px;font-weight: normal;width: 100%;
811
  }
812
  </style>
813
  <div class="controls">
814
  <br>
815
  <h3>Dev Checks:</h3>
816
  <hr />
817
  <strong>Funnel ID: <input id="checkFunID" type="text" value="<?php echo $thepage[0]; ?>" /></strong>
818
  <strong>Page Key: <input type="text" value="<?php echo $thepage[1]; ?>" /></strong>
819
  <strong>Page ID: <input type="text" value="<?php echo $thepage[2]; ?>" /></strong>
820
  <strong>Funnel Step ID: <input type="text" value="<?php echo $thepage[3]; ?>" /></strong>
821
  <strong>Saved Meta: <input type="text" id="oldmeta" value="<?php echo $thepage[4]; ?>" /></strong>
822
  <strong>JS Meta: <input type="text" id="jsmeta" value="" /></strong>
823
  <strong>Post ID: <input type="text" value="<?php echo $thepage[5]; ?>" /></strong>
824
  <strong>Page Name: <input type="text" value="<?php echo $thepage[6]; ?>" /></strong>
825
  <strong>Use iframe?: <input type="text" value="<?php echo $cf_iframe_check; ?>" /></strong>
826
  <strong>Iframe URL: <input type="text" value="<?php echo $cf_iframe_url; ?>" /></strong>
827
  <textarea name="cf_thefunnel" id="cf_data" style="display:block;margin-top: 5px;margin-bottom: 10px;width: 100%;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
828
  </div>
829
  </div>
830
  </div>
831
  </div>
 
832
  if(!get_option( 'clickfunnels_api_email')) {
833
  update_option( 'clickfunnels_api_email', '');
834
  }
835
  if(!get_option( 'clickfunnels_api_auth')) {
836
  update_option( 'clickfunnels_api_auth', '');
837
  }
838
  if(!get_option( 'clickfunnels_siteURL')) {
839
  update_option( 'clickfunnels_siteURL', '');
840
  }
841
  if(!get_option( 'clickfunnels_404Redirect')) {
842
  update_option( 'clickfunnels_404Redirect', '');
843
  }
844
  if(!get_option( 'clickfunnels_agency_group_tag')) {
845
  update_option( 'clickfunnels_agency_group_tag', '');
846
  }
847
  if(!get_option( 'clickfunnels_agency_api_details')) {
848
  update_option( 'clickfunnels_agency_api_details', '');
849
  }
850
  if(!get_option( 'clickfunnels_agency_reset_data')) {
851
  update_option( 'clickfunnels_agency_reset_data', '');
852
  }
853
  if(!get_option( 'clickfunnels_agency_hide_settings')) {
854
  update_option( 'clickfunnels_agency_hide_settings', '');
855
  }
856
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
857
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
858
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
859
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
860
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
861
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
862
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
863
  $cf_page_url = get_post_meta( $_GET['post'], "cf_page_url", true );
864
  $cf_favicon = get_post_meta( $_GET['post'], "cf_favicon", true );
865
  $cf_author = get_post_meta( $_GET['post'], "cf_author", true );
866
  $cf_keywords = get_post_meta( $_GET['post'], "cf_keywords", true );
867
  $cf_head_tracking = get_post_meta( $_GET['post'], "cf_head_tracking", true );
868
  $cf_footer_tracking = get_post_meta( $_GET['post'], "cf_footer_tracking", true );
869
  $cf_wptracking_code = get_post_meta( $_GET['post'], "cf_wptracking_code", true );
870
  $cf_favicon_choice = get_post_meta( $_GET['post'], "cf_favicon_choice", true );
871
  $cf_slug= get_post_meta( $_GET['post'], 'cf_slug', true );
872
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
873
  $thepage = explode( "{#}", $cf_page );
874
  $savedData = $cf_page;
875
  }
876
  else {
877
  $thepage = explode( "{#}", $cf_page['page_id'] );
878
  $savedData = $cf_page['page_id'];
879
  }
880
  $cf_options = get_option( "cf_options" );
881
  // populate funnels option field
882
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
883
  }
884
  else {
885
  if ($cf_page != "") {
886
  $response = wp_remote_get( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
887
  if( is_array($response) ) {
888
  $json = $response['body']; // use the content
889
  }
890
  $cf_funnels_pages = json_decode( $json );
891
  }
892
  else if ($cf_funnels == '') {
893
  $response = get_file_content( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
894
  if( is_array($response) ) {
895
  $json = $response['body']; // use the content
896
  }
897
  $cf_funnels_pages = json_decode( $json );
898
  }
899
  }
900
  jQuery(document).ready(function(){
901
  jQuery('.draft').hide();
902
  console.log("%cClickFunnels WordPress Plugin", "background: #0166AE; color: white; font-size: 23px");
903
  console.log("%cEditing anything inside the console is for developers only. Do not paste in any code given to you by anyone. Use with caution. Visit for support: https://support.clickfunnels.com/", "color: #888; font-size: 16px");
904
  // Set Correct Options
905
  var thenewdata = jQuery('#cf_thefunnel').val();
906
  var thenewdata = thenewdata.split('{#}');
907
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
908
  jQuery('#cf_thepage').find('option').remove().end();
909
  // alert(specificFunnel);
910
  // alert(thenewdata);
911
  jQuery('#loading').fadeIn();
912
  var favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
913
  <?php if ( empty( $_GET['action'] ) ) { ?>
914
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
915
  <?php } ?>
916
  jQuery.getJSON(specificFunnel, function(data) {
917
  setTimeout(function() {
918
  jQuery('#loading').fadeOut();
919
  }, 2000);
920
  var is_selected = "";
921
  if (data.favicon){
922
  favicon = data.favicon;
923
  }
924
  else {
925
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
926
  }
927
  jQuery.each(data.funnel_steps, function() {
928
  if (this.pages != ''){
929
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
930
  is_selected = "selected";
931
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
932
  } else {
933
  is_selected = "";
934
  }
935
  if ( this.wp_friendly == true && this.pages != '' ) {
936
  jQuery('#iframeURL').val(this.pages[0].published_url);
937
  if (data.favicon){
938
  jQuery('#cf_favicon').val(favicon);
939
  jQuery('#faviconPreview').attr('src', favicon);
940
  } else {
941
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
942
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
943
  }
944
  // Check if has split tests
945
  var splittestkeys = 'none';
946
  if (this.pages.length == 2) {
947
  splittestkeys = '2';
948
  }
949
  else if (this.pages.length == 3) {
950
  splittestkeys = '3';
951
  }
952
  // Ping All Pages in Funnel (to refresh split tests / api)
953
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
954
  pageKey = this.pages[0].key;
955
  jQuery('#headTracking').val(this.pages[0].head_tag);
956
  jQuery('#footerTracking').val(this.pages[0].body_tag);
957
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
958
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
959
  jQuery('#cf_thepage').append('<option value="' + pageKey + '{#}' + 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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'" '+is_selected+'>'+ this.name +'</option>');
960
  }
961
  }
962
  });
963
  }).done(function() {
964
  jQuery('#loading').fadeOut();
965
  var savedMeta = jQuery('#cf_thepage').val();
966
  if(savedMeta != undefined || savedMeta != null){
967
  savedMeta = savedMeta.split('{#}');
968
  <?php if ( !empty( $_GET['action'] ) ) { ?>
969
  jQuery('#cf_thepage').trigger('change');
970
  <?php } ?>
971
  }
972
  })
973
  .fail(function(jqXHR) {
974
  jQuery('#loading').fadeOut();
975
  jQuery('.badAPI').show();
976
  })
977
  .always(function() {
978
  jQuery('#loading').fadeOut();
979
  });
980
  // Change Funnel Populate Dropdown
981
  jQuery( '#cf_thefunnel' ).change(function() {
982
  jQuery('.choosePageBox').fadeIn();
983
  jQuery('.cftablink').removeClass('disabledLink');
984
  jQuery('#publish').removeClass('disabledLink');
985
  jQuery('#loading').fadeIn();
986
  var thenewdata = jQuery(this).val();
987
  var thenewdata = thenewdata.split('{#}');
988
  var totalPages = 0;
989
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
990
  // alert(specificFunnel);
991
  jQuery('#cf_thepage').find('option').remove().end();
992
  jQuery.getJSON(specificFunnel, function(data) {
993
  setTimeout(function() {
994
  jQuery('#loading').fadeOut();
995
  }, 2000);
996
  if (data.favicon){
997
  favicon = data.favicon;
998
  }
999
  else {
1000
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
1001
  }
1002
  // alert( specificFunnel);
1003
  jQuery.each(data.funnel_steps, function() {
1004
  if( this.wp_friendly == true && this.pages != '' ) {
1005
  // Ping All Pages in Funnel (to refresh split tests / api)
1006
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
1007
  // Check if has split tests
1008
  var splittestkeys = 'none';
1009
  if (this.pages.length == 2) {
1010
  splittestkeys = '2';
1011
  }
1012
  else if (this.pages.length == 3) {
1013
  splittestkeys = '3';
1014
  }
1015
  jQuery('#iframeURL').val(this.pages[0].published_url);
1016
  jQuery('#cf_funnelwide_tracking_head').val(favicon);
1017
  if (data.favicon){
1018
  jQuery('#cf_favicon').val(favicon);
1019
  jQuery('#faviconPreview').attr('src', favicon);
1020
  } else {
1021
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1022
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1023
  }
1024
  // Tracking Codes
1025
  jQuery('#headTracking').val(this.pages[0].head_tag);
1026
  jQuery('#footerTracking').val(this.pages[0].body_tag);
1027
  jQuery('#fw_headerTracking').val(thenewdata[1]);
1028
  jQuery('#fw_footerTracking').val(thenewdata[2]);
1029
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
1030
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
1031
  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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'">'+ this.name +'</option>');
1032
  totalPages += 1;
1033
  }
1034
  });
1035
  }).done(function() {
1036
  jQuery('#loading').fadeOut();
1037
  var savedMeta = jQuery('#cf_thepage').val();
1038
  jQuery('#cf_thepage').trigger('change');
1039
  if (totalPages == 0) {
1040
  jQuery('#cf_thepage').hide();
1041
  jQuery('#runningSplitTests').hide();
1042
  jQuery('#noPageWarning').fadeIn();
1043
  }
1044
  else {
1045
  jQuery('#noPageWarning').hide();
1046
  jQuery('#cf_thepage').fadeIn();
1047
  }
1048
  var theposition = jQuery('#cf_thepage').val();
1049
  var thefunnel = jQuery('#cf_thefunnel').val();
1050
  thefunnel = thefunnel.split('{#}');
1051
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
1052
  var myString = thefunnel[0]+'{#}'+theposition;
1053
  var arr = myString.split('{#}');
1054
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
1055
  var do_ping = function() {
1056
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {}).catch(function(error) {});
1057
  };
1058
  do_ping();
1059
  })
1060
  .fail(function() {
1061
  jQuery('#loading').fadeOut();
1062
  })
1063
  .always(function() {
1064
  jQuery('#loading').fadeOut();
1065
  });
1066
  });
1067
  var request_image = function(url) {
1068
  return new Promise(function(resolve, reject) {
1069
  var img = new Image();
1070
  img.onload = function() { resolve(img); };
1071
  img.onerror = function() { reject(url); };
1072
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
1073
  });
1074
  };
1075
  /**
1076
  * Pings a url.
1077
  * @param {String} url
1078
  * @return {Promise} promise that resolves to a ping (ms, float).
1079
  */
1080
  var ping = function(url) {
1081
  return new Promise(function(resolve, reject) {
1082
  var start = (new Date()).getTime();
1083
  var response = function() {
1084
  var delta = ((new Date()).getTime() - start);
1085
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
1086
  delta /= 4;
1087
  resolve(delta);
1088
  };
1089
  request_image(url).then(response).catch(response);
1090
  // Set a timeout for max-pings, 5s.
1091
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
1092
  });
1093
  };
1094
  function replaceText(inputText, tagName, tagReplace) {
1095
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
1096
  return inputText.replace(regExp, tagReplace);
1097
  }
1098
  // Select New Page
1099
  jQuery( '#cf_thepage' ).change(function() {
1100
  jQuery('#loading').fadeOut();
1101
  var thefunnel = jQuery('#cf_thefunnel').val();
1102
  thefunnel = thefunnel.split('{#}');
1103
  var theposition = jQuery(this).val();
1104
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
1105
  if(theposition != undefined || theposition != null){
1106
  var myString = thefunnel[0]+'{#}'+theposition;
1107
  var arr = myString.split('{#}');
1108
  var arr2 = theposition.split('{#}');
1109
  jQuery('#iframeURL').val(arr2[6]);
1110
  <?php if ($cf_favicon_choice == '') { ?>
1111
  if (arr2[7] !== ''){
1112
  jQuery('#cf_favicon').val(arr2[7]);
1113
  jQuery('#faviconPreview').attr('src', arr2[7]);
1114
  } else {
1115
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1116
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1117
  }
1118
  <?php } else { ?>
1119
  if (arr2[7] !== ''){
1120
  jQuery('#cf_favicon').val(arr2[7]);
1121
  jQuery('#faviconPreview').hide();
1122
  jQuery('#metaPreview strong').hide();
1123
  } else {
1124
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1125
  jQuery('#faviconPreview').hide();
1126
  jQuery('#metaPreview strong').hide();
1127
  }
1128
  <?php } ?>
1129
  // Tracking Code
1130
  jQuery('#headTracking').val(decodeURIComponent(arr2[8]));
1131
  jQuery('#footerTracking').val(decodeURIComponent(arr2[9]));
1132
  var thenewdata = jQuery('#cf_thefunnel').val();
1133
  var thenewdata = thenewdata.split('{#}');
1134
  jQuery('#fw_headTracking').val(thenewdata[1]);
1135
  jQuery('#fw_footerTracking').val(thenewdata[2]);
1136
  // Check if has split tests
1137
  if (arr2[11] == 2) {
1138
  var splittestkeys = '1 Active Split Test';
1139
  jQuery('#runningSplitTests').show();
1140
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
1141
  }
1142
  else if (arr2[11] == 3) {
1143
  var splittestkeys = '2 Active Split Tests';
1144
  jQuery('#runningSplitTests').show();
1145
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
1146
  }
1147
  else {
1148
  jQuery('#runningSplitTests').hide();
1149
  }
1150
  var myStr = arr2[3];
1151
  // Browser title
1152
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
1153
  jQuery('.seoTitle').val(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1154
  jQuery('#metaPreview h3').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1155
  jQuery('#opengraphPreview h3').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1156
  var authorname = myStr.match('author%22%20content=%22(.*)%22%3E%3');
1157
  jQuery('#seoAuthor').val(decodeURIComponent(authorname[1].replace(/%20/g, ' ')));
1158
  jQuery('#theAuthor').html('| '+authorname[1].replace(/%20/g, ' '));
1159
  var keywordsmeta = myStr.match('keywords%22%20content=%22(.*)%22%3E%3');
1160
  var keywords = keywordsmeta[1].replace(/%20/g, ' ').split('%');
1161
  jQuery('#seoKeywords').val(decodeURIComponent(keywords[0]));
1162
  // SEO Desc
1163
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
1164
  jQuery('.seoDesc').val(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1165
  jQuery('#metaPreview p').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1166
  jQuery('#opengraphPreview p').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1167
  // SEO Share Image
1168
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
1169
  jQuery('#seosocial').val(subStr[1]);
1170
  if (subStr[1] != ''){
1171
  jQuery('#seosocialimage').show();
1172
  jQuery('#seosocialimage').attr('src', subStr[1]);
1173
  } else {
1174
  jQuery('#seosocialimage').hide();
1175
  }
1176
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
1177
  <?php if ( !empty( $_GET['updatemeta']) ) { ?>
1178
  setTimeout(function() {
1179
  jQuery('#publish').trigger('click');
1180
  }, 4000);
1181
  <?php } ?>
1182
  }
1183
  });
1184
  // Savings
1185
  jQuery('#publish').click(function(e) {
1186
  // e.preventDefault()
1187
  // if (jQuery(this).hasClass('disabledLink')=== true) {
1188
  //
1189
  // }
1190
  // else {
1191
  // jQuery('#saving').fadeIn();
1192
  // if (jQuery('#cf_slug').val() == '' && jQuery('.cf_header').val() == 'p') {
1193
  // jQuery('.selectapagelink').trigger('click');
1194
  // jQuery('#customurlError').fadeIn();
1195
  // jQuery('#cf_slug').focus();
1196
  // jQuery('#saving').fadeOut();
1197
  // }
1198
  // else {
1199
  // saveNow = 'yes';
1200
  // jQuery('.used_slug').each(function () {
1201
  // if (jQuery(this).html() == jQuery('#cf_slug').val()) {
1202
  // jQuery('#customurlError_duplicate').fadeIn();
1203
  // jQuery('#saving').fadeOut();
1204
  // saveNow = 'no!';
1205
  // }
1206
  //
1207
  // });
1208
  // if (saveNow == 'yes') {
1209
  // jQuery('form').submit();
1210
  // }
1211
  // }
1212
  // }
1213
  });
1214
  jQuery('.showupdatemetalink').click(function() {
1215
  jQuery('form').submit();
1216
  });
1217
  if (jQuery(this).hasClass('disabledLink')=== true) {
1218
  }
1219
  else {
1220
  jQuery('.cftabs').hide();
1221
  jQuery('.cftablink').removeClass('active');
1222
  jQuery(this).addClass('active');
1223
  var tab = jQuery(this).attr('data-tab');
1224
  jQuery('#'+tab).show();
1225
  }
1226
  str = str.replace(/^\s+|\s+$/g, ''); // trim
1227
  str = str.toLowerCase();
1228
  // remove accents, swap ñ for n, etc
1229
  var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
1230
  var to = "aaaaeeeeiiiioooouuuunc------";
1231
  for (var i=0, l=from.length ; i<l ; i++) {
1232
  str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
1233
  }
1234
  str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
1235
  .replace(/\s+/g, '-') // collapse whitespace and replace by -
1236
  .replace(/-+/g, '-'); // collapse dashes
1237
  return str;
1238
  {
1239
  var myStr = jQuery(this).val()
1240
  myStr=myStr.toLowerCase();
1241
  myStr=myStr.replace(/\s/g , "-");
1242
  jQuery('#cf_slug').val(myStr);
1243
  slug = jQuery(this).val();
1244
  customSlug = slug;
1245
  customSlug = string_to_slug(customSlug);
1246
  jQuery(this).val(customSlug);
1247
  jQuery('.customSlugText').text(customSlug);
1248
  newurl = jQuery('#cfslugurl').text();
1249
  jQuery('#cfslugurl').attr('href', newurl);
1250
  jQuery('#cf_page_url').val('<?php echo get_home_url(); ?>/'+myStr);
1251
  jQuery('#customurlError').hide();
1252
  jQuery('#customurlError_duplicate').hide();
1253
  jQuery('#publish').removeClass('disabledLink');
1254
  jQuery('.used_slug').each(function () {
1255
  if (jQuery(this).html() == customSlug) {
1256
  jQuery('#customurlError_duplicate').fadeIn();
1257
  jQuery('#publish').addClass('disabledLink');
1258
  }
1259
  });
1260
  if ('' == customSlug) {
1261
  jQuery('#customurlError').fadeIn();
1262
  jQuery('#publish').addClass('disabledLink');
1263
  }
1264
  });
1265
  if (jQuery(this).val() == 'clickgate') {
1266
  jQuery('.cf_url').hide();
1267
  jQuery('.clickgateinfo').show();
1268
  jQuery('#publish').removeClass('disabledLink');
1269
  }
1270
  else if (jQuery(this).val() == 'hp') {
1271
  jQuery('.cf_url').hide();
1272
  jQuery('#publish').removeClass('disabledLink');
1273
  }
1274
  else if (jQuery(this).val() == 'np') {
1275
  jQuery('.cf_url').hide();
1276
  jQuery('#publish').removeClass('disabledLink');
1277
  }
1278
  else {
1279
  jQuery('.cf_url').show();
1280
  jQuery('.clickgateinfo').hide();
1281
  jQuery('#cf_slug').trigger('keyup');
1282
  }
1283
  });
1284
  <?php
1285
  // check all CF page slugs
1286
  $posts = get_posts(array(
1287
  'post_type' => 'clickfunnels',
1288
  'post_status' => 'publish',
1289
  'fields' => 'ids'
1290
  )
1291
  );
1292
  foreach($posts as $p){
1293
  $slug = get_post_meta($p,"cf_slug",true);
1294
  if ($slug != $cf_slug) {
1295
  echo "<li class='used_slug'>$slug</li>";
1296
  }
1297
  }
1298
  foreach( get_posts('numberposts=-1') as $post ) {
1299
  echo "<li class='used_slug'>$post->post_name</li>";
1300
  }
1301
  foreach( get_pages('numberposts=-1') as $post ) {
1302
  echo "<li class='used_slug'>$post->post_name</li>";
1303
  }
1304
  ?>
1305
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
1306
  <?php $hideforUpdateMeta = 'display: none !important'; ?>
1307
  <style>.bootstrap-wp, .copyrightInfo {display: none; }</style>
1308
  <span style="margin: 10px;" class="compatCheck compatwarning">Updating Your Meta Data... <strong><i class="fa fa-spinner fa-spin"></i> Please wait just a moment.</strong></span>
1309
  <input type="hidden" name="meta_redirect" value='yes'>
1310
  <?php } else { ?>
1311
  <h2>
1312
  <?php
1313
  if ( !empty( $_GET['action'] ) && $cf_funnels ) {
1314
  $blankpage = 'no';
1315
  foreach ( $cf_funnels as $key=>$funnel ) {
1316
  if ( $cf_thefunnel == $funnel->id ) {
1317
  $lengthofheadline = 40;
1318
  if ( $cf_type=='hp' || $cf_type=='np' || $cf_type=='clickgate' ) { $lengthofheadline = 19; }
1319
  if (strlen($thepage[6]) > $lengthofheadline) {
1320
  echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...';
1321
  $check = '1';
1322
  }
1323
  else {
1324
  if(strlen($thepage[6]) > $lengthofheadline) { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...'; }
1325
  else { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.$thepage[6];}
1326
  $check = '1';
1327
  }
1328
  }
1329
  else {
1330
  $blankpage = 'yes';
1331
  }
1332
  }
1333
  $cf_options = get_option( "cf_options" );
1334
  $homeCheck = $cf_options['home'];
1335
  $postid = get_the_ID();
1336
  if ($cf_page == '' && $cf_type == '' && $blankpage = 'yes' && $homeCheck['post_id'] != $postid && $cf_thepage != '') {
1337
  echo 'Requires Custom URL';
1338
  }
1339
  } else {
1340
  echo '<i class="fa fa-plus-square" style="margin-right: 5px"></i> Add New Page';
1341
  }
1342
  ?>
1343
  <?php if ($cf_type == 'clickgate') { ?>
1344
  ClickGate Popup
1345
  <?php } ?> -->
1346
  </h2>
1347
  <?php if ( !empty( $_GET['action'] ) ) { ?>
1348
  <a style="margin-right: 0;margin-top: -33px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> EDITOR</a>
1349
  <a style="margin-right: 10px;margin-top: -33px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-filter"></i> FUNNEL</a>
1350
  <a style="margin-right: 10px;margin-top: -33px;" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> PREVIEW</a>
1351
  <?php if ( $cf_type=='p' ) {?>
1352
  <?php }?>
1353
  <?php if ( $cf_type=='hp' ) {?>
1354
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-home"></i> Set as Home Page</span>
1355
  <?php }?>
1356
  <?php if ( $cf_type=='np' ) {?>
1357
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-exclamation-triangle"></i> Set as 404 Page</span>
1358
  <?php }?>
1359
  <?php if ( $cf_type=='clickgate' ) {?>
1360
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-external-link"></i> Set as ClickGate</span>
1361
  <?php }?>
1362
  <?php }?>
1363
  <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>
1364
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
1365
  <input type="hidden" name="meta_redirect" value='yes'>
1366
  <?php } ?>
1367
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
1368
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
1369
  <div class="bootstrap-wp"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
1370
  <div id="app_sidebar">
1371
  <a href="#" data-tab="tab1" class="cftablink selectapagelink active">Select Page</a>
1372
  <a href="#" data-tab="tab2" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Meta Data</a>
1373
  <a href="#" data-tab="tab4" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Open Graph</a>
1374
  <a href="#" data-tab="tab6" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Tracking Code</a>
1375
  <a href="#" data-tab="tab3" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Settings</a>
1376
  </div>
1377
  <div id="app_main" class="col-sm-7 row-fluid form-horizontal">
1378
  <div id="tab6" class="cftabs" style="display: none">
1379
  <!-- Tracking Code -->
1380
  <h2>Tracking Code</h2>
1381
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel.</em></p>
1382
  <hr style="margin-left: 51px">
1383
  <div class="control-group" >
1384
  <label class="control-label" for="cf_iframe_check"> WordPress Only Tracking Code </label>
1385
  <div class="controls">
1386
  <textarea class="input-xlarge wpfooterTracking" id="wpfooterTracking" style="height: 80px;" name="cf_wptracking_code"><?php echo $cf_wptracking_code; ?></textarea>
1387
  </div>
1388
  </div>
1389
  <hr style="margin-left: 51px">
1390
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> You can add your own custom tracking code for only this WordPress page, meaning your original page will not have this tracking code.</em></p>
1391
  <hr style="margin-left: 51px">
1392
  <div class="control-group" >
1393
  <label class="control-label" for="cf_iframe_check"> Header Tracking </label>
1394
  <div class="controls">
1395
  <textarea class="input-xlarge headTracking" id="headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
1396
  </div>
1397
  </div>
1398
  <div class="control-group" >
1399
  <label class="control-label" for="cf_iframe_check"> Footer Tracking </label>
1400
  <div class="controls">
1401
  <textarea class="input-xlarge footerTracking" id="footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
1402
  </div>
1403
  </div>
1404
  <hr style="margin-left: 51px">
1405
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Funnel wide tracking is set inside the Funnel Settings in the ClickFunnels app.</em></p>
1406
  <hr style="margin-left: 51px">
1407
  <div class="control-group" >
1408
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Header Tracking </label>
1409
  <div class="controls">
1410
  <textarea class="input-xlarge fw_headTracking" id="fw_headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
1411
  </div>
1412
  </div>
1413
  <div class="control-group" >
1414
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Footer Tracking </label>
1415
  <div class="controls">
1416
  <textarea class="input-xlarge fw_footerTracking" id="fw_footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
1417
  </div>
1418
  </div>
1419
  </div>
1420
  <div id="tab1" class="cftabs">
1421
  <!-- Select a Page / Funnel -->
1422
  <h2>Select a Page</h2>
1423
  <div class="control-group cf_uses_api clearfix" style="">
1424
  <label class="control-label" for="cf_thefunnel"> Choose Funnel </label>
1425
  <div class="controls">
1426
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
1427
  <?php if ( empty( $cf_funnels ) ) { ?>
1428
  <option value="0">No Funnels Found</option>
1429
  <?php }
1430
  else {
1431
  // Agency Gate Check
1432
  $agency_group_tag = get_option('clickfunnels_agency_group_tag');
1433
  foreach ( $cf_funnels as $key=>$funnel ) {
1434
  if ($agency_group_tag != 'off') {
1435
  if ($funnel->group_tag || $funnel->group_tag != '') {
1436
  $group_tag = str_replace("'", '{replace}', $funnel->group_tag);
1437
  $group_tag = str_replace("\"", '{replace}', $funnel->group_tag);
1438
  if ($agency_group_tag == $group_tag) { ?>
1439
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1440
  <?php }
1441
  } else {
1442
  if ($agency_group_tag == 'ungrouped') { ?>
1443
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1444
  <?php }
1445
  }
1446
  }
1447
  else { ?>
1448
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1449
  <?php }
1450
  }
1451
  } ?>
1452
  </select>
1453
  </div>
1454
  </div>
1455
  <div class="control-group choosePageBox clearfix" style="<?php if ( empty( $_GET['action'] ) ) { echo "display: none"; } ?>">
1456
  <label class="control-label" for="cf_thepage">
1457
  Choose Page <span id="loading"><i class="fa fa-spinner"></i> <em style="margin-left: 5px;font-size: 11px;">Loading Pages...</em></span>
1458
  <div id="runningSplitTests" style="font-size: 11px;opacity: .8;float: right;padding-top: 5px;color: #555;margin-right: 26px;display: none;clear: both">
1459
  <!-- Number of Split Tests -->
1460
  </div>
1461
  </label>
1462
  <div class="controls">
1463
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
1464
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
1465
  <option value="0">No Pages Found</option>
1466
  <?php }
1467
  else {
1468
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
1469
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1470
  <?php
1471
  }
1472
  }
1473
  ?>
1474
  </select>
1475
  </div>
1476
  <div id="noPageWarning" style="font-size: 11px; margin-left: 28px; margin-top: -13px;float: left;padding-top: 14px;display: none;width: 100%; clear: both">
1477
  <strong style="font-size: 13px;display: block;">No compatible pages found. </strong>
1478
  <em style="display: block">Membership pages and order pages are not available through plugin.</em>
1479
  </div>
1480
  <br clear="all">
1481
  </div>
1482
  <?php if ( $cf_type!="p" && $check == '1') $display ="display:none"; else $display="";?>
1483
  <?php if ( $cf_type == '') $display ="display:block"; ?>
1484
  <div class="cf_url control-group clearfix" style="<?php echo $display;?>" >
1485
  <label class="control-label" for="cf_slug"> Custom Slug</label>
1486
  <div id="cf-wp-path" class="controls ">
1487
  <input style="padding:10px;"type="text" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" placeholder="your-path-here" name="cf_slug" id="cf_slug" class="input-xlarge">
1488
  <?php if ( $cf_type == '' ) $display ="display:block;"; else $display="";?>
1489
  <div id="customurlError" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
1490
  Add a path before saving.
1491
  </div>
1492
  <div id="customurlError_duplicate" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
1493
  Slug already taken
1494
  </div>
1495
  </div>
1496
  <p class="infoHelp" style="padding-left: 25px;margin-top: 13px;"><span><i class="fa fa-globe" style="margin-right: 3px"></i>
1497
  <?php if ( !empty( $_GET['action'] ) ) { ?>
1498
  <a style="font-weight: bold;text-decoration: none; padding-bottom: 3px;" id="cfslugurl" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" target="_blank"><?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></a>
1499
  <?php } else { ?>
1500
  <span style="font-weight: bold;text-decoration: none; padding-bottom: 3px;"> <?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></span>
1501
  <?php } ?>
1502
  </span></p>
1503
  <input type="text" style="display: none" class="input-xlarge" style="height: 30px;" value="<?php echo $cf_page_url; ?>" name="cf_page_url" id="cf_page_url" />
1504
  </div>
1505
  </div>
1506
  <div id="tab2" class="cftabs" style="display: none">
1507
  <!-- Meta Data -->
1508
  <h2>Meta Data</h2>
1509
  <div id="metaPreview">
1510
  <h5>PREVIEW</h5>
1511
  <img src="<?php echo $cf_favicon; ?>" id="faviconPreview" style="width: 18px;margin-left: 10px;margin-bottom: 5px;float: left;" />
1512
  <strong>FAVICON</strong>
1513
  <h3><?php echo $cf_seo_title; ?></h3>
1514
  <span><?php echo get_home_url() ; ?>/<em style="font-style: normal" class="customSlugText"><?php echo $cf_slug; ?></em></span>
1515
  <p><?php echo $cf_seo_desc; ?></p>
1516
  </div>
1517
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
1518
  <hr style="margin-left: 51px">
1519
  <div class="control-group" >
1520
  <label class="control-label" for="cf_iframe_check"> Website Title </label>
1521
  <div class="controls">
1522
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
1523
  </div>
1524
  </div>
1525
  <div class="control-group" >
1526
  <label class="control-label" for="cf_iframe_check"> Description </label>
1527
  <div class="controls">
1528
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
1529
  </div>
1530
  </div>
1531
  <div class="control-group" >
1532
  <label class="control-label" for="cf_iframe_check"> Keywords </label>
1533
  <div class="controls">
1534
  <input type="text" class="input-xlarge" id="seoKeywords" readonly="readonly"style="height: 30px;" value="<?php echo $cf_keywords; ?>" name="cf_keywords" />
1535
  </div>
1536
  </div>
1537
  <div class="control-group" >
1538
  <label class="control-label" for="cf_iframe_check"> Favicon </label>
1539
  <div class="controls">
1540
  <input type="text" class="input-xlarge" readonly="readonly"id="cf_favicon" style="height: 30px;" value="<?php echo $cf_favicon; ?>" name="cf_favicon" />
1541
  </div>
1542
  </div>
1543
  <div class="control-group" >
1544
  <label class="control-label" for="cf_favicon_choice"> Choose Favicon to Show </label>
1545
  <div class="controls">
1546
  <select name="cf_favicon_choice" id="cf_favicon_choice" class="cf_favicon_choice" style="width: 100% !important">
1547
  <option value="" <?php if($cf_favicon_choice == ''){ echo 'selected'; } ?>>Show ClickFunnels Page Favicon</option>
1548
  <option value="default"<?php if($cf_favicon_choice == 'default'){ echo 'selected'; } ?>>Show Default WordPress Favicon</option>
1549
  </select>
1550
  </div>
1551
  </div>
1552
  </div>
1553
  <div id="tab3" class="cftabs" style="display: none">
1554
  <!-- Page Settings -->
1555
  <h2>Page Settings</h2>
1556
  <div class="innerTab">
1557
  <div class="control-group ">
1558
  <label class="control-label" for="cf_type"> Choose Page Type</label>
1559
  <select name="cf_type" id="cf_type" class="cf_header" style="width: 100% !important">
1560
  <option value="p" <?php if($cf_type == 'p'){ echo 'selected'; } ?>>Regular Page</option>
1561
  <option value="hp"<?php if($cf_type == 'hp'){ echo 'selected'; } ?>>Set as Home Page</option>
1562
  <option value="np"<?php if($cf_type == 'np'){ echo 'selected'; } ?>>Set as 404 Page</option>
1563
  <option value="clickgate"<?php if($cf_type == 'clickgate'){ echo 'selected'; } ?>>Set as ClickGate</option>
1564
  </select>
1565
  </div>
1566
  </div>
1567
  <?php if ( $cf_type == 'clickgate') $display ="display:block;"; else $display="";?>
1568
  <p class="infoHelp clickgateinfo" style="color: #8A6D3B;display: none; <?php echo $display; ?>"><i class="fa fa-star" style="margin-right: 3px"></i> <strong>ClickGate will show this page at the top of any page or post that your visitors land on and will cookie them to show only page only once.</strong></em></p>
1569
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Choose to make this a regular page with a path (custom URL) or show this page as the Home Page for your blog. You can also set this page as a 404 page for any old, mispelled or deleted paths. <em>(only one page can be set as a Home, 404 or ClickGate at a time)</em></p>
1570
  <hr style="margin-left: 51px">
1571
  <div class="control-group cf_uses_api" >
1572
  <label class="control-label" for="cf_iframe_check"> Show Page Inside of Iframe</label>
1573
  <div class="controls">
1574
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
1575
  <option value="off">No, show page using ClickFunnels API.</option>
1576
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Yes, show page using an iframe.</option>
1577
  </select>
1578
  </div>
1579
  </div>
1580
  <br style="clear: both">
1581
  <p class="infoHelp" style="margin-top: 15px"><i class="fa fa-question-circle" style="margin-right: 3px"></i> If you have custom code on your page that is not working, choose to show your page inside an iframe to fix any custom code issues. If your page is showing up blank use the iframe option and submit a support ticket.</p>
1582
  <hr style="margin-left: 51px">
1583
  <div class="control-group" style="display: block">
1584
  <label class="control-label" for="cf_iframe_check"> ClickFunnels Page URL <small>(reference only)</small></label>
1585
  <div class="controls">
1586
  <input type="text" class="input-xlarge" id="iframeURL" readonly="readonly"style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
1587
  </div>
1588
  </div>
1589
  </div>
1590
  <div id="tab4" class="cftabs" style="display: none">
1591
  <!-- Extra Settings -->
1592
  <h2>Open Graph</h2>
1593
  <div id="opengraphPreview">
1594
  <h5>PREVIEW</h5>
1595
  <img style="<?php if ($cf_seo_image == '') { echo 'display: none;'; } ?>" src="<?php echo $cf_seo_image; ?>" id="seosocialimage">
1596
  <h3><?php echo $cf_seo_title; ?></h3>
1597
  <p><?php echo $cf_seo_desc; ?></p>
1598
  <span><?php echo get_home_url() ; ?> <em id="theAuthor"><?php echo '| '.$cf_author; ?></em></span>
1599
  </div>
1600
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
1601
  <hr style="margin-left: 51px">
1602
  <div class="control-group" >
1603
  <label class="control-label" for="cf_iframe_check"> Title </label>
1604
  <div class="controls">
1605
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" />
1606
  </div>
1607
  </div>
1608
  <div class="control-group" >
1609
  <label class="control-label" for="cf_iframe_check"> Description </label>
1610
  <div class="controls">
1611
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
1612
  </div>
1613
  </div>
1614
  <div class="control-group" >
1615
  <label class="control-label" for="cf_iframe_check"> Author </label>
1616
  <div class="controls">
1617
  <input type="text" class="input-xlarge" id="seoAuthor" readonly="readonly"style="height: 30px;" value="<?php echo $cf_author; ?>" name="cf_author" />
1618
  </div>
1619
  </div>
1620
  <div class="control-group" >
1621
  <label class="control-label" for="cf_iframe_check"> Social Image URL </label>
1622
  <div class="controls">
1623
  <input type="text" class="input-xlarge" id="seosocial" readonly="readonly" style=" height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
1624
  </div>
1625
  </div>
1626
  </div>
1627
  <div id="savePage">
1628
  <div style="width: 100%">
1629
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
1630
  <?php } else { ?>
1631
  <input type="submit" name="publish" id="publish" value="Save Page" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" style="float: right; ">
1632
  <?php } ?>
1633
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 9px;margin-right: 4px;font-size: 15px;">
1634
  <i class="fa fa-spinner fa-spin"></i>
1635
  <span>Saving...</span>
1636
  </div>
1637
  </div>
1638
  </div>
1639
  <style>
1640
  #hiddenStuff {display: none}
1641
  </style>
1642
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block;clear: both;" <?php } ?>>
1643
  <style>
1644
  #hiddenStuff input {
1645
  display:block;margin-top: 5px;margin-bottom: 5px;font-weight: normal;width: 100%;
1646
  }
1647
  </style>
1648
  <div class="controls">
1649
  <br>
1650
  <h3>Dev Checks:</h3>
1651
  <hr />
1652
  <strong>Funnel ID: <input id="checkFunID" type="text" value="<?php echo $thepage[0]; ?>" /></strong>
1653
  <strong>Page Key: <input type="text" value="<?php echo $thepage[1]; ?>" /></strong>
1654
  <strong>Page ID: <input type="text" value="<?php echo $thepage[2]; ?>" /></strong>
1655
  <strong>Funnel Step ID: <input type="text" value="<?php echo $thepage[3]; ?>" /></strong>
1656
  <strong>Saved Meta: <input type="text" id="oldmeta" value="<?php echo $thepage[4]; ?>" /></strong>
1657
  <strong>JS Meta: <input type="text" id="jsmeta" value="" /></strong>
1658
  <strong>Post ID: <input type="text" value="<?php echo $thepage[5]; ?>" /></strong>
1659
  <strong>Page Name: <input type="text" value="<?php echo $thepage[6]; ?>" /></strong>
1660
  <strong>Use iframe?: <input type="text" value="<?php echo $cf_iframe_check; ?>" /></strong>
1661
  <strong>Iframe URL: <input type="text" value="<?php echo $cf_iframe_url; ?>" /></strong>
1662
  <textarea name="cf_thefunnel" id="cf_data" style="display:block;margin-top: 5px;margin-bottom: 10px;width: 100%;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
1663
  </div>
1664
  </div>
1665
  </div>
1666
  </div>
 
1
  if(!get_option( 'clickfunnels_api_email')) {
2
  update_option( 'clickfunnels_api_email', '');
3
  }
4
  if(!get_option( 'clickfunnels_api_auth')) {
5
  update_option( 'clickfunnels_api_auth', '');
6
  }
7
  if(!get_option( 'clickfunnels_siteURL')) {
8
  update_option( 'clickfunnels_siteURL', '');
9
  }
10
  if(!get_option( 'clickfunnels_404Redirect')) {
11
  update_option( 'clickfunnels_404Redirect', '');
12
  }
13
  if(!get_option( 'clickfunnels_agency_group_tag')) {
14
  update_option( 'clickfunnels_agency_group_tag', '');
15
  }
16
  if(!get_option( 'clickfunnels_agency_api_details')) {
17
  update_option( 'clickfunnels_agency_api_details', '');
18
  }
19
  if(!get_option( 'clickfunnels_agency_reset_data')) {
20
  update_option( 'clickfunnels_agency_reset_data', '');
21
  }
22
  if(!get_option( 'clickfunnels_agency_hide_settings')) {
23
  update_option( 'clickfunnels_agency_hide_settings', '');
24
  }
25
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
26
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
27
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
28
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
29
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
30
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
31
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
32
  $cf_page_url = get_post_meta( $_GET['post'], "cf_page_url", true );
33
  $cf_favicon = get_post_meta( $_GET['post'], "cf_favicon", true );
34
  $cf_author = get_post_meta( $_GET['post'], "cf_author", true );
35
  $cf_keywords = get_post_meta( $_GET['post'], "cf_keywords", true );
36
  $cf_head_tracking = get_post_meta( $_GET['post'], "cf_head_tracking", true );
37
  $cf_footer_tracking = get_post_meta( $_GET['post'], "cf_footer_tracking", true );
38
  $cf_wptracking_code = get_post_meta( $_GET['post'], "cf_wptracking_code", true );
39
  $cf_favicon_choice = get_post_meta( $_GET['post'], "cf_favicon_choice", true );
40
  $cf_slug= get_post_meta( $_GET['post'], 'cf_slug', true );
41
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
42
  $thepage = explode( "{#}", $cf_page );
43
  $savedData = $cf_page;
44
  }
45
  else {
46
  $thepage = explode( "{#}", $cf_page['page_id'] );
47
  $savedData = $cf_page['page_id'];
48
  }
49
  $cf_options = get_option( "cf_options" );
50
  // populate funnels option field
51
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
52
  }
53
  else {
54
  if ($cf_page != "") {
55
  $response = wp_remote_get( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
56
  if( is_array($response) ) {
57
  $json = $response['body']; // use the content
58
  }
59
  $cf_funnels_pages = json_decode( $json );
60
  }
61
  }
62
  jQuery(document).ready(function(){
63
  jQuery('.draft').hide();
64
  console.log("%cClickFunnels WordPress Plugin", "background: #0166AE; color: white; font-size: 23px");
65
  console.log("%cEditing anything inside the console is for developers only. Do not paste in any code given to you by anyone. Use with caution. Visit for support: https://support.clickfunnels.com/", "color: #888; font-size: 16px");
66
  // Set Correct Options
67
  var thenewdata = jQuery('#cf_thefunnel').val();
68
  var thenewdata = thenewdata.split('{#}');
69
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
70
  jQuery('#cf_thepage').find('option').remove().end();
71
  // alert(specificFunnel);
72
  // alert(thenewdata);
73
  jQuery('#loading').fadeIn();
74
  var favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
75
  <?php if ( empty( $_GET['action'] ) ) { ?>
76
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
77
  <?php } ?>
78
  jQuery.getJSON(specificFunnel, function(data) {
79
  setTimeout(function() {
80
  jQuery('#loading').fadeOut();
81
  }, 2000);
82
  var is_selected = "";
83
  if (data.favicon){
84
  favicon = data.favicon;
85
  }
86
  else {
87
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
88
  }
89
  jQuery.each(data.funnel_steps, function() {
90
  if (this.pages != ''){
91
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
92
  is_selected = "selected";
93
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
94
  } else {
95
  is_selected = "";
96
  }
97
  if ( this.wp_friendly == true && this.pages != '' ) {
98
  jQuery('#iframeURL').val(this.pages[0].published_url);
99
  if (data.favicon){
100
  jQuery('#cf_favicon').val(favicon);
101
  jQuery('#faviconPreview').attr('src', favicon);
102
  } else {
103
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
104
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
105
  }
106
  // Check if has split tests
107
  var splittestkeys = 'none';
108
  if (this.pages.length == 2) {
109
  splittestkeys = '2';
110
  }
111
  else if (this.pages.length == 3) {
112
  splittestkeys = '3';
113
  }
114
  // Ping All Pages in Funnel (to refresh split tests / api)
115
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
116
  pageKey = this.pages[0].key;
117
  jQuery('#headTracking').val(this.pages[0].head_tag);
118
  jQuery('#footerTracking').val(this.pages[0].body_tag);
119
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
120
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
121
  jQuery('#cf_thepage').append('<option value="' + pageKey + '{#}' + 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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'" '+is_selected+'>'+ this.name +'</option>');
122
  }
123
  }
124
  });
125
  }).done(function() {
126
  jQuery('#loading').fadeOut();
127
  var savedMeta = jQuery('#cf_thepage').val();
128
  if(savedMeta != undefined || savedMeta != null){
129
  savedMeta = savedMeta.split('{#}');
130
  <?php if ( !empty( $_GET['action'] ) ) { ?>
131
  jQuery('#cf_thepage').trigger('change');
132
  <?php } ?>
133
  }
134
  })
135
  .fail(function(jqXHR) {
136
  jQuery('#loading').fadeOut();
137
  jQuery('.badAPI').show();
138
  })
139
  .always(function() {
140
  jQuery('#loading').fadeOut();
141
  });
142
  // Change Funnel Populate Dropdown
143
  jQuery( '#cf_thefunnel' ).change(function() {
144
  jQuery('.choosePageBox').fadeIn();
145
  jQuery('.cftablink').removeClass('disabledLink');
146
  jQuery('#publish').removeClass('disabledLink');
147
  jQuery('#loading').fadeIn();
148
  var thenewdata = jQuery(this).val();
149
  var thenewdata = thenewdata.split('{#}');
150
  var totalPages = 0;
151
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
152
  // alert(specificFunnel);
153
  jQuery('#cf_thepage').find('option').remove().end();
154
  jQuery.getJSON(specificFunnel, function(data) {
155
  setTimeout(function() {
156
  jQuery('#loading').fadeOut();
157
  }, 2000);
158
  if (data.favicon){
159
  favicon = data.favicon;
160
  }
161
  else {
162
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
163
  }
164
  // alert( specificFunnel);
165
  jQuery.each(data.funnel_steps, function() {
166
  if( this.wp_friendly == true && this.pages != '' ) {
167
  // Ping All Pages in Funnel (to refresh split tests / api)
168
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
169
  // Check if has split tests
170
  var splittestkeys = 'none';
171
  if (this.pages.length == 2) {
172
  splittestkeys = '2';
173
  }
174
  else if (this.pages.length == 3) {
175
  splittestkeys = '3';
176
  }
177
  jQuery('#iframeURL').val(this.pages[0].published_url);
178
  jQuery('#cf_funnelwide_tracking_head').val(favicon);
179
  if (data.favicon){
180
  jQuery('#cf_favicon').val(favicon);
181
  jQuery('#faviconPreview').attr('src', favicon);
182
  } else {
183
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
184
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
185
  }
186
  // Tracking Codes
187
  jQuery('#headTracking').val(this.pages[0].head_tag);
188
  jQuery('#footerTracking').val(this.pages[0].body_tag);
189
  jQuery('#fw_headerTracking').val(thenewdata[1]);
190
  jQuery('#fw_footerTracking').val(thenewdata[2]);
191
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
192
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
193
  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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'">'+ this.name +'</option>');
194
  totalPages += 1;
195
  }
196
  });
197
  }).done(function() {
198
  jQuery('#loading').fadeOut();
199
  var savedMeta = jQuery('#cf_thepage').val();
200
  jQuery('#cf_thepage').trigger('change');
201
  if (totalPages == 0) {
202
  jQuery('#cf_thepage').hide();
203
  jQuery('#runningSplitTests').hide();
204
  jQuery('#noPageWarning').fadeIn();
205
  }
206
  else {
207
  jQuery('#noPageWarning').hide();
208
  jQuery('#cf_thepage').fadeIn();
209
  }
210
  var theposition = jQuery('#cf_thepage').val();
211
  var thefunnel = jQuery('#cf_thefunnel').val();
212
  thefunnel = thefunnel.split('{#}');
213
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
214
  var myString = thefunnel[0]+'{#}'+theposition;
215
  var arr = myString.split('{#}');
216
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
217
  var do_ping = function() {
218
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {}).catch(function(error) {});
219
  };
220
  do_ping();
221
  })
222
  .fail(function() {
223
  jQuery('#loading').fadeOut();
224
  })
225
  .always(function() {
226
  jQuery('#loading').fadeOut();
227
  });
228
  });
229
  var request_image = function(url) {
230
  return new Promise(function(resolve, reject) {
231
  var img = new Image();
232
  img.onload = function() { resolve(img); };
233
  img.onerror = function() { reject(url); };
234
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
235
  });
236
  };
237
  /**
238
  * Pings a url.
239
  * @param {String} url
240
  * @return {Promise} promise that resolves to a ping (ms, float).
241
  */
242
  var ping = function(url) {
243
  return new Promise(function(resolve, reject) {
244
  var start = (new Date()).getTime();
245
  var response = function() {
246
  var delta = ((new Date()).getTime() - start);
247
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
248
  delta /= 4;
249
  resolve(delta);
250
  };
251
  request_image(url).then(response).catch(response);
252
  // Set a timeout for max-pings, 5s.
253
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
254
  });
255
  };
256
  function replaceText(inputText, tagName, tagReplace) {
257
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
258
  return inputText.replace(regExp, tagReplace);
259
  }
260
  // Select New Page
261
  jQuery( '#cf_thepage' ).change(function() {
262
  jQuery('#loading').fadeOut();
263
  var thefunnel = jQuery('#cf_thefunnel').val();
264
  thefunnel = thefunnel.split('{#}');
265
  var theposition = jQuery(this).val();
266
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
267
  if(theposition != undefined || theposition != null){
268
  var myString = thefunnel[0]+'{#}'+theposition;
269
  var arr = myString.split('{#}');
270
  var arr2 = theposition.split('{#}');
271
  jQuery('#iframeURL').val(arr2[6]);
272
  <?php if ($cf_favicon_choice == '') { ?>
273
  if (arr2[7] !== ''){
274
  jQuery('#cf_favicon').val(arr2[7]);
275
  jQuery('#faviconPreview').attr('src', arr2[7]);
276
  } else {
277
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
278
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
279
  }
280
  <?php } else { ?>
281
  if (arr2[7] !== ''){
282
  jQuery('#cf_favicon').val(arr2[7]);
283
  jQuery('#faviconPreview').hide();
284
  jQuery('#metaPreview strong').hide();
285
  } else {
286
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
287
  jQuery('#faviconPreview').hide();
288
  jQuery('#metaPreview strong').hide();
289
  }
290
  <?php } ?>
291
  // Tracking Code
292
  jQuery('#headTracking').val(decodeURIComponent(arr2[8]));
293
  jQuery('#footerTracking').val(decodeURIComponent(arr2[9]));
294
  var thenewdata = jQuery('#cf_thefunnel').val();
295
  var thenewdata = thenewdata.split('{#}');
296
  jQuery('#fw_headTracking').val(thenewdata[1]);
297
  jQuery('#fw_footerTracking').val(thenewdata[2]);
298
  // Check if has split tests
299
  if (arr2[11] == 2) {
300
  var splittestkeys = '1 Active Split Test';
301
  jQuery('#runningSplitTests').show();
302
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
303
  }
304
  else if (arr2[11] == 3) {
305
  var splittestkeys = '2 Active Split Tests';
306
  jQuery('#runningSplitTests').show();
307
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
308
  }
309
  else {
310
  jQuery('#runningSplitTests').hide();
311
  }
312
  var myStr = arr2[3];
313
  // Browser title
314
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
315
  jQuery('.seoTitle').val(subStr[1].replace(/%20/g, ' '));
316
  jQuery('#metaPreview h3').text(subStr[1].replace(/%20/g, ' '));
317
  jQuery('#opengraphPreview h3').text(subStr[1].replace(/%20/g, ' '));
318
  var authorname = myStr.match('author%22%20content=%22(.*)%22%3E%3');
319
  jQuery('#seoAuthor').val(authorname[1].replace(/%20/g, ' '));
320
  jQuery('#theAuthor').html('| '+authorname[1].replace(/%20/g, ' '));
321
  var keywordsmeta = myStr.match('keywords%22%20content=%22(.*)%22%3E%3');
322
  var keywords = keywordsmeta[1].replace(/%20/g, ' ').split('%');
323
  jQuery('#seoKeywords').val(keywords[0]);
324
  // SEO Desc
325
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
326
  jQuery('.seoDesc').val(subStr[1].replace(/%20/g, ' '));
327
  jQuery('#metaPreview p').text(subStr[1].replace(/%20/g, ' '));
328
  jQuery('#opengraphPreview p').text(subStr[1].replace(/%20/g, ' '));
329
  // SEO Share Image
330
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
331
  jQuery('#seosocial').val(subStr[1]);
332
  if (subStr[1] != ''){
333
  jQuery('#seosocialimage').show();
334
  jQuery('#seosocialimage').attr('src', subStr[1]);
335
  } else {
336
  jQuery('#seosocialimage').hide();
337
  }
338
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
339
  <?php if ( !empty( $_GET['updatemeta']) ) { ?>
340
  setTimeout(function() {
341
  jQuery('#publish').trigger('click');
342
  }, 4000);
343
  <?php } ?>
344
  }
345
  });
346
  // Savings
347
  jQuery('#publish').click(function() {
348
  if (jQuery(this).hasClass('disabledLink')=== true) {
349
  }
350
  else {
351
  jQuery('#saving').fadeIn();
352
  if (jQuery('#cf_slug').val() == '' && jQuery('.cf_header').val() == 'p') {
353
  jQuery('.selectapagelink').trigger('click');
354
  jQuery('#customurlError').fadeIn();
355
  jQuery('#cf_slug').focus();
356
  jQuery('#saving').fadeOut();
357
  }
358
  else {
359
  saveNow = 'yes';
360
  jQuery('.used_slug').each(function () {
361
  if (jQuery(this).html() == jQuery('#cf_slug').val()) {
362
  jQuery('#customurlError_duplicate').fadeIn();
363
  jQuery('#saving').fadeOut();
364
  saveNow = 'no!';
365
  }
366
  });
367
  if (saveNow == 'yes') {
368
  jQuery('form').submit();
369
  }
370
  }
371
  }
372
  });
373
  jQuery('.showupdatemetalink').click(function() {
374
  jQuery('form').submit();
375
  });
376
  if (jQuery(this).hasClass('disabledLink')=== true) {
377
  }
378
  else {
379
  jQuery('.cftabs').hide();
380
  jQuery('.cftablink').removeClass('active');
381
  jQuery(this).addClass('active');
382
  var tab = jQuery(this).attr('data-tab');
383
  jQuery('#'+tab).show();
384
  }
385
  str = str.replace(/^\s+|\s+$/g, ''); // trim
386
  str = str.toLowerCase();
387
  // remove accents, swap ñ for n, etc
388
  var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
389
  var to = "aaaaeeeeiiiioooouuuunc------";
390
  for (var i=0, l=from.length ; i<l ; i++) {
391
  str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
392
  }
393
  str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
394
  .replace(/\s+/g, '-') // collapse whitespace and replace by -
395
  .replace(/-+/g, '-'); // collapse dashes
396
  return str;
397
  {
398
  var myStr = jQuery(this).val()
399
  myStr=myStr.toLowerCase();
400
  myStr=myStr.replace(/\s/g , "-");
401
  jQuery('#cf_slug').val(myStr);
402
  slug = jQuery(this).val();
403
  customSlug = slug;
404
  customSlug = string_to_slug(customSlug);
405
  jQuery(this).val(customSlug);
406
  jQuery('.customSlugText').text(customSlug);
407
  newurl = jQuery('#cfslugurl').text();
408
  jQuery('#cfslugurl').attr('href', newurl);
409
  jQuery('#cf_page_url').val('<?php echo get_home_url(); ?>/'+myStr);
410
  jQuery('#customurlError').hide();
411
  jQuery('#customurlError_duplicate').hide();
412
  jQuery('#publish').removeClass('disabledLink');
413
  jQuery('.used_slug').each(function () {
414
  if (jQuery(this).html() == customSlug) {
415
  jQuery('#customurlError_duplicate').fadeIn();
416
  jQuery('#publish').addClass('disabledLink');
417
  }
418
  });
419
  if ('' == customSlug) {
420
  jQuery('#customurlError').fadeIn();
421
  jQuery('#publish').addClass('disabledLink');
422
  }
423
  });
424
  if (jQuery(this).val() == 'clickgate') {
425
  jQuery('.cf_url').hide();
426
  jQuery('.clickgateinfo').show();
427
  jQuery('#publish').removeClass('disabledLink');
428
  }
429
  else if (jQuery(this).val() == 'hp') {
430
  jQuery('.cf_url').hide();
431
  jQuery('#publish').removeClass('disabledLink');
432
  }
433
  else if (jQuery(this).val() == 'np') {
434
  jQuery('.cf_url').hide();
435
  jQuery('#publish').removeClass('disabledLink');
436
  }
437
  else {
438
  jQuery('.cf_url').show();
439
  jQuery('.clickgateinfo').hide();
440
  jQuery('#cf_slug').trigger('keyup');
441
  }
442
  });
443
  <?php
444
  // check all CF page slugs
445
  $posts = get_posts(array(
446
  'post_type' => 'clickfunnels',
447
  'post_status' => 'publish',
448
  'fields' => 'ids'
449
  )
450
  );
451
  foreach($posts as $p){
452
  $slug = get_post_meta($p,"cf_slug",true);
453
  if ($slug != $cf_slug) {
454
  echo "<li class='used_slug'>$slug</li>";
455
  }
456
  }
457
  foreach( get_posts('numberposts=-1') as $post ) {
458
  echo "<li class='used_slug'>$post->post_name</li>";
459
  }
460
  foreach( get_pages('numberposts=-1') as $post ) {
461
  echo "<li class='used_slug'>$post->post_name</li>";
462
  }
463
  ?>
464
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
465
  <?php $hideforUpdateMeta = 'display: none !important'; ?>
466
  <style>.bootstrap-wp, .copyrightInfo {display: none; }</style>
467
  <span style="margin: 10px;" class="compatCheck compatwarning">Updating Your Meta Data... <strong><i class="fa fa-spinner fa-spin"></i> Please wait just a moment.</strong></span>
468
  <input type="hidden" name="meta_redirect" value='yes'>
469
  <?php } else { ?>
470
  <h2>
471
  <?php
472
  if ( !empty( $_GET['action'] ) && $cf_funnels ) {
473
  $blankpage = 'no';
474
  foreach ( $cf_funnels as $key=>$funnel ) {
475
  if ( $cf_thefunnel == $funnel->id ) {
476
  $lengthofheadline = 40;
477
  if ( $cf_type=='hp' || $cf_type=='np' || $cf_type=='clickgate' ) { $lengthofheadline = 19; }
478
  if (strlen($thepage[6]) > $lengthofheadline) {
479
  echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...';
480
  $check = '1';
481
  }
482
  else {
483
  if(strlen($thepage[6]) > $lengthofheadline) { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...'; }
484
  else { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.$thepage[6];}
485
  $check = '1';
486
  }
487
  }
488
  else {
489
  $blankpage = 'yes';
490
  }
491
  }
492
  $cf_options = get_option( "cf_options" );
493
  $homeCheck = $cf_options['home'];
494
  $postid = get_the_ID();
495
  if ($cf_page == '' && $cf_type == '' && $blankpage = 'yes' && $homeCheck['post_id'] != $postid && $cf_thepage != '') {
496
  echo 'Requires Custom URL';
497
  }
498
  } else {
499
  echo '<i class="fa fa-plus-square" style="margin-right: 5px"></i> Add New Page';
500
  }
501
  ?>
502
  <?php if ($cf_type == 'clickgate') { ?>
503
  ClickGate Popup
504
  <?php } ?> -->
505
  </h2>
506
  <?php if ( !empty( $_GET['action'] ) ) { ?>
507
  <a style="margin-right: 0;margin-top: -33px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> EDITOR</a>
508
  <a style="margin-right: 10px;margin-top: -33px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-filter"></i> FUNNEL</a>
509
  <a style="margin-right: 10px;margin-top: -33px;" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> PREVIEW</a>
510
  <?php if ( $cf_type=='p' ) {?>
511
  <?php }?>
512
  <?php if ( $cf_type=='hp' ) {?>
513
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-home"></i> Set as Home Page</span>
514
  <?php }?>
515
  <?php if ( $cf_type=='np' ) {?>
516
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-exclamation-triangle"></i> Set as 404 Page</span>
517
  <?php }?>
518
  <?php if ( $cf_type=='clickgate' ) {?>
519
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-external-link"></i> Set as ClickGate</span>
520
  <?php }?>
521
  <?php }?>
522
  <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>
523
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
524
  <input type="hidden" name="meta_redirect" value='yes'>
525
  <?php } ?>
526
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
527
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
528
  <div class="bootstrap-wp"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
529
  <div id="app_sidebar">
530
  <a href="#" data-tab="tab1" class="cftablink selectapagelink active">Select Page</a>
531
  <a href="#" data-tab="tab2" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Meta Data</a>
532
  <a href="#" data-tab="tab4" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Open Graph</a>
533
  <a href="#" data-tab="tab6" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Tracking Code</a>
534
  <a href="#" data-tab="tab3" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Settings</a>
535
  </div>
536
  <div id="app_main" class="col-sm-7 row-fluid form-horizontal">
537
  <div id="tab6" class="cftabs" style="display: none">
538
  <!-- Tracking Code -->
539
  <h2>Tracking Code</h2>
540
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel.</em></p>
541
  <hr style="margin-left: 51px">
542
  <div class="control-group" >
543
  <label class="control-label" for="cf_iframe_check"> WordPress Only Tracking Code </label>
544
  <div class="controls">
545
  <textarea class="input-xlarge wpfooterTracking" id="wpfooterTracking" style="height: 80px;" name="cf_wptracking_code"><?php echo $cf_wptracking_code; ?></textarea>
546
  </div>
547
  </div>
548
  <hr style="margin-left: 51px">
549
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> You can add your own custom tracking code for only this WordPress page, meaning your original page will not have this tracking code.</em></p>
550
  <hr style="margin-left: 51px">
551
  <div class="control-group" >
552
  <label class="control-label" for="cf_iframe_check"> Header Tracking </label>
553
  <div class="controls">
554
  <textarea class="input-xlarge headTracking" id="headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
555
  </div>
556
  </div>
557
  <div class="control-group" >
558
  <label class="control-label" for="cf_iframe_check"> Footer Tracking </label>
559
  <div class="controls">
560
  <textarea class="input-xlarge footerTracking" id="footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
561
  </div>
562
  </div>
563
  <hr style="margin-left: 51px">
564
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Funnel wide tracking is set inside the Funnel Settings in the ClickFunnels app.</em></p>
565
  <hr style="margin-left: 51px">
566
  <div class="control-group" >
567
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Header Tracking </label>
568
  <div class="controls">
569
  <textarea class="input-xlarge fw_headTracking" id="fw_headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
570
  </div>
571
  </div>
572
  <div class="control-group" >
573
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Footer Tracking </label>
574
  <div class="controls">
575
  <textarea class="input-xlarge fw_footerTracking" id="fw_footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
576
  </div>
577
  </div>
578
  </div>
579
  <div id="tab1" class="cftabs">
580
  <!-- Select a Page / Funnel -->
581
  <h2>Select a Page</h2>
582
  <div class="control-group cf_uses_api clearfix" style="">
583
  <label class="control-label" for="cf_thefunnel"> Choose Funnel </label>
584
  <div class="controls">
585
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
586
  <?php if ( empty( $cf_funnels ) ) { ?>
587
  <option value="0">No Funnels Found</option>
588
  <?php }
589
  else {
590
  // Agency Gate Check
591
  $agency_group_tag = get_option('clickfunnels_agency_group_tag');
592
  foreach ( $cf_funnels as $key=>$funnel ) {
593
  if ($agency_group_tag != 'off') {
594
  if ($funnel->group_tag || $funnel->group_tag != '') {
595
  $group_tag = str_replace("'", '{replace}', $funnel->group_tag);
596
  $group_tag = str_replace("\"", '{replace}', $funnel->group_tag);
597
  if ($agency_group_tag == $group_tag) { ?>
598
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
599
  <?php }
600
  } else {
601
  if ($agency_group_tag == 'ungrouped') { ?>
602
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
603
  <?php }
604
  }
605
  }
606
  else { ?>
607
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
608
  <?php }
609
  }
610
  } ?>
611
  </select>
612
  </div>
613
  </div>
614
  <div class="control-group choosePageBox clearfix" style="<?php if ( empty( $_GET['action'] ) ) { echo "display: none"; } ?>">
615
  <label class="control-label" for="cf_thepage">
616
  Choose Page <span id="loading"><i class="fa fa-spinner"></i> <em style="margin-left: 5px;font-size: 11px;">Loading Pages...</em></span>
617
  <div id="runningSplitTests" style="font-size: 11px;opacity: .8;float: right;padding-top: 5px;color: #555;margin-right: 26px;display: none;clear: both">
618
  <!-- Number of Split Tests -->
619
  </div>
620
  </label>
621
  <div class="controls">
622
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
623
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
624
  <option value="0">No Pages Found</option>
625
  <?php }
626
  else {
627
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
628
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
629
  <?php
630
  }
631
  }
632
  ?>
633
  </select>
634
  </div>
635
  <div id="noPageWarning" style="font-size: 11px; margin-left: 28px; margin-top: -13px;float: left;padding-top: 14px;display: none;width: 100%; clear: both">
636
  <strong style="font-size: 13px;display: block;">No compatible pages found. </strong>
637
  <em style="display: block">Membership pages and order pages are not available through plugin.</em>
638
  </div>
639
  <br clear="all">
640
  </div>
641
  <?php if ( $cf_type!="p" && $check == '1') $display ="display:none"; else $display="";?>
642
  <?php if ( $cf_type == '') $display ="display:block"; ?>
643
  <div class="cf_url control-group clearfix" style="<?php echo $display;?>" >
644
  <label class="control-label" for="cf_slug"> Custom Slug</label>
645
  <div id="cf-wp-path" class="controls ">
646
  <input style="padding:10px;"type="text" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" placeholder="your-path-here" name="cf_slug" id="cf_slug" class="input-xlarge">
647
  <?php if ( $cf_type == '' ) $display ="display:block;"; else $display="";?>
648
  <div id="customurlError" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
649
  Add a path before saving.
650
  </div>
651
  <div id="customurlError_duplicate" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
652
  Slug already taken
653
  </div>
654
  </div>
655
  <p class="infoHelp" style="padding-left: 25px;margin-top: 13px;"><span><i class="fa fa-globe" style="margin-right: 3px"></i>
656
  <?php if ( !empty( $_GET['action'] ) ) { ?>
657
  <a style="font-weight: bold;text-decoration: none; padding-bottom: 3px;" id="cfslugurl" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" target="_blank"><?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></a>
658
  <?php } else { ?>
659
  <span style="font-weight: bold;text-decoration: none; padding-bottom: 3px;"> <?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></span>
660
  <?php } ?>
661
  </span></p>
662
  <input type="text" style="display: none" class="input-xlarge" style="height: 30px;" value="<?php echo $cf_page_url; ?>" name="cf_page_url" id="cf_page_url" />
663
  </div>
664
  </div>
665
  <div id="tab2" class="cftabs" style="display: none">
666
  <!-- Meta Data -->
667
  <h2>Meta Data</h2>
668
  <div id="metaPreview">
669
  <h5>PREVIEW</h5>
670
  <img src="<?php echo $cf_favicon; ?>" id="faviconPreview" style="width: 18px;margin-left: 10px;margin-bottom: 5px;float: left;" />
671
  <strong>FAVICON</strong>
672
  <h3><?php echo $cf_seo_title; ?></h3>
673
  <span><?php echo get_home_url() ; ?>/<em style="font-style: normal" class="customSlugText"><?php echo $cf_slug; ?></em></span>
674
  <p><?php echo $cf_seo_desc; ?></p>
675
  </div>
676
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
677
  <hr style="margin-left: 51px">
678
  <div class="control-group" >
679
  <label class="control-label" for="cf_iframe_check"> Website Title </label>
680
  <div class="controls">
681
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
682
  </div>
683
  </div>
684
  <div class="control-group" >
685
  <label class="control-label" for="cf_iframe_check"> Description </label>
686
  <div class="controls">
687
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
688
  </div>
689
  </div>
690
  <div class="control-group" >
691
  <label class="control-label" for="cf_iframe_check"> Keywords </label>
692
  <div class="controls">
693
  <input type="text" class="input-xlarge" id="seoKeywords" readonly="readonly"style="height: 30px;" value="<?php echo $cf_keywords; ?>" name="cf_keywords" />
694
  </div>
695
  </div>
696
  <div class="control-group" >
697
  <label class="control-label" for="cf_iframe_check"> Favicon </label>
698
  <div class="controls">
699
  <input type="text" class="input-xlarge" readonly="readonly"id="cf_favicon" style="height: 30px;" value="<?php echo $cf_favicon; ?>" name="cf_favicon" />
700
  </div>
701
  </div>
702
  <div class="control-group" >
703
  <label class="control-label" for="cf_favicon_choice"> Choose Favicon to Show </label>
704
  <div class="controls">
705
  <select name="cf_favicon_choice" id="cf_favicon_choice" class="cf_favicon_choice" style="width: 100% !important">
706
  <option value="" <?php if($cf_favicon_choice == ''){ echo 'selected'; } ?>>Show ClickFunnels Page Favicon</option>
707
  <option value="default"<?php if($cf_favicon_choice == 'default'){ echo 'selected'; } ?>>Show Default WordPress Favicon</option>
708
  </select>
709
  </div>
710
  </div>
711
  </div>
712
  <div id="tab3" class="cftabs" style="display: none">
713
  <!-- Page Settings -->
714
  <h2>Page Settings</h2>
715
  <div class="innerTab">
716
  <div class="control-group ">
717
  <label class="control-label" for="cf_type"> Choose Page Type</label>
718
  <select name="cf_type" id="cf_type" class="cf_header" style="width: 100% !important">
719
  <option value="p" <?php if($cf_type == 'p'){ echo 'selected'; } ?>>Regular Page</option>
720
  <option value="hp"<?php if($cf_type == 'hp'){ echo 'selected'; } ?>>Set as Home Page</option>
721
  <option value="np"<?php if($cf_type == 'np'){ echo 'selected'; } ?>>Set as 404 Page</option>
722
  <option value="clickgate"<?php if($cf_type == 'clickgate'){ echo 'selected'; } ?>>Set as ClickGate</option>
723
  </select>
724
  </div>
725
  </div>
726
  <?php if ( $cf_type == 'clickgate') $display ="display:block;"; else $display="";?>
727
  <p class="infoHelp clickgateinfo" style="color: #8A6D3B;display: none; <?php echo $display; ?>"><i class="fa fa-star" style="margin-right: 3px"></i> <strong>ClickGate will show this page at the top of any page or post that your visitors land on and will cookie them to show only page only once.</strong></em></p>
728
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Choose to make this a regular page with a path (custom URL) or show this page as the Home Page for your blog. You can also set this page as a 404 page for any old, mispelled or deleted paths. <em>(only one page can be set as a Home, 404 or ClickGate at a time)</em></p>
729
  <hr style="margin-left: 51px">
730
  <div class="control-group cf_uses_api" >
731
  <label class="control-label" for="cf_iframe_check"> Show Page Inside of Iframe</label>
732
  <div class="controls">
733
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
734
  <option value="off">No, show page using ClickFunnels API.</option>
735
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Yes, show page using an iframe.</option>
736
  </select>
737
  </div>
738
  </div>
739
  <br style="clear: both">
740
  <p class="infoHelp" style="margin-top: 15px"><i class="fa fa-question-circle" style="margin-right: 3px"></i> If you have custom code on your page that is not working, choose to show your page inside an iframe to fix any custom code issues. If your page is showing up blank use the iframe option and submit a support ticket.</p>
741
  <hr style="margin-left: 51px">
742
  <div class="control-group" style="display: block">
743
  <label class="control-label" for="cf_iframe_check"> ClickFunnels Page URL <small>(reference only)</small></label>
744
  <div class="controls">
745
  <input type="text" class="input-xlarge" id="iframeURL" readonly="readonly"style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
746
  </div>
747
  </div>
748
  </div>
749
  <div id="tab4" class="cftabs" style="display: none">
750
  <!-- Extra Settings -->
751
  <h2>Open Graph</h2>
752
  <div id="opengraphPreview">
753
  <h5>PREVIEW</h5>
754
  <img style="<?php if ($cf_seo_image == '') { echo 'display: none;'; } ?>" src="<?php echo $cf_seo_image; ?>" id="seosocialimage">
755
  <h3><?php echo $cf_seo_title; ?></h3>
756
  <p><?php echo $cf_seo_desc; ?></p>
757
  <span><?php echo get_home_url() ; ?> <em id="theAuthor"><?php echo '| '.$cf_author; ?></em></span>
758
  </div>
759
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
760
  <hr style="margin-left: 51px">
761
  <div class="control-group" >
762
  <label class="control-label" for="cf_iframe_check"> Title </label>
763
  <div class="controls">
764
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" />
765
  </div>
766
  </div>
767
  <div class="control-group" >
768
  <label class="control-label" for="cf_iframe_check"> Description </label>
769
  <div class="controls">
770
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
771
  </div>
772
  </div>
773
  <div class="control-group" >
774
  <label class="control-label" for="cf_iframe_check"> Author </label>
775
  <div class="controls">
776
  <input type="text" class="input-xlarge" id="seoAuthor" readonly="readonly"style="height: 30px;" value="<?php echo $cf_author; ?>" name="cf_author" />
777
  </div>
778
  </div>
779
  <div class="control-group" >
780
  <label class="control-label" for="cf_iframe_check"> Social Image URL </label>
781
  <div class="controls">
782
  <input type="text" class="input-xlarge" id="seosocial" readonly="readonly" style=" height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
783
  </div>
784
  </div>
785
  </div>
786
  <div id="savePage">
787
  <div style="width: 100%">
788
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
789
  <a href="#" id="publish" name="publish" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" disabled style="float: right; ">
790
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-check-circle'></i> Update Page"; } else { echo "<i class='fa fa-check-circle'></i> Save and Publish"; } ?>
791
  </a>
792
  <?php } else { ?>
793
  <a href="#" id="publish" name="publish" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" style="float: right; ">
794
  <?php if ( !empty( $_GET['action'] ) ) { echo "<i class='fa fa-check-circle'></i> Update Page"; } else { echo "<i class='fa fa-check-circle'></i> Save and Publish"; } ?>
795
  </a>
796
  <?php } ?>
797
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 9px;margin-right: 4px;font-size: 15px;">
798
  <i class="fa fa-spinner fa-spin"></i>
799
  <span>Saving...</span>
800
  </div>
801
  </div>
802
  </div>
803
  <style>
804
  #hiddenStuff {display: none}
805
  </style>
806
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block;clear: both;" <?php } ?>>
807
  <style>
808
  #hiddenStuff input {
809
  display:block;margin-top: 5px;margin-bottom: 5px;font-weight: normal;width: 100%;
810
  }
811
  </style>
812
  <div class="controls">
813
  <br>
814
  <h3>Dev Checks:</h3>
815
  <hr />
816
  <strong>Funnel ID: <input id="checkFunID" type="text" value="<?php echo $thepage[0]; ?>" /></strong>
817
  <strong>Page Key: <input type="text" value="<?php echo $thepage[1]; ?>" /></strong>
818
  <strong>Page ID: <input type="text" value="<?php echo $thepage[2]; ?>" /></strong>
819
  <strong>Funnel Step ID: <input type="text" value="<?php echo $thepage[3]; ?>" /></strong>
820
  <strong>Saved Meta: <input type="text" id="oldmeta" value="<?php echo $thepage[4]; ?>" /></strong>
821
  <strong>JS Meta: <input type="text" id="jsmeta" value="" /></strong>
822
  <strong>Post ID: <input type="text" value="<?php echo $thepage[5]; ?>" /></strong>
823
  <strong>Page Name: <input type="text" value="<?php echo $thepage[6]; ?>" /></strong>
824
  <strong>Use iframe?: <input type="text" value="<?php echo $cf_iframe_check; ?>" /></strong>
825
  <strong>Iframe URL: <input type="text" value="<?php echo $cf_iframe_url; ?>" /></strong>
826
  <textarea name="cf_thefunnel" id="cf_data" style="display:block;margin-top: 5px;margin-bottom: 10px;width: 100%;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
827
  </div>
828
  </div>
829
  </div>
830
  </div>
831
+ <style>.hndle {display: none !important}</style>
832
  if(!get_option( 'clickfunnels_api_email')) {
833
  update_option( 'clickfunnels_api_email', '');
834
  }
835
  if(!get_option( 'clickfunnels_api_auth')) {
836
  update_option( 'clickfunnels_api_auth', '');
837
  }
838
  if(!get_option( 'clickfunnels_siteURL')) {
839
  update_option( 'clickfunnels_siteURL', '');
840
  }
841
  if(!get_option( 'clickfunnels_404Redirect')) {
842
  update_option( 'clickfunnels_404Redirect', '');
843
  }
844
  if(!get_option( 'clickfunnels_agency_group_tag')) {
845
  update_option( 'clickfunnels_agency_group_tag', '');
846
  }
847
  if(!get_option( 'clickfunnels_agency_api_details')) {
848
  update_option( 'clickfunnels_agency_api_details', '');
849
  }
850
  if(!get_option( 'clickfunnels_agency_reset_data')) {
851
  update_option( 'clickfunnels_agency_reset_data', '');
852
  }
853
  if(!get_option( 'clickfunnels_agency_hide_settings')) {
854
  update_option( 'clickfunnels_agency_hide_settings', '');
855
  }
856
  $cf_thefunnel = get_post_meta( $_GET['post'], "cf_thefunnel", true );
857
  $cf_thepage = get_post_meta( $_GET['post'], "cf_thepage", true );
858
  $cf_iframe_check = get_post_meta( $_GET['post'], "cf_iframe_check", true );
859
  $cf_iframe_url = get_post_meta( $_GET['post'], "cf_iframe_url", true );
860
  $cf_seo_title = get_post_meta( $_GET['post'], "cf_seo_title", true );
861
  $cf_seo_desc = get_post_meta( $_GET['post'], "cf_seo_desc", true );
862
  $cf_seo_image = get_post_meta( $_GET['post'], "cf_seo_image", true );
863
  $cf_page_url = get_post_meta( $_GET['post'], "cf_page_url", true );
864
  $cf_favicon = get_post_meta( $_GET['post'], "cf_favicon", true );
865
  $cf_author = get_post_meta( $_GET['post'], "cf_author", true );
866
  $cf_keywords = get_post_meta( $_GET['post'], "cf_keywords", true );
867
  $cf_head_tracking = get_post_meta( $_GET['post'], "cf_head_tracking", true );
868
  $cf_footer_tracking = get_post_meta( $_GET['post'], "cf_footer_tracking", true );
869
  $cf_wptracking_code = get_post_meta( $_GET['post'], "cf_wptracking_code", true );
870
  $cf_favicon_choice = get_post_meta( $_GET['post'], "cf_favicon_choice", true );
871
  $cf_slug= get_post_meta( $_GET['post'], 'cf_slug', true );
872
  if ( !isset( $cf_page['page_id'] ) || $cf_page['page_id'] < 10 ) {
873
  $thepage = explode( "{#}", $cf_page );
874
  $savedData = $cf_page;
875
  }
876
  else {
877
  $thepage = explode( "{#}", $cf_page['page_id'] );
878
  $savedData = $cf_page['page_id'];
879
  }
880
  $cf_options = get_option( "cf_options" );
881
  // populate funnels option field
882
  if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) {
883
  }
884
  else {
885
  if ($cf_page != "") {
886
  $response = wp_remote_get( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
887
  if( is_array($response) ) {
888
  $json = $response['body']; // use the content
889
  }
890
  $cf_funnels_pages = json_decode( $json );
891
  }
892
  else if ($cf_funnels == '') {
893
  $response = get_file_content( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
894
  if( is_array($response) ) {
895
  $json = $response['body']; // use the content
896
  }
897
  $cf_funnels_pages = json_decode( $json );
898
  }
899
  }
900
  jQuery(document).ready(function(){
901
  jQuery('.draft').hide();
902
  console.log("%cClickFunnels WordPress Plugin", "background: #0166AE; color: white; font-size: 23px");
903
  console.log("%cEditing anything inside the console is for developers only. Do not paste in any code given to you by anyone. Use with caution. Visit for support: https://support.clickfunnels.com/", "color: #888; font-size: 16px");
904
  // Set Correct Options
905
  var thenewdata = jQuery('#cf_thefunnel').val();
906
  var thenewdata = thenewdata.split('{#}');
907
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
908
  jQuery('#cf_thepage').find('option').remove().end();
909
  // alert(specificFunnel);
910
  // alert(thenewdata);
911
  jQuery('#loading').fadeIn();
912
  var favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
913
  <?php if ( empty( $_GET['action'] ) ) { ?>
914
  jQuery('#cf_thefunnel').prepend('<option value="" disabled selected>Select a Funnel</option>');
915
  <?php } ?>
916
  jQuery.getJSON(specificFunnel, function(data) {
917
  setTimeout(function() {
918
  jQuery('#loading').fadeOut();
919
  }, 2000);
920
  var is_selected = "";
921
  if (data.favicon){
922
  favicon = data.favicon;
923
  }
924
  else {
925
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
926
  }
927
  jQuery.each(data.funnel_steps, function() {
928
  if (this.pages != ''){
929
  if(this.pages[0].id == "<?php echo $thepage[2] ?>" && this.pages != '' ) {
930
  is_selected = "selected";
931
  jQuery('#cf_seo_tags').val(this.pages[0].metatags);
932
  } else {
933
  is_selected = "";
934
  }
935
  if ( this.wp_friendly == true && this.pages != '' ) {
936
  jQuery('#iframeURL').val(this.pages[0].published_url);
937
  if (data.favicon){
938
  jQuery('#cf_favicon').val(favicon);
939
  jQuery('#faviconPreview').attr('src', favicon);
940
  } else {
941
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
942
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
943
  }
944
  // Check if has split tests
945
  var splittestkeys = 'none';
946
  if (this.pages.length == 2) {
947
  splittestkeys = '2';
948
  }
949
  else if (this.pages.length == 3) {
950
  splittestkeys = '3';
951
  }
952
  // Ping All Pages in Funnel (to refresh split tests / api)
953
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
954
  pageKey = this.pages[0].key;
955
  jQuery('#headTracking').val(this.pages[0].head_tag);
956
  jQuery('#footerTracking').val(this.pages[0].body_tag);
957
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
958
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
959
  jQuery('#cf_thepage').append('<option value="' + pageKey + '{#}' + 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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'" '+is_selected+'>'+ this.name +'</option>');
960
  }
961
  }
962
  });
963
  }).done(function() {
964
  jQuery('#loading').fadeOut();
965
  var savedMeta = jQuery('#cf_thepage').val();
966
  if(savedMeta != undefined || savedMeta != null){
967
  savedMeta = savedMeta.split('{#}');
968
  <?php if ( !empty( $_GET['action'] ) ) { ?>
969
  jQuery('#cf_thepage').trigger('change');
970
  <?php } ?>
971
  }
972
  })
973
  .fail(function(jqXHR) {
974
  jQuery('#loading').fadeOut();
975
  jQuery('.badAPI').show();
976
  })
977
  .always(function() {
978
  jQuery('#loading').fadeOut();
979
  });
980
  // Change Funnel Populate Dropdown
981
  jQuery( '#cf_thefunnel' ).change(function() {
982
  jQuery('.choosePageBox').fadeIn();
983
  jQuery('.cftablink').removeClass('disabledLink');
984
  jQuery('#publish').removeClass('disabledLink');
985
  jQuery('#loading').fadeIn();
986
  var thenewdata = jQuery(this).val();
987
  var thenewdata = thenewdata.split('{#}');
988
  var totalPages = 0;
989
  var specificFunnel = 'https://api.clickfunnels.com/funnels/'+thenewdata[0]+'.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
990
  // alert(specificFunnel);
991
  jQuery('#cf_thepage').find('option').remove().end();
992
  jQuery.getJSON(specificFunnel, function(data) {
993
  setTimeout(function() {
994
  jQuery('#loading').fadeOut();
995
  }, 2000);
996
  if (data.favicon){
997
  favicon = data.favicon;
998
  }
999
  else {
1000
  favicon = 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png';
1001
  }
1002
  // alert( specificFunnel);
1003
  jQuery.each(data.funnel_steps, function() {
1004
  if( this.wp_friendly == true && this.pages != '' ) {
1005
  // Ping All Pages in Funnel (to refresh split tests / api)
1006
  ping('https://api.clickfunnels.com/s3_proxy/'+this.pages[0].key+'?preview=true');
1007
  // Check if has split tests
1008
  var splittestkeys = 'none';
1009
  if (this.pages.length == 2) {
1010
  splittestkeys = '2';
1011
  }
1012
  else if (this.pages.length == 3) {
1013
  splittestkeys = '3';
1014
  }
1015
  jQuery('#iframeURL').val(this.pages[0].published_url);
1016
  jQuery('#cf_funnelwide_tracking_head').val(favicon);
1017
  if (data.favicon){
1018
  jQuery('#cf_favicon').val(favicon);
1019
  jQuery('#faviconPreview').attr('src', favicon);
1020
  } else {
1021
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1022
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1023
  }
1024
  // Tracking Codes
1025
  jQuery('#headTracking').val(this.pages[0].head_tag);
1026
  jQuery('#footerTracking').val(this.pages[0].body_tag);
1027
  jQuery('#fw_headerTracking').val(thenewdata[1]);
1028
  jQuery('#fw_footerTracking').val(thenewdata[2]);
1029
  if(this.pages[0].head_tag) { head_tag = encodeURIComponent(this.pages[0].head_tag); } else { head_tag = ''; }
1030
  if(this.pages[0].body_tag) { body_tag = encodeURIComponent(this.pages[0].body_tag); } else { body_tag = ''; }
1031
  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].published_url+'{#}'+favicon+'{#}'+head_tag+'{#}'+body_tag+'{#}'+data.name+'{#}'+splittestkeys+'">'+ this.name +'</option>');
1032
  totalPages += 1;
1033
  }
1034
  });
1035
  }).done(function() {
1036
  jQuery('#loading').fadeOut();
1037
  var savedMeta = jQuery('#cf_thepage').val();
1038
  jQuery('#cf_thepage').trigger('change');
1039
  if (totalPages == 0) {
1040
  jQuery('#cf_thepage').hide();
1041
  jQuery('#runningSplitTests').hide();
1042
  jQuery('#noPageWarning').fadeIn();
1043
  }
1044
  else {
1045
  jQuery('#noPageWarning').hide();
1046
  jQuery('#cf_thepage').fadeIn();
1047
  }
1048
  var theposition = jQuery('#cf_thepage').val();
1049
  var thefunnel = jQuery('#cf_thefunnel').val();
1050
  thefunnel = thefunnel.split('{#}');
1051
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
1052
  var myString = thefunnel[0]+'{#}'+theposition;
1053
  var arr = myString.split('{#}');
1054
  // jQuery('#loadPageforUpdate').attr('src', 'https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
1055
  var do_ping = function() {
1056
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true').then(function(delta) {}).catch(function(error) {});
1057
  };
1058
  do_ping();
1059
  })
1060
  .fail(function() {
1061
  jQuery('#loading').fadeOut();
1062
  })
1063
  .always(function() {
1064
  jQuery('#loading').fadeOut();
1065
  });
1066
  });
1067
  var request_image = function(url) {
1068
  return new Promise(function(resolve, reject) {
1069
  var img = new Image();
1070
  img.onload = function() { resolve(img); };
1071
  img.onerror = function() { reject(url); };
1072
  img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
1073
  });
1074
  };
1075
  /**
1076
  * Pings a url.
1077
  * @param {String} url
1078
  * @return {Promise} promise that resolves to a ping (ms, float).
1079
  */
1080
  var ping = function(url) {
1081
  return new Promise(function(resolve, reject) {
1082
  var start = (new Date()).getTime();
1083
  var response = function() {
1084
  var delta = ((new Date()).getTime() - start);
1085
  // HACK: Use a fudge factor to correct the ping for HTTP bulk.
1086
  delta /= 4;
1087
  resolve(delta);
1088
  };
1089
  request_image(url).then(response).catch(response);
1090
  // Set a timeout for max-pings, 5s.
1091
  setTimeout(function() { reject(Error('Timeout')); }, 5000);
1092
  });
1093
  };
1094
  function replaceText(inputText, tagName, tagReplace) {
1095
  var regExp = new RegExp('\\[' + tagName+ '\\]([^\\[]*)\\[\/' + tagName + '\\]', 'g');
1096
  return inputText.replace(regExp, tagReplace);
1097
  }
1098
  // Select New Page
1099
  jQuery( '#cf_thepage' ).change(function() {
1100
  jQuery('#loading').fadeOut();
1101
  var thefunnel = jQuery('#cf_thefunnel').val();
1102
  thefunnel = thefunnel.split('{#}');
1103
  var theposition = jQuery(this).val();
1104
  jQuery('#cf_data').val(thefunnel[0]+'{#}'+theposition);
1105
  if(theposition != undefined || theposition != null){
1106
  var myString = thefunnel[0]+'{#}'+theposition;
1107
  var arr = myString.split('{#}');
1108
  var arr2 = theposition.split('{#}');
1109
  jQuery('#iframeURL').val(arr2[6]);
1110
  <?php if ($cf_favicon_choice == '') { ?>
1111
  if (arr2[7] !== ''){
1112
  jQuery('#cf_favicon').val(arr2[7]);
1113
  jQuery('#faviconPreview').attr('src', arr2[7]);
1114
  } else {
1115
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1116
  jQuery('#faviconPreview').attr('src', 'https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1117
  }
1118
  <?php } else { ?>
1119
  if (arr2[7] !== ''){
1120
  jQuery('#cf_favicon').val(arr2[7]);
1121
  jQuery('#faviconPreview').hide();
1122
  jQuery('#metaPreview strong').hide();
1123
  } else {
1124
  jQuery('#cf_favicon').val('https://appassets3.clickfunnels.com/assets/favicon-8c74cad77e4e123f7dbb46b33e6de10c.png');
1125
  jQuery('#faviconPreview').hide();
1126
  jQuery('#metaPreview strong').hide();
1127
  }
1128
  <?php } ?>
1129
  // Tracking Code
1130
  jQuery('#headTracking').val(decodeURIComponent(arr2[8]));
1131
  jQuery('#footerTracking').val(decodeURIComponent(arr2[9]));
1132
  var thenewdata = jQuery('#cf_thefunnel').val();
1133
  var thenewdata = thenewdata.split('{#}');
1134
  jQuery('#fw_headTracking').val(thenewdata[1]);
1135
  jQuery('#fw_footerTracking').val(thenewdata[2]);
1136
  // Check if has split tests
1137
  if (arr2[11] == 2) {
1138
  var splittestkeys = '1 Active Split Test';
1139
  jQuery('#runningSplitTests').show();
1140
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
1141
  }
1142
  else if (arr2[11] == 3) {
1143
  var splittestkeys = '2 Active Split Tests';
1144
  jQuery('#runningSplitTests').show();
1145
  jQuery('#runningSplitTests').html('<em style="display: block"><i class="fa fa-bar-chart" style="margin-right: 2px"></i> '+splittestkeys+'</em>');
1146
  }
1147
  else {
1148
  jQuery('#runningSplitTests').hide();
1149
  }
1150
  var myStr = arr2[3];
1151
  // Browser title
1152
  var subStr = myStr.match("%3Ctitle%3E(.*)%3C/title%3E");
1153
  jQuery('.seoTitle').val(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1154
  jQuery('#metaPreview h3').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1155
  jQuery('#opengraphPreview h3').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1156
  var authorname = myStr.match('author%22%20content=%22(.*)%22%3E%3');
1157
  jQuery('#seoAuthor').val(decodeURIComponent(authorname[1].replace(/%20/g, ' ')));
1158
  jQuery('#theAuthor').html('| '+authorname[1].replace(/%20/g, ' '));
1159
  var keywordsmeta = myStr.match('keywords%22%20content=%22(.*)%22%3E%3');
1160
  var keywords = keywordsmeta[1].replace(/%20/g, ' ').split('%');
1161
  jQuery('#seoKeywords').val(decodeURIComponent(keywords[0]));
1162
  // SEO Desc
1163
  var subStr = myStr.match("description%22%20content=%22(.*)%22%3E%3Cmeta%20class=%22metaTagTop%22%20name=%22keywo");
1164
  jQuery('.seoDesc').val(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1165
  jQuery('#metaPreview p').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1166
  jQuery('#opengraphPreview p').text(decodeURIComponent(subStr[1].replace(/%20/g, ' ')));
1167
  // SEO Share Image
1168
  var subStr = myStr.match("rty=%22og:image%22%20content=%22(.*)%22%20id=%22social-image%22%3E");
1169
  jQuery('#seosocial').val(subStr[1]);
1170
  if (subStr[1] != ''){
1171
  jQuery('#seosocialimage').show();
1172
  jQuery('#seosocialimage').attr('src', subStr[1]);
1173
  } else {
1174
  jQuery('#seosocialimage').hide();
1175
  }
1176
  ping('https://api.clickfunnels.com/s3_proxy/'+arr[1]+'?preview=true');
1177
  <?php if ( !empty( $_GET['updatemeta']) ) { ?>
1178
  setTimeout(function() {
1179
  jQuery('#publish').trigger('click');
1180
  }, 4000);
1181
  <?php } ?>
1182
  }
1183
  });
1184
  // Savings
1185
  jQuery('#publish').click(function(e) {
1186
  // e.preventDefault()
1187
  // if (jQuery(this).hasClass('disabledLink')=== true) {
1188
  //
1189
  // }
1190
  // else {
1191
  // jQuery('#saving').fadeIn();
1192
  // if (jQuery('#cf_slug').val() == '' && jQuery('.cf_header').val() == 'p') {
1193
  // jQuery('.selectapagelink').trigger('click');
1194
  // jQuery('#customurlError').fadeIn();
1195
  // jQuery('#cf_slug').focus();
1196
  // jQuery('#saving').fadeOut();
1197
  // }
1198
  // else {
1199
  // saveNow = 'yes';
1200
  // jQuery('.used_slug').each(function () {
1201
  // if (jQuery(this).html() == jQuery('#cf_slug').val()) {
1202
  // jQuery('#customurlError_duplicate').fadeIn();
1203
  // jQuery('#saving').fadeOut();
1204
  // saveNow = 'no!';
1205
  // }
1206
  //
1207
  // });
1208
  // if (saveNow == 'yes') {
1209
  // jQuery('form').submit();
1210
  // }
1211
  // }
1212
  // }
1213
  });
1214
  jQuery('.showupdatemetalink').click(function() {
1215
  jQuery('form').submit();
1216
  });
1217
  if (jQuery(this).hasClass('disabledLink')=== true) {
1218
  }
1219
  else {
1220
  jQuery('.cftabs').hide();
1221
  jQuery('.cftablink').removeClass('active');
1222
  jQuery(this).addClass('active');
1223
  var tab = jQuery(this).attr('data-tab');
1224
  jQuery('#'+tab).show();
1225
  }
1226
  str = str.replace(/^\s+|\s+$/g, ''); // trim
1227
  str = str.toLowerCase();
1228
  // remove accents, swap ñ for n, etc
1229
  var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
1230
  var to = "aaaaeeeeiiiioooouuuunc------";
1231
  for (var i=0, l=from.length ; i<l ; i++) {
1232
  str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
1233
  }
1234
  str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
1235
  .replace(/\s+/g, '-') // collapse whitespace and replace by -
1236
  .replace(/-+/g, '-'); // collapse dashes
1237
  return str;
1238
  {
1239
  var myStr = jQuery(this).val()
1240
  myStr=myStr.toLowerCase();
1241
  myStr=myStr.replace(/\s/g , "-");
1242
  jQuery('#cf_slug').val(myStr);
1243
  slug = jQuery(this).val();
1244
  customSlug = slug;
1245
  customSlug = string_to_slug(customSlug);
1246
  jQuery(this).val(customSlug);
1247
  jQuery('.customSlugText').text(customSlug);
1248
  newurl = jQuery('#cfslugurl').text();
1249
  jQuery('#cfslugurl').attr('href', newurl);
1250
  jQuery('#cf_page_url').val('<?php echo get_home_url(); ?>/'+myStr);
1251
  jQuery('#customurlError').hide();
1252
  jQuery('#customurlError_duplicate').hide();
1253
  jQuery('#publish').removeClass('disabledLink');
1254
  jQuery('.used_slug').each(function () {
1255
  if (jQuery(this).html() == customSlug) {
1256
  jQuery('#customurlError_duplicate').fadeIn();
1257
  jQuery('#publish').addClass('disabledLink');
1258
  }
1259
  });
1260
  if ('' == customSlug) {
1261
  jQuery('#customurlError').fadeIn();
1262
  jQuery('#publish').addClass('disabledLink');
1263
  }
1264
  });
1265
  if (jQuery(this).val() == 'clickgate') {
1266
  jQuery('.cf_url').hide();
1267
  jQuery('.clickgateinfo').show();
1268
  jQuery('#publish').removeClass('disabledLink');
1269
  }
1270
  else if (jQuery(this).val() == 'hp') {
1271
  jQuery('.cf_url').hide();
1272
  jQuery('#publish').removeClass('disabledLink');
1273
  }
1274
  else if (jQuery(this).val() == 'np') {
1275
  jQuery('.cf_url').hide();
1276
  jQuery('#publish').removeClass('disabledLink');
1277
  }
1278
  else {
1279
  jQuery('.cf_url').show();
1280
  jQuery('.clickgateinfo').hide();
1281
  jQuery('#cf_slug').trigger('keyup');
1282
  }
1283
  });
1284
  <?php
1285
  // check all CF page slugs
1286
  $posts = get_posts(array(
1287
  'post_type' => 'clickfunnels',
1288
  'post_status' => 'publish',
1289
  'fields' => 'ids'
1290
  )
1291
  );
1292
  foreach($posts as $p){
1293
  $slug = get_post_meta($p,"cf_slug",true);
1294
  if ($slug != $cf_slug) {
1295
  echo "<li class='used_slug'>$slug</li>";
1296
  }
1297
  }
1298
  foreach( get_posts('numberposts=-1') as $post ) {
1299
  echo "<li class='used_slug'>$post->post_name</li>";
1300
  }
1301
  foreach( get_pages('numberposts=-1') as $post ) {
1302
  echo "<li class='used_slug'>$post->post_name</li>";
1303
  }
1304
  ?>
1305
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
1306
  <?php $hideforUpdateMeta = 'display: none !important'; ?>
1307
  <style>.bootstrap-wp, .copyrightInfo {display: none; }</style>
1308
  <span style="margin: 10px;" class="compatCheck compatwarning">Updating Your Meta Data... <strong><i class="fa fa-spinner fa-spin"></i> Please wait just a moment.</strong></span>
1309
  <input type="hidden" name="meta_redirect" value='yes'>
1310
  <?php } else { ?>
1311
  <h2>
1312
  <?php
1313
  if ( !empty( $_GET['action'] ) && $cf_funnels ) {
1314
  $blankpage = 'no';
1315
  foreach ( $cf_funnels as $key=>$funnel ) {
1316
  if ( $cf_thefunnel == $funnel->id ) {
1317
  $lengthofheadline = 40;
1318
  if ( $cf_type=='hp' || $cf_type=='np' || $cf_type=='clickgate' ) { $lengthofheadline = 19; }
1319
  if (strlen($thepage[6]) > $lengthofheadline) {
1320
  echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...';
1321
  $check = '1';
1322
  }
1323
  else {
1324
  if(strlen($thepage[6]) > $lengthofheadline) { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.trim(substr($thepage[6],0,$lengthofheadline)).' ...'; }
1325
  else { echo '<i class="fa fa-edit" style="margin-right: 5px"></i> '.$thepage[6];}
1326
  $check = '1';
1327
  }
1328
  }
1329
  else {
1330
  $blankpage = 'yes';
1331
  }
1332
  }
1333
  $cf_options = get_option( "cf_options" );
1334
  $homeCheck = $cf_options['home'];
1335
  $postid = get_the_ID();
1336
  if ($cf_page == '' && $cf_type == '' && $blankpage = 'yes' && $homeCheck['post_id'] != $postid && $cf_thepage != '') {
1337
  echo 'Requires Custom URL';
1338
  }
1339
  } else {
1340
  echo '<i class="fa fa-plus-square" style="margin-right: 5px"></i> Add New Page';
1341
  }
1342
  ?>
1343
  <?php if ($cf_type == 'clickgate') { ?>
1344
  ClickGate Popup
1345
  <?php } ?> -->
1346
  </h2>
1347
  <?php if ( !empty( $_GET['action'] ) ) { ?>
1348
  <a style="margin-right: 0;margin-top: -33px;" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>" target="_blank" class="editThisPage"><i class="fa fa-edit"></i> EDITOR</a>
1349
  <a style="margin-right: 10px;margin-top: -33px;" href="https://www.clickfunnels.com/funnels/<?php echo $thepage[0]; ?>#<?php echo $thepage[3]; ?>" target="_blank" class="editThisPage"><i class="fa fa-filter"></i> FUNNEL</a>
1350
  <a style="margin-right: 10px;margin-top: -33px;" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" title="View Page" target="_blank" class="editThisPage"><i class="fa fa-search"></i> PREVIEW</a>
1351
  <?php if ( $cf_type=='p' ) {?>
1352
  <?php }?>
1353
  <?php if ( $cf_type=='hp' ) {?>
1354
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-home"></i> Set as Home Page</span>
1355
  <?php }?>
1356
  <?php if ( $cf_type=='np' ) {?>
1357
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-exclamation-triangle"></i> Set as 404 Page</span>
1358
  <?php }?>
1359
  <?php if ( $cf_type=='clickgate' ) {?>
1360
  <span style="margin-right: 10px;margin-top: -33px;" class="editThisPage2"><i class="fa fa-external-link"></i> Set as ClickGate</span>
1361
  <?php }?>
1362
  <?php }?>
1363
  <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>
1364
  <?php if ( !empty( $_GET['updatemeta'] ) ) { ?>
1365
  <input type="hidden" name="meta_redirect" value='yes'>
1366
  <?php } ?>
1367
  <input type="hidden" name="post_title" size="30" tabindex="1" value="ClickFunnels Page" id="title" autocomplete="off" />
1368
  <input type="hidden" name="post_status" size="30" tabindex="1" value="publish" id="title" autocomplete="off" />
1369
  <div class="bootstrap-wp"><?php wp_nonce_field( "save_clickfunnel", "clickfunnel_nonce" ); ?>
1370
  <div id="app_sidebar">
1371
  <a href="#" data-tab="tab1" class="cftablink selectapagelink active">Select Page</a>
1372
  <a href="#" data-tab="tab2" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Meta Data</a>
1373
  <a href="#" data-tab="tab4" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Open Graph</a>
1374
  <a href="#" data-tab="tab6" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Tracking Code</a>
1375
  <a href="#" data-tab="tab3" class="cftablink <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>">Settings</a>
1376
  </div>
1377
  <div id="app_main" class="col-sm-7 row-fluid form-horizontal">
1378
  <div id="tab6" class="cftabs" style="display: none">
1379
  <!-- Tracking Code -->
1380
  <h2>Tracking Code</h2>
1381
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel.</em></p>
1382
  <hr style="margin-left: 51px">
1383
  <div class="control-group" >
1384
  <label class="control-label" for="cf_iframe_check"> WordPress Only Tracking Code </label>
1385
  <div class="controls">
1386
  <textarea class="input-xlarge wpfooterTracking" id="wpfooterTracking" style="height: 80px;" name="cf_wptracking_code"><?php echo $cf_wptracking_code; ?></textarea>
1387
  </div>
1388
  </div>
1389
  <hr style="margin-left: 51px">
1390
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> You can add your own custom tracking code for only this WordPress page, meaning your original page will not have this tracking code.</em></p>
1391
  <hr style="margin-left: 51px">
1392
  <div class="control-group" >
1393
  <label class="control-label" for="cf_iframe_check"> Header Tracking </label>
1394
  <div class="controls">
1395
  <textarea class="input-xlarge headTracking" id="headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
1396
  </div>
1397
  </div>
1398
  <div class="control-group" >
1399
  <label class="control-label" for="cf_iframe_check"> Footer Tracking </label>
1400
  <div class="controls">
1401
  <textarea class="input-xlarge footerTracking" id="footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
1402
  </div>
1403
  </div>
1404
  <hr style="margin-left: 51px">
1405
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Funnel wide tracking is set inside the Funnel Settings in the ClickFunnels app.</em></p>
1406
  <hr style="margin-left: 51px">
1407
  <div class="control-group" >
1408
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Header Tracking </label>
1409
  <div class="controls">
1410
  <textarea class="input-xlarge fw_headTracking" id="fw_headTracking" readonly="readonly"style="height: 80px;" name="cf_head_tracking"><?php echo $cf_head_tracking; ?></textarea>
1411
  </div>
1412
  </div>
1413
  <div class="control-group" >
1414
  <label class="control-label" for="cf_iframe_check"> Funnel Wide Footer Tracking </label>
1415
  <div class="controls">
1416
  <textarea class="input-xlarge fw_footerTracking" id="fw_footerTracking" readonly="readonly"style="height: 80px;" name="cf_footer_tracking"><?php echo $cf_footer_tracking; ?></textarea>
1417
  </div>
1418
  </div>
1419
  </div>
1420
  <div id="tab1" class="cftabs">
1421
  <!-- Select a Page / Funnel -->
1422
  <h2>Select a Page</h2>
1423
  <div class="control-group cf_uses_api clearfix" style="">
1424
  <label class="control-label" for="cf_thefunnel"> Choose Funnel </label>
1425
  <div class="controls">
1426
  <select class="input-xlarge" id="cf_thefunnel" name="cf_thefunnel_backup">
1427
  <?php if ( empty( $cf_funnels ) ) { ?>
1428
  <option value="0">No Funnels Found</option>
1429
  <?php }
1430
  else {
1431
  // Agency Gate Check
1432
  $agency_group_tag = get_option('clickfunnels_agency_group_tag');
1433
  foreach ( $cf_funnels as $key=>$funnel ) {
1434
  if ($agency_group_tag != 'off') {
1435
  if ($funnel->group_tag || $funnel->group_tag != '') {
1436
  $group_tag = str_replace("'", '{replace}', $funnel->group_tag);
1437
  $group_tag = str_replace("\"", '{replace}', $funnel->group_tag);
1438
  if ($agency_group_tag == $group_tag) { ?>
1439
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1440
  <?php }
1441
  } else {
1442
  if ($agency_group_tag == 'ungrouped') { ?>
1443
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1444
  <?php }
1445
  }
1446
  }
1447
  else { ?>
1448
  <option value="<?php echo $funnel->id;?>{#}<?php echo htmlentities($funnel->head_tracking_code, ENT_QUOTES);?>{#}<?php echo htmlentities($funnel->body_tracking_code, ENT_QUOTES);?>" <?php if ( $cf_thefunnel == $funnel->id ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1449
  <?php }
1450
  }
1451
  } ?>
1452
  </select>
1453
  </div>
1454
  </div>
1455
  <div class="control-group choosePageBox clearfix" style="<?php if ( empty( $_GET['action'] ) ) { echo "display: none"; } ?>">
1456
  <label class="control-label" for="cf_thepage">
1457
  Choose Page <span id="loading"><i class="fa fa-spinner"></i> <em style="margin-left: 5px;font-size: 11px;">Loading Pages...</em></span>
1458
  <div id="runningSplitTests" style="font-size: 11px;opacity: .8;float: right;padding-top: 5px;color: #555;margin-right: 26px;display: none;clear: both">
1459
  <!-- Number of Split Tests -->
1460
  </div>
1461
  </label>
1462
  <div class="controls">
1463
  <select class="input-xlarge" id="cf_thepage" name="cf_thepage" style="float: left;">
1464
  <?php if ( empty( $cf_funnels_pages ) ) { ?>
1465
  <option value="0">No Pages Found</option>
1466
  <?php }
1467
  else {
1468
  foreach ( $cf_funnels_pages->funnel_steps as $key => $funnel ) { ?>
1469
  <option value="<?php echo $funnel->position;?>" <?php if ( $cf_thepage == $funnel->position ) { echo "selected"; } ?>><?php echo $funnel->name;?></option>
1470
  <?php
1471
  }
1472
  }
1473
  ?>
1474
  </select>
1475
  </div>
1476
  <div id="noPageWarning" style="font-size: 11px; margin-left: 28px; margin-top: -13px;float: left;padding-top: 14px;display: none;width: 100%; clear: both">
1477
  <strong style="font-size: 13px;display: block;">No compatible pages found. </strong>
1478
  <em style="display: block">Membership pages and order pages are not available through plugin.</em>
1479
  </div>
1480
  <br clear="all">
1481
  </div>
1482
  <?php if ( $cf_type!="p" && $check == '1') $display ="display:none"; else $display="";?>
1483
  <?php if ( $cf_type == '') $display ="display:block"; ?>
1484
  <div class="cf_url control-group clearfix" style="<?php echo $display;?>" >
1485
  <label class="control-label" for="cf_slug"> Custom Slug</label>
1486
  <div id="cf-wp-path" class="controls ">
1487
  <input style="padding:10px;"type="text" value="<?php if ( isset( $cf_slug ) ) echo $cf_slug;?>" placeholder="your-path-here" name="cf_slug" id="cf_slug" class="input-xlarge">
1488
  <?php if ( $cf_type == '' ) $display ="display:block;"; else $display="";?>
1489
  <div id="customurlError" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
1490
  Add a path before saving.
1491
  </div>
1492
  <div id="customurlError_duplicate" style="display: none; <?php echo $display; ?> color: #E54F3F; font-weight: bold;margin-top: 4px;">
1493
  Slug already taken
1494
  </div>
1495
  </div>
1496
  <p class="infoHelp" style="padding-left: 25px;margin-top: 13px;"><span><i class="fa fa-globe" style="margin-right: 3px"></i>
1497
  <?php if ( !empty( $_GET['action'] ) ) { ?>
1498
  <a style="font-weight: bold;text-decoration: none; padding-bottom: 3px;" id="cfslugurl" href="<?php echo get_home_url() ; ?>/<?php echo $cf_slug; ?>" target="_blank"><?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></a>
1499
  <?php } else { ?>
1500
  <span style="font-weight: bold;text-decoration: none; padding-bottom: 3px;"> <?php echo get_home_url() ; ?>/<span class="customSlugText"><?php echo $cf_slug; ?></span></span>
1501
  <?php } ?>
1502
  </span></p>
1503
  <input type="text" style="display: none" class="input-xlarge" style="height: 30px;" value="<?php echo $cf_page_url; ?>" name="cf_page_url" id="cf_page_url" />
1504
  </div>
1505
  </div>
1506
  <div id="tab2" class="cftabs" style="display: none">
1507
  <!-- Meta Data -->
1508
  <h2>Meta Data</h2>
1509
  <div id="metaPreview">
1510
  <h5>PREVIEW</h5>
1511
  <img src="<?php echo $cf_favicon; ?>" id="faviconPreview" style="width: 18px;margin-left: 10px;margin-bottom: 5px;float: left;" />
1512
  <strong>FAVICON</strong>
1513
  <h3><?php echo $cf_seo_title; ?></h3>
1514
  <span><?php echo get_home_url() ; ?>/<em style="font-style: normal" class="customSlugText"><?php echo $cf_slug; ?></em></span>
1515
  <p><?php echo $cf_seo_desc; ?></p>
1516
  </div>
1517
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
1518
  <hr style="margin-left: 51px">
1519
  <div class="control-group" >
1520
  <label class="control-label" for="cf_iframe_check"> Website Title </label>
1521
  <div class="controls">
1522
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" name="cf_seo_title" />
1523
  </div>
1524
  </div>
1525
  <div class="control-group" >
1526
  <label class="control-label" for="cf_iframe_check"> Description </label>
1527
  <div class="controls">
1528
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
1529
  </div>
1530
  </div>
1531
  <div class="control-group" >
1532
  <label class="control-label" for="cf_iframe_check"> Keywords </label>
1533
  <div class="controls">
1534
  <input type="text" class="input-xlarge" id="seoKeywords" readonly="readonly"style="height: 30px;" value="<?php echo $cf_keywords; ?>" name="cf_keywords" />
1535
  </div>
1536
  </div>
1537
  <div class="control-group" >
1538
  <label class="control-label" for="cf_iframe_check"> Favicon </label>
1539
  <div class="controls">
1540
  <input type="text" class="input-xlarge" readonly="readonly"id="cf_favicon" style="height: 30px;" value="<?php echo $cf_favicon; ?>" name="cf_favicon" />
1541
  </div>
1542
  </div>
1543
  <div class="control-group" >
1544
  <label class="control-label" for="cf_favicon_choice"> Choose Favicon to Show </label>
1545
  <div class="controls">
1546
  <select name="cf_favicon_choice" id="cf_favicon_choice" class="cf_favicon_choice" style="width: 100% !important">
1547
  <option value="" <?php if($cf_favicon_choice == ''){ echo 'selected'; } ?>>Show ClickFunnels Page Favicon</option>
1548
  <option value="default"<?php if($cf_favicon_choice == 'default'){ echo 'selected'; } ?>>Show Default WordPress Favicon</option>
1549
  </select>
1550
  </div>
1551
  </div>
1552
  </div>
1553
  <div id="tab3" class="cftabs" style="display: none">
1554
  <!-- Page Settings -->
1555
  <h2>Page Settings</h2>
1556
  <div class="innerTab">
1557
  <div class="control-group ">
1558
  <label class="control-label" for="cf_type"> Choose Page Type</label>
1559
  <select name="cf_type" id="cf_type" class="cf_header" style="width: 100% !important">
1560
  <option value="p" <?php if($cf_type == 'p'){ echo 'selected'; } ?>>Regular Page</option>
1561
  <option value="hp"<?php if($cf_type == 'hp'){ echo 'selected'; } ?>>Set as Home Page</option>
1562
  <option value="np"<?php if($cf_type == 'np'){ echo 'selected'; } ?>>Set as 404 Page</option>
1563
  <option value="clickgate"<?php if($cf_type == 'clickgate'){ echo 'selected'; } ?>>Set as ClickGate</option>
1564
  </select>
1565
  </div>
1566
  </div>
1567
  <?php if ( $cf_type == 'clickgate') $display ="display:block;"; else $display="";?>
1568
  <p class="infoHelp clickgateinfo" style="color: #8A6D3B;display: none; <?php echo $display; ?>"><i class="fa fa-star" style="margin-right: 3px"></i> <strong>ClickGate will show this page at the top of any page or post that your visitors land on and will cookie them to show only page only once.</strong></em></p>
1569
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> Choose to make this a regular page with a path (custom URL) or show this page as the Home Page for your blog. You can also set this page as a 404 page for any old, mispelled or deleted paths. <em>(only one page can be set as a Home, 404 or ClickGate at a time)</em></p>
1570
  <hr style="margin-left: 51px">
1571
  <div class="control-group cf_uses_api" >
1572
  <label class="control-label" for="cf_iframe_check"> Show Page Inside of Iframe</label>
1573
  <div class="controls">
1574
  <select class="input-xlarge" id="cf_iframe_check" name="cf_iframe_check" style="float: left;">
1575
  <option value="off">No, show page using ClickFunnels API.</option>
1576
  <option value="on" <?php if( $cf_iframe_check == 'on') { ?>selected <?php } ?>>Yes, show page using an iframe.</option>
1577
  </select>
1578
  </div>
1579
  </div>
1580
  <br style="clear: both">
1581
  <p class="infoHelp" style="margin-top: 15px"><i class="fa fa-question-circle" style="margin-right: 3px"></i> If you have custom code on your page that is not working, choose to show your page inside an iframe to fix any custom code issues. If your page is showing up blank use the iframe option and submit a support ticket.</p>
1582
  <hr style="margin-left: 51px">
1583
  <div class="control-group" style="display: block">
1584
  <label class="control-label" for="cf_iframe_check"> ClickFunnels Page URL <small>(reference only)</small></label>
1585
  <div class="controls">
1586
  <input type="text" class="input-xlarge" id="iframeURL" readonly="readonly"style="height: 30px;" value="<?php echo $cf_iframe_url; ?>" name="cf_iframe_url" />
1587
  </div>
1588
  </div>
1589
  </div>
1590
  <div id="tab4" class="cftabs" style="display: none">
1591
  <!-- Extra Settings -->
1592
  <h2>Open Graph</h2>
1593
  <div id="opengraphPreview">
1594
  <h5>PREVIEW</h5>
1595
  <img style="<?php if ($cf_seo_image == '') { echo 'display: none;'; } ?>" src="<?php echo $cf_seo_image; ?>" id="seosocialimage">
1596
  <h3><?php echo $cf_seo_title; ?></h3>
1597
  <p><?php echo $cf_seo_desc; ?></p>
1598
  <span><?php echo get_home_url() ; ?> <em id="theAuthor"><?php echo '| '.$cf_author; ?></em></span>
1599
  </div>
1600
  <p class="infoHelp"><i class="fa fa-question-circle" style="margin-right: 3px"></i> To edit your meta data settings <a target="_blank" href="https://www.clickfunnels.com/pages/<?php echo $thepage[2]; ?>">click to open this page inside the editor</a> and edit meta data inside the settings panel. To update this page with new changes, re-save this page to keep your meta data up-to-date.</em></p>
1601
  <hr style="margin-left: 51px">
1602
  <div class="control-group" >
1603
  <label class="control-label" for="cf_iframe_check"> Title </label>
1604
  <div class="controls">
1605
  <input type="text" class="input-xlarge seoTitle" id="seoTitle" readonly="readonly"style="height: 30px;" value="<?php echo $cf_seo_title; ?>" />
1606
  </div>
1607
  </div>
1608
  <div class="control-group" >
1609
  <label class="control-label" for="cf_iframe_check"> Description </label>
1610
  <div class="controls">
1611
  <textarea class="input-xlarge seoDesc" id="seoDesc" readonly="readonly"style="height: 80px;" name="cf_seo_desc"><?php echo $cf_seo_desc; ?></textarea>
1612
  </div>
1613
  </div>
1614
  <div class="control-group" >
1615
  <label class="control-label" for="cf_iframe_check"> Author </label>
1616
  <div class="controls">
1617
  <input type="text" class="input-xlarge" id="seoAuthor" readonly="readonly"style="height: 30px;" value="<?php echo $cf_author; ?>" name="cf_author" />
1618
  </div>
1619
  </div>
1620
  <div class="control-group" >
1621
  <label class="control-label" for="cf_iframe_check"> Social Image URL </label>
1622
  <div class="controls">
1623
  <input type="text" class="input-xlarge" id="seosocial" readonly="readonly" style=" height: 30px;" value="<?php echo $cf_seo_image; ?>" name="cf_seo_image" />
1624
  </div>
1625
  </div>
1626
  </div>
1627
  <div id="savePage">
1628
  <div style="width: 100%">
1629
  <?php if ( get_option( 'clickfunnels_api_email' ) == "" || get_option( 'clickfunnels_api_auth' ) == "" ) { ?>
1630
  <?php } else { ?>
1631
  <input type="submit" name="publish" id="publish" value="Save Page" class="action-button shadow animate green <?php if ( empty( $_GET['action'] ) ) { echo 'disabledLink'; } ?>" style="float: right; ">
1632
  <?php } ?>
1633
  <div id="saving" style="float: right;display: none; padding-right: 10px;opacity: .6;padding-top: 9px;margin-right: 4px;font-size: 15px;">
1634
  <i class="fa fa-spinner fa-spin"></i>
1635
  <span>Saving...</span>
1636
  </div>
1637
  </div>
1638
  </div>
1639
  <style>
1640
  #hiddenStuff {display: none}
1641
  </style>
1642
  <div class="control-group" id="hiddenStuff" <?php if ( !empty( $_GET['cf'] ) ) { ?>style="display: block;clear: both;" <?php } ?>>
1643
  <style>
1644
  #hiddenStuff input {
1645
  display:block;margin-top: 5px;margin-bottom: 5px;font-weight: normal;width: 100%;
1646
  }
1647
  </style>
1648
  <div class="controls">
1649
  <br>
1650
  <h3>Dev Checks:</h3>
1651
  <hr />
1652
  <strong>Funnel ID: <input id="checkFunID" type="text" value="<?php echo $thepage[0]; ?>" /></strong>
1653
  <strong>Page Key: <input type="text" value="<?php echo $thepage[1]; ?>" /></strong>
1654
  <strong>Page ID: <input type="text" value="<?php echo $thepage[2]; ?>" /></strong>
1655
  <strong>Funnel Step ID: <input type="text" value="<?php echo $thepage[3]; ?>" /></strong>
1656
  <strong>Saved Meta: <input type="text" id="oldmeta" value="<?php echo $thepage[4]; ?>" /></strong>
1657
  <strong>JS Meta: <input type="text" id="jsmeta" value="" /></strong>
1658
  <strong>Post ID: <input type="text" value="<?php echo $thepage[5]; ?>" /></strong>
1659
  <strong>Page Name: <input type="text" value="<?php echo $thepage[6]; ?>" /></strong>
1660
  <strong>Use iframe?: <input type="text" value="<?php echo $cf_iframe_check; ?>" /></strong>
1661
  <strong>Iframe URL: <input type="text" value="<?php echo $cf_iframe_url; ?>" /></strong>
1662
  <textarea name="cf_thefunnel" id="cf_data" style="display:block;margin-top: 5px;margin-bottom: 10px;width: 100%;height: 300px; font-size: 13px;"><?php echo $savedData; ?></textarea>
1663
  </div>
1664
  </div>
1665
  </div>
1666
  </div>
admin_testing.php DELETED
@@ -1,84 +0,0 @@
1
-
2
- <script>
3
- (function($) {
4
- setTimeout(function() {
5
- $('#errorMessage').fadeOut();
6
- }, 1500);
7
- var specificFunnel = 'https://api.clickfunnels.com/funnels.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
8
- $.getJSON(specificFunnel, function(data) {
9
- $('.checkSuccess').html('<i class="fa fa-check successGreen"></i>');
10
- $('.checkSuccessDev').html('<i class="fa fa-check"> Connected</i>');
11
-
12
- }).fail(function(jqXHR) {
13
- $('.checkSuccess').html('<i class="fa fa-times errorRed"></i>');
14
- $('.checkSuccessDev').html('<i class="fa fa-times"> Not Connected</i>');
15
- $('.badAPI').show();
16
- });
17
- $('#showDataTesting').click(function() {
18
- $('#devShowTesting').toggle();
19
- });
20
- })(jQuery);
21
- </script>
22
- <style>
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;
29
- margin:30px 10px;
30
- float: left;
31
- margin-left: 195px;
32
- width: 340px;
33
- }
34
- #checkPHPStuff span {
35
- display: block;
36
- line-height: 1.6em;
37
- padding: 4px 0;
38
- border-bottom: 1px solid rgba(255, 255, 255, .3);
39
- }
40
- #checkPHPStuff span strong {
41
- float: right;
42
- }
43
- #checkPHPStuff span strong i.fa-check {
44
- font-weight: bold;
45
- color: #8FC742;
46
- }
47
- #checkPHPStuff span strong i.fa-times {
48
- font-weight: bold;
49
- color: #E34E3D;
50
- }
51
- #checkPHPStuff span:last-child {
52
- border-bottom: none;
53
- }
54
-
55
-
56
-
57
- #checkJSONStuff h3, #checkPHPStuff h3 {
58
- color: #D3D3C9;
59
- margin: 10px 0;
60
- font-weight: 200;
61
- opacity: .5;
62
- }
63
-
64
- #adminTesting h2 {
65
- text-align: center;
66
- margin: 10px 0;
67
- margin-bottom: 0;
68
- width: 760px;
69
- }
70
- </style>
71
- <div id="devShowTesting" style="display: none">
72
- <br clear="both"><br>
73
- <div id="adminTesting">
74
- <h2><i class="fa fa-dashboard"></i> Developer Testing Check PHP and JSON</h2>
75
- </div>
76
- <div id="checkPHPStuff" >
77
- <h3>Test PHP Server Details</h3>
78
- <span>CURL: <strong><?php echo function_exists('curl_version') ? '<i class="fa fa-check"> Enabled</i>' : '<i class="fa fa-times">Disabled</i>' ?></strong></span>
79
- <span>File Get Contents: <strong><?php echo file_get_contents(__FILE__) ? '<i class="fa fa-check"> Enabled</i>' : '<i class="fa fa-times">Disabled</i>' ; ?> </strong></span>
80
- <span>Allow URL fopen: <strong><?php echo ini_get('allow_url_fopen') ? '<i class="fa fa-check"> Enabled</i>' : '<i class="fa fa-times">Disabled</i>' ; ?> </strong></span>
81
- <span>PHP Version: <strong><?php echo PHP_VERSION; ?> </strong></span>
82
- <span>API Authorization Connection: <strong class='checkSuccessDev'></strong></span>
83
- </div>
84
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf-template.php DELETED
@@ -1,14 +0,0 @@
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
@@ -3,7 +3,7 @@
3
  * Plugin Name: ClickFunnels
4
  * Plugin URI: https://www.clickfunnels.com
5
  * Description: Connect to your ClickFunnels account with simple authorization key and show any ClickFunnels page as your homepage or as 404 error pages or simply choose any of your pages and make clean URLs to your ClickFunnels pages. Don't have an account? <a target="_blank" href="https://www.clickfunnels.com">Sign up for your 2 week <em>free</em> trial now.</a>
6
- * Version: 2.0.1
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
@@ -55,10 +55,10 @@ class ClickFunnels {
55
  if ( $this->is_404( $post_id ) ) {
56
  $this->set_404( "", "" );
57
  }
58
- if ( $this->is_home( $post_id ) ) {
59
  $this->set_home( "", "" );
60
  }
61
- if ( $this->is_clickgate( $post_id ) ) {
62
  $this->set_clickgate( "", "" );
63
  }
64
  }
@@ -262,6 +262,7 @@ class ClickFunnels {
262
  }
263
  }
264
  }
 
265
  private function get_url( $post_id ) {
266
  $cf_type = get_post_meta( $post_id, 'cf_type', true );
267
  $cf_slug= get_post_meta( $post_id, 'cf_slug', true );
@@ -655,6 +656,72 @@ function cf_api_settings_page() {
655
  function clickfunnels_shortcodes() {
656
  include 'post_shortcode.php';
657
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  function clickfunnels_loadjquery($hook) {
659
  if( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' ) {
660
  return;
@@ -713,7 +780,6 @@ add_shortcode( 'clickfunnels_embed', 'clickfunnels_embed' );
713
  // ClickPop Shortcode
714
  function clickfunnels_clickpop_script() {
715
  wp_register_script( 'cf_clickpop', 'https://app.clickfunnels.com/assets/cfpop.js', array(), '1.0.0', true );
716
- // wp_register_script( 'cf_clickpop', 'http://localhost:8080/wordpress/test_cfpop.js', array(), '1.0.0', true );
717
  wp_enqueue_script( 'cf_clickpop' );
718
  }
719
  add_action( 'wp_enqueue_scripts', 'clickfunnels_clickpop_script' );
@@ -731,7 +797,13 @@ function clickfunnels_clickpop( $atts, $content = null ) {
731
  $delayTime = '';
732
  $delay_js = "";
733
  }
734
- return "<a href='https://{$a['subdomain']}.clickfunnels.com/optin_box/{$a['id']}' data-exit='{$a['exit']}'>$content</a>$delay_js";
 
 
 
 
 
 
735
  }
736
  add_shortcode( 'clickfunnels_clickpop', 'clickfunnels_clickpop' );
737
 
@@ -768,6 +840,15 @@ function clickfunnels_clickoptin( $atts ) {
768
  } else {
769
  $placeholder = $a['placeholder'];
770
  }
 
 
 
 
 
 
 
 
 
771
  return "<div id='clickoptin_cf_wrapper_".$a['id']."' class='clickoptin_".$a['theme_style']."'>
772
  <input type='text' id='clickoptin_cf_email_".$a['id']."' placeholder='".$placeholder."' class='clickoptin_".$a['input_icon']."' />
773
  <span class='clickoptin_".$a['button_color']."' id='clickoptin_cf_button_".$a['id']."'>".$button_text."</span>
@@ -785,10 +866,10 @@ function clickfunnels_clickoptin( $atts ) {
785
  if (check_email != '' && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(check_email)) {
786
  jQueries( '#clickoptin_cf_email_".$a['id']."' ).addClass('clickoptin_cf_email_green');
787
  if('".$a['redirect']."' == 'newtab') {
788
- window.open('https://".$a['subdomain'].".clickfunnels.com/instant_optin/".$a['id']."/'+jQueries( '#clickoptin_cf_email_".$a['id']."' ).val(), '_blank');
789
  }
790
  else {
791
- window.location.href = 'https://".$a['subdomain'].".clickfunnels.com/instant_optin/".$a['id']."/'+jQueries( '#clickoptin_cf_email_".$a['id']."' ).val();
792
  }
793
  }
794
  else {
@@ -809,10 +890,10 @@ function clickfunnels_clickoptin( $atts ) {
809
  if (check_email != '' && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(check_email)) {
810
  $( '#clickoptin_cf_email_".$a['id']."' ).addClass('clickoptin_cf_email_green');
811
  if('".$a['redirect']."' == 'newtab') {
812
- window.open('https://".$a['subdomain'].".clickfunnels.com/instant_optin/".$a['id']."/'+$( '#clickoptin_cf_email_".$a['id']."' ).val(), '_blank');
813
  }
814
  else {
815
- window.location.href = 'https://".$a['subdomain'].".clickfunnels.com/instant_optin/".$a['id']."/'+$( '#clickoptin_cf_email_".$a['id']."' ).val();
816
  }
817
  }
818
  else {
@@ -956,6 +1037,9 @@ class clickfunnels_widget extends WP_Widget {
956
  return $instance;
957
  }
958
  }
 
 
 
959
  function clickfunnels_widget_load() {
960
  register_widget( 'clickfunnels_widget' );
961
  }
3
  * Plugin Name: ClickFunnels
4
  * Plugin URI: https://www.clickfunnels.com
5
  * Description: Connect to your ClickFunnels account with simple authorization key and show any ClickFunnels page as your homepage or as 404 error pages or simply choose any of your pages and make clean URLs to your ClickFunnels pages. Don't have an account? <a target="_blank" href="https://www.clickfunnels.com">Sign up for your 2 week <em>free</em> trial now.</a>
6
+ * Version: 2.0.2
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
55
  if ( $this->is_404( $post_id ) ) {
56
  $this->set_404( "", "" );
57
  }
58
+ else if ( $this->is_home( $post_id ) ) {
59
  $this->set_home( "", "" );
60
  }
61
+ else if ( $this->is_clickgate( $post_id ) ) {
62
  $this->set_clickgate( "", "" );
63
  }
64
  }
262
  }
263
  }
264
  }
265
+
266
  private function get_url( $post_id ) {
267
  $cf_type = get_post_meta( $post_id, 'cf_type', true );
268
  $cf_slug= get_post_meta( $post_id, 'cf_slug', true );
656
  function clickfunnels_shortcodes() {
657
  include 'post_shortcode.php';
658
  }
659
+
660
+ function cf_get_file_contents ($url) {
661
+ if(function_exists('file_get_contents')){
662
+ $url_get_contents_data = file_get_contents($url);
663
+ }
664
+ elseif (function_exists('curl_exec')){
665
+ $conn = curl_init($url);
666
+ curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, true);
667
+ curl_setopt($conn, CURLOPT_FRESH_CONNECT, true);
668
+ curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);
669
+ $url_get_contents_data = (curl_exec($conn));
670
+ curl_close($conn);
671
+ }elseif(function_exists('fopen') && function_exists('stream_get_contents')){
672
+ $handle = fopen ($url, "r");
673
+ $url_get_contents_data = stream_get_contents($handle);
674
+ }else{
675
+ $url_get_contents_data = false;
676
+ }
677
+ return $url_get_contents_data;
678
+ }
679
+
680
+
681
+ function get_file_content($url, $forceCURL = false)
682
+ {
683
+ $internalServerURL = 'http://' . $_SERVER['SERVER_NAME'];
684
+ $internalSecureServerURL = 'https://' . $_SERVER['SERVER_NAME'];
685
+
686
+ $externalURL = strpos('http', $url) === 0 && !(strpos($internalServerURL, $url) === 0 || strpos($internalSecureServerURL, $url) === 0);
687
+
688
+ if($externalURL && !ini_get('allow_url_fopen'))
689
+ {
690
+ return 'ERROR: Reading content from external URLs is not allowed on this server. Please contact your administrator or provider to resolve this issue!';
691
+ }
692
+
693
+ if(!defined('CONTENTMETHOD'))
694
+ {
695
+ $contentMethod = false;
696
+ if(file_get_contents(__FILE__))
697
+ {
698
+ $contentMethod = 'file';
699
+ }
700
+ else if(function_exists('curl_version'))
701
+ {
702
+ $contentMethod = 'curl';
703
+ }
704
+ define('CONTENTMETHOD', $contentMethod);
705
+ }
706
+ if(!CONTENTMETHOD)
707
+ {
708
+ return false;
709
+ }
710
+ $content = '';
711
+ if(CONTENTMETHOD === 'file' && !$forceCURL)
712
+ {
713
+ $content = file_get_contents($url);
714
+ }
715
+ else
716
+ {
717
+ $ch = curl_init();
718
+ curl_setopt($ch, CURLOPT_URL, $url);
719
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
720
+ $content = curl_exec($ch);
721
+ curl_close($ch);
722
+ }
723
+ return $content;
724
+ }
725
  function clickfunnels_loadjquery($hook) {
726
  if( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' ) {
727
  return;
780
  // ClickPop Shortcode
781
  function clickfunnels_clickpop_script() {
782
  wp_register_script( 'cf_clickpop', 'https://app.clickfunnels.com/assets/cfpop.js', array(), '1.0.0', true );
 
783
  wp_enqueue_script( 'cf_clickpop' );
784
  }
785
  add_action( 'wp_enqueue_scripts', 'clickfunnels_clickpop_script' );
797
  $delayTime = '';
798
  $delay_js = "";
799
  }
800
+ if (strpos($a['subdomain'], '.') !== false) {
801
+ return "<a href='https://{$a['subdomain']}/optin_box/{$a['id']}' data-exit='{$a['exit']}'>$content</a>$delay_js";
802
+ }
803
+ else {
804
+ return "<a href='https://{$a['subdomain']}.clickfunnels.com/optin_box/{$a['id']}' data-exit='{$a['exit']}'>$content</a>$delay_js";
805
+ }
806
+
807
  }
808
  add_shortcode( 'clickfunnels_clickpop', 'clickfunnels_clickpop' );
809
 
840
  } else {
841
  $placeholder = $a['placeholder'];
842
  }
843
+
844
+ if (strpos($a['subdomain'], '.') !== false) {
845
+ $subdomain = $a['subdomain'];
846
+ }
847
+ else {
848
+ $subdomain = $a['subdomain'] . '.clickfunnels.com';
849
+ }
850
+
851
+
852
  return "<div id='clickoptin_cf_wrapper_".$a['id']."' class='clickoptin_".$a['theme_style']."'>
853
  <input type='text' id='clickoptin_cf_email_".$a['id']."' placeholder='".$placeholder."' class='clickoptin_".$a['input_icon']."' />
854
  <span class='clickoptin_".$a['button_color']."' id='clickoptin_cf_button_".$a['id']."'>".$button_text."</span>
866
  if (check_email != '' && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(check_email)) {
867
  jQueries( '#clickoptin_cf_email_".$a['id']."' ).addClass('clickoptin_cf_email_green');
868
  if('".$a['redirect']."' == 'newtab') {
869
+ window.open('https://".$subdomain."/instant_optin/".$a['id']."/'+jQueries( '#clickoptin_cf_email_".$a['id']."' ).val(), '_blank');
870
  }
871
  else {
872
+ window.location.href = 'https://".$subdomain."/instant_optin/".$a['id']."/'+jQueries( '#clickoptin_cf_email_".$a['id']."' ).val();
873
  }
874
  }
875
  else {
890
  if (check_email != '' && /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(check_email)) {
891
  $( '#clickoptin_cf_email_".$a['id']."' ).addClass('clickoptin_cf_email_green');
892
  if('".$a['redirect']."' == 'newtab') {
893
+ window.open('https://".$subdomain."/instant_optin/".$a['id']."/'+$( '#clickoptin_cf_email_".$a['id']."' ).val(), '_blank');
894
  }
895
  else {
896
+ window.location.href = 'https://".$subdomain."/instant_optin/".$a['id']."/'+$( '#clickoptin_cf_email_".$a['id']."' ).val();
897
  }
898
  }
899
  else {
1037
  return $instance;
1038
  }
1039
  }
1040
+
1041
+
1042
+
1043
  function clickfunnels_widget_load() {
1044
  register_widget( 'clickfunnels_widget' );
1045
  }
css/admin.css CHANGED
@@ -161,8 +161,8 @@
161
  display: none !important;
162
  }
163
  #loading {
164
-
165
-
166
  display: none;
167
  }
168
  #apiFooter {
@@ -197,7 +197,7 @@
197
  }
198
  body .btn-selected {
199
  background-color: #0166AE !important;
200
-
201
  text-shadow: 1px 1px 0 #034E82 !important;
202
  font-family: Arial !important;
203
  color: #ffffff !important;
@@ -355,7 +355,7 @@ input.input-xlarge {
355
  #app_sidebar {
356
  width: 200px;float: left;
357
  background: #fafafa;
358
-
359
  }
360
  .innerTab {
361
  padding: 0px;
@@ -368,7 +368,7 @@ input.input-xlarge {
368
  padding-left : 0 !important;
369
  }
370
  #publish {
371
-
372
  /*background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811));
373
  background:-moz-linear-gradient(top, #77d42a 5%, #5cb811 100%);
374
  background:-webkit-linear-gradient(top, #77d42a 5%, #5cb811 100%);
@@ -458,7 +458,7 @@ input.input-xlarge {
458
  border-bottom: 2px solid #CAD9E2 !important;
459
  }
460
  #app_main h2 {
461
-
462
  margin: 0;
463
  padding-left: 50px;
464
  padding-bottom: 20px;
@@ -488,7 +488,7 @@ input.input-xlarge {
488
  background:#0166AE;
489
  color: #fff;
490
  text-shadow: none;
491
-
492
  box-shadow: 2px 3px 3px #D5E1E8;
493
  border-left: 4px solid #074E81;
494
  text-decoration: none;
@@ -497,7 +497,7 @@ input.input-xlarge {
497
  #app_sidebar a.cftablink:hover {
498
  background: #fff;
499
  color: #222;
500
-
501
  box-shadow: 2px 3px 3px #D5E1E8;
502
  border-left: 4px solid #0166AE;
503
  text-decoration: none;
@@ -506,7 +506,7 @@ input.input-xlarge {
506
  background: #0166AE;
507
  color: #fff;
508
  text-shadow: none;
509
-
510
  box-shadow: 2px 3px 3px #D5E1E8;
511
  border-left: 4px solid #074E81;
512
  text-decoration: none;
@@ -526,7 +526,7 @@ input.input-xlarge {
526
  #publish.disabledLink {
527
  opacity: .4;
528
  cursor: default;
529
-
530
  }
531
  #app_sidebar .button, #app_sidebar .button-primary {
532
  display: block;
@@ -541,7 +541,7 @@ input.input-xlarge {
541
  font-size: 17px;
542
  padding-bottom: 12px;
543
  width: 490px;
544
-
545
  }
546
  #metaPreview h5 {
547
  text-transform: uppercase;
@@ -591,7 +591,7 @@ input.input-xlarge {
591
  #opengraphPreview h3 {
592
  margin: 0;
593
  padding:0;
594
- display: block;
595
  font-family: Georgia, 'lucida grande',tahoma,verdana,arial,sans-serif;
596
  font-size: 19px;
597
  font-weight: 500;
@@ -608,7 +608,7 @@ input.input-xlarge {
608
  }
609
  #opengraphPreview span {
610
  margin: 0;
611
- display: block;
612
  color: #9DA3AD;
613
  margin-left: 10px;
614
  clear: both;
@@ -654,7 +654,7 @@ input.input-xlarge {
654
  #metaPreview h3 {
655
  margin: 0;
656
  margin-left: 10px;
657
- display: block;
658
  font-weight: normal;
659
  color: #1a0dab;
660
  font-size: 17px;
@@ -666,7 +666,7 @@ input.input-xlarge {
666
  }
667
  #metaPreview span {
668
  margin: 0;
669
- display: block;
670
  color: #006621;
671
  margin: 0;
672
  margin-left: 10px;
@@ -690,7 +690,7 @@ input.input-xlarge {
690
  list-style-type: decimal;
691
  text-align: left;
692
  visibility: visible;
693
- display: block;
694
  }
695
  #savePage {
696
  clear: both;
@@ -716,10 +716,10 @@ input.input-xlarge {
716
  font-size: 14px;
717
  font-weight: 900 !important;
718
  color: #FFF !important;
719
- text-decoration: none;
720
  border: none;
721
  cursor: pointer;
722
-
723
  }
724
 
725
 
161
  display: none !important;
162
  }
163
  #loading {
164
+
165
+
166
  display: none;
167
  }
168
  #apiFooter {
197
  }
198
  body .btn-selected {
199
  background-color: #0166AE !important;
200
+
201
  text-shadow: 1px 1px 0 #034E82 !important;
202
  font-family: Arial !important;
203
  color: #ffffff !important;
355
  #app_sidebar {
356
  width: 200px;float: left;
357
  background: #fafafa;
358
+
359
  }
360
  .innerTab {
361
  padding: 0px;
368
  padding-left : 0 !important;
369
  }
370
  #publish {
371
+
372
  /*background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811));
373
  background:-moz-linear-gradient(top, #77d42a 5%, #5cb811 100%);
374
  background:-webkit-linear-gradient(top, #77d42a 5%, #5cb811 100%);
458
  border-bottom: 2px solid #CAD9E2 !important;
459
  }
460
  #app_main h2 {
461
+
462
  margin: 0;
463
  padding-left: 50px;
464
  padding-bottom: 20px;
488
  background:#0166AE;
489
  color: #fff;
490
  text-shadow: none;
491
+
492
  box-shadow: 2px 3px 3px #D5E1E8;
493
  border-left: 4px solid #074E81;
494
  text-decoration: none;
497
  #app_sidebar a.cftablink:hover {
498
  background: #fff;
499
  color: #222;
500
+
501
  box-shadow: 2px 3px 3px #D5E1E8;
502
  border-left: 4px solid #0166AE;
503
  text-decoration: none;
506
  background: #0166AE;
507
  color: #fff;
508
  text-shadow: none;
509
+
510
  box-shadow: 2px 3px 3px #D5E1E8;
511
  border-left: 4px solid #074E81;
512
  text-decoration: none;
526
  #publish.disabledLink {
527
  opacity: .4;
528
  cursor: default;
529
+
530
  }
531
  #app_sidebar .button, #app_sidebar .button-primary {
532
  display: block;
541
  font-size: 17px;
542
  padding-bottom: 12px;
543
  width: 490px;
544
+
545
  }
546
  #metaPreview h5 {
547
  text-transform: uppercase;
591
  #opengraphPreview h3 {
592
  margin: 0;
593
  padding:0;
594
+ display: block;
595
  font-family: Georgia, 'lucida grande',tahoma,verdana,arial,sans-serif;
596
  font-size: 19px;
597
  font-weight: 500;
608
  }
609
  #opengraphPreview span {
610
  margin: 0;
611
+ display: block;
612
  color: #9DA3AD;
613
  margin-left: 10px;
614
  clear: both;
654
  #metaPreview h3 {
655
  margin: 0;
656
  margin-left: 10px;
657
+ display: block;
658
  font-weight: normal;
659
  color: #1a0dab;
660
  font-size: 17px;
666
  }
667
  #metaPreview span {
668
  margin: 0;
669
+ display: block;
670
  color: #006621;
671
  margin: 0;
672
  margin-left: 10px;
690
  list-style-type: decimal;
691
  text-align: left;
692
  visibility: visible;
693
+ display: block;
694
  }
695
  #savePage {
696
  clear: both;
716
  font-size: 14px;
717
  font-weight: 900 !important;
718
  color: #FFF !important;
719
+ text-decoration: none;
720
  border: none;
721
  cursor: pointer;
722
+
723
  }
724
 
725
 
footer.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="copyrightInfo">
2
- <p><strong style="float: right;font-weight: 600;font-size: 11px;text-align: right;">Running Version 2.0.1</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
1
  <div class="copyrightInfo">
2
+ <p><strong style="float: right;font-weight: 600;font-size: 11px;text-align: right;">Running Version 2.0.2</strong> Copyright 2015+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
geobg.png DELETED
Binary file
js/admin.js DELETED
@@ -1,53 +0,0 @@
1
- jQuery(document).ready(function(){
2
- jQuery('.draft').hide();
3
- jQuery("#cf_type").val(jQuery(".btn.active").data("value"));
4
- jQuery(".cf_header .btn").click(function(){
5
- jQuery(".cf_header .btn").removeClass().addClass('btn');
6
- jQuery(this).addClass("active");
7
- jQuery("#cf_type").val(jQuery(this).data("value"));
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
- {
43
- e.preventDefault();
44
- jQuery("#cf_slug").css("border", "1px solid red");
45
- jQuery("#cf_invalid_slug").show();
46
- }
47
- else
48
- {
49
- jQuery("#cf_slug").css("border", "1px solid #cccccc");
50
- jQuery("#cf_invalid_slug").hide();
51
- }
52
- })
53
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/hidedraft.js DELETED
@@ -1,3 +0,0 @@
1
- jQuery(document).ready(function(){
2
- jQuery('.draft').hide();
3
- });
 
 
 
post_shortcode.php CHANGED
@@ -151,7 +151,13 @@
151
  jQuery.each(data.funnel_steps, function() {
152
  if( this.wp_friendly == true && this.pages != '' ) {
153
  var parts = this.pages[0].published_url.split('.');
154
- var subdomain = parts.shift().replace("https://", "");
 
 
 
 
 
 
155
  jQuery('#cf_thepage_clickoptin').append('<option value="' + this.pages[0].key+'{#}'+subdomain+'">'+ this.name +'</option>');
156
  }
157
  placeholder = jQuery('#cf_placeholder').val();
@@ -186,26 +192,26 @@
186
  jQuery('#loading').fadeOut();
187
  data = jQuery(this).val().split('{#}');
188
  var parts = data[1].split('.');
189
- var subdomain = parts.shift().replace("https://", "");
190
  placeholder = jQuery('#cf_placeholder').val();
191
  button_text = jQuery('#cf_button_text').val();
192
  button_color = jQuery('#cf_button_color').val();
193
  redirect = jQuery('#cf_redirect').val();
194
  input_icon = jQuery('#cf_input_icon').val();
195
- jQuery('#cf_shortcode_clickoptin').val('[clickfunnels_clickoptin id="'+data[0]+'" subdomain="'+subdomain+'" placeholder="'+placeholder+'" button_text="'+button_text+'" button_color="'+button_color+'" redirect="'+redirect+'" input_icon="'+input_icon+'"]');
196
  jQuery('#cf_shortcode_clickoptin').select();
197
  });
198
  jQuery( '.cf_optinchange' ).change(function() {
199
  jQuery('#loading').fadeOut();
200
  data = jQuery('#cf_thepage_clickoptin').val().split('{#}');
201
  var parts = data[1].split('.');
202
- var subdomain = parts.shift().replace("https://", "");
203
  placeholder = jQuery('#cf_placeholder').val();
204
  button_text = jQuery('#cf_button_text').val();
205
  button_color = jQuery('#cf_button_color').val();
206
  redirect = jQuery('#cf_redirect').val();
207
  input_icon = jQuery('#cf_input_icon').val();
208
- jQuery('#cf_shortcode_clickoptin').val('[clickfunnels_clickoptin id="'+data[0]+'" subdomain="'+subdomain+'" placeholder="'+placeholder+'" button_text="'+button_text+'" button_color="'+button_color+'" redirect="'+redirect+'" input_icon="'+input_icon+'"]');
209
  });
210
  // ****************************************************************************************************************************
211
  // ClickPops
@@ -220,7 +226,14 @@
220
  jQuery.each(data.funnel_steps, function() {
221
  if( this.wp_friendly == true && this.pages != '' ) {
222
  var parts = this.pages[0].published_url.split('.');
223
- var subdomain = parts.shift().replace("https://", "");
 
 
 
 
 
 
 
224
  jQuery('#cf_thepage_clickpop').append('<option value="' + this.pages[0].key+'{#}'+subdomain+'">'+ this.name +'</option>');
225
  jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop id="'+this.pages[0].key+'" subdomain="'+subdomain+'"]Your Content[/clickfunnels_clickpop]');
226
  jQuery('#cf_shortcode_clickpop').select();
@@ -257,9 +270,8 @@
257
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
258
  }
259
  data = jQuery(this).val().split('{#}');
260
- var parts = data[1].split('.');
261
- var subdomain = parts.shift().replace("https://", "");
262
- jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain+'"]Your Content[/clickfunnels_clickpop]');
263
  jQuery('#cf_shortcode_clickpop').select();
264
  });
265
  jQuery( '#cf_exit' ).change(function() {
@@ -273,9 +285,8 @@
273
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
274
  }
275
  data = jQuery('#cf_thepage_clickpop').val().split('{#}');
276
- var parts = data[1].split('.');
277
- var subdomain = parts.shift().replace("https://", "");
278
- jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain+'"]Your Content[/clickfunnels_clickpop]');
279
  jQuery('#cf_shortcode_clickpop').select();
280
  });
281
  jQuery( '#cf_delay' ).change(function() {
@@ -289,9 +300,8 @@
289
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
290
  }
291
  data = jQuery('#cf_thepage_clickpop').val().split('{#}');
292
- var parts = data[1].split('.');
293
- var subdomain = parts.shift().replace("https://", "");
294
- jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain+'"]Your Content[/clickfunnels_clickpop]');
295
  jQuery('#cf_shortcode_clickpop').select();
296
  });
297
  // ****************************************************************************************************************************
@@ -320,6 +330,13 @@
320
  }
321
  $cf_funnels_pages = json_decode( $json );
322
  }
 
 
 
 
 
 
 
323
  }
324
  ?>
325
  <div id="message" class="badAPI error notice" style="display: none; width: 733px;padding: 10px 12px;font-weight: bold"><i class="fa fa-times" style="margin-right: 5px;"></i> Failed API Connection with ClickFunnels. Check <a href="edit.php?post_type=clickfunnels&page=cf_api&error=compatibility">Settings > Compatibility Check</a> for details.</div>
151
  jQuery.each(data.funnel_steps, function() {
152
  if( this.wp_friendly == true && this.pages != '' ) {
153
  var parts = this.pages[0].published_url.split('.');
154
+ if (this.pages[0].published_url.indexOf('clickfunnels.com') > -1) {
155
+ subdomain = parts.shift().replace("https://", "");
156
+ }
157
+ else {
158
+ subdomain = parts[0] + '.' + parts[1];
159
+ subdomain = subdomain.replace("https://", "")
160
+ }
161
  jQuery('#cf_thepage_clickoptin').append('<option value="' + this.pages[0].key+'{#}'+subdomain+'">'+ this.name +'</option>');
162
  }
163
  placeholder = jQuery('#cf_placeholder').val();
192
  jQuery('#loading').fadeOut();
193
  data = jQuery(this).val().split('{#}');
194
  var parts = data[1].split('.');
195
+ var subdomain = data[1].split('/');
196
  placeholder = jQuery('#cf_placeholder').val();
197
  button_text = jQuery('#cf_button_text').val();
198
  button_color = jQuery('#cf_button_color').val();
199
  redirect = jQuery('#cf_redirect').val();
200
  input_icon = jQuery('#cf_input_icon').val();
201
+ jQuery('#cf_shortcode_clickoptin').val('[clickfunnels_clickoptin id="'+data[0]+'" subdomain="'+subdomain[0]+'" placeholder="'+placeholder+'" button_text="'+button_text+'" button_color="'+button_color+'" redirect="'+redirect+'" input_icon="'+input_icon+'"]');
202
  jQuery('#cf_shortcode_clickoptin').select();
203
  });
204
  jQuery( '.cf_optinchange' ).change(function() {
205
  jQuery('#loading').fadeOut();
206
  data = jQuery('#cf_thepage_clickoptin').val().split('{#}');
207
  var parts = data[1].split('.');
208
+ var subdomain = data[1].split('/');
209
  placeholder = jQuery('#cf_placeholder').val();
210
  button_text = jQuery('#cf_button_text').val();
211
  button_color = jQuery('#cf_button_color').val();
212
  redirect = jQuery('#cf_redirect').val();
213
  input_icon = jQuery('#cf_input_icon').val();
214
+ jQuery('#cf_shortcode_clickoptin').val('[clickfunnels_clickoptin id="'+data[0]+'" subdomain="'+subdomain[0]+'" placeholder="'+placeholder+'" button_text="'+button_text+'" button_color="'+button_color+'" redirect="'+redirect+'" input_icon="'+input_icon+'"]');
215
  });
216
  // ****************************************************************************************************************************
217
  // ClickPops
226
  jQuery.each(data.funnel_steps, function() {
227
  if( this.wp_friendly == true && this.pages != '' ) {
228
  var parts = this.pages[0].published_url.split('.');
229
+ // var subdomain = parts.shift().replace("https://", "");
230
+ if (this.pages[0].published_url.indexOf('clickfunnels.com') > -1) {
231
+ subdomain = parts.shift().replace("https://", "");
232
+ }
233
+ else {
234
+ subdomain = parts[0] + '.' + parts[1];
235
+ subdomain = subdomain.replace("https://", "")
236
+ }
237
  jQuery('#cf_thepage_clickpop').append('<option value="' + this.pages[0].key+'{#}'+subdomain+'">'+ this.name +'</option>');
238
  jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop id="'+this.pages[0].key+'" subdomain="'+subdomain+'"]Your Content[/clickfunnels_clickpop]');
239
  jQuery('#cf_shortcode_clickpop').select();
270
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
271
  }
272
  data = jQuery(this).val().split('{#}');
273
+ var subdomain = data[1].split('/');
274
+ jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain[0]+'"]Your Content[/clickfunnels_clickpop]');
 
275
  jQuery('#cf_shortcode_clickpop').select();
276
  });
277
  jQuery( '#cf_exit' ).change(function() {
285
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
286
  }
287
  data = jQuery('#cf_thepage_clickpop').val().split('{#}');
288
+ var subdomain = data[1].split('/');
289
+ jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain[0]+'"]Your Content[/clickfunnels_clickpop]');
 
290
  jQuery('#cf_shortcode_clickpop').select();
291
  });
292
  jQuery( '#cf_delay' ).change(function() {
300
  showDelay = 'delay="'+jQuery('#cf_delay').val()+'" ';
301
  }
302
  data = jQuery('#cf_thepage_clickpop').val().split('{#}');
303
+ var subdomain = data[1].split('/');
304
+ jQuery('#cf_shortcode_clickpop').val('[clickfunnels_clickpop '+showOnExit+showDelay+'id="'+data[0]+'" subdomain="'+subdomain[0]+'"]Your Content[/clickfunnels_clickpop]');
 
305
  jQuery('#cf_shortcode_clickpop').select();
306
  });
307
  // ****************************************************************************************************************************
330
  }
331
  $cf_funnels_pages = json_decode( $json );
332
  }
333
+ else if ($cf_funnels == '' && $cf_thefunnel != '') {
334
+ $response = get_file_content( 'https://api.clickfunnels.com/funnels/'.$cf_thefunnel.'.json?email='.get_option( 'clickfunnels_api_email' ).'&auth_token='.get_option( 'clickfunnels_api_auth' ));
335
+ if( is_array($response) ) {
336
+ $json = $response['body']; // use the content
337
+ }
338
+ $cf_funnels_pages = json_decode( $json );
339
+ }
340
  }
341
  ?>
342
  <div id="message" class="badAPI error notice" style="display: none; width: 733px;padding: 10px 12px;font-weight: bold"><i class="fa fa-times" style="margin-right: 5px;"></i> Failed API Connection with ClickFunnels. Check <a href="edit.php?post_type=clickfunnels&page=cf_api&error=compatibility">Settings > Compatibility Check</a> for details.</div>
readme.md DELETED
@@ -1,178 +0,0 @@
1
- ClickFunnels WordPress Plugin
2
- ====================
3
-
4
- Contributors: Wynter Jones
5
- Plugin URI: http://clickfunnels.com/
6
- Author URI: https://profiles.wordpress.org/clickfunnelscom
7
- Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
8
- Requires at least: 3.0
9
- Tested up to: 4.3.1
10
- Stable tag: 2.0.1
11
-
12
- Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
13
-
14
- Description
15
- -----------
16
-
17
- Connect to your ClickFunnels account to show your funnel pages within your blog without any coding. Create clean URLs to your pages with ease and much more.
18
-
19
- First, you install the plugin in your WordPress dashboard. (check Installation
20
- for more info) and connect to ClickFunnels using the *Authentication Key*
21
- provided for you.
22
-
23
- You can now connect unlimited pages using custom URLs to truly get the most out of your ClickFunnels account.
24
-
25
- **With the ClickFunnels plugin you can...**
26
-
27
- * Create custom URLs for your pages
28
- * Set any page as homepage
29
- * Set any page as 404 page
30
- * Edit / Manage your pages
31
-
32
- Want to show an order page of one of your Webinar funnels? Easy, just select the
33
- funnel and choose the order page and create a custom URL.
34
-
35
- Example: "http://yourblog.com/ordernow" can be connected to your order page from any funnel within your ClickFunnels account.
36
-
37
- **Don't have a ClickFunnels account?** You can sign up now to transform the way you run your business online. The WordPress plugin is free to all members.
38
-
39
- **Need more help?** Check out the installation, FAQ and screenshots for more information or check out the Support Desk.
40
-
41
- <https://support.clickfunnels.com/>
42
-
43
- ClickFunnels.com is the premier service for building complete funnels for any marketing campaign. High converting email optin funnels or complex membership funnels.
44
-
45
- The power is in your hands with the **Editor** allows you to design and change your pages in your web browser. Choose from a huge array of templates and edit on the fly.
46
-
47
- *Complete with hosting and free WordPress plugin.*
48
-
49
- **Sign up for ClickFunnels Now:**
50
- <https://clickfunnels.com/>
51
-
52
-
53
- Installation
54
- ------------
55
-
56
- **Turn off Minify for JavaScript when using CloudFlare on Your Blog **
57
-
58
- **Easy Installation**: In your WordPress dashboard go to Plugins > Add New and search for "clickfunnels" and you will be able to quickly install the latest version of the plugin.
59
-
60
- *Updates will be ready automatically and you will be notified in your dashboard.*
61
-
62
- **Manual Installation**: Download the ClickFunnels WordPress plugin .zip file. Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation via a FTP and then activate the Plugin from Plugins page.
63
-
64
- **How to Setup Authenication Key**
65
-
66
- Login to your ClickFunnels account and go to your Settings to get the
67
- authentication key, which is unique to your account.
68
-
69
- You will also need the email address you signed up with. From there you can use the email and key to connect the plugin to your account.
70
-
71
- See more in Screenshots or visit the Support Desk.
72
-
73
- <https://support.clickfunnels.com/>
74
-
75
- == Frequently Asked Questions ==
76
-
77
- Here are some of the most frequently asked questions:
78
-
79
- = Where do I get Authentication Key? =
80
-
81
- To access your Authentication Token go to your ClickFunnels Members area and choose My Account > Settings and you will find your unique authenication key.
82
-
83
- = What is a Custom URL? =
84
-
85
- 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.
86
-
87
- = How do I Set Homepage or 404 Page? =
88
-
89
- 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. You can only have one page set to Home page or 404 page at a time.
90
-
91
- = Do I Need a ClickFunnels Account? =
92
-
93
- **Yes.** A clickfunnels account is required to use this plugin. If you are not already a member you can sign up for your account and transform the way you run your online business.
94
-
95
- = Special Characters Displaying Incorrectly? =
96
-
97
- The error for displaying special characters incorrectly has been fixed for all newly created pages.
98
-
99
- For older pages you will need to open the page in the editor and hit save. Or you can re-select your page in the WordPress plugin. Screenshot here: http://cl.ly/0n2H0v220e1U
100
-
101
- By re-selecting the page it will ping the server which should refresh your page.
102
-
103
- Changelog
104
- ---------
105
-
106
- Stay current with the latest version of the plugin:
107
-
108
- ### Version 2.0
109
-
110
- ( change log coming soon )
111
-
112
- ### Version 1.1.2
113
-
114
- * Error caused by array improperly formatted.
115
- (to update meta tag for URL when sharing on Facebook, please save and update old pages to get proper WordPress page url)
116
-
117
- ### Version 1.1.1
118
-
119
- * Added WordPress URL to social meta data (facebook open graph)
120
- * Fix split tests and cookies
121
- * New function for curl, file_get_contents fallback
122
-
123
- ### Version 1.1.0
124
-
125
- * Added mini preview of chosen page
126
- * Added 'publish' status for for ClickFunnels pages
127
- * Added meta data status check
128
- * Added ClickFunnels URL and editable meta data
129
- * Enable split tests & custom code option
130
-
131
-
132
- ### Version 1.0.8
133
-
134
- * Fixed bug for 'no template selected' causing certain pages not show
135
-
136
- ### Version 1.0.7
137
-
138
- * Excluded only pages with no template chosen
139
- * Better page management screen
140
- * Small copy changes.
141
- * Now display the chosen Funnel with Page name
142
-
143
- ### Version 1.0.6
144
-
145
- * Auto save if page id = null (fixes some blank page issues)
146
- * 404 No Page Found Error fixed to 200 OK
147
-
148
- ### Version 1.0.5
149
-
150
- * Fixed funnels showing no pages (caused by pages with template selected)
151
-
152
- ### Version: 1.0.4
153
-
154
- * Added CURL as a backup to flie_get_contents
155
- * Added developer testing for easier error reporting
156
-
157
- ### Version: 1.0.3
158
-
159
- * Fix Blank Homepage (caused by template_include)
160
- * Special Character Fix (see FAQ)
161
-
162
- ### Version: 1.0.2
163
-
164
- * Ping Page to Fix "Blank Pages"
165
- * Excluded Special Pages (OTO/Order)
166
- * Notification for Empty Funnels
167
-
168
- ### Version: 1.0.1
169
-
170
- * Meta UTF-8
171
-
172
- ### Version: 1.0.0
173
-
174
- * Launch Plugin to Repository
175
- * Added Support FAQ Tab
176
- * API Connection
177
- * Set as Home / 404 Page
178
- * Edit Funnel / Launch Editor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Author URI: https://profiles.wordpress.org/clickfunnelscom
6
  Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
7
  Requires at least: 3.0
8
  Tested up to: 4.3.1
9
- Stable tag: 2.0.1
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
@@ -100,13 +100,19 @@ By re-selecting the page it will ping the server which should refresh your page.
100
 
101
  Stay current with the latest version of the plugin:
102
 
 
 
 
 
 
 
103
  = Version 2.0.1 =
104
 
105
- Fix clickpop.js link
106
 
107
  = Version 2.0 =
108
 
109
- See: http://blog.clickfunnels.com/all-new-updates-to-the-clickfunnels-wordpress-plugin-v2-0/
110
 
111
  = Version 1.1.2 =
112
 
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: 2.0.2
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
100
 
101
  Stay current with the latest version of the plugin:
102
 
103
+ = Version 2.0.2 =
104
+
105
+ * fix conflict with other plugins when saving/updating
106
+ * fix unable to pull funnels for some users
107
+ * fix % and other characters in meta data
108
+
109
  = Version 2.0.1 =
110
 
111
+ * Fix clickpop url
112
 
113
  = Version 2.0 =
114
 
115
+ * Read blog post -> http://blog.clickfunnels.com/all-new-updates-to-the-clickfunnels-wordpress-plugin-v2-0/
116
 
117
  = Version 1.1.2 =
118
 
support.php DELETED
@@ -1,280 +0,0 @@
1
- <style>
2
- .api {
3
- width: 780px;
4
- margin-top: 20px;
5
- border-radius: 5px;
6
- }
7
- .api form {
8
- padding: 0;
9
- }
10
- .api form h3 {
11
- padding: 0;
12
- padding-bottom: 10px;
13
- margin: 0;
14
- font-size: 17px;
15
- margin-top: 10px;
16
- color: #39464E;
17
- font-weight: 400;
18
- }
19
- .api form input {
20
- width: 100%;
21
- font-size: 15px;
22
- padding: 7px;
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;
30
- border-top-right-radius: 5px;
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;
49
- }
50
- .apiSubHeader h2 {
51
- margin: 0 !important;
52
- padding: 0 !important;
53
- color: #fff;
54
- font-weight: bold;
55
- font-size: 17px;
56
- text-shadow: 1px 1px 0 #0367AE;
57
- }
58
- .leftSide {
59
- width: 380px;
60
- float: left;
61
- }
62
- .leftSide h3 {
63
- font-weight: 900;
64
- font-size: 13px !important;
65
- }
66
- .rightSide {
67
- width: 280px;
68
- float: left;
69
- padding: 20px;
70
- opacity: .7;
71
- padding-left: 30px;
72
- }
73
- .rightSide p {
74
- font-size: 12px;
75
- line-height: 18px;
76
- }
77
- #errorMessage {
78
- clear: both;
79
- padding: 8px;
80
- background: #fafafa;
81
- border: 2px solid #ddd;
82
- }
83
- #errorMessage.success {
84
- border: 2px solid #49BB85;
85
- background: #49BB85;
86
- color: #fff;
87
- }
88
- #errorMessage.error {
89
- border: 2px solid #B72D1C;
90
- background: #B72D1C;
91
- color: #fff;
92
- }
93
- .successGreen {
94
- color: #49BB85;
95
- }
96
- .errorRed {
97
- color: #B72D1C;
98
- }
99
- #errorMessage.badAPI {
100
- border: 2px solid #B72D1C;
101
- background: #B72D1C;
102
- color: #fff;
103
- display: none;
104
- }
105
- .copyrightInfo {
106
- width: 780px;
107
- padding: 0 10px;
108
- float: left;
109
- color: #999;
110
- font-size: 11px;
111
- }
112
- .copyrightInfo p {
113
- font-size: 11px;
114
- }
115
- .apiHeader a {
116
- float: right;
117
- display: block;
118
- color: #fff;
119
- font-size: 13px;
120
- text-decoration: none;
121
- margin-right: 4px !important;
122
- background-color: rgba(0, 0, 0, .3);
123
- border: 2px solid #2b2e30;
124
- color: #afbbc8 !important;
125
- font-weight: 700;
126
- margin-top: 0px !important;
127
- -webkit-border-radius: 4px;
128
- -moz-border-radius: 4px;
129
- border-radius: 4px;
130
- padding: 7px;
131
- padding-left: 12px;
132
- padding-right: 12px;
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;
140
- background-color: rgba(0, 0, 0, .6);
141
- color: #fff !important;
142
- }
143
- #side-sortables {
144
- display: none !important;
145
- }
146
-
147
- #apiFooter {
148
- background: #F1F1F1;
149
-
150
- padding: 10px 14px;
151
- border-bottom-left-radius: 5px;
152
- border-bottom-right-radius: 5px;
153
- }
154
- #apiFooter a:hover {
155
- text-decoration: none;
156
- }
157
- #apiSettings {
158
- padding: 10px 25px;
159
- padding-top: 20px;
160
- border: 10px solid #F1F1F1;
161
- }
162
- #faq h4 {
163
- font-size: 15px;
164
- margin-bottom: 0;
165
- font-weight: 500;
166
- color: #3E474F;
167
- }
168
- #faq h4 i {
169
- margin-right: 5px;
170
- }
171
- #faq p {
172
- font-size: 13px;
173
- line-height: 18px;
174
- display: block;
175
- padding-left: 23px;
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">
212
- <div class="apiHeader">
213
- <img src="<?php echo plugins_url( 'logo.png', __FILE__ ); ?>" alt="">
214
- <a href="https://www.clickfunnels.com/users/sign_in" target="_blank" class=""><i class="fa fa-bars"></i> My Account</a>
215
- <br clear="all">
216
- </div>
217
- <div class="apiSubHeader">
218
- <h2>ClickFunnels Plugin Support</h2>
219
- </div>
220
- <div id="apiSettings">
221
- <h2 style="margin-top: 10px"><strong>Frequently Asked Questions</strong></h2>
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
-
267
- <script>
268
- (function($) {
269
- setTimeout(function() {
270
- $('#errorMessage').fadeOut();
271
- }, 1500);
272
- var specificFunnel = 'https://api.clickfunnels.com/funnels.json?email=<?php echo get_option( "clickfunnels_api_email" ); ?>&auth_token=<?php echo get_option( "clickfunnels_api_auth" ); ?>';
273
- $.getJSON(specificFunnel, function(data) {
274
- $('.checkSuccess').html('<i class="fa fa-check successGreen"></i>');
275
- }).fail(function(jqXHR) {
276
- $('.checkSuccess').html('<i class="fa fa-times errorRed"></i>');
277
- $('.badAPI').show();
278
- });
279
- })(jQuery);
280
- </script>