PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 150
Lasso Lite – Affiliate Link Manager & Product Displays v150
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
simple-urls / admin / views / footer.php

footer.php in Lasso Lite – Affiliate Link Manager & Product Displays 150, at admin/views/footer.php

561 lines 20.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Footer HTML
4 *
5 * @package Footer
6 */
7 use LassoLite\Admin\Constant;
8
9 use LassoLite\Classes\Enum;
10 use LassoLite\Classes\Helper;
11 use LassoLite\Classes\License;
12 use LassoLite\Classes\Page;
13 use LassoLite\Classes\Setting;
14
15 $current_page = $_GET['page'] ?? '';
16 $import_page_slug = Helper::add_prefix_page( Enum::PAGE_IMPORT );
17 $amazon_page_slug = Helper::add_prefix_page( Enum::PAGE_SETTINGS_AMAZON );
18 $ajax_url = admin_url( 'admin-ajax.php' );
19
20 $user_email = get_option( 'admin_email' ); // phpcs:ignore
21 $user_email = get_option( 'lasso_license_email', $user_email );
22
23 $settings = Setting::get_settings();
24 $support_enable = $settings[ Enum::SUPPORT_ENABLED ] ?? 0;
25 $general_disable_notification = (bool) $settings['general_disable_notification'];
26 $customer_flow_enabled = (int) $settings[ Enum::CUSTOMER_FLOW_ENABLED ];
27
28 $lasso_lite_setting = new Setting();
29 $plugins_for_import = $lasso_lite_setting->check_plugins_for_import();
30 $import_page_link = Page::get_lite_page_url( Enum::PAGE_IMPORT );
31 $license_active = License::get_license_status();
32 $is_connected_aff = intval( Helper::get_option( Constant::LASSO_OPTION_IS_CONNECTED_AFFILIATE, '0' ) );
33 $is_show_upsell = ! $license_active && 0 === $is_connected_aff;
34 $intercom_jwt = $settings[ Enum::INTERCOM_JWT ] ?? '';
35
36 // Normalize email before Intercom usage.
37 $user_email = strtolower( trim( $user_email ) );
38 $checksum_file = SIMPLE_URLS_DIR . '/checksum.txt';
39 $commit_hash = file_exists( $checksum_file ) && is_readable( $checksum_file ) ? trim( (string) file_get_contents( $checksum_file ) ) : ''; // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
40 if ( '' !== $commit_hash ) {
41 $commit_hash = 'lasso-lite-rc' . $commit_hash;
42 }
43
44 ?>
45 <input type="hidden" id="license_status" value="<?php echo $license_active; ?>">
46
47 <?php
48 if ( ! $lasso_lite_setting->is_setting_onboarding_page() ) {
49 $is_connected_aff = intval( Helper::get_option( Constant::LASSO_OPTION_IS_CONNECTED_AFFILIATE, '0' ) );
50 $lasso_account_email = Helper::get_option( Constant::LASSO_ACCOUNT_EMAIL, '' );
51 $lasso_account_user_id = intval( Helper::get_option( Constant::LASSO_ACCOUNT_USER_ID, 0 ) );
52 $is_lasso_connected = ! empty( $lasso_account_email ) || $lasso_account_user_id > 0 || $is_connected_aff > 0;
53 $prefill_email = get_option( 'admin_email' );
54
55 $lasso_logo_url = esc_url( rtrim( SIMPLE_URLS_URL, '/' ) . '/admin/assets/images/lasso-logo.svg' );
56 $footer_links = array(
57 array(
58 'label' => 'About',
59 'href' => 'https://getlasso.co/about/',
60 ),
61 array(
62 'label' => 'Help Center',
63 'href' => 'https://support.getlasso.co/',
64 ),
65 array(
66 'label' => 'Go Pro',
67 'href' => Constant::LASSO_UPGRADE_URL,
68 ),
69 );
70
71 $render_footer_brand_social = function () use ( $lasso_logo_url ) {
72 ?>
73 <div class="lasso-footer-brand">
74 <a href="https://getlasso.co" target="_blank" rel="noopener">
75 <img src="<?php echo $lasso_logo_url; ?>" alt="Lasso Logo" class="lasso-footer-logo">
76 </a>
77 <div class="lasso-footer-social">
78 <a href="https://twitter.com/lassowp" target="_blank" rel="noopener nofollow" title="Twitter">
79 <i class="fa-brands fa-twitter"></i>
80 </a>
81 <a href="https://www.linkedin.com/company/lasso-analytics/" target="_blank" rel="noopener nofollow" title="LinkedIn">
82 <i class="fa-brands fa-linkedin-in"></i>
83 </a>
84 <a href="https://www.instagram.com/getlassoco/" target="_blank" rel="noopener nofollow" title="Instagram">
85 <i class="fa-brands fa-instagram"></i>
86 </a>
87 <a href="https://www.youtube.com/@getlasso" target="_blank" rel="noopener nofollow" title="YouTube">
88 <i class="fa-brands fa-youtube"></i>
89 </a>
90 </div>
91 </div>
92 <?php
93 };
94
95 $render_footer_links = function ( $link_class = '' ) use ( $footer_links ) {
96 foreach ( $footer_links as $link ) {
97 $href = esc_url( $link['href'] );
98 $label = esc_html( $link['label'] );
99 ?>
100 <a <?php echo $link_class ? 'class="' . esc_attr( $link_class ) . '"' : ''; ?> href="<?php echo $href; ?>" target="_blank" rel="noopener">
101 <?php echo $label; ?>
102 </a>
103 <?php
104 }
105 };
106 ?>
107
108 <footer class="lasso-plugin-footer <?php echo $is_lasso_connected ? 'lasso-plugin-footer--default-only' : 'lasso-plugin-footer--with-cta'; ?>">
109 <div class="lasso-plugin-footer-version">
110 <?php print 'Version ' . LASSO_LITE_VERSION; // phpcs:ignore ?>
111 <?php if ( '' !== $commit_hash ) : ?>
112 <span class="d-block mt-1"><?php echo esc_html( $commit_hash ); ?></span>
113 <?php endif; ?>
114 </div>
115
116 <?php if ( ! $is_lasso_connected ) : ?>
117 <div class="lasso-footer-cta-content">
118 <div class="lasso-plugin-footer-version">
119 <?php print 'Version ' . LASSO_LITE_VERSION; // phpcs:ignore ?>
120 <?php if ( '' !== $commit_hash ) : ?>
121 <span class="d-block mt-1"><?php echo esc_html( $commit_hash ); ?></span>
122 <?php endif; ?>
123 </div>
124
125 <div class="lasso-footer-cta">
126 <div class="lasso-footer-cta-inner">
127 <h2 class="lasso-footer-cta-title">Create Your Free Account</h2>
128 <p class="lasso-footer-cta-subtitle">Access free click tracking, private brand deals, and more.</p>
129
130 <div id="lasso-signup-wrapper" class="lasso-footer-signup-wrapper">
131 <button id="btn-google-signup" class="lasso-signup-btn lasso-signup-btn-google w-100 mb-3">
132 <svg width="20" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
133 <path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z" fill="#4285F4"/>
134 <path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/>
135 <path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/>
136 <path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/>
137 </svg>
138 Sign Up with Google
139 </button>
140
141 <button id="btn-email-signup-toggle" class="lasso-signup-btn w-100 mb-3">
142 Sign Up with Email
143 <svg aria-hidden="true" focusable="false" width="6px" height="8px" viewBox="0 0 8 12" xmlns="http://www.w3.org/2000/svg">
144 <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
145 <g transform="translate(-148.000000, -32.000000)" fill="#7c3aed">
146 <polygon points="148 33.4 149.4 32 155.4 38 149.4 44 148 42.6 152.6 38"></polygon>
147 </g>
148 </g>
149 </svg>
150 </button>
151
152 <div id="lasso-email-signup-form" class="footer-form d-none">
153 <div class="lasso-signup-divider mb-3">
154 <span>or</span>
155 </div>
156
157 <div class="form-group mb-3">
158 <label for="lasso-signup-email" class="d-block text-left mb-2">Email</label>
159 <input
160 type="email"
161 id="lasso-signup-email"
162 class="form-control"
163 placeholder="Enter your email"
164 value="<?php echo esc_attr( $prefill_email ); ?>"
165 >
166 <div id="lasso-email-error" class="lasso-field-error d-none"></div>
167 </div>
168
169 <div class="form-group mb-3">
170 <label for="lasso-signup-password" class="d-block text-left mb-2">Password</label>
171 <div class="lasso-password-wrapper">
172 <input
173 type="password"
174 id="lasso-signup-password"
175 class="form-control"
176 placeholder="Enter your password"
177 >
178 <button type="button" id="lasso-toggle-password" class="lasso-password-toggle">
179 <svg id="lasso-eye-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
180 <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
181 <circle cx="12" cy="12" r="3"></circle>
182 </svg>
183 <svg id="lasso-eye-off-icon" class="d-none" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
184 <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
185 <line x1="1" y1="1" x2="23" y2="23"></line>
186 </svg>
187 </button>
188 </div>
189 <div id="lasso-password-error" class="lasso-field-error d-none"></div>
190 </div>
191
192 <div id="lasso-general-error" class="lasso-general-error d-none mb-3"></div>
193
194 <button id="btn-create-account" class="lasso-signup-btn w-100">
195 Create your account
196 </button>
197 </div>
198 </div>
199
200 <div class="lasso-footer-cta-footer">
201 <?php $render_footer_brand_social(); ?>
202 <?php $render_footer_links( 'lasso-footer-nav-link' ); ?>
203 </div>
204 </div>
205 </div>
206 </div>
207
208 <input type="hidden" id="footer-prefill-email" value="<?php echo esc_attr( $prefill_email ); ?>">
209 <input type="hidden" id="footer-lasso-hub-url" value="<?php echo esc_attr( Constant::get_lasso_hub_url() ); ?>">
210 <?php endif; ?>
211
212 <?php if ( $is_lasso_connected ) : ?>
213 <div class="lasso-footer-default">
214 <div class="lasso-footer-inner">
215 <?php $render_footer_brand_social(); ?>
216 <div class="lasso-footer-links">
217 <?php $render_footer_links(); ?>
218 </div>
219 </div>
220 </div>
221 <?php endif; ?>
222 </footer>
223 <?php } ?>
224
225 <script>
226 // Check existing account via admin-ajax so it's visible in DevTools Network.
227 window.lassoLiteCheckExistingAccount = function () {
228 try {
229 if (window.__lassoLiteExistingAccountCheckRan) return;
230 window.__lassoLiteExistingAccountCheckRan = true;
231
232 if (!window.lassoLiteOptionsData || !lassoLiteOptionsData.ajax_url) return;
233 if (!lassoLiteOptionsData.optionsNonce) return;
234
235 // Only run when we don't already have a synced user_id.
236 var userId = parseInt((lassoLiteOptionsData.userId || 0), 10) || 0;
237 if (userId > 0) return;
238
239 jQuery.ajax({
240 url: lassoLiteOptionsData.ajax_url,
241 type: 'POST',
242 dataType: 'json',
243 data: {
244 action: 'lasso_lite_check_existing_account',
245 nonce: lassoLiteOptionsData.optionsNonce
246 }
247 });
248 } catch (e) {}
249 };
250
251 jQuery(function () {
252 window.lassoLiteCheckExistingAccount();
253 });
254 </script>
255
256 <div class="modal fade" id="modal-save-animation" data-backdrop="static" tabindex="-1" role="dialog">
257 <div class="modal-dialog" role="document">
258 <div class="modal-content p-5 shadow text-center">
259 <h3></h3>
260 <p>Saving your changes now.</p>
261 <div class="progress">
262 <div class="progress-bar progress-bar-striped progress-bar-animated green-bg" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
263 </div>
264 </div>
265 </div>
266 </div>
267
268 <div id="up-sell-modal">
269 <p class="large">This is a premium feature.</p>
270 <a href="<?php echo esc_url( Constant::LASSO_UPGRADE_URL ); ?>" target="_blank">Upgrade to Lasso Pro</a>
271 </div>
272
273 <?php if ( ! $lasso_lite_setting->is_setting_onboarding_page() && empty( $intercom_jwt ) ) { ?>
274 <div id="support-launcher">
275 <i class="fas fa-question icon-default"></i>
276 <i class="fas fa-times icon-close"></i>
277 </div>
278 <?php } ?>
279
280 <?php
281 echo Helper::wrapper_js_render( 'import-suggestion-jsrender', Helper::get_path_views_folder() . 'notifications/import-suggestion-jsrender.html' );
282 ?>
283 <?php
284 echo Helper::wrapper_js_render( 'earnings-notification-jsrender', Helper::get_path_views_folder() . 'notifications/earnings-notification-jsrender.html' );
285 ?>
286 <?php
287 echo Helper::wrapper_js_render( 'amazon-credentials-update-jsrender', Helper::get_path_views_folder() . 'notifications/amazon-credentials-update-jsrender.html' );
288 ?>
289
290 <!-- MODALS -->
291 <?php
292 if ( ! $customer_flow_enabled ) {
293 require_once SIMPLE_URLS_DIR . '/admin/views/modals/customer-flow-confirm.php';
294 }
295 ?>
296
297 <?php
298 // ? Show notification for import plugin
299 if ( '' !== $plugins_for_import && ! $general_disable_notification && $import_page_slug !== $current_page && Helper::is_importable() ) :
300 ?>
301 <script>
302 let json_data = [{ import_page_link: '<?php echo $import_page_link; ?>' }];
303 lasso_lite_helper.inject_to_template(jQuery("#lasso_lite_notifications"), 'import-suggestion-jsrender', json_data);
304 </script>
305 <?php endif; ?>
306
307 <?php
308 $template_path = '';
309 if ( $is_show_upsell ) {
310 if ( ! $support_enable && ! $lasso_lite_setting->is_setting_onboarding_page() ) {
311 $template_path = '/admin/views/notifications/promotions-no-intercom-jsrender.html';
312 } else {
313 $template_path = '/admin/views/notifications/promotions-intercom-jsrender.html';
314 }
315 }
316
317 ?>
318
319 <?php if ( 0 !== intval( Helper::get_option( Constant::LASSO_OPTION_AFFILIATE_PROMOTIONS, '1' ) ) && $is_show_upsell && '' !== $template_path ) : ?>
320 <script>
321 var notificationHtml = `<?php include SIMPLE_URLS_DIR . $template_path; ?>`;
322 jQuery("#lasso_lite_notifications").append(notificationHtml);
323 jQuery('#lasso-intercom-promotions button.close').click(function() {
324 let btn = jQuery(this);
325 jQuery.ajax({
326 url: '<?php echo $ajax_url; // phpcs:ignore ?>',
327 type: 'post',
328 data: {
329 action: 'lasso_lite_disable_affiliate_promotions',
330 nonce: lassoLiteOptionsData.optionsNonce,
331 },
332 }).done(function(res) {
333 jQuery('#lasso-intercom-promotions').collapse('hide');
334 });
335 });
336
337 // ? Redirect to Lasso dashboard and show modal connect to Lasso
338 if (window.location.href.indexOf( 'post_type=surl&page=surl-dashboard&is-connect=1' ) !== -1) {
339 jQuery("#enable-support").modal('show');
340 var newUrl = window.location.href.replace('&is-connect=1', '');
341 window.history.replaceState(null, null, newUrl);
342 }
343 </script>
344 <?php endif; ?>
345
346 <?php if ( $amazon_page_slug !== $current_page && Helper::show_amazon_credentials_notice() ) : ?>
347 <script>
348 jQuery(function () {
349 lasso_lite_helper.inject_to_template(
350 jQuery("#lasso_lite_notifications"),
351 'amazon-credentials-update-jsrender',
352 {
353 amazon_settings_url: '<?php echo esc_js( Page::get_lite_page_url( Enum::PAGE_SETTINGS_AMAZON ) ); ?>'
354 },
355 false
356 );
357 jQuery('#lasso-amazon-credentials-update').collapse('show');
358
359 jQuery(document).on('click', '#lasso-amazon-credentials-update button.close', function() {
360 jQuery.ajax({
361 url: '<?php echo $ajax_url; // phpcs:ignore ?>',
362 type: 'post',
363 data: {
364 action: 'lasso_lite_dismiss_notice',
365 nonce: lassoLiteOptionsData.optionsNonce,
366 option_name: '<?php echo esc_js( Constant::LASSO_OPTION_AMAZON_CREDENTIALS_NOTICE_DISMISSED ); ?>',
367 },
368 }).done(function() {
369 jQuery('#lasso-amazon-credentials-update').collapse('hide');
370 });
371 });
372 });
373 </script>
374 <?php endif; ?>
375
376 <?php if ( ! $lasso_lite_setting->is_setting_onboarding_page() && ! $is_lasso_connected ) : ?>
377 <script>
378 jQuery(function () {
379 try {
380 var now = new Date();
381 var monthKey = now.getFullYear() + '-' + (now.getMonth() + 1);
382 var dismissedMonth = localStorage.getItem('lasso_lite_earnings_notification_dismissed_month');
383 if (dismissedMonth === monthKey) return;
384
385 if (!window.lassoLiteOptionsData || !lassoLiteOptionsData.ajax_url) return;
386 if (!lassoLiteOptionsData.optionsNonce) return;
387
388 var useCache = '1';
389 try {
390 var url = new URL(window.location.href);
391 useCache = (url.searchParams.get('use_cache') || '1');
392 } catch (e) {}
393
394 jQuery.ajax({
395 url: lassoLiteOptionsData.ajax_url,
396 type: 'post',
397 dataType: 'json',
398 data: {
399 action: 'lasso_lite_get_earnings_estimate',
400 nonce: lassoLiteOptionsData.optionsNonce,
401 use_cache: useCache
402 }
403 }).done(function (res) {
404 if (!res || !res.success || !res.data) return;
405 var data = res.data.data ? res.data.data : res.data;
406
407 var tplData = {
408 earnings_display: data.payout_30d,
409 signup_url: '<?php echo esc_js( Constant::LASSO_PLUS_SIGNUP_URL ); ?>'
410 };
411
412 lasso_lite_helper.inject_to_template(
413 jQuery("#lasso_lite_notifications"),
414 'earnings-notification-jsrender',
415 tplData,
416 false
417 );
418 jQuery('#lasso-earnings-notification').collapse('show');
419 });
420
421 jQuery(document).on('click', '#lasso-earnings-notification button.close', function(e) {
422 try {
423 localStorage.setItem('lasso_lite_earnings_notification_dismissed_month', monthKey);
424 } catch (err) {}
425 jQuery('#lasso-earnings-notification').collapse('hide');
426 });
427 } catch (e) {}
428 });
429 </script>
430 <?php endif; ?>
431
432 <!-- JS errors detection -->
433 <script
434 src="https://browser.sentry-cdn.com/7.9.0/bundle.tracing.min.js"
435 integrity="sha384-a80B6QRSQ+pPpoX+H79BVaE52KTvYkQDL+lD8+TajwMxswO+ywB3p99gWNraTNrt"
436 crossorigin="anonymous"
437 ></script>
438
439 <script>
440 var license_active = '<?php echo $license_active ? 1 : 0; // phpcs:ignore ?>';
441 let lasso_path = '<?php echo SIMPLE_URLS_URL; // phpcs:ignore ?>';
442 let post_type = 'post_type=<?php echo SIMPLE_URLS_SLUG; // phpcs:ignore ?>';
443 Sentry.init({
444 dsn: '<?php echo Constant::SENTRY_DSN; // phpcs:ignore ?>',
445 release: '<?php echo LASSO_LITE_VERSION; // phpcs:ignore ?>',
446 ignoreErrors: [
447 'ResizeObserver loop limit exceeded',
448 'ResizeObserver loop completed with undelivered notifications',
449 '__ez is not defined',
450 '_ezaq is not defined',
451 'Can\'t find variable: _ezaq',
452 'wpColorPickerL10n is not defined',
453 'window.jQuery(...).wpColorPicker is not a function',
454 ],
455 integrations: [new Sentry.Integrations.BrowserTracing()],
456 tracesSampleRate: 1.0,
457 beforeSend(event, hint) {
458 try {
459 let is_lasso_lite_error = false;
460 let event_id = event.event_id;
461 let frames = event.exception.values[0].stacktrace.frames;
462 for(let i = 0; i < frames.length; i++) {
463 if(frames[i].filename.includes(lasso_path) || frames[i].filename.includes(post_type)) {
464 is_lasso_lite_error = true;
465 break;
466 }
467 }
468
469 if(is_lasso_lite_error) {
470 return event;
471 }
472 } catch (error) {
473 console.log(error);
474 }
475 }
476 });
477
478 Sentry.configureScope(function(scope) {
479 scope.setUser({
480 email: '<?php echo $user_email; ?>',
481 });
482 scope.setTag('site_id', '<?php echo Helper::get_option( Constant::SITE_ID_KEY ); ?>');
483 scope.setTag('wp_version', '
484 <?php
485 global $wp_version;
486 echo esc_js( $wp_version );
487 ?>
488 ');
489 });
490
491 </script>
492 <script>
493 // Expose APP_ID and a reusable loader so other scripts can init Intercom after AJAX
494 var APP_ID = '<?php echo Constant::LASSO_INTERCOM_APP_ID; // phpcs:ignore ?>';
495 window.lassoInitIntercom = function(intercomParams, options) {
496 try {
497 // Ensure app_id always present in settings
498 if (!intercomParams) intercomParams = {};
499 if (!intercomParams.app_id) intercomParams.app_id = APP_ID;
500 window.intercomSettings = intercomParams;
501 var shouldShow = !options || options.show !== false;
502 var onReady = function() {
503 try {
504 window.Intercom('reattach_activator');
505 window.Intercom('update', window.intercomSettings);
506 if (shouldShow) {
507 window.Intercom('show');
508 }
509 } catch (e) {}
510 };
511 if (typeof window.Intercom === 'function') {
512 onReady();
513 return;
514 }
515 var s = document.createElement('script');
516 s.type = 'text/javascript';
517 s.async = true;
518 s.src = 'https://widget.intercom.io/widget/' + APP_ID;
519 s.onload = onReady;
520 var x = document.getElementsByTagName('script')[0];
521 x.parentNode.insertBefore(s, x);
522 } catch (e) {}
523 }
524 </script>
525 <!-- PHP errors detection -->
526 <?php
527 echo Helper::wrapper_js_render( 'setup-pregress-jsrender', Helper::get_path_views_folder() . 'components/setup-progress-jsrender.html' );
528 ?>
529 <?php
530 if ( $intercom_jwt && ! $lasso_lite_setting->is_setting_onboarding_page() ) {
531 $intercom_user_id = Helper::get_intercom_user_id( $user_email, $intercom_jwt );
532 $user = get_user_by( 'email', $user_email );
533 $user_name = isset( $user->display_name ) ? $user->display_name : get_bloginfo( 'name' );
534 $classic_editor = Helper::is_classic_editor() ? 1 : 0;
535 $email_support = $settings[ Enum::EMAIL_SUPPORT ] ?? $user_email;
536 $email_support = strtolower( trim( $email_support ) );
537 $user_hash = $settings[ Enum::USER_HASH ] ?? '';
538 $lasso_lite_user = 1;
539 if ( Helper::is_lasso_pro_plugin_active() ) {
540 $lasso_lite_user = 0;
541 }
542 ?>
543
544 <script>
545 var isClassicEditor = '<?php echo $classic_editor; // phpcs:ignore ?>' == 1 ? true : false;
546 var lasso_lite_user = '<?php echo $lasso_lite_user; // phpcs:ignore ?>' == 1 ? true : false;
547 var intercomParams = {
548 app_id: APP_ID,
549 name: '<?php echo addslashes( $user_name ); // phpcs:ignore ?>',
550 user_id: '<?php echo esc_js( $intercom_user_id ); // phpcs:ignore ?>',
551 email: '<?php echo esc_js( $email_support ); // phpcs:ignore ?>',
552 lasso_version: parseInt('<?php echo LASSO_LITE_VERSION; // phpcs:ignore ?>'),
553 classic_editor: isClassicEditor,
554 wp_admin_url: '<?php echo admin_url(); // phpcs:ignore ?>',
555 lasso_lite_user: lasso_lite_user,
556 intercom_user_jwt: '<?php echo $intercom_jwt; ?>'
557 };
558 window.lassoInitIntercom(intercomParams, { show: false });
559 </script>
560 <?php } ?>
561