WC_Tracker::get_tracking_data │ public static │ WC 1.0
Get all the tracking data.
Метод класса: WC_Tracker{}
Возвращает
Массив.
Использование
$result = WC_Tracker::get_tracking_data();
Код WC_Tracker::get_tracking_data() WC Tracker::get tracking data WC 10.3.4
public static function get_tracking_data() {
$data = array();
$start_time = microtime( true );
// General site info.
$data['url'] = home_url();
$data['store_id'] = get_option( \WC_Install::STORE_ID_OPTION, null );
$data['blog_id'] = class_exists( 'Jetpack_Options' ) ? Jetpack_Options::get_option( 'id' ) : null;
/**
* Filter the admin email that's sent with data.
*
* @since 2.3.0
*/
$data['email'] = apply_filters( 'woocommerce_tracker_admin_email', get_option( 'admin_email' ) );
$data['theme'] = self::get_theme_info();
// WordPress Info.
$data['wp'] = self::get_wordpress_info();
// Server Info.
$data['server'] = self::get_server_info();
// Plugin info.
$all_plugins = self::get_all_plugins();
$data['active_plugins'] = $all_plugins['active_plugins'];
$data['inactive_plugins'] = $all_plugins['inactive_plugins'];
// Jetpack & WooCommerce Connect.
$data['jetpack_version'] = Constants::is_defined( 'JETPACK__VERSION' ) ? Constants::get_constant( 'JETPACK__VERSION' ) : 'none';
$data['jetpack_connected'] = ( class_exists( 'Jetpack' ) && is_callable( 'Jetpack::is_active' ) && Jetpack::is_active() ) ? 'yes' : 'no';
$data['jetpack_is_staging'] = self::is_jetpack_staging_site() ? 'yes' : 'no';
$data['connect_installed'] = class_exists( 'WC_Connect_Loader' ) ? 'yes' : 'no';
$data['connect_active'] = ( class_exists( 'WC_Connect_Loader' ) && wp_next_scheduled( 'wc_connect_fetch_service_schemas' ) ) ? 'yes' : 'no';
$data['helper_connected'] = self::get_helper_connected();
// Store count info.
$data['users'] = self::get_user_counts();
$data['products'] = self::get_product_counts();
$data['orders'] = self::get_orders();
$data['reviews'] = self::get_review_counts();
$data['categories'] = self::get_category_counts();
$data['brands'] = self::get_brands_counts();
// Migrator CLI statistics.
$data['migrator'] = self::get_migrator_data();
// Get order snapshot.
$data['order_snapshot'] = self::get_order_snapshot();
// Payment gateway info.
$data['gateways'] = self::get_active_payment_gateways();
// WcPay settings info.
$data['wcpay_settings'] = self::get_wcpay_settings();
// Shipping method info.
$data['shipping_methods'] = self::get_active_shipping_methods();
// Features.
$data['enabled_features'] = self::get_enabled_features();
// Get all WooCommerce options info.
$data['settings'] = self::get_all_woocommerce_options_values();
// Template overrides.
$template_overrides = self::get_all_template_overrides();
$data['template_overrides'] = $template_overrides;
// Cart & checkout tech (blocks or shortcodes).
$data['cart_checkout'] = self::get_cart_checkout_info();
// Mini Cart block, which only exists since wp 5.9.
if ( version_compare( get_bloginfo( 'version' ), '5.9', '>=' ) ) {
$data['mini_cart_block'] = self::get_mini_cart_info();
}
/**
* Filter whether to disable admin tracking.
*
* @since 5.2.0
*/
$data['wc_admin_disabled'] = apply_filters( 'woocommerce_admin_disabled', false ) ? 'yes' : 'no';
// Mobile info.
$data['wc_mobile_usage'] = self::get_woocommerce_mobile_usage();
// WC Tracker data.
$data['woocommerce_allow_tracking'] = get_option( 'woocommerce_allow_tracking', 'no' );
$data['woocommerce_allow_tracking_last_modified'] = get_option( 'woocommerce_allow_tracking_last_modified', 'unknown' );
$data['woocommerce_allow_tracking_first_optin'] = get_option( 'woocommerce_allow_tracking_first_optin', 'unknown' );
// Email improvements tracking data.
$data['email_improvements'] = self::get_email_improvements_info( $template_overrides );
// Store email usage.
$data['store_emails'] = self::get_store_emails();
// Address autocomplete usage.
$data['address_autocomplete'] = self::get_address_autocomplete_info();
/**
* Filter the data that's sent with the tracker.
*
* @since 2.3.0
*/
$data = apply_filters( 'woocommerce_tracker_data', $data );
// Total seconds taken to generate snapshot (including filtered data).
$data['snapshot_generation_time'] = microtime( true ) - $start_time;
return $data;
}