first
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
<div class="sui-notice sui-notice-info">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
|
||||
<p>
|
||||
<?php
|
||||
esc_html_e( 'Bulk smush is running in the background.', 'wp-smushit' );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk compress dashboard meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var int $uncompressed Number of uncompressed attachments.
|
||||
* @var string $upsell_url Upsell URL.
|
||||
* @var bool $background_processing_enabled Whether background processing is enabled or not.
|
||||
* @var bool $background_in_processing Whether BO is in processing or not.
|
||||
* @var int $total_count Total count.
|
||||
*/
|
||||
?>
|
||||
<div class="sui-notice sui-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %d - number of uncompressed attachments */
|
||||
esc_html__( 'You have %d images that needs compressing!', 'wp-smushit' ),
|
||||
(int) $uncompressed
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
|
||||
$show_bulk_limit_notice = ! $bg_optimization->can_use_background();
|
||||
if ( $show_bulk_limit_notice && $uncompressed > \Smush\Core\Core::MAX_FREE_BULK ) : ?>
|
||||
<div class="sui-notice sui-notice-upsell">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %1$s - opening <a> tag, %2$s - closing </a> tag, %3$s - number of images */
|
||||
esc_html__( '%1$sUpgrade to Pro%2$s to bulk smush all images in one click. Free users can smush %3$s images per batch.', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( $upsell_url ) . '" target="_blank" class="smush-upsell-link">',
|
||||
'</a>',
|
||||
(int) \Smush\Core\Core::MAX_FREE_BULK
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-bulk' ) ); ?>" class="sui-button sui-button-blue wp-smush-bulk-smush-link">
|
||||
<?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?>
|
||||
</a>
|
@ -0,0 +1,11 @@
|
||||
<div class="sui-notice sui-notice-info">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_html_e( 'We haven’t found any images in your media library yet so there’s no compression to be done!', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="sui-button sui-button-blue" href="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>">
|
||||
<?php esc_html_e( 'UPLOAD IMAGES', 'wp-smushit' ); ?>
|
||||
</a>
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk compress dashboard meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var int $uncompressed Number of uncompressed attachments.
|
||||
* @var string $upsell_url Upsell URL.
|
||||
* @var bool $background_processing_enabled Whether background processing is enabled or not.
|
||||
* @var bool $background_in_processing Whether BO is in processing or not.
|
||||
* @var int $total_count Total count.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
if ( $background_processing_enabled ) {
|
||||
$msg = __( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk in the background without any quality loss.', 'wp-smushit' );
|
||||
} else {
|
||||
$msg = __( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk.', 'wp-smushit' );
|
||||
}
|
||||
?>
|
||||
<p><?php echo esc_html( $msg ); ?></p>
|
||||
<?php
|
||||
if ( $background_in_processing ) {
|
||||
$this->view( 'background-in-processing', array(), 'views/dashboard/bulk' );
|
||||
} elseif ( 0 === $total_count ) {
|
||||
$this->view( 'media-lib-empty', array(), 'views/dashboard/bulk' );
|
||||
} elseif ( 0 === $uncompressed ) {
|
||||
$this->view( 'all-images-smushed-notice', array( 'all_done' => true ), 'common' );
|
||||
} else {
|
||||
$this->view( 'exists-uncompressed', array( 'uncompressed' => $uncompressed, 'upsell_url' => $upsell_url ), 'views/dashboard/bulk' );
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* CDN meta box header.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Meta box title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title"><?php echo esc_html( $title ); ?></h3>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<div class="sui-actions-left">
|
||||
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* CDN meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $cdn_status CDN status.
|
||||
* @var bool $is_webp WebP conversion status.
|
||||
* @var string $upsell_url Upsell URL.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Multiply the speed and savings! Upload huge images and the Smush CDN will perfectly resize the files, safely convert to a Next-Gen format (WebP), and delivers them directly to your visitors from our blazing-fast multi-location globe servers.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<a href="<?php echo esc_url( $upsell_url ); ?>" target="_blank" class="sui-button sui-button-purple">
|
||||
<?php esc_html_e( 'Upgrade to Pro', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<?php if ( 'disabled' === $cdn_status ) : ?>
|
||||
<button class="sui-button sui-button-blue" id="smush-enable-cdn">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<?php if ( 'overcap' === $cdn_status ) : ?>
|
||||
<div class="sui-notice sui-notice-error">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_attr_e( "You've gone through your CDN bandwidth limit, so we’ve stopped serving your images via the CDN. Contact your administrator to upgrade your Smush CDN plan to reactivate this service.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php elseif ( 'upgrade' === $cdn_status ) : ?>
|
||||
<div class="sui-notice sui-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_attr_e( "You're almost through your CDN bandwidth limit. Please contact your administrator to upgrade your Smush CDN plan to ensure you don't lose this service.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="sui-notice sui-notice-success">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_attr_e( 'Your media is currently being served from the WPMU DEV CDN.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="sui-box-settings-row sui-flushed sui-no-padding">
|
||||
<table class="sui-table sui-table-flushed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Tools', 'wp-smushit' ); ?></th>
|
||||
<th colspan="2" width="50%"><?php esc_html_e( 'Status', 'wp-smushit' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="sui-table-item-title">
|
||||
<span class="smush-filename-extension smush-extension-webp">webp</span>
|
||||
<?php esc_html_e( 'WebP Conversion', 'wp-smushit' ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( $is_webp ) : ?>
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
<?php else : ?>
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-cdn' ) ); ?>" role="button" class="sui-button-icon">
|
||||
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
|
||||
<span class="sui-screen-reader-text"><?php esc_html_e( 'Configure', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-cdn' ) ); ?>" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-wrench-tool" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Directory compress meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $images Array of images with errors.
|
||||
* @var int $errors Number of errors.
|
||||
*
|
||||
* @var Smush\App\Abstract_Page $this Dashboard page.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'In addition to smushing your media uploads, you may want to smush non WordPress images that are outside of your uploads directory. Get started by adding files and folders you wish to optimize.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! empty( $images ) ) : ?>
|
||||
<div class="sui-notice sui-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %d - number of failed images */
|
||||
esc_html__( "%d images failed to be optimized. This is usually because they no longer exist, or we can't optimize the file format.", 'wp-smushit' ),
|
||||
(int) $errors
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="smush-final-log sui-margin-bottom">
|
||||
<div class="smush-bulk-errors">
|
||||
<?php foreach ( $images as $image ) : ?>
|
||||
<div class="smush-bulk-error-row">
|
||||
<div class="smush-bulk-image-data">
|
||||
<i class="sui-icon-photo-picture" aria-hidden="true"></i>
|
||||
<span class="smush-image-name"><?php echo esc_html( $image['path'] ); ?></span>
|
||||
<span class="smush-image-error"><?php echo esc_html( $image['error'] ); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if ( $errors > 20 ) : ?>
|
||||
<p class="sui-description">
|
||||
<?php
|
||||
printf( /* translators: %d: number of images with errors */
|
||||
esc_html__( 'Showing 20 of %d failed optimizations. Fix or remove these images and run another Directory Smush.', 'wp-smushit' ),
|
||||
absint( $errors )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-directory' ) ); ?>&scan=done" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-eye" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'View All', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-directory' ) ); ?>&start" class="sui-button sui-button-blue">
|
||||
<?php esc_html_e( 'Choose Directory', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Integrations meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $basic_features Basic features.
|
||||
* @var array $fields Available integration settings.
|
||||
* @var bool $is_pro Pro status.
|
||||
* @var array $settings Settings array.
|
||||
* @var string $upsell_url Upsell link.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Integrate with powerful third-party providers and make compression even easier.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<div class="sui-box-settings-row sui-flushed sui-no-padding">
|
||||
<table class="sui-table sui-table-flushed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Available Integrations', 'wp-smushit' ); ?></th>
|
||||
<th><?php esc_html_e( 'Status', 'wp-smushit' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ( $fields as $name ) : ?>
|
||||
<?php
|
||||
$disable = apply_filters( 'wp_smush_integration_status_' . $name, false ); // Disable setting.
|
||||
$upsell = ! in_array( $name, $basic_features, true ) && ! $is_pro; // Gray out row, disable setting.
|
||||
$value = ! ( $upsell || empty( $settings[ $name ] ) || $disable ) && $settings[ $name ];
|
||||
?>
|
||||
<tr class="<?php echo $upsell ? 'smush-disabled-table-row' : ''; ?>">
|
||||
<td class="sui-table-item-title">
|
||||
<?php echo esc_html( Settings::get_setting_data( $name, 'short-label' ) ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( $upsell ) : ?>
|
||||
<span class="sui-tag sui-tag-purple sui-tag-sm"><?php esc_html_e( 'PRO', 'wp-smushit' ); ?></span>
|
||||
<?php elseif ( $value ) : ?>
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
<?php else : ?>
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ( ! $is_pro ) : ?>
|
||||
<p><?php esc_html_e( 'Smush Pro supports hosting images on Amazon S3 and optimizing NextGen Gallery images directly through NextGen Gallery settings.', 'wp-smushit' ); ?></p>
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %1$s - opening <a>, %2$s - closing </a> */
|
||||
esc_html__( '%1$sUnlock now%2$s with a WPMU DEV membership today!', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( $upsell_url ) . '" target="_blank" class="smush-upsell-link">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-integrations' ) ); ?>" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-wrench-tool" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
|
||||
</a>
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Lazy load meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var bool $is_lazy_load Is lazy load module active.
|
||||
* @var array $media_types List of supported media types.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'This feature stops offscreen images from loading until a visitor scrolls to them. Make your page load faster, use less bandwidth and fix the “defer offscreen images” recommendation from a Google PageSpeed test.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! $is_lazy_load ) : ?>
|
||||
<button class="sui-button sui-button-blue" id="smush-enable-lazyload">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<div class="sui-notice sui-notice-success">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_html_e( 'Lazy loading is active.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row sui-flushed">
|
||||
<span class="sui-settings-label"><?php esc_html_e( 'Active Media Types', 'wp-smushit' ); ?></span>
|
||||
<div>
|
||||
<?php foreach ( $media_types as $media => $value ) : ?>
|
||||
<?php
|
||||
if ( true !== $value ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<span class="smush-filename-extension smush-extension-<?php echo esc_attr( $media ); ?>">
|
||||
<?php echo esc_html( $media ); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-lazy-load' ) ); ?>" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-wrench-tool" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* Summary meta box on dashboard page.
|
||||
*
|
||||
* @since 3.8.3
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $cdn_status CDN status.
|
||||
* @var string $human_bytes
|
||||
* @var bool $is_cdn CDN module status.
|
||||
* @var bool $is_lazy_load Lazy load status.
|
||||
* @var bool $is_local_webp Local WebP status.
|
||||
* @var int $resize_count Number of resizes images.
|
||||
* @var string $upsell_url_cdn CDN upsell URL.
|
||||
* @var string $upsell_url_webp Local WebP upsell URL.
|
||||
* @var bool $webp_configured WebP set up configured.
|
||||
* @var string $percent_grade Circle grade class.
|
||||
* @var int|float $percent_metric Metric to calculate circle score.
|
||||
* @var int $percent_optimized Percent optimized.
|
||||
* @var int $total_optimized Total nubmer of images optimized.
|
||||
* @var string|int $stats_percent
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
$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" style="overflow: visible">
|
||||
<ul class="sui-list">
|
||||
<li>
|
||||
<span class="sui-list-label">
|
||||
<?php esc_html_e( 'CDN', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-list-detail">
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<a href="<?php echo esc_url( $upsell_url_cdn ); ?>" target="_blank" class="smush-upgrade-text">
|
||||
<?php esc_html_e( 'Upgrade', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<span class="sui-tooltip sui-tooltip-constrained sui-tooltip-top-right" style="--tooltip-width: 360px;" data-tooltip="<?php esc_attr_e( 'Multiply the speed and savings! Serve your images from our CDN from 114 blazing fast servers around the world.', 'wp-smushit' ); ?>">
|
||||
<span class="sui-tag sui-tag-sm sui-tag-purple"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
|
||||
</span>
|
||||
<?php elseif ( $is_cdn ) : ?>
|
||||
<?php if ( 'overcap' === $cdn_status ) : ?>
|
||||
<span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_attr_e( "You're almost through your CDN bandwidth limit. Please contact your administrator to upgrade your Smush CDN plan to ensure you don't lose this service.", 'wp-smushit' ); ?>">
|
||||
<span class="sui-icon-warning-alert sui-md sui-warning" aria-hidden="true"></span>
|
||||
</span>
|
||||
<span><?php esc_html_e( 'Overcap', 'wp-smushit' ); ?></span>
|
||||
<?php elseif ( 'upgrade' === $cdn_status ) : ?>
|
||||
<span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_attr_e( "You've gone through your CDN bandwidth limit, so we’ve stopped serving your images via the CDN. Contact your administrator to upgrade your Smush CDN plan to reactivate this service.", 'wp-smushit' ); ?>">
|
||||
<span class="sui-icon-warning-alert sui-md sui-error" aria-hidden="true"></span>
|
||||
</span>
|
||||
<span><?php esc_html_e( 'Overcap', 'wp-smushit' ); ?></span>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-cdn' ) ); ?>">
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-cdn' ) ); ?>">
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php if ( ! is_multisite() ) : ?>
|
||||
<li>
|
||||
<span class="sui-list-label">
|
||||
<?php esc_html_e( 'Local WebP', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-list-detail">
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<a href="<?php echo esc_url( $upsell_url_webp ); ?>" target="_blank" class="smush-upgrade-text">
|
||||
<?php esc_html_e( 'Upgrade', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<span class="sui-tooltip sui-tooltip-constrained sui-tooltip-top-right" style="--tooltip-width: 360px;" data-tooltip="<?php esc_attr_e( 'Fix the “Serve images in next-gen format” Google PageSpeed recommendation by setting up this feature. Locally serve WebP versions of your images to supported browsers, and gracefully fall back to JPEGs and PNGs for browsers that don’t support WebP.', 'wp-smushit' ); ?>">
|
||||
<span class="sui-tag sui-tag-sm sui-tag-purple"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
|
||||
</span>
|
||||
<?php elseif ( $is_local_webp && $webp_configured ) : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-webp' ) ); ?>">
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php elseif ( $is_local_webp && ! $webp_configured ) : ?>
|
||||
<span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_attr_e( 'The setup for Local WebP feature is inactive. Complete the setup, to activate the feature.', 'wp-smushit' ); ?>">
|
||||
<span class="sui-icon-warning-alert sui-md sui-warning" aria-hidden="true"></span>
|
||||
</span>
|
||||
<span><?php esc_html_e( 'Incomplete setup', 'wp-smushit' ); ?></span>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-webp' ) ); ?>">
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li>
|
||||
<span class="sui-list-label">
|
||||
<?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-list-detail">
|
||||
<?php if ( $is_lazy_load ) : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-lazy-load' ) ); ?>">
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-lazy-load' ) ); ?>">
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php $this->view( 'summary/lossy-level' ); ?>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* Tools meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var bool $is_resize_detection Image resize detection module status.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Use Tools for extra configurations.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<div class="sui-box-settings-row sui-flushed sui-no-padding">
|
||||
<table class="sui-table sui-table-flushed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Available Tools', 'wp-smushit' ); ?></th>
|
||||
<th><?php esc_html_e( 'Status', 'wp-smushit' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="sui-table-item-title">
|
||||
<?php esc_html_e( 'Image Resize Detection', 'wp-smushit' ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( $is_resize_detection ) : ?>
|
||||
<span class="sui-tag sui-tag-green"><?php esc_html_e( 'Active', 'wp-smushit' ); ?></span>
|
||||
<?php else : ?>
|
||||
<span class="sui-tag"><?php esc_html_e( 'Inactive', 'wp-smushit' ); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-settings' ) ); ?>" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-wrench-tool" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'View Tools', 'wp-smushit' ); ?>
|
||||
</a>
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Upsell meta box header.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Meta box title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title"><?php echo esc_html( $title ); ?></h3>
|
||||
<div class="sui-actions-left">
|
||||
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
|
||||
</div>
|
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Upsell meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $upsell_url Upsell URL.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
|
||||
$can_use_background = $bg_optimization->can_use_background();
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( 'Get our full WordPress image optimization suite with Smush Pro and additional benefits of WPMU DEV membership.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<ol class="sui-upsell-list">
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Serve image faster with Ultra compression', 'wp-smushit' ); ?> <span class="sui-tag smush-sui-tag-new"><?php esc_html_e( 'NEW', 'wp-smushit' ); ?></span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Fix Google PageSpeed image recommendations', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( '10 GB Smush CDN', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<?php if( ! $can_use_background ) :?>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Background optimization', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Unlimited image optimization', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<?php endif;?>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Serve next-gen formats with WebP conversion', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Get faster sites with Hummingbird Pro', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( '24/7 live WordPress support', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-md" aria-hidden="true"></span>
|
||||
<?php esc_html_e( '30-day money-back guarantee', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<a href="<?php echo esc_url( $upsell_url ); ?>" target="_blank" class="sui-button sui-button-purple sui-margin-top">
|
||||
<?php esc_html_e( 'UNLOCK NOW WITH PRO', 'wp-smushit' ); ?>
|
||||
</a>
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Local WebP meta box header.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Meta box title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title"><?php echo esc_html( $title ); ?></h3>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<div class="sui-actions-left">
|
||||
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Local WebP meta box.
|
||||
*
|
||||
* @since 3.8.6
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var true|string $is_configured Is local WebP module configured. Error message if it's not.
|
||||
* @var bool $is_webp_active Is local WebP module enabled.
|
||||
* @var string $upsell_url Upsell URL.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( "Serve WebP versions of your images to supported browsers, and gracefully fall back on JPEGs and PNGs for browsers that don't support WebP.", 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<a href="<?php echo esc_url( $upsell_url ); ?>" target="_blank" class="sui-button sui-button-purple">
|
||||
<?php esc_html_e( 'Upgrade to Pro', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php elseif ( ! $is_webp_active ) : ?>
|
||||
<button class="sui-button sui-button-blue" id="smush-toggle-webp-button" data-action="enable">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Activate', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<?php if ( true === $is_configured ) : ?>
|
||||
<div class="sui-notice sui-notice-success">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></span>
|
||||
<p><?php esc_html_e( 'WebP conversion is active and working well.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="sui-notice sui-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<span class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></span>
|
||||
<p><?php echo esc_html( $is_configured ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url( $this->get_url( 'smush-webp' ) ); ?>" class="sui-button sui-button-ghost">
|
||||
<span class="sui-icon-wrench-tool" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
Reference in New Issue
Block a user