-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
57 lines (52 loc) · 1.52 KB
/
uninstall.php
File metadata and controls
57 lines (52 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* ORBEXA Agentic Commerce — Uninstall cleanup.
*
* Runs when the plugin is deleted (not deactivated) via the WordPress admin.
* Removes all plugin-created options from the database.
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// All option keys created by this plugin.
$orbexa_options = array(
'orbexa_api_key',
'orbexa_api_key_enc',
'orbexa_encryption_key',
'orbexa_webhook_secret',
'orbexa_merchant_id',
'orbexa_brand_domain',
'orbexa_verification_code',
'orbexa_domain_status',
'orbexa_domain_failure_reason',
'orbexa_trust_score',
'orbexa_badge',
'orbexa_trust_dimensions',
'orbexa_score_updated_at',
'orbexa_otr_listed',
'orbexa_otr_listed_at',
'orbexa_otr_delist_reason',
'orbexa_last_sync',
'orbexa_cleaning_stats',
'orbexa_cleaning_completed_at',
'orbexa_sync_products',
'orbexa_sync_orders',
'orbexa_show_badge',
'orbexa_badge_position',
'orbexa_flush_rules',
);
foreach ( $orbexa_options as $orbexa_option ) {
delete_option( $orbexa_option );
}
// Clean up any transients.
global $wpdb;
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Uninstall cleanup, no cache needed.
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
'_transient_orbexa_%',
'_transient_timeout_orbexa_%'
)
);
// Clear scheduled events.
wp_clear_scheduled_hook( 'orbexa_daily_sync' );