PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.14.1
WpStream – Live Streaming, Video on Demand, Pay Per View v4.14.1
4.14.1 4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 All 181 releases
wpstream / includes / class-wpstream-deactivator.php

class-wpstream-deactivator.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.14.1, at includes/class-wpstream-deactivator.php

55 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 /**
4 * Fired during plugin deactivation
5 *
6 * @link http://wpstream.net
7 * @since 3.0.1
8 *
9 * @package Wpstream
10 * @subpackage Wpstream/includes
11 */
12
13
14 // Exit if accessed directly.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Fired during plugin deactivation.
21 *
22 * This class defines all code necessary to run during the plugin's deactivation.
23 *
24 * @since 3.0.1
25 * @package Wpstream
26 * @subpackage Wpstream/includes
27 * @author wpstream <office@wpstream.net>
28 */
29 class Wpstream_Deactivator {
30
31 /**
32 * Clean up regenerable caches on deactivation.
33 *
34 * Deactivation is not uninstallation: the stored WpStream account
35 * credentials and tokens (wpstream_api_* / wpstream_* options) must
36 * survive so a temporary deactivation (conflict testing, WordPress
37 * auto-deactivation on a fatal, staging clones) does not sever the
38 * account connection. Permanent data removal lives in uninstall.php.
39 * Only the transient-cached auth token — regenerable from the stored
40 * credentials on the next API call — is cleared here, plus a rewrite
41 * flush so plugin-registered permalinks are dropped. (issue #112)
42 *
43 * @since 3.0.1
44 */
45 public static function deactivate() {
46 // Drop the transient-cached auth token and its per-30s request cache;
47 // both are regenerable from the stored credentials, which stay untouched.
48 delete_transient( 'wpstream_token_api' );
49 delete_transient( 'wpstream_token_request_30' );
50 // Flush rewrite rules so plugin-registered permalinks are cleared.
51 flush_rewrite_rules();
52 }
53
54 }
55