Automattic\WooCommerce\Internal\Admin

Analytics::__constructpublicWC 1.0

Hook into WooCommerce.

Method of the class: Analytics{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Analytics = new Analytics();
$Analytics->__construct();

Analytics::__construct() code WC 10.9.4

public function __construct() {
	add_action( 'update_option_' . self::TOGGLE_OPTION_NAME, array( $this, 'reload_page_on_toggle' ), 10, 2 );
	add_action( 'woocommerce_settings_saved', array( $this, 'maybe_reload_page' ) );

	if ( ! Features::is_enabled( 'analytics' ) ) {
		return;
	}

	add_filter( 'woocommerce_component_settings_preload_endpoints', array( $this, 'add_preload_endpoints' ) );
	add_filter( 'woocommerce_admin_get_user_data_fields', array( $this, 'add_user_data_fields' ) );
	add_action( 'admin_menu', array( $this, 'register_pages' ) );
	add_filter( 'woocommerce_debug_tools', array( $this, 'register_cache_clear_tool' ) );
	add_filter( 'woocommerce_debug_tools', array( $this, 'register_regenerate_order_fulfillment_status_tool' ), 12 );

	// Always register the batch hook so in-flight jobs survive after the legacy
	// flag is cleared (clearing happens before the first batch is queued).
	add_action( 'woocommerce_analytics_refund_fix_batch', array( $this, 'process_refund_fix_batch' ) );

	if ( $this->should_show_refund_fix_tool() ) {
		add_filter( 'woocommerce_debug_tools', array( $this, 'register_full_refund_fix_data_tool' ) );
		add_action( 'admin_footer', array( $this, 'output_refund_fix_tool_js' ) );
		add_action( 'wp_ajax_woocommerce_check_refund_fix_needed', array( $this, 'ajax_check_refund_fix_needed' ) );
	}
}