| @@ -51,13 +51,22 @@ | ||
| 51 | 51 | /** |
| 52 | 52 | * Fired when the plugin is deactivated. |
| 53 | 53 | */ |
| 54 | 54 | public function single_deactivate(): void { |
| 55 | + // Report churn before tearing anything down, while settings (and so the | |
| 56 | + // consent state) are still readable. | |
| 57 | + $lifecycle = new \WCPOS\WooCommercePOS\Services\Lifecycle_Events(); | |
| 58 | + $lifecycle->report_deactivation(); | |
| 59 | + $lifecycle->clear_schedule(); | |
| 60 | + | |
| 55 | 61 | // remove pos capabilities. |
| 56 | 62 | $this->remove_pos_capability(); |
| 57 | 63 | |
| 58 | 64 | // stop the print-job retention purge. |
| 59 | 65 | wp_clear_scheduled_hook( \WCPOS\WooCommercePOS\Services\Print_Job_Service::PURGE_HOOK ); |
| 66 | + | |
| 67 | + // stop the journal retention purge. | |
| 68 | + wp_clear_scheduled_hook( \WCPOS\WooCommercePOS\Sync\Sync_Journal_Purge::PURGE_HOOK ); | |
| 60 | 69 | |
| 61 | 70 | // remove pos rewrite rule. |
| 62 | 71 | flush_rewrite_rules( false ); // false will not overwrite .htaccess. |
| 63 | 72 | } |