Tribe__PUE__Notices::render_expired_key()

Generate a notice listing any plugins for which license keys have expired.

This notice should only appear at the top of the plugin admin screen and "trumps" the missing/invalid key notice on that screen only.


Source

File: src/Tribe/PUE/Notices.php

	public function render_expired_key() {
		global $pagenow;

		if ( 'plugins.php' !== $pagenow ) {
			return;
		}

		$plugin_names = $this->get_formatted_plugin_names( self::EXPIRED_KEY );

		if ( empty( $plugin_names ) ) {
			return;
		}

		$prompt = sprintf( _n(
				'There is an update available for %1$s but your license has expired. %2$sVisit the Events Calendar website to renew your license.%3$s',
				'Updates are available for %1$s but your license keys have expired. %2$sVisit the Events Calendar website to renew your licenses.%3$s',
				count( $this->notices[ self::EXPIRED_KEY ] ),
				'tribe-common'
			),
			$plugin_names,
			'<a href="http://m.tri.be/195d" target="_blank">',
			'</a>'
		);

		$renew_action =
			'<a href="http://m.tri.be/195y" target="_blank" class="button button-primary">' .
			__( 'Renew Your License Now', 'tribe-common' ) .
			'<span class="screen-reader-text">' .
			__( ' (opens in a new window)', 'tribe-common' ) .
			'</span></a>';

		$this->render_notice( 'pue_key-' . self::EXPIRED_KEY, "<p>$prompt</p> <p>$renew_action</p>" );
	}