| 1 |
<?php |
| 2 |
/** |
| 3 |
* Dashboard |
| 4 |
* |
| 5 |
* @package Dashboard |
| 6 |
*/ |
| 7 |
|
| 8 |
use LassoLite\Classes\Config; |
| 9 |
use LassoLite\Classes\Enum; |
| 10 |
use LassoLite\Classes\Helper; |
| 11 |
use LassoLite\Classes\Setting; |
| 12 |
use LassoLite\Classes\SURL; |
| 13 |
|
| 14 |
$dashboard_link_count = SURL::total(); |
| 15 |
$link_search_txt = esc_html( $_GET['link-search-input'] ?? '' ); |
| 16 |
$lasso_account_email = Helper::get_option( LassoLite\Admin\Constant::LASSO_ACCOUNT_EMAIL, '' ); |
| 17 |
$lasso_account_user_id = intval( Helper::get_option( LassoLite\Admin\Constant::LASSO_ACCOUNT_USER_ID, 0 ) ); |
| 18 |
// Same as header: app signup/login only; is_connected_aff alone must not skip the create-account modal. |
| 19 |
$is_lasso_app_account_connected = ! empty( $lasso_account_email ) || $lasso_account_user_id > 0; |
| 20 |
?> |
| 21 |
|
| 22 |
<?php Config::get_header(); ?> |
| 23 |
|
| 24 |
<!-- DASHBOARD --> |
| 25 |
<input id="total-posts" class="d-none" value="0" /> |
| 26 |
<section class="px-3 pt-5 pb-0"> |
| 27 |
<div class="lite-container min-height"> |
| 28 |
|
| 29 |
<!-- TITLE BAR --> |
| 30 |
<div class="row align-items-center"> |
| 31 |
|
| 32 |
<!-- TITLE --> |
| 33 |
<div class="col-lg-4 text-lg-left text-center mb-4"> |
| 34 |
<h1 class="m-0 mr-2 d-inline-block align-middle">Dashboard</h1> |
| 35 |
<span id="lasso-lite-realtime-live" class="badge badge-info align-middle ml-2 d-none" title="Clicks detected while this page is open"> |
| 36 |
Live: <span id="lasso-lite-realtime-click-count">0</span> |
| 37 |
</span> |
| 38 |
</div> |
| 39 |
|
| 40 |
<!-- FILTERS --> |
| 41 |
<div class="col-lg text-center large mb-4 lasso-lite-skip-upsell"> |
| 42 |
<ul class="nav justify-content-center font-weight-bold"> |
| 43 |
<li class="nav-item mx-3 red-tooltip d-none" id="total-broken-links-li" data-tooltip="See broken URLs"> |
| 44 |
<a class="nav-link red hover-underline px-0 lasso-lite-pro-trigger" href="#" data-feature="broken-links" id="total-broken-links-a"><span id="total-broken-links"></span></a> |
| 45 |
</li> |
| 46 |
<li class="nav-item mx-3 orange-tooltip d-none" id="total-out-of-stock-li" data-tooltip="See out-of-stock products"> |
| 47 |
<a class="nav-link orange hover-underline px-0 lasso-lite-pro-trigger" href="#" data-feature="out-of-stock" id="total-out-of-stock-a"><span id="total-out-of-stock"></span></a> |
| 48 |
</li> |
| 49 |
<li class="nav-item mx-3 green-tooltip d-none" id="total-opportunities-li" data-tooltip="See opportunities"> |
| 50 |
<a class="nav-link green hover-underline px-0 lasso-lite-pro-trigger" href="#" data-feature="opportunities" id="total-opportunities-a"><span id="total-opportunities"></span></a> |
| 51 |
</li> |
| 52 |
</ul> |
| 53 |
</div> |
| 54 |
|
| 55 |
<!-- SEARCH --> |
| 56 |
<div class="col-lg-4 mb-4"> |
| 57 |
<form role="search" method="GET" id="links-filter" autocomplete="off"> |
| 58 |
<div id="search-links"> |
| 59 |
<input type="search" id="link-search-input" name="link-search-input" class="form-control" |
| 60 |
value="<?php echo $link_search_txt; ?>" placeholder="Search All <?php echo $dashboard_link_count; ?> Links"> |
| 61 |
</div> |
| 62 |
</form> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
|
| 66 |
<!-- TABLE --> |
| 67 |
<div class="white-bg rounded shadow"> |
| 68 |
|
| 69 |
<!-- TABLE HEADER --> |
| 70 |
<div class="px-4 pt-4 pb-2 font-weight-bold dark-gray d-lg-block"> |
| 71 |
<div class="row align-items-center"> |
| 72 |
<div class="col-lg-1 text-center">Image</div> |
| 73 |
<div class="col-lg-4">Title</div> |
| 74 |
<div class="col-lg-5">Link</div> |
| 75 |
<div class="col-lg-2">Groups</div> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
|
| 79 |
<div id="report-content"></div> |
| 80 |
</div> |
| 81 |
|
| 82 |
<!-- PAGINATION --> |
| 83 |
<div class="pagination row align-items-center no-gutters pb-3 pt-0 dashboard-pagination"></div> |
| 84 |
</div> |
| 85 |
</section> |
| 86 |
|
| 87 |
<!-- Lasso Lite Link Issues Snapshot Alert Box --> |
| 88 |
<div id="lasso-lite-link-issues-snapshot-box" class="lasso-lite-link-issues-snapshot"> |
| 89 |
<button type="button" class="close-snapshot close-link-issues-snapshot" aria-label="Close"> |
| 90 |
<span aria-hidden="true">×</span> |
| 91 |
</button> |
| 92 |
<div class="snapshot-content"> |
| 93 |
<h4 class="snapshot-title" id="link-issues-snapshot-title">Monthly Snapshot</h4> |
| 94 |
<div class="snapshot-message" role="list"> |
| 95 |
<div class="snapshot-row snapshot-row-broken" role="listitem"> |
| 96 |
<span class="snapshot-value snapshot-value-red" id="link-issues-broken-clicks">--</span> |
| 97 |
<span class="snapshot-label">Clicks to broken links</span> |
| 98 |
</div> |
| 99 |
<div class="snapshot-row snapshot-row-out-of-stock" role="listitem"> |
| 100 |
<span class="snapshot-value snapshot-value-red" id="link-issues-out-of-stock-clicks">--</span> |
| 101 |
<span class="snapshot-label">Clicks to out-of-stock links</span> |
| 102 |
</div> |
| 103 |
<div class="snapshot-row snapshot-row-international" role="listitem"> |
| 104 |
<span class="snapshot-value snapshot-value-orange" id="link-issues-international-clicks">--</span> |
| 105 |
<span class="snapshot-label">International clicks</span> |
| 106 |
</div> |
| 107 |
<div class="snapshot-row snapshot-row-earnings" id="link-issues-potential-earnings-row" role="listitem"> |
| 108 |
<strong class="snapshot-value snapshot-value-red" id="link-issues-potential-earnings">--</strong> |
| 109 |
<strong class="snapshot-label">Potential earnings lost</strong> |
| 110 |
</div> |
| 111 |
</div> |
| 112 |
<a class="lasso-lite-upgrade-btn" href="<?php echo esc_url( LassoLite\Admin\Constant::LASSO_CHECKOUT_URL_DEFAULT ); ?>" target="_blank" rel="noopener noreferrer"> |
| 113 |
Fix It |
| 114 |
</a> |
| 115 |
</div> |
| 116 |
</div> |
| 117 |
|
| 118 |
<div id="lasso-lite-click-snapshot-box" class="lasso-lite-click-snapshot"> |
| 119 |
<button type="button" class="close-snapshot" aria-label="Close"> |
| 120 |
<span aria-hidden="true">×</span> |
| 121 |
</button> |
| 122 |
<div class="snapshot-content"> |
| 123 |
<h3 class="snapshot-title">Your Click Activity</h3> |
| 124 |
<p class="snapshot-message" id="snapshot-message"> |
| 125 |
You've sent <span id="snapshot-click-count">--</span> clicks so far <span id="snapshot-period">today</span>. |
| 126 |
</p> |
| 127 |
<?php if ( ! $is_lasso_app_account_connected ) : ?> |
| 128 |
<a class="learn-more-link lasso-lite-dashboard-connect-cta" href="#" role="button"> |
| 129 |
Learn More |
| 130 |
</a> |
| 131 |
<?php endif; ?> |
| 132 |
</div> |
| 133 |
</div> |
| 134 |
|
| 135 |
<div id="lasso-lite-realtime-click-toast" class="lasso-lite-click-snapshot lasso-lite-realtime-click-toast" style="display: none;" aria-live="polite"> |
| 136 |
<button type="button" class="close-realtime-live-toast" aria-label="Close"> |
| 137 |
<span aria-hidden="true">×</span> |
| 138 |
</button> |
| 139 |
<div class="snapshot-content"> |
| 140 |
<p class="snapshot-message" id="lasso-lite-realtime-toast-message"> |
| 141 |
One of your products just got clicked. Create your free account to<br> |
| 142 |
<a class="learn-more-link lasso-lite-realtime-toast-learn-more lasso-lite-dashboard-connect-cta" href="#" role="button"> |
| 143 |
Learn more |
| 144 |
</a>. |
| 145 |
</p> |
| 146 |
</div> |
| 147 |
</div> |
| 148 |
|
| 149 |
<?php |
| 150 |
// Header only loads this modal when no app account; connected sites still see the realtime upsell toast. |
| 151 |
if ( $is_lasso_app_account_connected ) { |
| 152 |
$lasso_options_prefill = Setting::get_settings(); |
| 153 |
$email_support_prefill = $lasso_options_prefill[ Enum::EMAIL_SUPPORT ] ?? ''; |
| 154 |
$admin_email_prefill = get_option( 'admin_email' ); |
| 155 |
$prefill_connect_modal = ! empty( $email_support_prefill ) ? $email_support_prefill : $admin_email_prefill; |
| 156 |
echo Helper::include_with_variables( |
| 157 |
SIMPLE_URLS_DIR . '/admin/views/modals/lasso-lite-analytics-modal.php', |
| 158 |
array( |
| 159 |
'prefill_email_header' => $prefill_connect_modal, |
| 160 |
) |
| 161 |
); |
| 162 |
} |
| 163 |
?> |
| 164 |
|
| 165 |
<?php echo Helper::wrapper_js_render( 'dashboard-list', Helper::get_path_views_folder() . Enum::PAGE_DASHBOARD . '/list-jsrender.html' )?> |
| 166 |
|
| 167 |
<div class="modal fade lasso-lite-pro-modal" id="lasso-lite-pro-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="true" data-keyboard="true"> |
| 168 |
<div class="modal-dialog modal-dialog-centered" role="document"> |
| 169 |
<div class="modal-content text-center"> |
| 170 |
<button type="button" class="close lasso-lite-pro-modal-close" data-dismiss="modal" aria-label="Close"> |
| 171 |
<span aria-hidden="true">×</span> |
| 172 |
</button> |
| 173 |
<h3 class="modal-title" id="lasso-lite-pro-modal-title">Link alerts are currently disabled</h3> |
| 174 |
<a class="btn lasso-lite-upgrade-btn" href="https://getlasso.co/upgrade/?utm_campaign=lite-upgrade&utm_source=lasso-lite&utm_medium=wordpress" target="_blank" rel="noopener noreferrer">Enable Now</a> |
| 175 |
</div> |
| 176 |
</div> |
| 177 |
</div> |
| 178 |
|
| 179 |
<?php Config::get_footer(); ?> |
| 180 |
|