Skip to content

Commit bf02869

Browse files
committed
Fix the nonce generated for the plugin activation link in the upgrade instructions admin notice.
1 parent d4750f4 commit bf02869

2 files changed

Lines changed: 34 additions & 18 deletions

File tree

‎includes/class-freemius.php‎

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24686,23 +24686,39 @@ private function get_complete_upgrade_instructions( $plan_title = '' ) {
2468624686
$this->get_premium_slug() :
2468724687
$this->premium_plugin_basename();
2468824688

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&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24698-
wp_nonce_url( 'plugins.php?action=activate&amp;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-
);
24689+
if ( is_admin() ) {
24690+
return sprintf(
24691+
/* translators: %1$s: Product title; %2$s: Plan title */
24692+
$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' ),
24693+
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24694+
$plan_title,
24695+
sprintf(
24696+
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24697+
( $this->is_theme() ?
24698+
wp_nonce_url( 'themes.php?action=activate&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24699+
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
24700+
esc_html( sprintf(
24701+
/* translators: %s: Plan title */
24702+
$this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
24703+
$plan_title
24704+
) )
24705+
)
24706+
);
24707+
} else {
24708+
return sprintf(
24709+
/* translators: %1$s: Product title; %3$s: Plan title */
24710+
$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' ),
24711+
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24712+
sprintf(
24713+
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24714+
admin_url( $this->is_theme() ? 'themes.php' : 'plugins.php' ),
24715+
( $this->is_theme() ?
24716+
$this->get_text_inline( 'Themes page', 'themes-page' ) :
24717+
$this->get_text_inline( 'Plugins page', 'plugins-page' ) ),
24718+
),
24719+
$plan_title
24720+
);
24721+
}
2470624722
} else {
2470724723
// @since 1.2.1.5 The free version is auto deactivated.
2470824724
$deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?

‎start.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @var string
1717
*/
18-
$this_sdk_version = '2.12.1';
18+
$this_sdk_version = '2.12.1.1';
1919

2020
#region SDK Selection Logic --------------------------------------------------------------------
2121

0 commit comments

Comments
 (0)