wpsc_jetpack_boost_install_banner()WPSCache 1.0

Show a Jetpack Boost installation banner (unless dismissed or installed)

Хуков нет.

Возвращает

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

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

wpsc_jetpack_boost_install_banner();

Код wpsc_jetpack_boost_install_banner() WPSCache 1.12.2

<?php
function wpsc_jetpack_boost_install_banner() {
	if ( ! wpsc_is_boost_current() ) {
		return;
	}
	// Don't show the banner if Boost is installed, or the banner has been dismissed.
	$is_dismissed = '1' === get_user_option( 'wpsc_dismissed_boost_banner' );
	if ( wpsc_is_boost_active() || $is_dismissed ) {
		return;
	}

	$config       = wpsc_get_boost_migration_config();
	$button_url   = $config['is_installed'] ? $config['activate_url'] : $config['install_url'];
	$button_label = $config['is_installed'] ? __( 'Set up Jetpack Boost', 'wp-super-cache' ) : __( 'Install Jetpack Boost', 'wp-super-cache' );
	$button_class = $config['is_installed'] ? 'wpsc-activate-boost-button' : 'wpsc-install-boost-button';
	$plugin_url   = plugin_dir_url( __FILE__ );

	?>
		<div class="wpsc-boost-banner">
			<div class="wpsc-boost-banner-inner">
				<div class="wpsc-boost-banner-content">
					<img style="width:282px" src="<?php echo esc_url( $plugin_url . '/assets/jetpack-logo.svg' ); ?>" height="36" />

					<h3>
						<?php esc_html_e( 'Speed up your site with our top&#8209;rated performance tool', 'wp-super-cache' ); ?>
					</h3>

					<p id="wpsc-install-invitation">
						<?php
							esc_html_e(
								'Caching is a great start, but there is more to maximize your site speed. Find out how much your cache speeds up your site and make it blazing fast with Jetpack Boost, the easiest WordPress speed optimization plugin developed by WP Super Cache engineers.',
								'wp-super-cache'
							);
						?>
					</p>

					<div class="wpsc-boost-migration-error" style="display:none; color:red; margin-bottom: 20px;"></div>

					<div style="display: flex; gap: 24px;">
						<a style="font-weight: 500; line-height: 1; padding: 10px 20px 15px;" data-source='banner' href="<?php echo esc_url( $button_url ); ?>" class="wpsc-boost-migration-button button button-primary <?php echo esc_attr( $button_class ); ?>">
							<div class='spinner' style='display:none; margin-top: 8px'></div>
							<label><?php echo esc_html( $button_label ); ?></label>
						</a>
						<a style="display: flex; align-items: center; font-weight: 500; color: #000; " href="https://jetpack.com/blog/discover-how-to-improve-your-site-performance-with-jetpack-boost/">
							Learn More
						</a>
					</div>
				</div>

				<div class="wpsc-boost-banner-image-container">
					<img
						width="350"
						height="452"
						src="<?php echo esc_url( $plugin_url . 'assets/boost-install-card-main.png' ); ?>"
						title="<?php esc_attr_e( 'Check how your web site performance scores for desktop and mobile.', 'wp-super-cache' ); ?>"
						alt="<?php esc_attr_e( 'An image showing the Jetpack Boost dashboard.', 'wp-super-cache' ); ?>"
						srcset="<?php echo esc_url( $plugin_url . 'assets/boost-install-card-main.png' ); ?> 400w, <?php echo esc_url( $plugin_url . 'assets/boost-install-card-main-2x.png' ); ?> 800w"
						sizes="(max-width: 782px) 350px, 700px"
					>
				</div>
			</div>

			<span class="wpsc-boost-dismiss dashicons dashicons-dismiss"></span>
		</div>
	<?php
}