PluginProbe
Additional Terms Lite for WooCommerce / 1.5.2
Additional Terms Lite for WooCommerce v1.5.2
1.7.3 1.7.2.1 trunk 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 All 35 releases
woo-additional-terms / uninstall.php

uninstall.php in Additional Terms Lite for WooCommerce 1.5.2, at uninstall.php

42 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall Woo Additional Terms.
4 * Fired when the plugin is uninstalled.
5 *
6 * @link https://mypreview.one/woo-additional-terms
7 *
8 * @author MyPreview (Github: @mahdiyazdani, @gooklani, @mypreview)
9 *
10 * @since 1.0.0
11 *
12 * @package woo-additional-terms
13 */
14
15 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
16 defined( 'WP_UNINSTALL_PLUGIN' ) || exit; // If uninstall not called from WordPress, then exit.
17
18 // Delete the already rated option.
19 delete_option( 'woo_additional_terms_rated' );
20
21 // Reset the activation timestamp as the user already decided to delete the plugin.
22 delete_site_option( 'woo_additional_terms_activation_timestamp' );
23
24 /*
25 * Only perform uninstall if WC_REMOVE_ALL_DATA constant is set to true in user's
26 * wp-config.php. This is to prevent data loss when deleting the plugin from the backend
27 * and to ensure only the site owner can perform this action.
28 */
29 if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) {
30 $woo_additional_terms_page_id = '_woo_additional_terms_page_id';
31 $woo_additional_terms_notice = '_woo_additional_terms_notice';
32 $woo_additional_terms_error = '_woo_additional_terms_error';
33
34 delete_option( $woo_additional_terms_page_id );
35 delete_option( $woo_additional_terms_notice );
36 delete_option( $woo_additional_terms_error );
37 // For site options in Multisite.
38 delete_site_option( $woo_additional_terms_page_id );
39 delete_site_option( $woo_additional_terms_notice );
40 delete_site_option( $woo_additional_terms_error );
41 }
42