Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
Deactivator
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 deactivate
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Fired during plugin deactivation
4 *
5 * @link       http://example.com
6 * @since      1.0.0
7 *
8 * @package brianhenryie/bh-wc-checkout-rate-limiter
9 */
10
11namespace BrianHenryIE\Checkout_Rate_Limiter\WP_Includes;
12
13/**
14 * Fired during plugin deactivation.
15 *
16 * This class defines all code necessary to run during the plugin's deactivation.
17 *
18 * @since      1.0.0
19 * @package brianhenryie/bh-wc-checkout-rate-limiter
20 *
21 * @author     BrianHenryIE <BrianHenryIE@gmail.com>
22 */
23class Deactivator {
24
25    const DEACTIVATED_TIME_OPTION_KEY = 'bh_wc_checkout_rate_limiter_deactivated_time';
26
27    /**
28     * Short Description. (use period)
29     *
30     * Long Description.
31     *
32     * @since    1.0.0
33     */
34    public static function deactivate(): void {
35
36        $option_key = self::DEACTIVATED_TIME_OPTION_KEY;
37
38        $deactivations = get_option( $option_key, array() );
39
40        $deactivations[] = time();
41
42        update_option( $option_key, $deactivations );
43
44    }
45
46}