WPSEO_Addon_Manager::expired_subscription_warningpublicYoast 1.0

If the plugin is lacking an active subscription, throw a warning.

Метод класса: WPSEO_Addon_Manager{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WPSEO_Addon_Manager = new WPSEO_Addon_Manager();
$WPSEO_Addon_Manager->expired_subscription_warning( $plugin_data );
$plugin_data(массив) (обязательный)
The data for the plugin in this row.

Код WPSEO_Addon_Manager::expired_subscription_warning() Yoast 27.3

public function expired_subscription_warning( $plugin_data ) {
	$subscription = $this->get_subscription( $plugin_data['slug'] );
	if ( $subscription && $this->has_subscription_expired( $subscription ) ) {
		$addon_link = ( isset( $this->addon_details[ $plugin_data['slug'] ] ) ) ? $this->addon_details[ $plugin_data['slug'] ]['short_link_renewal'] : $this->addon_details[ self::PREMIUM_SLUG ]['short_link_renewal'];

		$sale_copy = '';
		if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-promotion' ) ) {
			$sale_copy = sprintf(
			/* translators: %1$s and %2$s are a <span> opening and closing tag. */
				esc_html__( '%1$s30%% OFF - Black Friday %2$s', 'wordpress-seo' ),
				'<span class="yoast-update-plugin-bf-sale-badge">',
				'</span>',
			);
		}
		echo '<br><br>';
		echo '<strong><span class="yoast-dashicons-notice warning dashicons dashicons-warning"></span> '
			. sprintf(
				/* translators: %1$s is the plugin name, %2$s and %3$s are a link. */
				esc_html__( 'Your %1$s plugin cannot be updated as your subscription has expired. %2$sRenew your product subscription%3$s to restore updates and full feature access.', 'wordpress-seo' ),
				esc_html( $plugin_data['name'] ),
				'<a href="' . esc_url( WPSEO_Shortlinker::get( $addon_link ) ) . '">',
				'</a>',
			)
			// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is escaped above.
			. $sale_copy
			. '</strong>';
	}
}