diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 0f4dabcb6..4c79f6552 100644 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -4119,19 +4119,10 @@ function _activate_plugin_event_hook() { // Clear API cache on activation. FS_Api::clear_cache(); - if ( $this->is_registered() ) { $is_premium_version_activation = ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) ); - if ( $is_premium_version_activation ) { - $this->reconnect_locally(); - } - $this->_logger->info( 'Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.' ); - // Schedule re-activation event and sync. -// $this->sync_install( array(), true ); - $this->schedule_install_sync(); - // 1. If running in the activation of the FREE module, get the basename of the PREMIUM. // 2. If running in the activation of the PREMIUM module, get the basename of the FREE. $other_version_basename = $is_premium_version_activation ? @@ -4148,6 +4139,15 @@ function _activate_plugin_event_hook() { deactivate_plugins( $other_version_basename ); } + if ( $this->is_registered() ) { + if ( $is_premium_version_activation ) { + $this->reconnect_locally(); + } + + // Schedule re-activation event and sync. +// $this->sync_install( array(), true ); + $this->schedule_install_sync(); + // If activating the premium module version, add an admin notice to congratulate for an upgrade completion. if ( $is_premium_version_activation ) { $this->_admin_notices->add(