Skip to content

Commit 775382e

Browse files
settings: add locked section to tracking settings page
1 parent 982522d commit 775382e

6 files changed

Lines changed: 90 additions & 7 deletions

File tree

assets/css/dashboard.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,24 @@ textarea.ka-input {
652652
--bs-btn-disabled-border-color: #6c757d;
653653
}
654654

655+
.btn-koko,
656+
.koko-analytics .btn-koko {
657+
--bs-btn-color: white;
658+
--bs-btn-bg: #b60205;
659+
--bs-btn-border-color: #a40205;
660+
--bs-btn-hover-color: #fff;
661+
--bs-btn-hover-bg: #a40205;
662+
--bs-btn-hover-border-color: #a40205;
663+
--bs-btn-focus-shadow-rgb: 130, 138, 145;
664+
--bs-btn-active-color: #fff;
665+
--bs-btn-active-bg: #565e64;
666+
--bs-btn-active-border-color: #51585e;
667+
--bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
668+
--bs-btn-disabled-color: #fff;
669+
--bs-btn-disabled-bg: #6c757d;
670+
--bs-btn-disabled-border-color: #6c757d;
671+
}
672+
655673
.btn-danger,
656674
.koko-analytics .btn-danger {
657675
--bs-btn-color: #fff;
@@ -770,6 +788,32 @@ textarea.ka-input {
770788
height: 12px;
771789
}
772790

791+
/* locked settings */
792+
.ka-locked-section {
793+
position: relative;
794+
padding: 1.5rem 0;
795+
border-top: 1px solid #efefef;
796+
border-bottom: 1px solid #efefef;
797+
margin-bottom: 1.5rem;
798+
}
799+
.ka-locked-section-button {
800+
position: absolute;
801+
width: 100%;
802+
height: 100%;
803+
left: 0;
804+
top: 0; z-index: 2; display: flex; align-items: center; text-align: center;
805+
}
806+
.ka-locked-section-button a {
807+
display: block;
808+
margin-left: auto;
809+
margin-right: auto;
810+
}
811+
.ka-locked-section-contents {
812+
opacity: .4;
813+
z-index: 1;
814+
}
815+
816+
773817
/* sm */
774818
@media (min-width: 576px) {
775819
.d-sm-flex {

src/Resources/views/settings/dashboard.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
</div>
3939
<?php
4040
}, 200);
41+
4142
?>
4243

4344
<h2 class="mt-0 mb-3"><?= esc_html__('Dashboard settings', 'koko-analytics') ?></h2>
@@ -54,4 +55,8 @@
5455
<div>
5556
<input type="submit" class="btn btn-primary" value="<?= esc_attr__('Save Changes') ?>">
5657
</div>
58+
59+
<?php if (!defined('KOKO_ANALYTICS_PRO_VERSION')) : ?>
60+
<p class="text-muted mt-5 mb-0"><a class="text-reset" href="https://www.kokoanalytics.com/pricing/?utm_source=koko-analytics&utm_medium=link&utm_campaign=free-plugin-settings-dashboard">Upgrade to Koko Analytics Pro</a> to password protect your public analytics dashboard.</p>
61+
<?php endif; ?>
5762
</form>

src/Resources/views/settings/emails.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<h2 class="mt-0 mb-3"><?= esc_html__('Email reports', 'koko-analytics') ?></h2>
1313

1414
<p>Email reports is a feature from Koko Analytics Pro that allows you to configure periodic email reports, delivering a summary of your most important metrics to your email inbox.</p>
15-
<p><a href="https://www.kokoanalytics.com/pricing/#utm_source=koko-analytics&amp;utm_medium=link&amp;utm_campaign=free-plugin-settings-emails-upgrade">Upgrade to Koko Analytics Pro</a></p>
15+
<p><a href="https://www.kokoanalytics.com/pricing/?utm_source=koko-analytics&utm_medium=link&utm_campaign=free-plugin-settings-emails">Upgrade to Koko Analytics Pro</a></p>
1616
<?php endif; ?>

src/Resources/views/settings/events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<?php if (! has_action('koko_analytics_output_settings_tab_events')) : ?>
1212
<h2 class="mt-0">Custom events</h2>
1313
<p>Custom events is a feature from Koko Analytics Pro that allows you to track any type of event that occurs on your site, like outbound link clicks or form submissions.</p>
14-
<p><a href="https://www.kokoanalytics.com/pricing/#utm_source=koko-analytics&amp;utm_medium=link&amp;utm_campaign=free-plugin-settings-events-upgrade">Upgrade to Koko Analytics Pro</a></p>
14+
<p><a href="https://www.kokoanalytics.com/pricing/?utm_source=koko-analytics&utm_medium=link&utm_campaign=free-plugin-settings-events">Upgrade to Koko Analytics Pro</a></p>
1515

1616
<?php endif; ?>

src/Resources/views/settings/help.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<h2 class="mt-0 mb-3"><?= esc_html__('Help', 'koko-analytics') ?></h2>
2424
<div class="mb-5">
2525
<ul class="ul-square">
26+
<li><a href="https://www.kokoanalytics.com/pricing/?utm_source=koko-analytics&utm_medium=link&utm_campaign=free-plugin-settings-help">Upgrade to Koko Analytics Pro</a> to get direct email support from the plugin builder.</li>
2627
<li><?php printf(esc_html__('Have a look at our %1$sknowledge base%2$s for help with configuring and using Koko Analytics.', 'koko-analytics'), '<a href="https://www.kokoanalytics.com/docs/#utm_source=koko-analytics&amp;utm_medium=link&amp;utm_campaign=free-plugin-settings-help-docs" target="_blank">', '</a>'); ?></li>
2728
<li><?php printf(esc_html__('Go through our %1$srepository of sample code snippets%2$s for inspiration on modifying the default Koko Analytics behavior.', 'koko-analytics'), '<a href="https://github.com/ibericode/koko-analytics/tree/main/code-snippets" target="_blank">', '</a>'); ?></li>
2829
<li><?php printf(esc_html__('Vote on %1$snew features you would like to have in Koko Analytics%2$s.', 'koko-analytics'), '<a href="https://github.com/ibericode/koko-analytics/discussions?discussions_q=is%3Aopen+sort%3Atop" target="_blank">', '</a>'); ?></li>

src/Resources/views/settings/tracking.php

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,47 @@
7777
</p>
7878
</div>
7979

80+
81+
<?php if (! defined('KOKO_ANALYTICS_PRO')) : ?>
82+
<div class="ka-locked-section">
83+
<div class="ka-locked-section-button">
84+
<a href="https://www.kokoanalytics.com/pricing/?utm_source=koko-analytics&utm_medium=link&utm_campaign=free-plugin-settings-tracking" class="btn btn-koko btn-sm">
85+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-unlock me-2" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M12 0a4 4 0 0 1 4 4v2.5h-1V4a3 3 0 1 0-6 0v2h.5A2.5 2.5 0 0 1 12 8.5v5A2.5 2.5 0 0 1 9.5 16h-7A2.5 2.5 0 0 1 0 13.5v-5A2.5 2.5 0 0 1 2.5 6H8V4a4 4 0 0 1 4-4M2.5 7A1.5 1.5 0 0 0 1 8.5v5A1.5 1.5 0 0 0 2.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 9.5 7z"/></svg>
86+
Unlock with Pro
87+
</a>
88+
</div>
89+
<div class="ka-locked-section-contents">
90+
<div class="mb-4">
91+
<label class="ka-label"><?php esc_html_e('Enable geo-location?', 'koko-analytics'); ?></label>
92+
<div class="mb-2">
93+
<label class="me-1"><input type="radio" disabled> <?php esc_html_e('Yes', 'koko-analytics'); ?></label> &nbsp;
94+
<label><input type="radio" checked="checked" disabled> <?php esc_html_e('No', 'koko-analytics'); ?></label>
95+
</div>
96+
<p class="description"><?php esc_html_e('Select "yes" if you want Koko Analytics to geo-locate visitors by their IP address.', 'koko-analytics'); ?></p>
97+
</div>
98+
<div class="mb-4">
99+
<label class="ka-label"><?php esc_html_e('Enable device tracking?', 'koko-analytics'); ?></label>
100+
<div class="mb-2">
101+
<label class="me-1"><input type="radio" disabled> <?php esc_html_e('Yes', 'koko-analytics'); ?></label> &nbsp;
102+
<label><input type="radio" checked="checked" disabled> <?php esc_html_e('No', 'koko-analytics'); ?></label>
103+
</div>
104+
<p class="description"><?php esc_html_e('Select "yes" if you want Koko Analytics to count browsers, operating systems and device types.', 'koko-analytics'); ?></p>
105+
</div>
106+
<div class="mb-0">
107+
<label class="ka-label"><?php esc_html_e('Enable UTM tracking?', 'koko-analytics'); ?></label>
108+
<div class="mb-2">
109+
<label class="me-1"><input type="radio" disabled> <?php esc_html_e('Yes', 'koko-analytics'); ?></label> &nbsp;
110+
<label><input type="radio" checked="checked" disabled> <?php esc_html_e('No', 'koko-analytics'); ?></label>
111+
</div>
112+
<p class="description"><?php esc_html_e('Select "yes" if you want Koko Analytics to track utm_source, utm_medium and utm_campaign parameters from the URL query string or hash.', 'koko-analytics'); ?></p>
113+
</div>
114+
</div>
115+
</div>
116+
<?php endif; ?>
117+
80118
<?php do_action('koko_analytics_output_after_tracking_settings', $settings); ?>
81119

82120
<div>
83121
<input type="submit" class="btn btn-primary" value="<?= esc_attr__('Save Changes') ?>">
84122
</div>
85123
</form>
86-
87-
88-
<?php if (!defined('KOKO_ANALYTICS_PRO_VERSION')) : ?>
89-
<p class="text-muted mt-5"><?= sprintf(__('Collect country, browser, operating system and device statistics with %s.', 'koko-analytics'), '<a href="https://www.kokoanalytics.com/pricing/#utm_source=koko-analytics&amp;utm_medium=link&amp;utm_campaign=free-plugin-settings-tracking-upgrade">Koko Analytics Pro</a>'); ?></p>
90-
<?php endif; ?>

0 commit comments

Comments
 (0)