first
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
$lossy_level_setting = Settings::get_instance()->get_lossy_level_setting();
|
||||
$is_ultra_active = Settings::LEVEL_ULTRA_LOSSY === $lossy_level_setting;
|
||||
$is_super_active = Settings::LEVEL_SUPER_LOSSY === $lossy_level_setting;
|
||||
$is_pro = WP_Smush::is_pro();
|
||||
$class_names = array();
|
||||
if ( ! $is_pro ) {
|
||||
$class_names[] = 'smush-upsell-link wp-smush-upsell-ultra-compression';
|
||||
$is_dashboard_page = 'smush' === $this->get_slug();
|
||||
$location = $is_dashboard_page ? 'dashboard_summary' : 'bulksmush_summary';
|
||||
$utm_link = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => "smush_ultra_{$location}",
|
||||
)
|
||||
);
|
||||
} elseif ( $is_ultra_active ) {
|
||||
$class_names[] = 'sui-hidden';
|
||||
}
|
||||
?>
|
||||
<li class="smush-summary-row-compression-type">
|
||||
<span class="sui-list-label"><?php esc_html_e( 'Smush Mode', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-list-detail">
|
||||
<span class="wp-smush-current-compression-level sui-tag sui-tag-green"><?php echo esc_html( Settings::get_instance()->get_current_lossy_level_label() ); ?></span>
|
||||
<a target="<?php echo $is_pro ? '_self' : '_blank'; ?>" href="<?php echo isset( $utm_link ) ? esc_url( $utm_link ) : esc_url( $this->get_url( 'smush-bulk' ) ) . '#lossy-settings-row'; ?>" class="<?php echo esc_attr( join( ' ', $class_names ) ); ?>" title="<?php esc_attr_e( 'Choose the level of compression that suits your needs.', 'wp-smushit' ); ?>">
|
||||
<?php if ( $is_pro ) : ?>
|
||||
<?php esc_html_e( 'Improve page speed with Ultra', 'wp-smushit' ); ?>
|
||||
<?php else : ?>
|
||||
<?php esc_html_e( '5x your compression with Ultra', 'wp-smushit' ); ?>
|
||||
<span class="sui-icon-open-new-window" aria-hidden="true"></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
65
wp-content/plugins/wp-smushit/app/views/summary/meta-box.php
Normal file
65
wp-content/plugins/wp-smushit/app/views/summary/meta-box.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Summary meta box on dashboard page.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $human_bytes
|
||||
* @var int $remaining
|
||||
* @var int $resize_count
|
||||
* @var bool $resize_enabled
|
||||
* @var int $resize_savings
|
||||
* @var string|int $stats_percent
|
||||
* @var int $total_optimized
|
||||
* @var string $percent_grade
|
||||
* @var int|float $percent_metric
|
||||
* @var int $percent_optimized
|
||||
*
|
||||
* @var Smush\App\Abstract_Page $this Page.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$this->view(
|
||||
'scan-progress-bar',
|
||||
array(),
|
||||
'common'
|
||||
);
|
||||
|
||||
$this->view(
|
||||
'circle-progress-bar',
|
||||
array(
|
||||
'percent_grade' => $percent_grade,
|
||||
'percent_optimized' => $percent_optimized,
|
||||
'percent_metric' => $percent_metric,
|
||||
),
|
||||
'common'
|
||||
);
|
||||
|
||||
$this->view(
|
||||
'summary-segment',
|
||||
array(
|
||||
'human_bytes' => $human_bytes,
|
||||
'total_optimized' => $total_optimized,
|
||||
'stats_percent' => $stats_percent,
|
||||
'resize_count' => $resize_count,
|
||||
),
|
||||
'common'
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<div class="sui-summary-segment">
|
||||
<ul class="sui-list smush-stats-list">
|
||||
<?php
|
||||
/**
|
||||
* Allows to output Directory Smush stats
|
||||
*/
|
||||
do_action( 'stats_ui_after_resize_savings' );
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user