Skip to content

Commit 874cf97

Browse files
committed
chore: added proper links for license renew on lock notice
1 parent 1ea938f commit 874cf97

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,13 @@ public function renderLibraryPage() {
10191019
}
10201020
// enqueue charts array
10211021
$ajaxurl = admin_url( 'admin-ajax.php' );
1022+
$license = get_option( 'visualizer_pro_license_data', 'free' );
1023+
$license_key = '';
1024+
$download_id = '';
1025+
if ( ! empty( $license ) && is_object( $license ) ) {
1026+
$license_key = $license->key;
1027+
$download_id = $license->download_id;
1028+
}
10221029
wp_localize_script(
10231030
'visualizer-library',
10241031
'visualizer',
@@ -1058,6 +1065,8 @@ public function renderLibraryPage() {
10581065
'conflict' => __( 'We have detected a potential conflict with another component that prevents Visualizer from functioning properly. Please disable any of the following components if they are activated on your instance: Modern Events Calendar plugin, Acronix plugin. In case the aforementioned components are not activated or you continue to see this error message, please disable all other plugins and enable them one by one to find out the component that is causing the conflict.', 'visualizer' ),
10591066
),
10601067
'is_pro_user' => Visualizer_Module::is_pro(),
1068+
'admin_license_url' => admin_url('options-general.php#visualizer_pro_license'),
1069+
'renew_license_url' => tsdk_utmify( Visualizer_Plugin::STORE_URL . '?edd_license_key=' . $license_key . '&download_id=' .$download_id, 'visualizer_license_block' ),
10611070
)
10621071
);
10631072
// render library page

classes/Visualizer/Plugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class Visualizer_Plugin {
5757
const ACTION_UPLOAD_DATA = 'visualizer-upload-data';
5858
const ACTION_EXPORT_DATA = 'visualizer-export-data';
5959

60+
const STORE_URL = 'https://store.themeisle.com/';
61+
6062
/**
6163
*Action used for fetching specific users/roles for permissions.
6264
*/

js/library.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function createPopupProBlocker() {
5757
buttonsContainer.classList.add('vizualizer-renew-notice-buttons-container');
5858

5959
var link1 = document.createElement('a');
60-
link1.href = 'https://store.themeisle.com/';
60+
link1.href = visualizer.renew_license_url;
6161
link1.target = '_blank';
6262
var button1 = document.createElement('button');
6363
button1.innerHTML = '<span class="dashicons dashicons-cart"></span> Renew License';
@@ -66,7 +66,7 @@ function createPopupProBlocker() {
6666
buttonsContainer.appendChild(link1);
6767

6868
var link2 = document.createElement('a');
69-
link2.href = '/wp-admin/options-general.php#visualizer_pro_license';
69+
link2.href = visualizer.admin_license_url;
7070
var button2 = document.createElement('button');
7171
button2.innerHTML = '<span class="dashicons dashicons-unlock"></span> Activate License';
7272
button2.classList.add('vizualizer-renew-notice-button', 'vizualizer-renew-notice-activate-button');

0 commit comments

Comments
 (0)