Plugin Directory

Changeset 1295211


Ignore:
Timestamp:
11/26/2015 06:11:38 PM (9 years ago)
Author:
unbouncewordpress
Message:

Releasing version 1.0.14

Location:
unbounce
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • unbounce/tags/1.0.14/UBConfig.php

    r1290232 r1295211  
    55  const UB_PLUGIN_NAME           = 'ub-wordpress';
    66  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    7   const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.13';
    8   const UB_VERSION               = '1.0.13';
     7  const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.14';
     8  const UB_VERSION               = '1.0.14';
    99
    1010  # Option keys
    11   const UB_ROUTES_CACHE_KEY       = 'ub-route-cache';
    12   const UB_REMOTE_DEBUG_KEY       = 'ub-remote-debug';
    13   const UB_PAGE_SERVER_DOMAIN_KEY = 'ub-page-server-domain';
    14   const UB_REMOTE_LOG_URL_KEY     = 'ub-remote-log-url';
    15   const UB_REMOTE_EVENTS_URL_KEY  = 'ub-remote-events-url';
    16   const UB_API_URL_KEY            = 'ub-api-url';
    17   const UB_API_CLIENT_ID_KEY      = 'ub-api-client-id';
    18   const UB_AUTHORIZED_DOMAINS_KEY = 'ub-authorized-domains';
    19   const UB_HAS_AUTHORIZED_KEY     = 'ub-has-authorized';
    20   const UB_USER_ID_KEY            = 'ub-user-id';
    21   const UB_DOMAIN_ID_KEY          = 'ub-domain-id';
    22   const UB_CLIENT_ID_KEY          = 'ub-client-id';
    23 
    24   const UB_LOCK_NAME              = 'ub-sql-lock';
     11  const UB_ROUTES_CACHE_KEY        = 'ub-route-cache';
     12  const UB_REMOTE_DEBUG_KEY        = 'ub-remote-debug';
     13  const UB_PAGE_SERVER_DOMAIN_KEY  = 'ub-page-server-domain';
     14  const UB_REMOTE_LOG_URL_KEY      = 'ub-remote-log-url';
     15  const UB_REMOTE_EVENTS_URL_KEY   = 'ub-remote-events-url';
     16  const UB_API_URL_KEY             = 'ub-api-url';
     17  const UB_API_CLIENT_ID_KEY       = 'ub-api-client-id';
     18  const UB_AUTHORIZED_DOMAINS_KEY  = 'ub-authorized-domains';
     19  const UB_HAS_AUTHORIZED_KEY      = 'ub-has-authorized';
     20  const UB_USER_ID_KEY             = 'ub-user-id';
     21  const UB_DOMAIN_ID_KEY           = 'ub-domain-id';
     22  const UB_CLIENT_ID_KEY           = 'ub-client-id';
     23  const UB_PROXY_ERROR_MESSAGE_KEY = 'ub-proxy-error-message';
     24
     25  const UB_LOCK_NAME               = 'ub-sql-lock';
    2526
    2627  public static function ub_option_keys() {
    27     # All options, used by UBDiagnostics
     28    # All options, used by UBDiagnostics and deactivation hook
    2829    # Arrays are not allowed in class constants, so use a function
    2930    return array(
     
    3940      UBConfig::UB_USER_ID_KEY,
    4041      UBConfig::UB_DOMAIN_ID_KEY,
    41       UBConfig::UB_CLIENT_ID_KEY
     42      UBConfig::UB_CLIENT_ID_KEY,
     43      UBConfig::UB_PROXY_ERROR_MESSAGE_KEY
    4244    );
    4345  }
  • unbounce/tags/1.0.14/UBDiagnostics.php

    r1290232 r1295211  
    2929      'PHP Version'             => phpversion(),
    3030      'WordPress Version'       => UBDiagnostics::wordpress_version(),
    31       'Unbounce Plugin Version' => "1.0.13",
     31      'Unbounce Plugin Version' => "1.0.14",
    3232      'Permalink Structure'     => get_option('permalink_structure', ''),
    3333      'Domain'                  => $domain,
  • unbounce/tags/1.0.14/UBHTTP.php

    r1290232 r1295211  
    33class UBHTTP {
    44  public static $powered_by_header_regex  = '/^X-Powered-By: (.+)$/i';
    5   public static $form_confirmation_url_regex = '/(.+)\/[a-z]+-form_confirmation\.html/';
     5  public static $form_confirmation_url_regex = '/(.+)\/[a-z]+-form_confirmation\.html/i';
     6  public static $lightbox_url_regex = '/(.+)\/[a-z]+-[0-9]+-lightbox\.html/i';
     7  public static $variant_url_regex = '/(.+)\/[a-z]+\.html/i';
    68  // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches)
    79  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';
     
    168170      UBLogger::warning($message);
    169171      http_response_code(500);
    170     }
     172      $result = array(false, $message);
     173    } else {
     174      $result = array(true, null);
     175    }
     176
    171177    curl_close($curl);
     178
     179    return $result;
    172180  }
    173181
     
    191199  }
    192200
     201  public static function is_lightbox($proxyable_url_set, $url_without_protocol) {
     202    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     203                                            UBHTTP::$lightbox_url_regex,
     204                                            1,
     205                                            $url_without_protocol);
     206  }
     207
     208  public static function is_variant($proxyable_url_set, $url_without_protocol) {
     209    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     210                                            UBHTTP::$variant_url_regex,
     211                                            1,
     212                                            $url_without_protocol);
     213  }
     214
    193215  public static function is_tracking_link($proxyable_url_set, $url_without_protocol) {
    194216    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     
    205227    UBLogger::debug_var('get_url_purpose $path', $path);
    206228    UBLogger::debug_var('get_url_purpose $url_without_protocol', $url_without_protocol);
    207 
    208     $url_without_protocol_without_variant = preg_replace('/\/[a-zA-Z]+\.html$/', '', $url_without_protocol);
    209     UBLogger::debug_var('get_url_purpose $url_without_protocol_without_variant', $url_without_protocol_without_variant);
    210 
    211229    if ($http_method == 'GET' && $path == '/_ubhc') {
    212230      return 'HealthCheck';
    213 
    214231    } elseif ($http_method == "POST" &&
    215232        preg_match("/^\/(fsn|fsg|fs)\/?$/", $path)) {
    216233      return "SubmitLead";
    217 
    218234    } elseif ($http_method == "GET" &&
    219               UBHTTP::is_tracking_link($proxyable_url_set, $url_without_protocol_without_variant)) {
     235              UBHTTP::is_tracking_link($proxyable_url_set, $url_without_protocol)) {
    220236      return "TrackClick";
    221 
    222237    } elseif (($http_method == "GET" || $http_method == "POST") &&
    223                (in_array($url_without_protocol_without_variant, $proxyable_url_set) ||
    224                 UBHTTP::is_confirmation_dialog($proxyable_url_set, $url_without_protocol_without_variant))) {
     238               (in_array($url_without_protocol, $proxyable_url_set) ||
     239                UBHTTP::is_confirmation_dialog($proxyable_url_set, $url_without_protocol) ||
     240                UBHTTP::is_lightbox($proxyable_url_set, $url_without_protocol) ||
     241                UBHTTP::is_variant($proxyable_url_set, $url_without_protocol))) {
    225242      return "ViewLandingPage";
    226 
    227243    } else {
    228244      return null;
  • unbounce/tags/1.0.14/Unbounce-Page.php

    r1290232 r1295211  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.13
     6Version: 1.0.14
    77Author: Unbounce
    88Author URI: http://unbounce.com
     
    4040  add_option(UBConfig::UB_DOMAIN_ID_KEY);
    4141  add_option(UBConfig::UB_CLIENT_ID_KEY);
     42  add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY);
    4243});
    4344
    4445register_deactivation_hook(__FILE__, function() {
    45   delete_option(UBConfig::UB_ROUTES_CACHE_KEY);
    46   delete_option(UBConfig::UB_REMOTE_DEBUG_KEY);
    47   delete_option(UBConfig::UB_PAGE_SERVER_DOMAIN_KEY);
    48   delete_option(UBConfig::UB_REMOTE_LOG_URL_KEY);
    49   delete_option(UBConfig::UB_API_URL_KEY);
    50   delete_option(UBConfig::UB_API_CLIENT_ID_KEY);
    51   delete_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY);
    52   delete_option(UBConfig::UB_HAS_AUTHORIZED_KEY);
    53   delete_option(UBConfig::UB_REMOTE_EVENTS_URL_KEY);
    54   delete_option(UBConfig::UB_USER_ID_KEY);
    55   delete_option(UBConfig::UB_DOMAIN_ID_KEY);
    56   delete_option(UBConfig::UB_CLIENT_ID_KEY);
     46  foreach(UBConfig::ub_option_keys() as $key) {
     47    delete_option($key);
     48  }
    5749});
    5850
     
    148140    header('Cache-Control: max-age=0; private');
    149141
    150     UBHTTP::stream_request($http_method,
    151                            $raw_url,
    152                            $cookie_string,
    153                            $req_headers,
    154                            $user_agent);
     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) {
     149      update_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY, $message);
     150    }
    155151
    156152    $end = microtime(true);
  • unbounce/tags/1.0.14/readme.txt

    r1290232 r1295211  
    44Requires at least: 4.1.5
    55Tested up to: 4.3
    6 Stable tag: 1.0.13
     6Stable tag: 1.0.14
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • unbounce/tags/1.0.14/templates/main_authorized_footer.php

    r1290232 r1295211  
    1818</a>
    1919<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.13</p>
     20<p class="ub-version">Unbounce Version 1.0.14</p>
  • unbounce/tags/1.0.14/templates/main_unauthorized_footer.php

    r1290232 r1295211  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.13</p>
     7<p class="ub-version">Unbounce Version 1.0.14</p>
  • unbounce/trunk/UBConfig.php

    r1290232 r1295211  
    55  const UB_PLUGIN_NAME           = 'ub-wordpress';
    66  const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP';
    7   const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.13';
    8   const UB_VERSION               = '1.0.13';
     7  const UB_USER_AGENT            = 'Unbounce WP Plugin 1.0.14';
     8  const UB_VERSION               = '1.0.14';
    99
    1010  # Option keys
    11   const UB_ROUTES_CACHE_KEY       = 'ub-route-cache';
    12   const UB_REMOTE_DEBUG_KEY       = 'ub-remote-debug';
    13   const UB_PAGE_SERVER_DOMAIN_KEY = 'ub-page-server-domain';
    14   const UB_REMOTE_LOG_URL_KEY     = 'ub-remote-log-url';
    15   const UB_REMOTE_EVENTS_URL_KEY  = 'ub-remote-events-url';
    16   const UB_API_URL_KEY            = 'ub-api-url';
    17   const UB_API_CLIENT_ID_KEY      = 'ub-api-client-id';
    18   const UB_AUTHORIZED_DOMAINS_KEY = 'ub-authorized-domains';
    19   const UB_HAS_AUTHORIZED_KEY     = 'ub-has-authorized';
    20   const UB_USER_ID_KEY            = 'ub-user-id';
    21   const UB_DOMAIN_ID_KEY          = 'ub-domain-id';
    22   const UB_CLIENT_ID_KEY          = 'ub-client-id';
    23 
    24   const UB_LOCK_NAME              = 'ub-sql-lock';
     11  const UB_ROUTES_CACHE_KEY        = 'ub-route-cache';
     12  const UB_REMOTE_DEBUG_KEY        = 'ub-remote-debug';
     13  const UB_PAGE_SERVER_DOMAIN_KEY  = 'ub-page-server-domain';
     14  const UB_REMOTE_LOG_URL_KEY      = 'ub-remote-log-url';
     15  const UB_REMOTE_EVENTS_URL_KEY   = 'ub-remote-events-url';
     16  const UB_API_URL_KEY             = 'ub-api-url';
     17  const UB_API_CLIENT_ID_KEY       = 'ub-api-client-id';
     18  const UB_AUTHORIZED_DOMAINS_KEY  = 'ub-authorized-domains';
     19  const UB_HAS_AUTHORIZED_KEY      = 'ub-has-authorized';
     20  const UB_USER_ID_KEY             = 'ub-user-id';
     21  const UB_DOMAIN_ID_KEY           = 'ub-domain-id';
     22  const UB_CLIENT_ID_KEY           = 'ub-client-id';
     23  const UB_PROXY_ERROR_MESSAGE_KEY = 'ub-proxy-error-message';
     24
     25  const UB_LOCK_NAME               = 'ub-sql-lock';
    2526
    2627  public static function ub_option_keys() {
    27     # All options, used by UBDiagnostics
     28    # All options, used by UBDiagnostics and deactivation hook
    2829    # Arrays are not allowed in class constants, so use a function
    2930    return array(
     
    3940      UBConfig::UB_USER_ID_KEY,
    4041      UBConfig::UB_DOMAIN_ID_KEY,
    41       UBConfig::UB_CLIENT_ID_KEY
     42      UBConfig::UB_CLIENT_ID_KEY,
     43      UBConfig::UB_PROXY_ERROR_MESSAGE_KEY
    4244    );
    4345  }
  • unbounce/trunk/UBDiagnostics.php

    r1290232 r1295211  
    2929      'PHP Version'             => phpversion(),
    3030      'WordPress Version'       => UBDiagnostics::wordpress_version(),
    31       'Unbounce Plugin Version' => "1.0.13",
     31      'Unbounce Plugin Version' => "1.0.14",
    3232      'Permalink Structure'     => get_option('permalink_structure', ''),
    3333      'Domain'                  => $domain,
  • unbounce/trunk/UBHTTP.php

    r1290232 r1295211  
    33class UBHTTP {
    44  public static $powered_by_header_regex  = '/^X-Powered-By: (.+)$/i';
    5   public static $form_confirmation_url_regex = '/(.+)\/[a-z]+-form_confirmation\.html/';
     5  public static $form_confirmation_url_regex = '/(.+)\/[a-z]+-form_confirmation\.html/i';
     6  public static $lightbox_url_regex = '/(.+)\/[a-z]+-[0-9]+-lightbox\.html/i';
     7  public static $variant_url_regex = '/(.+)\/[a-z]+\.html/i';
    68  // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches)
    79  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';
     
    168170      UBLogger::warning($message);
    169171      http_response_code(500);
    170     }
     172      $result = array(false, $message);
     173    } else {
     174      $result = array(true, null);
     175    }
     176
    171177    curl_close($curl);
     178
     179    return $result;
    172180  }
    173181
     
    191199  }
    192200
     201  public static function is_lightbox($proxyable_url_set, $url_without_protocol) {
     202    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     203                                            UBHTTP::$lightbox_url_regex,
     204                                            1,
     205                                            $url_without_protocol);
     206  }
     207
     208  public static function is_variant($proxyable_url_set, $url_without_protocol) {
     209    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     210                                            UBHTTP::$variant_url_regex,
     211                                            1,
     212                                            $url_without_protocol);
     213  }
     214
    193215  public static function is_tracking_link($proxyable_url_set, $url_without_protocol) {
    194216    return UBHTTP::is_extract_url_proxyable($proxyable_url_set,
     
    205227    UBLogger::debug_var('get_url_purpose $path', $path);
    206228    UBLogger::debug_var('get_url_purpose $url_without_protocol', $url_without_protocol);
    207 
    208     $url_without_protocol_without_variant = preg_replace('/\/[a-zA-Z]+\.html$/', '', $url_without_protocol);
    209     UBLogger::debug_var('get_url_purpose $url_without_protocol_without_variant', $url_without_protocol_without_variant);
    210 
    211229    if ($http_method == 'GET' && $path == '/_ubhc') {
    212230      return 'HealthCheck';
    213 
    214231    } elseif ($http_method == "POST" &&
    215232        preg_match("/^\/(fsn|fsg|fs)\/?$/", $path)) {
    216233      return "SubmitLead";
    217 
    218234    } elseif ($http_method == "GET" &&
    219               UBHTTP::is_tracking_link($proxyable_url_set, $url_without_protocol_without_variant)) {
     235              UBHTTP::is_tracking_link($proxyable_url_set, $url_without_protocol)) {
    220236      return "TrackClick";
    221 
    222237    } elseif (($http_method == "GET" || $http_method == "POST") &&
    223                (in_array($url_without_protocol_without_variant, $proxyable_url_set) ||
    224                 UBHTTP::is_confirmation_dialog($proxyable_url_set, $url_without_protocol_without_variant))) {
     238               (in_array($url_without_protocol, $proxyable_url_set) ||
     239                UBHTTP::is_confirmation_dialog($proxyable_url_set, $url_without_protocol) ||
     240                UBHTTP::is_lightbox($proxyable_url_set, $url_without_protocol) ||
     241                UBHTTP::is_variant($proxyable_url_set, $url_without_protocol))) {
    225242      return "ViewLandingPage";
    226 
    227243    } else {
    228244      return null;
  • unbounce/trunk/Unbounce-Page.php

    r1290232 r1295211  
    44Plugin URI: http://unbounce.com
    55Description: Unbounce is the most powerful standalone landing page builder available.
    6 Version: 1.0.13
     6Version: 1.0.14
    77Author: Unbounce
    88Author URI: http://unbounce.com
     
    4040  add_option(UBConfig::UB_DOMAIN_ID_KEY);
    4141  add_option(UBConfig::UB_CLIENT_ID_KEY);
     42  add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY);
    4243});
    4344
    4445register_deactivation_hook(__FILE__, function() {
    45   delete_option(UBConfig::UB_ROUTES_CACHE_KEY);
    46   delete_option(UBConfig::UB_REMOTE_DEBUG_KEY);
    47   delete_option(UBConfig::UB_PAGE_SERVER_DOMAIN_KEY);
    48   delete_option(UBConfig::UB_REMOTE_LOG_URL_KEY);
    49   delete_option(UBConfig::UB_API_URL_KEY);
    50   delete_option(UBConfig::UB_API_CLIENT_ID_KEY);
    51   delete_option(UBConfig::UB_AUTHORIZED_DOMAINS_KEY);
    52   delete_option(UBConfig::UB_HAS_AUTHORIZED_KEY);
    53   delete_option(UBConfig::UB_REMOTE_EVENTS_URL_KEY);
    54   delete_option(UBConfig::UB_USER_ID_KEY);
    55   delete_option(UBConfig::UB_DOMAIN_ID_KEY);
    56   delete_option(UBConfig::UB_CLIENT_ID_KEY);
     46  foreach(UBConfig::ub_option_keys() as $key) {
     47    delete_option($key);
     48  }
    5749});
    5850
     
    148140    header('Cache-Control: max-age=0; private');
    149141
    150     UBHTTP::stream_request($http_method,
    151                            $raw_url,
    152                            $cookie_string,
    153                            $req_headers,
    154                            $user_agent);
     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) {
     149      update_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY, $message);
     150    }
    155151
    156152    $end = microtime(true);
  • unbounce/trunk/readme.txt

    r1290232 r1295211  
    44Requires at least: 4.1.5
    55Tested up to: 4.3
    6 Stable tag: 1.0.13
     6Stable tag: 1.0.14
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • unbounce/trunk/templates/main_authorized_footer.php

    r1290232 r1295211  
    1818</a>
    1919<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.13</p>
     20<p class="ub-version">Unbounce Version 1.0.14</p>
  • unbounce/trunk/templates/main_unauthorized_footer.php

    r1290232 r1295211  
    55  Click here for troubleshooting and plugin diagnostics
    66</a>
    7 <p class="ub-version">Unbounce Version 1.0.13</p>
     7<p class="ub-version">Unbounce Version 1.0.14</p>
Note: See TracChangeset for help on using the changeset viewer.