| @@ -201,9 +201,9 @@ | ||
| 201 | 201 | </button> |
| 202 | 202 | <span id="metasync-hc-save-msg" style="display: none; font-size: 13px;"></span> |
| 203 | 203 | </div> |
| 204 | 204 | |
| 205 | - <input type="hidden" id="metasync-hc-nonce" value="<?php echo wp_create_nonce('metasync_hosting_cache_nonce'); ?>" /> | |
| 205 | + <input type="hidden" id="metasync-hc-nonce" value="<?php echo esc_attr(wp_create_nonce('metasync_hosting_cache_nonce')); ?>" /> | |
| 206 | 206 | </div> |
| 207 | 207 | |
| 208 | 208 | <!-- Purge button --> |
| 209 | 209 | <form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>"> |
| @@ -655,8 +655,17 @@ | ||
| 655 | 655 | ]); |
| 656 | 656 | return; |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | + if ($result === 'reactivated' || $result === true) { | |
| 660 | + // Consent-gated analytics: excluding URLs from OTTO is an opt-out signal. | |
| 661 | + Metasync_PostHog::feature('otto_opt_out', [ | |
| 662 | + 'scope' => 'pattern', | |
| 663 | + 'action' => 'add', | |
| 664 | + 'pattern_type' => sanitize_key((string) $pattern_type), | |
| 665 | + ]); | |
| 666 | + } | |
| 667 | + | |
| 659 | 668 | if ($result === 'reactivated') { |
| 660 | 669 | $db->clear_cache(); |
| 661 | 670 | |
| 662 | 671 | if ($pattern_type === 'exact') { |
| @@ -728,8 +737,12 @@ | ||
| 728 | 737 | |
| 729 | 738 | $result = $db->delete([$id]); |
| 730 | 739 | |
| 731 | 740 | if ($result) { |
| 741 | + Metasync_PostHog::feature('otto_opt_out', [ | |
| 742 | + 'scope' => 'pattern', | |
| 743 | + 'action' => 'remove', | |
| 744 | + ]); | |
| 732 | 745 | wp_send_json_success([ |
| 733 | 746 | 'message' => 'Excluded URL deleted successfully', |
| 734 | 747 | ]); |
| 735 | 748 | } else { |