Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
Activator
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 activate
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2/**
3 * Fired during plugin activation
4 *
5 * @link       https://BrianHenry.ie
6 * @since      1.2.0
7 *
8 * @package brianhenryie/bh-wp-aws-ses-bounce-handler
9 */
10
11namespace BrianHenryIE\AWS_SES_Bounce_Handler\WP_Includes;
12
13use BrianHenryIE\AWS_SES_Bounce_Handler\Settings_Interface;
14
15/**
16 * Fired during plugin activation.
17 *
18 * This class defines all code necessary to run during the plugin's activation.
19 */
20class Activator {
21
22
23    /**
24     * Register the Bounced Email WordPress user role.
25     * The role has no capabilities.
26     *
27     * @since 1.2.0
28     */
29    public static function activate(): void {
30        add_role( 'bounced_email', 'Bounced Email' );
31
32        $secret_key = get_option( Settings_Interface::SECRET_KEY );
33        if ( false === $secret_key ) {
34            $secret_key = wp_generate_password( 12, false );
35            update_option( Settings_Interface::SECRET_KEY, $secret_key );
36        }
37    }
38
39}
40