'
. '
'
. \sprintf(
/* translators: %1$s: Yoast SEO, %2$s: The minimum Yoast SEO version required, %3$s: Yoast SEO Premium. */
\esc_html__( '%1$s %2$s must be installed and activated in order to use %3$s.', 'wordpress-seo-premium' ),
'Yoast SEO',
\esc_html( self::MINIMUM_YOAST_SEO_VERSION ),
'Yoast SEO Premium'
)
. '
'
. '
'
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is escaped above.
. $action
. '
'
. '
'
);
}
/**
* Returns the notification action to display.
*
* @return false|string The notification action or false if no action should be taken.
*/
protected function get_notification_action() {
$minimum_version_met = \version_compare( $this->yoast_seo_version, self::MINIMUM_YOAST_SEO_VERSION . '-RC0', '>=' );
$network_active = \is_plugin_active_for_network( \WPSEO_PREMIUM_BASENAME );
$yoast_seo_active = ( $network_active ) ? \is_plugin_active_for_network( $this->yoast_seo_file ) : \is_plugin_active( $this->yoast_seo_file );
if ( $minimum_version_met && $yoast_seo_active ) {
return false;
}
if ( $minimum_version_met ) {
$permission = 'activate_plugins';
}
elseif ( $this->yoast_seo_version !== '0' ) {
$permission = 'update_plugins';
}
else {
$permission = 'install_plugins';
}
if ( \current_user_can( $permission ) ) {
switch ( $permission ) {
case 'activate_plugins':
if ( $network_active ) {
$base_url = \network_admin_url( 'plugins.php?action=activate&plugin=' . $this->yoast_seo_file );
/* translators: %1$s: Yoast SEO, %2$s: Link start tag, %3$s: Link end tag. */
$button_content = \__( '%2$sNetwork Activate %1$s now%3$s', 'wordpress-seo-premium' );
}
else {
$base_url = \self_admin_url( 'plugins.php?action=activate&plugin=' . $this->yoast_seo_file );
/* translators: %1$s: Yoast SEO, %2$s: Link start tag, %3$s: Link end tag. */
$button_content = \__( '%2$sActivate %1$s now%3$s', 'wordpress-seo-premium' );
}
$url = \wp_nonce_url( $base_url, 'activate-plugin_' . $this->yoast_seo_file );
break;
case 'update_plugins':
$url = \wp_nonce_url( \self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $this->yoast_seo_file ), 'upgrade-plugin_' . $this->yoast_seo_file );
/* translators: %1$s: Yoast SEO, %2$s: Link start tag, %3$s: Link end tag. */
$button_content = \__( '%2$sUpgrade %1$s now%3$s', 'wordpress-seo-premium' );
break;
case 'install_plugins':
$url = \wp_nonce_url( \self_admin_url( 'update.php?action=install-plugin&plugin=wordpress-seo' ), 'install-plugin_wordpress-seo' );
/* translators: %1$s: Yoast SEO, %2$s: Link start tag, %3$s: Link end tag. */
$button_content = \__( '%2$sInstall %1$s now%3$s', 'wordpress-seo-premium' );
break;
}
return \sprintf(
\esc_html( $button_content ),
'Yoast SEO',
'