2023-06-05 11:23:16 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* File: FeatureShowcase_Plugin_Admin_View.php
|
|
|
|
*
|
|
|
|
* @since 2.1.0
|
|
|
|
*
|
|
|
|
* @package W3TC
|
|
|
|
*
|
|
|
|
* @uses array $config W3TC configuration.
|
|
|
|
* @uses array $cards {
|
|
|
|
* Feature configuration.
|
|
|
|
*
|
|
|
|
* @type string $title Title.
|
|
|
|
* @type string $icon Dashicon icon class.
|
|
|
|
* @type string $text Description.
|
|
|
|
* @type string $button Button markup.
|
|
|
|
* @type string $link Link URL address.
|
|
|
|
* @type bool $is_premium Is it a premium feature.
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @see Util_Environment::is_w3tc_pro()
|
|
|
|
* @see Util_Ui::pro_wrap_maybe_end2()
|
|
|
|
*
|
|
|
|
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace W3TC;
|
|
|
|
|
|
|
|
$is_pro = Util_Environment::is_w3tc_pro( $config );
|
|
|
|
|
2023-10-22 22:21:26 +00:00
|
|
|
require W3TC_INC_DIR . '/options/common/header.php';
|
2023-06-05 11:23:16 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="w3tc-page-container">
|
|
|
|
<?php
|
2023-12-08 23:23:32 +00:00
|
|
|
foreach ( $cards_data as $card_type => $cards ) {
|
|
|
|
$class = 'new' === $card_type ? 'w3tc-card-container-new' : 'w3tc-card-container';
|
2023-06-05 11:23:16 +00:00
|
|
|
|
2023-12-08 23:23:32 +00:00
|
|
|
echo reset( $cards_data ) !== $cards ? '<hr class="w3tc-card-container-divider"/>' : '';
|
2023-06-05 11:23:16 +00:00
|
|
|
?>
|
2023-12-08 23:23:32 +00:00
|
|
|
<div class="<?php echo $class; ?>">
|
2023-06-05 11:23:16 +00:00
|
|
|
<?php
|
2023-12-08 23:23:32 +00:00
|
|
|
foreach ( $cards as $feature_id => $card ) {
|
|
|
|
$card_classes = 'w3tc-card';
|
|
|
|
$title_classes = 'w3tc-card-title';
|
|
|
|
$is_premium = ! empty( $card['is_premium'] );
|
|
|
|
$is_new = ! empty( $card['is_new'] );
|
2023-06-05 11:23:16 +00:00
|
|
|
|
2023-12-08 23:23:32 +00:00
|
|
|
if ( $is_premium ) {
|
|
|
|
$card_classes .= ' w3tc-card-premium';
|
|
|
|
$title_classes .= ' w3tc-card-premium';
|
|
|
|
}
|
2023-06-05 11:23:16 +00:00
|
|
|
|
2023-12-08 23:23:32 +00:00
|
|
|
if ( $is_premium && ! $is_pro ) {
|
|
|
|
$card_classes .= ' w3tc-card-upgrade';
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="<?php echo $card_classes; ?>" id="w3tc-feature-<?php echo esc_attr( $feature_id ); ?>">
|
2023-06-05 11:23:16 +00:00
|
|
|
<div class="<?php echo $title_classes; ?>">
|
|
|
|
<p><?php echo $card['title']; ?></p>
|
2023-12-08 23:23:32 +00:00
|
|
|
<?php
|
|
|
|
if ( $is_premium ) {
|
|
|
|
echo '<p class="w3tc-card-pro">' . __( 'PRO FEATURE', 'w3-total-cache' ) . '</p>';
|
|
|
|
}
|
|
|
|
?>
|
2023-06-05 11:23:16 +00:00
|
|
|
</div>
|
|
|
|
<div class="w3tc-card-icon"><span class="dashicons <?php echo $card['icon']; ?>"></span></div>
|
|
|
|
<div class="w3tc-card-body"><p><?php echo $card['text']; ?></p></div>
|
|
|
|
<div class="w3tc-card-footer">
|
|
|
|
<div class="w3tc-card-button">
|
2023-10-22 22:21:26 +00:00
|
|
|
<?php
|
|
|
|
if ( $is_premium && ! $is_pro ) {
|
2023-12-08 23:23:32 +00:00
|
|
|
echo '<button class="button w3tc-gopro-button button-buy-plugin" data-src="feature_showcase">'
|
|
|
|
. esc_html__( 'Unlock Feature', 'w3-total-cache' ) . '</button>';
|
2023-10-22 22:21:26 +00:00
|
|
|
} elseif ( ! empty( $card['button'] ) ) {
|
|
|
|
echo $card['button'];
|
|
|
|
}
|
|
|
|
?>
|
2023-06-05 11:23:16 +00:00
|
|
|
</div><div class="w3tc-card-links"><?php echo $card['link']; ?></div>
|
|
|
|
</div>
|
2023-12-08 23:23:32 +00:00
|
|
|
<?php
|
|
|
|
if ( $is_new ) {
|
|
|
|
?>
|
|
|
|
<div class="w3tc-card-ribbon-new">
|
|
|
|
<span class="dashicons dashicons-awards"></span>
|
|
|
|
<b><?php esc_html_e( 'New', 'w3-total-cache' ); ?></b>
|
|
|
|
<span>
|
|
|
|
<?php esc_html_e( 'in', 'w3-total-cache' ); ?> W3 Total Cache Pro <?php echo W3TC_VERSION; ?>!
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2023-06-05 11:23:16 +00:00
|
|
|
</div>
|
2023-12-08 23:23:32 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
2023-06-05 11:23:16 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|