| 1 |
<?php |
| 2 |
/** |
| 3 |
* CartFlows |
| 4 |
* Delete Plugin Data. |
| 5 |
* |
| 6 |
* @package CartFlows |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
global $wpdb; |
| 15 |
|
| 16 |
|
| 17 |
$is_delete = get_option( 'cartflows_delete_plugin_data', false ); |
| 18 |
|
| 19 |
if ( 'enable' === $is_delete ) { |
| 20 |
|
| 21 |
$options = array( |
| 22 |
'cartflows-version', |
| 23 |
'wcf_setup_complete', |
| 24 |
'cartflows-divi-flows-and-steps-1', |
| 25 |
'cartflows-gutenberg-flows-and-steps-1', |
| 26 |
'cartflows-elementor-flows-and-steps-1', |
| 27 |
'cartflows-beaver-builder-flows-and-steps-1', |
| 28 |
'cartflows-last-export-checksums-latest', |
| 29 |
'cartflows-batch-status-string', |
| 30 |
'cartflows-elementor-requests', |
| 31 |
'cartflows-fresh-site', |
| 32 |
'cartflows-batch-is-complete', |
| 33 |
|
| 34 |
'cartflows-old-ui-user', |
| 35 |
'cartflows-legacy-admin', |
| 36 |
'cartflows-legacy-meta-show-design-options', |
| 37 |
'cartflows-assets-version', |
| 38 |
|
| 39 |
'_cartflows_common', |
| 40 |
'_cartflows_permalink', |
| 41 |
'_cartflows_facebook', |
| 42 |
'_cartflows_google_analytics', |
| 43 |
'_cartflows_offer_global_settings', |
| 44 |
|
| 45 |
'cf_analytics_installed_time', |
| 46 |
'cf_usage_optin', |
| 47 |
'cartflows_delete_plugin_data', |
| 48 |
'wcf-instant-checkout-notice-skipped', |
| 49 |
'nps-survey-cartflows', |
| 50 |
); |
| 51 |
|
| 52 |
foreach ( $options as $index => $key ) { |
| 53 |
delete_option( $key ); |
| 54 |
} |
| 55 |
|
| 56 |
// Clean up per-user "new UI available" notice dismissal flags set by the |
| 57 |
// legacy admin's soft-promo notice. The fourth arg ($delete_all = true) |
| 58 |
// removes the meta for every user in one query. |
| 59 |
delete_metadata( 'user', 0, 'cartflows-switch-to-new-ui-notice', '', true ); |
| 60 |
|
| 61 |
if ( function_exists( 'as_next_scheduled_action' ) && as_next_scheduled_action( 'cartflows_send_report_summary_email' ) ) { |
| 62 |
as_unschedule_all_actions( 'cartflows_send_report_summary_email' ); |
| 63 |
} |
| 64 |
} |
| 65 |
|