WPSEO_Addon_Manager::expired_subscription_warning()publicYoast 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 22.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-2023-promotion' ) ) {
			$sale_copy = sprintf(
			/* translators: %1$s is a <br> tag. */
				esc_html__( '%1$s Now with 30%% Black Friday Discount!', 'wordpress-seo' ),
				'<br>'
			);
		}
		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__( '%1$s can\'t be updated because your product subscription is expired. %2$sRenew your product subscription%3$s to get updates again and use all the features of %1$s.', '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>';
	}
}