diff --git a/inc/partners.php b/inc/partners.php index a35712f97..2bc60e782 100644 --- a/inc/partners.php +++ b/inc/partners.php @@ -32,3 +32,22 @@ function aioseo_upgrade_affiliate_link( $url ) { } add_filter( 'aioseo_upgrade_link', __NAMESPACE__ . '\\aioseo_upgrade_affiliate_link' ); + +/** + * Enable Sharing with WooCommerce + * + * @param string $plugin the plugin + * @param boolean $network_activation flag is network activated + * + * @return void + */ +function plugin_activated( $plugin, $network_activation ) { + switch( $plugin ) { + case 'woocommerce/woocommerce.php': + // Enable the usage tracking option by default https://woocommerce.com/usage-tracking/ + update_option( 'woocommerce_allow_tracking', 'yes' ); + break; + } +} + +add_action( 'activated_plugin', __NAMESPACE__ . '\\plugin_activated', 10, 2 ); \ No newline at end of file