add additional information to the WC Tracker

* Some basic info about Jetpack version, if connected, and if is a staging site
* Some basic info about WooCommerce Connect, if installed and if active
This commit is contained in:
Joey Kudish 2016-05-11 15:36:04 -07:00
parent 06dbc81d66
commit 3b59fd7af4
1 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,13 @@ class WC_Tracker {
$data['active_plugins'] = $all_plugins['active_plugins'];
$data['inactive_plugins'] = $all_plugins['inactive_plugins'];
// Jetpack & WooCommerce Connect
$data['jetpack_version'] = defined( 'JETPACK__VERSION' ) ? JETPACK__VERSION : 'none';
$data['jetpack_connected'] = ( class_exists( 'Jetpack' ) && is_callable( 'Jetpack::is_active' ) && Jetpack::is_active() ) ? 'yes' : 'no';
$data['jetpack_is_staging'] = ( class_exists( 'Jetpack' ) && is_callable( 'Jetpack::is_staging_site' ) && Jetpack::is_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';
// Store count info
$data['users'] = self::get_user_counts();
$data['products'] = self::get_product_counts();