PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.9.14
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.9.14
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / uninstall.php

uninstall.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.9.14, at uninstall.php

38 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fired when the plugin is uninstalled.
4 *
5 * When populating this file, consider the following flow
6 * of control:
7 *
8 * - This method should be static
9 * - Check if the $_REQUEST content actually is the plugin name
10 * - Init an admin referrer check to make sure it goes through authentication
11 * - Verify the output of $_GET makes sense
12 * - Repeat with other user roles. Best directly by using the links/query string parameters.
13 * - Repeat things for multisite. Once for a single site in the network, once sitewide.
14 *
15 * @author Paul Kilmurray <paul@kilbot.com.au>
16 *
17 * @see http://www.woopos.com.au
18 * @package WooCommercePOS
19 */
20
21 // If uninstall not called from WordPress, then exit.
22 if ( ! \defined( 'WP_UNINSTALL_PLUGIN' ) ) {
23 exit;
24 }
25
26 // Analytics identity (landing-experiments spec §5.1: deleted on uninstall).
27 if ( \function_exists( 'is_multisite' ) && is_multisite() ) {
28 $woocommerce_pos_sites = get_sites( array( 'fields' => 'ids' ) );
29
30 foreach ( $woocommerce_pos_sites as $woocommerce_pos_site_id ) {
31 switch_to_blog( (int) $woocommerce_pos_site_id );
32 delete_option( 'wcpos_anon_id' );
33 restore_current_blog();
34 }
35 } else {
36 delete_option( 'wcpos_anon_id' );
37 }
38