| 1 |
<?php |
| 2 |
/** |
| 3 |
* Signup moment events. |
| 4 |
* |
| 5 |
* @package WpVr\Tracking |
| 6 |
* @since 8.5.37 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Wpvr\Admin\Tracking\Events; |
| 10 |
|
| 11 |
// Exit if accessed directly. |
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
use Wpvr\Admin\Tracking\AbstractEvent; |
| 17 |
|
| 18 |
/** |
| 19 |
* Class SignupEvents |
| 20 |
* |
| 21 |
* Tracks signup-related events. |
| 22 |
* |
| 23 |
* @package WpVr\Tracking\Events |
| 24 |
* @since 8.5.37 |
| 25 |
*/ |
| 26 |
class SignupEvents extends AbstractEvent { |
| 27 |
|
| 28 |
/** |
| 29 |
* Register WordPress hooks for this event. |
| 30 |
* |
| 31 |
* @since 8.5.37 |
| 32 |
*/ |
| 33 |
public function register_hooks() { |
| 34 |
add_action( 'wpvr_plugin_activated', array( $this, 'track_plugin_activation' ) ); |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Track plugin activation. |
| 39 |
* |
| 40 |
* @since 8.5.37 |
| 41 |
*/ |
| 42 |
public function track_plugin_activation() { |
| 43 |
$this->track_signup_moment( 'plugin_activation', array( |
| 44 |
'plugin_version' => defined('WPVR_VERSION') ? WPVR_VERSION : 'unknown', |
| 45 |
'wordpress_version' => get_bloginfo( 'version' ), |
| 46 |
'site_url' => get_site_url(), |
| 47 |
'admin_email' => get_option( 'admin_email' ), |
| 48 |
'activation_time' => current_time( 'c' ), |
| 49 |
) ); |
| 50 |
} |
| 51 |
} |
| 52 |
|