Skip to content

Commit ec484dc

Browse files
authored
Merge pull request #197 from aesirxio/freemium-version
Freemium version
2 parents 0d59589 + 276318f commit ec484dc

File tree

5 files changed

+120
-15
lines changed

5 files changed

+120
-15
lines changed

assets/images/Hero.png

-401 KB
Binary file not shown.

wp-content/plugins/aesirx-analytics/aesirx-analytics.php

Lines changed: 89 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,30 @@ function aesirx_analytics_freemium_config_is_ok(string $isStorage = null): bool
138138
}
139139

140140
add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) {
141-
$nonce = wp_create_nonce('aesirx_analytics_submenu');
142-
$url = add_query_arg(
143-
[
144-
'page' => 'aesirx-bi-dashboard',
145-
'aesirx_analytics_nonce' => $nonce,
146-
],
147-
admin_url('admin.php')
141+
$nonce = wp_create_nonce('aesirx_analytics_submenu');
142+
$stats_url = add_query_arg(
143+
[
144+
'page' => 'aesirx-bi-dashboard',
145+
'aesirx_analytics_nonce' => $nonce,
146+
],
147+
admin_url('admin.php')
148+
);
149+
$links[] = sprintf(
150+
'<a href="%s">%s</a>',
151+
esc_url($stats_url),
152+
esc_html__('Statistics', 'aesirx-analytics')
153+
);
154+
155+
156+
$pro_url = 'https://aesirx.io/solutions/analytics';
157+
158+
$links[] = sprintf(
159+
'<a href="%s" target="_blank" style="color:#d63638;font-weight:600;">
160+
%s
161+
</a>',
162+
esc_url($pro_url),
163+
esc_html__('Upgrade to Pro', 'aesirx-analytics')
148164
);
149-
array_push($links, "<a href='$url'>" . esc_html__('Statistics', 'aesirx-analytics') . '</a>');
150165
return $links;
151166
});
152167

@@ -280,6 +295,72 @@ function aesirx_analytics_freemium_display_update_notice( ) {
280295

281296
add_action( 'admin_notices', 'aesirx_analytics_freemium_display_update_notice' );
282297

298+
register_activation_hook(__FILE__, function () {
299+
if (!defined('AESIRX_ANALYTICS_PRO')) {
300+
set_transient(
301+
'aesirx_analytics_pro_upsell_notice',
302+
true,
303+
DAY_IN_SECONDS * 7 // show for 7 days max
304+
);
305+
}
306+
});
307+
308+
function aesirx_analytics_display_pro_upsell_notice() {
309+
310+
if (!current_user_can('manage_options')) {
311+
return;
312+
}
313+
314+
if (defined('AESIRX_ANALYTICS_PRO')) {
315+
return;
316+
}
317+
318+
if (!get_transient('aesirx_analytics_pro_upsell_notice')) {
319+
return;
320+
}
321+
322+
$pro_url = 'https://aesirx.io/solutions/analytics';
323+
?>
324+
<div class="notice notice-info is-dismissible aesirx-pro-upsell">
325+
<p>
326+
<strong><?php esc_html_e('Unlock AesirX Analytics Pro 🚀', 'aesirx-analytics'); ?></strong><br>
327+
<?php esc_html_e(
328+
'Get real-time visitors, UTM & Tag Value Mapping, advanced Analytics dashboards, and priority support.',
329+
'aesirx-analytics'
330+
); ?>
331+
</p>
332+
<p>
333+
<a href="<?php echo esc_url($pro_url); ?>"
334+
target="_blank"
335+
class="button button-primary">
336+
<?php esc_html_e('Upgrade to Pro', 'aesirx-analytics'); ?>
337+
</a>
338+
</p>
339+
</div>
340+
<?php
341+
}
342+
add_action('admin_notices', 'aesirx_analytics_display_pro_upsell_notice');
343+
344+
add_action('admin_enqueue_scripts', function () {
345+
wp_enqueue_script('jquery');
346+
347+
wp_add_inline_script(
348+
'jquery',
349+
"
350+
jQuery(document).on('click', '.aesirx-pro-upsell .notice-dismiss', function () {
351+
jQuery.post(ajaxurl, {
352+
action: 'aesirx_dismiss_pro_upsell'
353+
});
354+
});
355+
"
356+
);
357+
});
358+
359+
add_action('wp_ajax_aesirx_dismiss_pro_upsell', function () {
360+
delete_transient('aesirx_analytics_pro_upsell_notice');
361+
wp_die();
362+
});
363+
283364
add_action('admin_init', function () {
284365
if (get_option('aesirx_analytics_freemium_do_activation_redirect', false)) {
285366

wp-content/plugins/aesirx-analytics/languages/aesirx-analytics-de_DE.po

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ msgstr "aesirx.io"
3333
msgid "https://aesirx.io/"
3434
msgstr "https://aesirx.io/"
3535

36-
#: aesirx-analytics.php:264
36+
#: aesirx-analytics.php:279
3737
msgid "Problem with Aesirx Analytics plugin install"
3838
msgstr "Problem mit der Installation des Aesirx Analytics Plugins"
3939

@@ -393,6 +393,19 @@ msgstr ""
393393
msgid "AesirX First-Party Server"
394394
msgstr ""
395395

396-
#: aesirx-analytics.php:149
396+
#: aesirx-analytics.php:152
397397
msgid "Statistics"
398398
msgstr ""
399+
400+
#: aesirx-analytics.php:163
401+
#: aesirx-analytics.php:336
402+
msgid "Upgrade to Pro"
403+
msgstr ""
404+
405+
#: aesirx-analytics.php:326
406+
msgid "Unlock AesirX Analytics Pro 🚀"
407+
msgstr ""
408+
409+
#: aesirx-analytics.php:327
410+
msgid "Get real-time visitors, UTM & Tag Value Mapping, advanced Analytics dashboards, and priority support."
411+
msgstr ""

wp-content/plugins/aesirx-analytics/languages/aesirx-analytics.pot

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-12-26T08:11:43+00:00\n"
12+
"POT-Creation-Date: 2025-12-29T03:59:05+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.11.0\n"
1515
"X-Domain: aesirx-analytics\n"
@@ -285,14 +285,27 @@ msgstr ""
285285
msgid "Consent Management"
286286
msgstr ""
287287

288-
#: aesirx-analytics.php:149
288+
#: aesirx-analytics.php:152
289289
msgid "Statistics"
290290
msgstr ""
291291

292-
#: aesirx-analytics.php:264
292+
#: aesirx-analytics.php:163
293+
#: aesirx-analytics.php:336
294+
msgid "Upgrade to Pro"
295+
msgstr ""
296+
297+
#: aesirx-analytics.php:279
293298
msgid "Problem with Aesirx Analytics plugin install"
294299
msgstr ""
295300

301+
#: aesirx-analytics.php:326
302+
msgid "Unlock AesirX Analytics Pro 🚀"
303+
msgstr ""
304+
305+
#: aesirx-analytics.php:327
306+
msgid "Get real-time visitors, UTM & Tag Value Mapping, advanced Analytics dashboards, and priority support."
307+
msgstr ""
308+
296309
#. translators: %s: URL to aesir.io read mor details
297310
#: includes/settings.php:25
298311
msgid "Note: "

wp-content/plugins/aesirx-analytics/readme.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,3 @@ The Terms of service can be found here https://aesirx.io/terms-conditions and th
225225
3. Tracking - Measure the performance of marketing campaigns.
226226
4. User Experience - Detailed analytics on customer journeys.
227227
5. Visitor - Gain insights into audience demographics and behaviors.
228-
6. Woo - Gain insights into e-commerce performance 1.
229-
7. Woo - Gain insights into e-commerce performance 2.

0 commit comments

Comments
 (0)