PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.5.9
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.5.9
1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / src / Setup / Activator.php
hostinger-reach / src / Setup Last commit date
Activator.php 3 months ago Assets.php 3 weeks ago Blocks.php 11 months ago Database.php 8 months ago Encrypt.php 8 months ago
Activator.php
47 lines
1 <?php
2
3 namespace Hostinger\Reach\Setup;
4
5 use Hostinger\Reach\Boot;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 die;
9 }
10
11 class Activator {
12 public function __construct( string $plugin_file_name ) {
13 register_activation_hook( $plugin_file_name, array( $this, 'activate_plugin' ) );
14 add_action( 'plugins_loaded', array( $this, 'boot' ) );
15 add_action( 'admin_init', array( $this, 'maybe_redirect' ) );
16 }
17
18 public function activate_plugin(): void {
19 if ( has_action( 'litespeed_purge_all' ) ) {
20 do_action( 'litespeed_purge_all' );
21 }
22
23 add_option( 'hostinger_reach_activation_redirect', true );
24 }
25
26 public function maybe_redirect(): void {
27 if ( ! get_option( 'hostinger_reach_activation_redirect' ) ) {
28 return;
29 }
30
31 delete_option( 'hostinger_reach_activation_redirect' );
32
33 $referer = wp_get_referer();
34 if ( ! $referer || strpos( $referer, 'plugin-install.php' ) === false ) {
35 return;
36 }
37
38 wp_safe_redirect( admin_url( 'admin.php?page=hostinger-reach' ) );
39 exit;
40 }
41
42 public function boot(): void {
43 $boot = Boot::get_instance();
44 $boot->plugins_loaded();
45 }
46 }
47