PluginProbe
Clicky Analytics / trunk
Clicky Analytics vtrunk
trunk 1.1 1.1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.5 1.5.1 1.5.2 1.6 1.6.1 All 40 releases
clicky-analytics / install / uninstall.php

uninstall.php in Clicky Analytics trunk, at install/uninstall.php

41 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Author: Alin Marcu
4 * Author URI: https://deconf.com
5 * Copyright 2013 Alin Marcu
6 * License: GPLv2 or later
7 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
8 */
9 // Exit if accessed directly
10 if ( ! defined( 'ABSPATH' ) )
11 exit();
12
13 class CAWP_Uninstall {
14
15 public static function uninstall() {
16 global $wpdb;
17 $cawp = CAWP();
18 if ( is_multisite() ) { // Cleanup Network install
19 foreach ( CAWP_Tools::get_sites( array( 'number' => apply_filters( 'cawp_sites_limit', 100 ) ) ) as $blog ) {
20 switch_to_blog( $blog['blog_id'] );
21 $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '%%cawp_cache_%%'" );
22 delete_option( 'cawp_options' );
23 restore_current_blog();
24 }
25 delete_site_option( 'cawp_network_options' );
26 } else { // Cleanup Single install
27 $sqlquery = $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE '%%cawp_cache_%%'" );
28 delete_option( 'cawp_options' );
29 }
30 CAWP_Tools::unset_cookie( 'default_metric' );
31 CAWP_Tools::unset_cookie( 'default_dimension' );
32 CAWP_Tools::unset_cookie( 'default_view' );
33 CAWP_Tools::unset_cookie( 'default_swmetric' );
34
35 $timestamp = wp_next_scheduled( 'cawp_expired_cache_hook' );
36 wp_unschedule_event( $timestamp, 'cawp_expired_cache_hook' );
37
38
39 }
40 }
41