@@ -8839,8 +8839,13 @@ private function get_plugins_data_for_api() {
88398839 isset( $site_active_plugins[ $basename ] )
88408840 ) {
88418841 // Plugin was site level activated.
8842- $site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ];
8843- $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
8842+ $site_active_plugins_cache->plugins[ $basename ] = array(
8843+ 'slug' => $network_plugins[ $basename ]['slug'],
8844+ 'version' => $network_plugins[ $basename ]['Version'],
8845+ 'title' => $network_plugins[ $basename ]['Name'],
8846+ 'is_active' => $is_active,
8847+ 'is_uninstalled' => false,
8848+ );
88448849 } else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
88458850 ! isset( $site_active_plugins[ $basename ] )
88468851 ) {
@@ -15777,6 +15782,10 @@ static function get_sites_blog_ids( $sites ) {
1577715782 function get_site_info( $site = null, $load_registration = false ) {
1577815783 $this->_logger->entrance();
1577915784
15785+ $fs_hook_snapshot = new FS_Hook_Snapshot();
15786+ // Remove all filters from `switch_blog`.
15787+ $fs_hook_snapshot->remove( 'switch_blog' );
15788+
1578015789 $switched = false;
1578115790
1578215791 $registration_date = null;
@@ -15836,6 +15845,9 @@ function get_site_info( $site = null, $load_registration = false ) {
1583615845 restore_current_blog();
1583715846 }
1583815847
15848+ // Add the filters back to `switch_blog`.
15849+ $fs_hook_snapshot->restore( 'switch_blog' );
15850+
1583915851 return $info;
1584015852 }
1584115853
@@ -23505,7 +23517,7 @@ function _fs_pricing_ajax_action_handler() {
2350523517 $params['plugin_public_key'] = $this->get_public_key();
2350623518 }
2350723519
23508- $result = $api->get( 'pricing.json?' . http_build_query( $params ) );
23520+ $result = $api->get( $this->add_show_pending( 'pricing.json?' . http_build_query( $params ) ) );
2350923521 break;
2351023522 case 'start_trial':
2351123523 $trial_plan_id = fs_request_get( 'plan_id' );
@@ -24686,23 +24698,39 @@ private function get_complete_upgrade_instructions( $plan_title = '' ) {
2468624698 $this->get_premium_slug() :
2468724699 $this->premium_plugin_basename();
2468824700
24689- return sprintf(
24690- /* translators: %1$s: Product title; %2$s: Plan title */
24691- $this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s', 'activate-premium-version' ),
24692- sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24693- $plan_title,
24694- sprintf(
24695- '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24696- ( $this->is_theme() ?
24697- wp_nonce_url( 'themes.php?action=activate&stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24698- wp_nonce_url( 'plugins.php?action=activate&plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
24699- esc_html( sprintf(
24700- /* translators: %s: Plan title */
24701- $this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
24702- $plan_title
24703- ) )
24704- )
24705- );
24701+ if ( is_admin() ) {
24702+ return sprintf(
24703+ /* translators: %1$s: Product title; %2$s: Plan title */
24704+ $this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting from the %2$s features. %3$s', 'activate-premium-version' ),
24705+ sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24706+ $plan_title,
24707+ sprintf(
24708+ '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24709+ ( $this->is_theme() ?
24710+ wp_nonce_url( 'themes.php?action=activate&stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24711+ wp_nonce_url( 'plugins.php?action=activate&plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
24712+ esc_html( sprintf(
24713+ /* translators: %s: Plan title */
24714+ $this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
24715+ $plan_title
24716+ ) )
24717+ )
24718+ );
24719+ } else {
24720+ return sprintf(
24721+ /* translators: %1$s: Product title; %3$s: Plan title */
24722+ $this->get_text_inline( ' The paid version of %1$s is already installed. Please navigate to the %2$s to activate it and start benefiting from the %3$s features.', 'activate-premium-version-plugins-page' ),
24723+ sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24724+ sprintf(
24725+ '<a href="%s">%s</a>',
24726+ admin_url( $this->is_theme() ? 'themes.php' : 'plugins.php' ),
24727+ ( $this->is_theme() ?
24728+ $this->get_text_inline( 'Themes page', 'themes-page' ) :
24729+ $this->get_text_inline( 'Plugins page', 'plugins-page' ) )
24730+ ),
24731+ $plan_title
24732+ );
24733+ }
2470624734 } else {
2470724735 // @since 1.2.1.5 The free version is auto deactivated.
2470824736 $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
0 commit comments