| @@ -130,8 +130,9 @@ | ||
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | 132 | // Pro / hotspot-limit config (populated via wp_localize_script) |
| 133 | 133 | const wpvrWizardCfg = (typeof wpvrSetupWizardData !== 'undefined') ? wpvrSetupWizardData : {}; |
| 134 | + const wizardNonce = (typeof wpvrNonce !== 'undefined' && wpvrNonce) ? wpvrNonce : (wpvrWizardCfg.ajax_nonce || ''); | |
| 134 | 135 | const isPro = !!wpvrWizardCfg.is_pro; |
| 135 | 136 | const HOTSPOT_LIMIT = isPro ? Infinity : (parseInt(wpvrWizardCfg.hotspot_limit, 10) || 5); |
| 136 | 137 | |
| 137 | 138 | const wizardStrings = wpvrWizardCfg.wizard_strings || {}; |
| @@ -638,9 +639,9 @@ | ||
| 638 | 639 | method: 'POST', |
| 639 | 640 | data: { |
| 640 | 641 | action: 'wpvr_fetch_template', |
| 641 | 642 | industry: selectedIndustry, |
| 642 | - security: wpvrNonce | |
| 643 | + security: wizardNonce | |
| 643 | 644 | }, |
| 644 | 645 | success: function (response) { |
| 645 | 646 | if (response.success && response.data.template) { |
| 646 | 647 | templateData = response.data.template; |
| @@ -808,9 +809,9 @@ | ||
| 808 | 809 | selectedIndustry === 'fitness' ? 'Fitness' : |
| 809 | 810 | selectedIndustry === 'museums' ? 'Museum' : 'Virtual' |
| 810 | 811 | ) + ' Tour', |
| 811 | 812 | industry: selectedIndustry, |
| 812 | - security: wpvrNonce | |
| 813 | + security: wizardNonce | |
| 813 | 814 | }, |
| 814 | 815 | success: function (response) { |
| 815 | 816 | if (response.success) { |
| 816 | 817 | // Store tour ID and URLs for later use |
| @@ -883,9 +884,9 @@ | ||
| 883 | 884 | type: 'POST', |
| 884 | 885 | data: { |
| 885 | 886 | action: 'wpvr_save_opt_in_toggle', |
| 886 | 887 | opt_in: isChecked ? 1 : 0, |
| 887 | - security: wpvrNonce | |
| 888 | + security: wizardNonce | |
| 888 | 889 | }, |
| 889 | 890 | success: function (response) { |
| 890 | 891 | console.log('Opt-in preference updated:', response); |
| 891 | 892 | } |