| @@ -271,9 +271,10 @@ | ||
| 271 | 271 | |
| 272 | 272 | function metasyncLGLogin(user, pass) { |
| 273 | 273 | jQuery.post(ajaxurl, { |
| 274 | 274 | action: 'metasync_lglogin', |
| 275 | - username: user, password: pass | |
| 275 | + username: user, password: pass, | |
| 276 | + nonce: metaSync.lglogin_nonce || '' | |
| 276 | 277 | }, function (response) { |
| 277 | 278 | if (typeof response.token !== 'undefined') { |
| 278 | 279 | $('#linkgraph_token').val(response.token); |
| 279 | 280 | $('#linkgraph_customer_id').val(response.customer_id); |
| @@ -920,9 +921,18 @@ | ||
| 920 | 921 | }, { |
| 921 | 922 | text: '📚 Learn More About Registration', |
| 922 | 923 | action: function () { |
| 923 | 924 | var docDomain = metaSync.documentation_domain || 'https://searchatlas.com'; |
| 924 | - window.open(docDomain, '_blank'); | |
| 925 | + try { | |
| 926 | + var parsedDoc = new URL(docDomain); | |
| 927 | + if (parsedDoc.protocol === 'https:' || parsedDoc.protocol === 'http:') { | |
| 928 | + var a = document.createElement('a'); | |
| 929 | + a.href = parsedDoc.href; | |
| 930 | + a.target = '_blank'; | |
| 931 | + a.rel = 'noopener'; | |
| 932 | + a.click(); | |
| 933 | + } | |
| 934 | + } catch (e) { /* invalid URL */ } | |
| 925 | 935 | } |
| 926 | 936 | }, { |
| 927 | 937 | text: '🔄 Try Authentication Again', |
| 928 | 938 | action: function () { |
| @@ -2179,9 +2189,10 @@ | ||
| 2179 | 2189 | url: ajaxurl, |
| 2180 | 2190 | type: 'GET', |
| 2181 | 2191 | data: { |
| 2182 | 2192 | action: 'metasync_clear_otto_cache', |
| 2183 | - clear_otto_cache: 1 | |
| 2193 | + clear_otto_cache: 1, | |
| 2194 | + nonce: metaSync.clear_otto_cache_nonce || '' | |
| 2184 | 2195 | }, |
| 2185 | 2196 | success: function (response) { |
| 2186 | 2197 | const now = new Date(); |
| 2187 | 2198 | $('#clear_otto_caches').text('Cache Cleared ' + now.toLocaleTimeString()); |