Unbounce Landing Pages - Version 1.0.19

Version Description

Download this release

Release Info

Developer unbouncewordpress
Plugin Icon Unbounce Landing Pages
Version 1.0.19
Comparing to
See all releases

Code changes from version 1.0.18 to 1.0.19

UBCompatibility.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  // For 4.3.0 <= PHP <= 5.4.0
4
  if (!function_exists('http_response_code')) {
5
  function http_response_code($code = NULL) {
@@ -66,4 +67,21 @@ if (!function_exists('http_response_code')) {
66
  }
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ?>
1
  <?php
2
 
3
+ // taken from: http://php.net/manual/en/function.http-response-code.php
4
  // For 4.3.0 <= PHP <= 5.4.0
5
  if (!function_exists('http_response_code')) {
6
  function http_response_code($code = NULL) {
67
  }
68
  }
69
 
70
+ // taken from: http://php.net/manual/en/function.getallheaders.php
71
+ if (!function_exists('getallheaders'))
72
+ {
73
+ function getallheaders()
74
+ {
75
+ $headers = '';
76
+ foreach ($_SERVER as $name => $value)
77
+ {
78
+ if (substr($name, 0, 5) == 'HTTP_')
79
+ {
80
+ $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
81
+ }
82
+ }
83
+ return $headers;
84
+ }
85
+ }
86
+
87
  ?>
UBConfig.php CHANGED
@@ -4,8 +4,8 @@ class UBConfig {
4
 
5
  const UB_PLUGIN_NAME = 'ub-wordpress';
6
  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
7
- const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.18';
8
- const UB_VERSION = '1.0.18';
9
 
10
  # Option keys
11
  const UB_ROUTES_CACHE_KEY = 'ub-route-cache';
4
 
5
  const UB_PLUGIN_NAME = 'ub-wordpress';
6
  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
7
+ const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.19';
8
+ const UB_VERSION = '1.0.19';
9
 
10
  # Option keys
11
  const UB_ROUTES_CACHE_KEY = 'ub-route-cache';
UBDiagnostics.php CHANGED
@@ -28,7 +28,7 @@ class UBDiagnostics {
28
  return array(
29
  'PHP Version' => phpversion(),
30
  'WordPress Version' => UBDiagnostics::wordpress_version(),
31
- 'Unbounce Plugin Version' => "1.0.18",
32
  'Permalink Structure' => get_option('permalink_structure', ''),
33
  'Domain' => $domain,
34
  'Domain Authorized' => print_r(UBConfig::is_authorized_domain($domain), true),
28
  return array(
29
  'PHP Version' => phpversion(),
30
  'WordPress Version' => UBDiagnostics::wordpress_version(),
31
+ 'Unbounce Plugin Version' => "1.0.19",
32
  'Permalink Structure' => get_option('permalink_structure', ''),
33
  'Domain' => $domain,
34
  'Domain Authorized' => print_r(UBConfig::is_authorized_domain($domain), true),
UBHTTP.php CHANGED
@@ -7,7 +7,7 @@ class UBHTTP {
7
  public static $variant_url_regex = '/(.+)\/[a-z]+\.html/i';
8
  public static $pie_htc_url = '/PIE.htc';
9
  // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches)
10
- public static $forward_headers = '/^(Content-Type:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i';
11
 
12
  public static function is_private_ip_address($ip_address) {
13
  return !filter_var($ip_address,
@@ -126,6 +126,17 @@ class UBHTTP {
126
  return $protocol === 'http' || $protocol === 'https';
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
129
  public static function stream_request($method,
130
  $target_url,
131
  $cookie_string,
@@ -136,7 +147,9 @@ class UBHTTP {
136
  $forwarded_for = UBUtil::array_fetch($_SERVER, 'HTTP_X_FORWARDED_FOR');
137
  $remote_ip = UBUtil::array_fetch($_SERVER, 'REMOTE_ADDR');
138
 
139
- $headers = UBHTTP::get_proxied_for_header($headers0,
 
 
140
  $forwarded_for,
141
  $remote_ip);
142
 
7
  public static $variant_url_regex = '/(.+)\/[a-z]+\.html/i';
8
  public static $pie_htc_url = '/PIE.htc';
9
  // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches)
10
+ public static $forward_headers = '/^(Content-Type:|Content-Encoding:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i';
11
 
12
  public static function is_private_ip_address($ip_address) {
13
  return !filter_var($ip_address,
126
  return $protocol === 'http' || $protocol === 'https';
127
  }
128
 
129
+ // taken from: http://stackoverflow.com/a/13036310/322727
130
+ private static function convert_headers_to_curl($headers) {
131
+ // map to curl-friendly format
132
+ $req_headers = array();
133
+ array_walk($headers, function(&$v, $k) use (&$req_headers) {
134
+ array_push($req_headers, $k . ": " . $v);
135
+ });
136
+
137
+ return $req_headers;
138
+ }
139
+
140
  public static function stream_request($method,
141
  $target_url,
142
  $cookie_string,
147
  $forwarded_for = UBUtil::array_fetch($_SERVER, 'HTTP_X_FORWARDED_FOR');
148
  $remote_ip = UBUtil::array_fetch($_SERVER, 'REMOTE_ADDR');
149
 
150
+ $curl_headers = UBHTTP::convert_headers_to_curl($headers0);
151
+
152
+ $headers = UBHTTP::get_proxied_for_header($curl_headers,
153
  $forwarded_for,
154
  $remote_ip);
155
 
Unbounce-Page.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Unbounce Landing Pages
4
  Plugin URI: http://unbounce.com
5
  Description: Unbounce is the most powerful standalone landing page builder available.
6
- Version: 1.0.18
7
  Author: Unbounce
8
  Author URI: http://unbounce.com
9
  License: GPLv2
@@ -134,7 +134,8 @@ add_action('init', function() {
134
 
135
  $cookie_string = UBHTTP::cookie_string_from_array($cookies_to_forward);
136
 
137
- $req_headers = $referer == null ? array('Host: ' . $domain) : array('Referer: ' . $referer, 'Host: ' . $domain);
 
138
 
139
  // Make sure we don't get cached by Wordpress hosts like WPEngine
140
  header('Cache-Control: max-age=0; private');
@@ -142,7 +143,7 @@ add_action('init', function() {
142
  list($success, $message) = UBHTTP::stream_request($http_method,
143
  $raw_url,
144
  $cookie_string,
145
- $req_headers,
146
  $user_agent);
147
 
148
  if($success === false) {
3
  Plugin Name: Unbounce Landing Pages
4
  Plugin URI: http://unbounce.com
5
  Description: Unbounce is the most powerful standalone landing page builder available.
6
+ Version: 1.0.19
7
  Author: Unbounce
8
  Author URI: http://unbounce.com
9
  License: GPLv2
134
 
135
  $cookie_string = UBHTTP::cookie_string_from_array($cookies_to_forward);
136
 
137
+ $all_headers = getallheaders();
138
+ $all_headers['Host'] = $domain;
139
 
140
  // Make sure we don't get cached by Wordpress hosts like WPEngine
141
  header('Cache-Control: max-age=0; private');
143
  list($success, $message) = UBHTTP::stream_request($http_method,
144
  $raw_url,
145
  $cookie_string,
146
+ $all_headers,
147
  $user_agent);
148
 
149
  if($success === false) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: unbouncewordpress
3
  Tags: Unbounce, AB testing, A/B testing, split testing, CRO, conversion optimization, wordpress landing page, wp landing pages, splash pages, landing pages, squeeze pages, lead gen, lead generation, email list, responsive landing pages, templates, inbound marketing, ppc, analytics
4
  Requires at least: 4.1.5
5
  Tested up to: 4.4
6
- Stable tag: 1.0.18
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
3
  Tags: Unbounce, AB testing, A/B testing, split testing, CRO, conversion optimization, wordpress landing page, wp landing pages, splash pages, landing pages, squeeze pages, lead gen, lead generation, email list, responsive landing pages, templates, inbound marketing, ppc, analytics
4
  Requires at least: 4.1.5
5
  Tested up to: 4.4
6
+ Stable tag: 1.0.19
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
templates/main_authorized_footer.php CHANGED
@@ -17,4 +17,4 @@ $refresh_button = get_submit_button('refreshing the Published Pages list', 'seco
17
  Check out our knowledge base.
18
  </a>
19
  <br/><a class="ub-diagnostics-link" href="<?php echo $diagnostics_url ?>">Click here for troubleshooting and plugin diagnostics</a>
20
- <p class="ub-version">Unbounce Version 1.0.18</p>
17
  Check out our knowledge base.
18
  </a>
19
  <br/><a class="ub-diagnostics-link" href="<?php echo $diagnostics_url ?>">Click here for troubleshooting and plugin diagnostics</a>
20
+ <p class="ub-version">Unbounce Version 1.0.19</p>
templates/main_unauthorized_footer.php CHANGED
@@ -4,4 +4,4 @@
4
  <a class="ub-diagnostics-link" href="<?php echo admin_url('admin.php?page=unbounce-pages-diagnostics'); ?>">
5
  Click here for troubleshooting and plugin diagnostics
6
  </a>
7
- <p class="ub-version">Unbounce Version 1.0.18</p>
4
  <a class="ub-diagnostics-link" href="<?php echo admin_url('admin.php?page=unbounce-pages-diagnostics'); ?>">
5
  Click here for troubleshooting and plugin diagnostics
6
  </a>
7
+ <p class="ub-version">Unbounce Version 1.0.19</p>