PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 2.1.7
Backup Migration v2.1.7
2.1.7 2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / analyst / templates / optin.php
backup-backup / analyst / templates Last commit date
forms 2 weeks ago notice.php 2 weeks ago optin.php 2 weeks ago optout.php 2 weeks ago
optin.php
63 lines
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <script type="text/javascript">
3
4 (function ($) {
5 var isOptingIn = false
6
7 $('#analyst-opt-in-modal').appendTo($('body'))
8
9 var makeOptIn = function (pluginId) {
10 if (isOptingIn) return
11
12 isOptingIn = true
13
14 $.ajax({
15 url: ajaxurl,
16 method: 'POST',
17 data: {
18 action: 'analyst_opt_in_' + pluginId,
19 analyst_nonce: analyst_opt_localize.analyst_nonce
20 },
21 success: function () {
22 $('#analyst-opt-in-modal').hide()
23
24 isOptingIn = false
25
26 var optOutAction = $('<a />').attr({
27 class: 'analyst-action-opt analyst-opt-out',
28 'analyst-plugin-id': pluginId,
29 'analyst-plugin-signed': '1'
30 })
31 .text('Opt Out')
32 $('.analyst-opt-in[analyst-plugin-id="'+ pluginId +'"').replaceWith(optOutAction)
33
34 $('[analyst-plugin-id="' + pluginId + '"').attr('analyst-plugin-opted-in', 1)
35 }
36 })
37 }
38
39 $(document).on('click', '.analyst-opt-in:not([loading])', function() {
40 var pluginId = $(this).attr('analyst-plugin-id')
41 var isSigned = $(this).attr('analyst-plugin-signed') === '1'
42
43 if (!isSigned) {
44 $('#analyst-install-modal')
45 .attr('analyst-plugin-id', pluginId)
46 .show()
47
48 return;
49 }
50
51 $('#analyst-install-modal').attr({'analyst-plugin-id': pluginId})
52
53 $(this).attr('loading', true).text('Opting In...')
54
55 makeOptIn(pluginId);
56 })
57
58 $('.opt-in-modal-close').click(function () {
59 $('#analyst-opt-in-modal').hide()
60 })
61 })(jQuery)
62 </script>
63