Changeset 1295211
- Timestamp:
- 11/26/2015 06:11:38 PM (9 years ago)
- Location:
- unbounce
- Files:
-
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
unbounce/tags/1.0.14/UBConfig.php
r1290232 r1295211 5 5 const UB_PLUGIN_NAME = 'ub-wordpress'; 6 6 const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP'; 7 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.1 3';8 const UB_VERSION = '1.0.1 3';7 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.14'; 8 const UB_VERSION = '1.0.14'; 9 9 10 10 # 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'; 25 26 26 27 public static function ub_option_keys() { 27 # All options, used by UBDiagnostics 28 # All options, used by UBDiagnostics and deactivation hook 28 29 # Arrays are not allowed in class constants, so use a function 29 30 return array( … … 39 40 UBConfig::UB_USER_ID_KEY, 40 41 UBConfig::UB_DOMAIN_ID_KEY, 41 UBConfig::UB_CLIENT_ID_KEY 42 UBConfig::UB_CLIENT_ID_KEY, 43 UBConfig::UB_PROXY_ERROR_MESSAGE_KEY 42 44 ); 43 45 } -
unbounce/tags/1.0.14/UBDiagnostics.php
r1290232 r1295211 29 29 'PHP Version' => phpversion(), 30 30 'WordPress Version' => UBDiagnostics::wordpress_version(), 31 'Unbounce Plugin Version' => "1.0.1 3",31 'Unbounce Plugin Version' => "1.0.14", 32 32 'Permalink Structure' => get_option('permalink_structure', ''), 33 33 'Domain' => $domain, -
unbounce/tags/1.0.14/UBHTTP.php
r1290232 r1295211 3 3 class UBHTTP { 4 4 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'; 6 8 // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches) 7 9 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'; … … 168 170 UBLogger::warning($message); 169 171 http_response_code(500); 170 } 172 $result = array(false, $message); 173 } else { 174 $result = array(true, null); 175 } 176 171 177 curl_close($curl); 178 179 return $result; 172 180 } 173 181 … … 191 199 } 192 200 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 193 215 public static function is_tracking_link($proxyable_url_set, $url_without_protocol) { 194 216 return UBHTTP::is_extract_url_proxyable($proxyable_url_set, … … 205 227 UBLogger::debug_var('get_url_purpose $path', $path); 206 228 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 211 229 if ($http_method == 'GET' && $path == '/_ubhc') { 212 230 return 'HealthCheck'; 213 214 231 } elseif ($http_method == "POST" && 215 232 preg_match("/^\/(fsn|fsg|fs)\/?$/", $path)) { 216 233 return "SubmitLead"; 217 218 234 } 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)) { 220 236 return "TrackClick"; 221 222 237 } 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))) { 225 242 return "ViewLandingPage"; 226 227 243 } else { 228 244 return null; -
unbounce/tags/1.0.14/Unbounce-Page.php
r1290232 r1295211 4 4 Plugin URI: http://unbounce.com 5 5 Description: Unbounce is the most powerful standalone landing page builder available. 6 Version: 1.0.1 36 Version: 1.0.14 7 7 Author: Unbounce 8 8 Author URI: http://unbounce.com … … 40 40 add_option(UBConfig::UB_DOMAIN_ID_KEY); 41 41 add_option(UBConfig::UB_CLIENT_ID_KEY); 42 add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY); 42 43 }); 43 44 44 45 register_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 } 57 49 }); 58 50 … … 148 140 header('Cache-Control: max-age=0; private'); 149 141 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 } 155 151 156 152 $end = microtime(true); -
unbounce/tags/1.0.14/readme.txt
r1290232 r1295211 4 4 Requires at least: 4.1.5 5 5 Tested up to: 4.3 6 Stable tag: 1.0.1 36 Stable tag: 1.0.14 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
unbounce/tags/1.0.14/templates/main_authorized_footer.php
r1290232 r1295211 18 18 </a> 19 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.1 3</p>20 <p class="ub-version">Unbounce Version 1.0.14</p> -
unbounce/tags/1.0.14/templates/main_unauthorized_footer.php
r1290232 r1295211 5 5 Click here for troubleshooting and plugin diagnostics 6 6 </a> 7 <p class="ub-version">Unbounce Version 1.0.1 3</p>7 <p class="ub-version">Unbounce Version 1.0.14</p> -
unbounce/trunk/UBConfig.php
r1290232 r1295211 5 5 const UB_PLUGIN_NAME = 'ub-wordpress'; 6 6 const UB_CACHE_TIMEOUT_ENV_KEY = 'UB_WP_ROUTES_CACHE_EXP'; 7 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.1 3';8 const UB_VERSION = '1.0.1 3';7 const UB_USER_AGENT = 'Unbounce WP Plugin 1.0.14'; 8 const UB_VERSION = '1.0.14'; 9 9 10 10 # 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'; 25 26 26 27 public static function ub_option_keys() { 27 # All options, used by UBDiagnostics 28 # All options, used by UBDiagnostics and deactivation hook 28 29 # Arrays are not allowed in class constants, so use a function 29 30 return array( … … 39 40 UBConfig::UB_USER_ID_KEY, 40 41 UBConfig::UB_DOMAIN_ID_KEY, 41 UBConfig::UB_CLIENT_ID_KEY 42 UBConfig::UB_CLIENT_ID_KEY, 43 UBConfig::UB_PROXY_ERROR_MESSAGE_KEY 42 44 ); 43 45 } -
unbounce/trunk/UBDiagnostics.php
r1290232 r1295211 29 29 'PHP Version' => phpversion(), 30 30 'WordPress Version' => UBDiagnostics::wordpress_version(), 31 'Unbounce Plugin Version' => "1.0.1 3",31 'Unbounce Plugin Version' => "1.0.14", 32 32 'Permalink Structure' => get_option('permalink_structure', ''), 33 33 'Domain' => $domain, -
unbounce/trunk/UBHTTP.php
r1290232 r1295211 3 3 class UBHTTP { 4 4 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'; 6 8 // Suppress Etag and Last-Modified so that browser doesn't send If-None-Match and If-Modified-Since header (to bypass front-end caches) 7 9 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'; … … 168 170 UBLogger::warning($message); 169 171 http_response_code(500); 170 } 172 $result = array(false, $message); 173 } else { 174 $result = array(true, null); 175 } 176 171 177 curl_close($curl); 178 179 return $result; 172 180 } 173 181 … … 191 199 } 192 200 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 193 215 public static function is_tracking_link($proxyable_url_set, $url_without_protocol) { 194 216 return UBHTTP::is_extract_url_proxyable($proxyable_url_set, … … 205 227 UBLogger::debug_var('get_url_purpose $path', $path); 206 228 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 211 229 if ($http_method == 'GET' && $path == '/_ubhc') { 212 230 return 'HealthCheck'; 213 214 231 } elseif ($http_method == "POST" && 215 232 preg_match("/^\/(fsn|fsg|fs)\/?$/", $path)) { 216 233 return "SubmitLead"; 217 218 234 } 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)) { 220 236 return "TrackClick"; 221 222 237 } 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))) { 225 242 return "ViewLandingPage"; 226 227 243 } else { 228 244 return null; -
unbounce/trunk/Unbounce-Page.php
r1290232 r1295211 4 4 Plugin URI: http://unbounce.com 5 5 Description: Unbounce is the most powerful standalone landing page builder available. 6 Version: 1.0.1 36 Version: 1.0.14 7 7 Author: Unbounce 8 8 Author URI: http://unbounce.com … … 40 40 add_option(UBConfig::UB_DOMAIN_ID_KEY); 41 41 add_option(UBConfig::UB_CLIENT_ID_KEY); 42 add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY); 42 43 }); 43 44 44 45 register_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 } 57 49 }); 58 50 … … 148 140 header('Cache-Control: max-age=0; private'); 149 141 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 } 155 151 156 152 $end = microtime(true); -
unbounce/trunk/readme.txt
r1290232 r1295211 4 4 Requires at least: 4.1.5 5 5 Tested up to: 4.3 6 Stable tag: 1.0.1 36 Stable tag: 1.0.14 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
unbounce/trunk/templates/main_authorized_footer.php
r1290232 r1295211 18 18 </a> 19 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.1 3</p>20 <p class="ub-version">Unbounce Version 1.0.14</p> -
unbounce/trunk/templates/main_unauthorized_footer.php
r1290232 r1295211 5 5 Click here for troubleshooting and plugin diagnostics 6 6 </a> 7 <p class="ub-version">Unbounce Version 1.0.1 3</p>7 <p class="ub-version">Unbounce Version 1.0.14</p>
Note: See TracChangeset
for help on using the changeset viewer.