Unbounce Landing Pages - Version 1.0.43

Version Description

Download this release

Release Info

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

Code changes from version 1.0.42 to 1.0.43

UBConfig.php CHANGED
@@ -5,8 +5,8 @@ class UBConfig
5
 
6
  const UB_PLUGIN_NAME = 'ub-wordpress';
7
  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
8
- const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.42';
9
- const UB_VERSION = '1.0.42';
10
 
11
  // Option keys
12
  const UB_ROUTES_CACHE_KEY = 'ub-route-cache';
5
 
6
  const UB_PLUGIN_NAME = 'ub-wordpress';
7
  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
8
+ const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.43';
9
+ const UB_VERSION = '1.0.43';
10
 
11
  // Option keys
12
  const UB_ROUTES_CACHE_KEY = 'ub-route-cache';
UBDiagnostics.php CHANGED
@@ -100,7 +100,7 @@ class UBDiagnostics
100
  return array(
101
  'PHP Version' => phpversion(),
102
  'WordPress Version' => UBDiagnostics::wordpress_version(),
103
- 'Unbounce Plugin Version' => '1.0.42',
104
  'Checks' => self::pp(UBDiagnostics::checks($domain, $domain_info)),
105
  'Options' => self::pp(UBDiagnostics::ub_options()),
106
  'Permalink Structure' => get_option('permalink_structure', ''),
@@ -178,7 +178,7 @@ class UBDiagnostics
178
  return array(
179
  'php' => phpversion(),
180
  'wordpress' => UBDiagnostics::wordpress_version(),
181
- 'plugin_version' => '1.0.42',
182
  'curl_installed' => self::is_curl_installed(),
183
  'xml_installed' => self::is_xml_installed(),
184
  'sni_support' => self::hasSNI(),
100
  return array(
101
  'PHP Version' => phpversion(),
102
  'WordPress Version' => UBDiagnostics::wordpress_version(),
103
+ 'Unbounce Plugin Version' => '1.0.43',
104
  'Checks' => self::pp(UBDiagnostics::checks($domain, $domain_info)),
105
  'Options' => self::pp(UBDiagnostics::ub_options()),
106
  'Permalink Structure' => get_option('permalink_structure', ''),
178
  return array(
179
  'php' => phpversion(),
180
  'wordpress' => UBDiagnostics::wordpress_version(),
181
+ 'plugin_version' => '1.0.43',
182
  'curl_installed' => self::is_curl_installed(),
183
  'xml_installed' => self::is_xml_installed(),
184
  'sni_support' => self::hasSNI(),
UBHTTP.php CHANGED
@@ -12,6 +12,7 @@ class UBHTTP
12
  // @codingStandardsIgnoreLine
13
  public static $response_header_whitelist = '/^(Content-Type:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i';
14
  public static $request_header_blacklist = '/^(Accept-Encoding:)/i';
 
15
  public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk');
16
 
17
  public static function is_private_ip_address($ip_address)
@@ -245,12 +246,20 @@ class UBHTTP
245
 
246
  public static function sanitize_cookies($headers)
247
  {
 
 
 
 
 
 
 
 
248
  $cookies_to_forward = UBUtil::array_select_by_key(
249
- UBHTTP::cookie_array_from_string($headers["Cookie"]),
250
  UBHTTP::$cookie_whitelist
251
  );
252
  if (sizeof($cookies_to_forward) > 0) {
253
- $headers["Cookie"] = UBHTTP::cookie_string_from_array($cookies_to_forward);
254
  }
255
  return $headers;
256
  }
@@ -323,8 +332,13 @@ class UBHTTP
323
  if (!$resp) {
324
  $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl);
325
  UBLogger::warning($message);
326
- http_response_code(500);
327
- $result = array(false, $message);
 
 
 
 
 
328
  } else {
329
  $result = array(true, null);
330
  }
@@ -334,6 +348,17 @@ class UBHTTP
334
  return $result;
335
  }
336
 
 
 
 
 
 
 
 
 
 
 
 
337
  public static function is_extract_url_proxyable(
338
  $proxyable_url_set,
339
  $extract_regex,
12
  // @codingStandardsIgnoreLine
13
  public static $response_header_whitelist = '/^(Content-Type:|Location:|Link:|Content-Location:|Set-Cookie:|X-Server-Instance:|X-Unbounce-PageId:|X-Unbounce-Variant:|X-Unbounce-VisitorID:)/i';
14
  public static $request_header_blacklist = '/^(Accept-Encoding:)/i';
15
+ public static $location_header_regex = '/^(Location:)/i';
16
  public static $cookie_whitelist = array('ubvs', 'ubpv', 'ubvt', 'hubspotutk');
17
 
18
  public static function is_private_ip_address($ip_address)
246
 
247
  public static function sanitize_cookies($headers)
248
  {
249
+ $cookie_key = "Cookie";
250
+ if (!array_key_exists($cookie_key, $headers)) {
251
+ $cookie_key = "cookie"; // fallback to trying lowercase
252
+ if (!array_key_exists($cookie_key, $headers)) {
253
+ return $headers;
254
+ }
255
+ }
256
+
257
  $cookies_to_forward = UBUtil::array_select_by_key(
258
+ UBHTTP::cookie_array_from_string($headers[$cookie_key]),
259
  UBHTTP::$cookie_whitelist
260
  );
261
  if (sizeof($cookies_to_forward) > 0) {
262
+ $headers[$cookie_key] = UBHTTP::cookie_string_from_array($cookies_to_forward);
263
  }
264
  return $headers;
265
  }
332
  if (!$resp) {
333
  $message = "Error proxying to '" . $target_url . "': " . curl_error($curl) . " - Code: " . curl_errno($curl);
334
  UBLogger::warning($message);
335
+ if (UBHTTP::is_location_response_header_set()) {
336
+ UBLogger::debug("The location header was set despite the cURL error. Assuming it's safe to let the response flow back");
337
+ $result = array(true, null);
338
+ } else {
339
+ http_response_code(500);
340
+ $result = array(false, $message);
341
+ }
342
  } else {
343
  $result = array(true, null);
344
  }
348
  return $result;
349
  }
350
 
351
+ private static function is_location_response_header_set()
352
+ {
353
+ $resp_headers = headers_list();
354
+ foreach ($resp_headers as $value) { //headers at this point are raw strings, not K -> V
355
+ if (preg_match(UBHTTP::$location_header_regex, $value)) {
356
+ return true;
357
+ }
358
+ }
359
+ return false;
360
+ }
361
+
362
  public static function is_extract_url_proxyable(
363
  $proxyable_url_set,
364
  $extract_regex,
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.42
7
  Author: Unbounce
8
  Author URI: http://unbounce.com
9
  License: GPLv2
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.43
7
  Author: Unbounce
8
  Author URI: http://unbounce.com
9
  License: GPLv2
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: 5.0
6
- Stable tag: 1.0.42
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -100,6 +100,10 @@ You should add a rule to your cache to avoid caching Unbounce Pages which have t
100
 
101
  == Changelog ==
102
 
 
 
 
 
103
  = 1.0.42 =
104
  * Fixes an issue causing older versions of PHP to get a 404 when visiting pages
105
  * Updated diagnostics and matching documentation to require PHP 5.6 or higher
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: 5.0
6
+ Stable tag: 1.0.43
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
100
 
101
  == Changelog ==
102
 
103
+ = 1.0.43=
104
+ * Fixes an issue handling cookies
105
+ * Fixes an issue handling redirects
106
+
107
  = 1.0.42 =
108
  * Fixes an issue causing older versions of PHP to get a 404 when visiting pages
109
  * Updated diagnostics and matching documentation to require PHP 5.6 or higher
templates/main_authorized_footer.php CHANGED
@@ -21,4 +21,4 @@ $refresh_button = get_submit_button('refreshing the Published Pages list', 'seco
21
  <a class="ub-diagnostics-link" href="<?php echo $diagnostics_url ?>">
22
  Click here for troubleshooting and plugin diagnostics
23
  </a>
24
- <p class="ub-version">Unbounce Version 1.0.42</p>
21
  <a class="ub-diagnostics-link" href="<?php echo $diagnostics_url ?>">
22
  Click here for troubleshooting and plugin diagnostics
23
  </a>
24
+ <p class="ub-version">Unbounce Version 1.0.43</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.42</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.43</p>