| @@ -119,8 +119,9 @@ | ||
| 119 | 119 | const OPTION_REALTIME_CHANNEL_ID = 'lasso_lite_realtime_channel_id'; |
| 120 | 120 | const OPTION_REALTIME_INGEST_SECRET = 'lasso_lite_realtime_ingest_secret'; |
| 121 | 121 | const OPTION_REALTIME_CLICK_QUEUE = 'lasso_lite_realtime_click_queue'; |
| 122 | 122 | |
| 123 | + /** Default Hub app URL; use {@see self::get_lasso_hub_url()} for the effective base URL. */ | |
| 123 | 124 | const LASSO_HUB_URL = 'https://app.getlasso.co'; |
| 124 | 125 | const LASSO_ACCOUNT_EMAIL = 'lasso_account_email'; |
| 125 | 126 | const LASSO_ACCOUNT_API_KEY = 'lasso_account_api_key'; |
| 126 | 127 | const LASSO_ACCOUNT_USER_ID = 'lasso_account_user_id'; |
| @@ -216,8 +217,24 @@ | ||
| 216 | 217 | 'rating', |
| 217 | 218 | ), |
| 218 | 219 | 'notice' => 'For a detailed list of all customization options, visit our <a href="https://support.getlasso.co/en/articles/4575092-shortcode-reference-guide" target="_blank">Shortcode Reference Guide</a>.', |
| 219 | 220 | ); |
| 221 | + | |
| 222 | + /** | |
| 223 | + * Hub base URL without trailing slash. Override via `LASSO_LITE_HUB_URL` (wp-config.php) or `lasso_lite_hub_url`. | |
| 224 | + * | |
| 225 | + * @return string | |
| 226 | + */ | |
| 227 | + public static function get_lasso_hub_url() { | |
| 228 | + $url = self::LASSO_HUB_URL; | |
| 229 | + if ( defined( 'LASSO_LITE_HUB_URL' ) && is_string( LASSO_LITE_HUB_URL ) && LASSO_LITE_HUB_URL !== '' ) { | |
| 230 | + $url = LASSO_LITE_HUB_URL; | |
| 231 | + } | |
| 232 | + if ( function_exists( 'apply_filters' ) ) { | |
| 233 | + $url = (string) apply_filters( 'lasso_lite_hub_url', $url ); | |
| 234 | + } | |
| 235 | + return rtrim( $url, '/' ); | |
| 236 | + } | |
| 220 | 237 | } |
| 221 | 238 | |
| 222 | 239 | // Path for vanity JS served by the plugin and its source file location |
| 223 | 240 | if ( ! defined( 'LASSO_SNIPPET_VANITY_PATH_LITE' ) ) { |
| @@ -224,5 +241,13 @@ | ||
| 224 | 241 | define( 'LASSO_SNIPPET_VANITY_PATH_LITE', '/js/snippet.min.js' ); |
| 225 | 242 | } |
| 226 | 243 | if ( ! defined( 'LASSO_CONNECT_SNIPPET_FILE_LITE' ) ) { |
| 227 | 244 | define( 'LASSO_CONNECT_SNIPPET_FILE_LITE', SIMPLE_URLS_PLUGIN_PATH . '/admin/assets/js/connect-snippet.min.js' ); |
| 245 | +} | |
| 246 | + | |
| 247 | +if ( ! defined( 'LASSO_BEACON_VANITY_PATH' ) ) { | |
| 248 | + define( 'LASSO_BEACON_VANITY_PATH', '/js/e' ); | |
| 249 | +} | |
| 250 | + | |
| 251 | +if ( ! defined( 'LASSO_BEACON_QUERY' ) ) { | |
| 252 | + define( 'LASSO_BEACON_QUERY', 'lasso_js_e' ); | |
| 228 | 253 | } |