PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.2.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.2.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Plugin / Deactivator.php

Deactivator.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.2.0, at src/Performance/Plugin/Deactivator.php

64 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * All functionality related to deactivating the plugin.
4 *
5 * @since 0.1.0
6 *
7 * @package SolidWP\Performance
8 */
9
10 declare( strict_types=1 );
11
12 namespace SolidWP\Performance\Plugin;
13
14 use SolidWP\Performance\Config\Advanced_Cache;
15 use SolidWP\Performance\Container;
16
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit;
19 }
20
21 /**
22 * Handles actions that should run when the plugin is deactivated.
23 *
24 * @since 0.1.0
25 *
26 * @package SolidWP\Performance
27 */
28 final class Deactivator {
29
30 /**
31 * @var Container
32 */
33 private Container $container;
34
35 /**
36 * @param Container $container The container.
37 */
38 public function __construct( Container $container ) {
39 $this->container = $container;
40 }
41
42 /**
43 * Deactivation hook.
44 *
45 * @since 0.1.0
46 *
47 * @return void
48 */
49 public function __invoke(): void {
50 $this->remove_advanced_cache();
51 }
52
53 /**
54 * Remove the generated advanced-cache.php drop-in.
55 *
56 * @since 0.1.0
57 *
58 * @return void
59 */
60 private function remove_advanced_cache(): void {
61 $this->container->get( Advanced_Cache::class )->remove();
62 }
63 }
64