# defender-security/trunk/src/class-bootstrap.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version trunk. 56 lines.

- Page: https://pluginprobe.com/plugins/defender-security/trunk/code/src/class-bootstrap.php
- Raw: https://pluginprobe.com/plugins/defender-security/trunk/raw/src/class-bootstrap.php
- Modified: 2026-08-24T10:09:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/defender-security/trunk/code/src/class-bootstrap.php#L10-L20`.

```php
<?php

namespace WP_Defender;

use WP_Defender\Traits\Defender_Bootstrap;
use WP_Defender\Component\Rate;

/**
 * Class Bootstrap
 *
 * @package WP_Defender
 */
class Bootstrap {
	use Defender_Bootstrap;

	/**
	 * Activation.
	 */
	public function activation_hook(): void {
		$this->activation_hook_common();
		$this->set_free_installation_timestamp();
	}

	/**
	 * Add option with plugin install date.
	 *
	 * @since 2.4
	 */
	protected function set_free_installation_timestamp(): void {
		// Let's equate the plugin installation and postponed notice dates. This will simplify future checks.
		$install_date = (int) get_site_option( Rate::SLUG_FREE_INSTALL_DATE, 0 );
		if ( 0 === $install_date ) {
			update_site_option( Rate::SLUG_FREE_INSTALL_DATE, time() );
			update_site_option( Rate::SLUG_POSTPONED_NOTICE_DATE, time() );
		} else {
			update_site_option( Rate::SLUG_POSTPONED_NOTICE_DATE, $install_date );
		}
	}

	/**
	 * Load all modules.
	 */
	public function init_modules(): void {
		add_action( 'admin_init', array( $this, 'maybe_redirect_after_activation' ), 1 );
		$this->init_modules_common();
	}

	/**
	 * Deactivation clears only free version cron hooks.
	 */
	public function deactivation_hook(): void {
		$this->deactivation_hook_common();
		wp_clear_scheduled_hook( 'audit_clean_up_logs' );
	}
}

```
