ClickFunnels - Version 3.0.6

Version Description

Download this release

Release Info

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

Code changes from version 3.0.5 to 3.0.6

Files changed (3) hide show
  1. clickfunnels.php +55 -27
  2. pages/_footer.php +1 -1
  3. readme.txt +7 -3
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: 3.0.5
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
@@ -355,35 +355,63 @@ function upgrade_existing_posts() {
355
  $url = get_post_meta($id, 'cf_iframe_url', true);
356
  $funnel = get_post_meta($id, 'cf_thefunnel', true);
357
  $thepage = get_post_meta($id, 'cf_thepage', true);
358
- $funnel_parts = explode($sep, $funnel);
359
- $funnel_id = $funnel_parts[0];
360
- $funnel_name = $funnel_parts[11];
361
- $page_parts = explode($sep, $thepage);
362
- $page_name = $page_parts[5];
363
-
364
- if (!get_post_meta($id, 'cf_step_url', true)){
365
- update_post_meta($id, 'cf_step_url', $url);
366
- }
367
- if (!get_post_meta($id, 'cf_funnel_id', true)){
368
- update_post_meta($id, 'cf_funnel_id', $funnel_id);
369
- }
370
- if (!get_post_meta($id, 'cf_funnel_name', true)){
371
- update_post_meta($id, 'cf_funnel_name', $funnel_name);
372
- }
373
- if (!get_post_meta($id, 'cf_step_name', true)){
374
- update_post_meta($id, 'cf_step_name', $page_name);
 
 
 
 
 
 
 
 
375
  }
376
 
377
- $page_type = get_post_meta($id, 'cf_type', true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
 
379
- if ($page_type == 'hp') {
380
- update_option( 'clickfunnels_homepage_post_id', $id);
381
- update_post_meta($id, 'cf_page_type', 'homepage');
382
- } else if ($page_type == 'np') {
383
- update_option( 'clickfunnels_404_post_id', $id);
384
- update_post_meta($id, 'cf_page_type', '404');
385
- } else {
386
- update_post_meta($id, 'cf_page_type', 'page');
 
387
  }
388
  }
389
  }
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: 3.0.6
7
  * Author: Etison, LLC
8
  * Author URI: https://www.clickfunnels.com
9
  */
355
  $url = get_post_meta($id, 'cf_iframe_url', true);
356
  $funnel = get_post_meta($id, 'cf_thefunnel', true);
357
  $thepage = get_post_meta($id, 'cf_thepage', true);
358
+ $slug = get_post_meta($id, 'cf_slug', true);
359
+
360
+ if ($url && $funnel && $thepage && $slug) {
361
+ // If metadata is working, use that, it's cleaner
362
+ $funnel_parts = explode($sep, $funnel);
363
+ $funnel_id = $funnel_parts[0];
364
+ $funnel_name = $funnel_parts[11];
365
+ $page_parts = explode($sep, $thepage);
366
+ $page_name = $page_parts[5];
367
+ } else {
368
+ // Otherwise scour cf_options for the data
369
+ $cf_options = get_option( "cf_options" );
370
+ if (isset($cf_options)) {
371
+ foreach ($cf_options['pages'] as $key => $value) {
372
+ $parts = explode($sep, $value);
373
+ if ($parts[5] == $id) {
374
+ $url = $parts[7];
375
+ $funnel_id = $parts[0];
376
+ $funnel_name = $parts[11];
377
+ $page_name = $parts[6];
378
+ $slug = $key;
379
+ break;
380
+ }
381
+ }
382
+ }
383
  }
384
 
385
+ // We have all the data we need to create a page
386
+ // Homepage/404 set in cf_options will not be upgraded
387
+ if ($url && $funnel_id && $funnel_name && $page_name && $slug) {
388
+ if (!get_post_meta($id, 'cf_slug', true)){
389
+ update_post_meta($id, 'cf_slug', $slug);
390
+ }
391
+ if (!get_post_meta($id, 'cf_step_url', true)){
392
+ update_post_meta($id, 'cf_step_url', $url);
393
+ }
394
+ if (!get_post_meta($id, 'cf_funnel_id', true)){
395
+ update_post_meta($id, 'cf_funnel_id', $funnel_id);
396
+ }
397
+ if (!get_post_meta($id, 'cf_funnel_name', true)){
398
+ update_post_meta($id, 'cf_funnel_name', $funnel_name);
399
+ }
400
+ if (!get_post_meta($id, 'cf_step_name', true)){
401
+ update_post_meta($id, 'cf_step_name', $page_name);
402
+ }
403
+
404
+ $page_type = get_post_meta($id, 'cf_type', true);
405
 
406
+ if ($page_type == 'hp') {
407
+ update_option( 'clickfunnels_homepage_post_id', $id);
408
+ update_post_meta($id, 'cf_page_type', 'homepage');
409
+ } else if ($page_type == 'np') {
410
+ update_option( 'clickfunnels_404_post_id', $id);
411
+ update_post_meta($id, 'cf_page_type', '404');
412
+ } else {
413
+ update_post_meta($id, 'cf_page_type', 'page');
414
+ }
415
  }
416
  }
417
  }
pages/_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 3.0.5</strong> Copyright 2016+ &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 3.0.6</strong> Copyright 2016+ &copy; Eitson, LLC</p>
3
  </div>
4
  <style>
5
  .copyrightInfo {
readme.txt CHANGED
@@ -4,9 +4,9 @@ Contributors: Wynter Jones, Ross Hunter
4
  Plugin URI: http://clickfunnels.com/
5
  Author URI: https://profiles.wordpress.org/clickfunnelscom
6
  Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
7
- Requires at least: 3.0
8
- Tested up to: 4.4.1
9
- Stable tag: 3.0.5
10
 
11
  Connect your ClickFunnels pages to your WordPress blog. Create custom pages, set as homepage or 404 page with easy setup.
12
 
@@ -100,6 +100,10 @@ By re-selecting the page it will ping the server which should refresh your page.
100
 
101
  Stay current with the latest version of the plugin:
102
 
 
 
 
 
103
  = Version 3.0.5 =
104
 
105
  * Fix potential conflict with other plugins overwriting post_meta
4
  Plugin URI: http://clickfunnels.com/
5
  Author URI: https://profiles.wordpress.org/clickfunnelscom
6
  Tags: landing pages, clickfunnels, funnels, sales funnel, optin, internet marketing
7
+ Requires at least: 4.3
8
+ Tested up to: 4.5.2
9
+ Stable tag: 3.0.6
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 3.0.6 =
104
+
105
+ * Fix upgrading if metadata was not properly saved in version 2
106
+
107
  = Version 3.0.5 =
108
 
109
  * Fix potential conflict with other plugins overwriting post_meta