first
This commit is contained in:
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* Settings meta box.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $basic_features Basic features list.
|
||||
* @var bool $cdn_enabled CDN status.
|
||||
* @var array $grouped_settings Grouped settings that can be skipped.
|
||||
* @var array $settings Settings values.
|
||||
* @var bool $backup_exists Number of attachments with backups.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( WP_Smush::is_pro() && $cdn_enabled && Settings::can_access( 'bulk' ) ) : ?>
|
||||
<div class="sui-notice sui-notice-info">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Your images are currently being served via the WPMU DEV CDN. Bulk smush will continue to operate as per your settings below and is treated completely separately in case you ever want to disable the CDN.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
foreach ( $grouped_settings as $name ) {
|
||||
// If not bulk settings - skip.
|
||||
if ( ! in_array( $name, $grouped_settings, true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$can_access_pro = $this->settings->can_access_pro_field( $name );
|
||||
$is_pro_field = $this->settings->is_pro_field( $name );
|
||||
$is_upsell_field = $this->settings->is_upsell_field( $name );
|
||||
$is_disabled_field = ( $is_upsell_field || $is_pro_field ) && ! $can_access_pro;
|
||||
$is_pro_but_not_upsell = $is_pro_field && ! $is_upsell_field;
|
||||
// Only show pro upsell field on Bulk Smush page to avoid upselly UI.
|
||||
if ( $is_pro_but_not_upsell && ! $can_access_pro ) {
|
||||
continue;
|
||||
}
|
||||
$value = $is_disabled_field || empty( $settings[ $name ] ) ? false : $settings[ $name ];
|
||||
|
||||
// Show settings option.
|
||||
do_action( 'wp_smush_render_setting_row', $name, $value, $is_disabled_field, $is_upsell_field );
|
||||
}
|
||||
|
||||
// Hook after general settings.
|
||||
do_action( 'wp_smush_after_basic_settings' );
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="<?php echo WP_Smush::is_pro() ? 'sui-settings-label' : 'sui-settings-label-with-tag'; ?>">
|
||||
<?php esc_html_e( 'Bulk restore', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e( 'Made a mistake? Use this feature to restore your image thumbnails to their original state.', 'wp-smushit' );
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<button type="button" class="sui-button sui-button-ghost wp-smush-restore" onclick="WP_Smush.restore.init()" <?php disabled( ! $backup_exists ); ?>>
|
||||
<i class="sui-icon-undo" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Restore Thumbnails', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
printf( /* translators: %1$s - strong tag, %2$s - closing strong tag */
|
||||
wp_kses( 'This feature regenerates thumbnails using your original uploaded images. If %1$sCompress original images%2$s is enabled, your thumbnails can still be regenerated, but the quality will be impacted by the compression of your uploaded images.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
|
||||
<div class="sui-notice" style="margin-top: 10px">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php esc_html_e( 'Note: Backup original images must be enabled in order to bulk restore your images.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* Notification for auto Bulk Smush on scan completed while re-checking images.
|
||||
*
|
||||
* @var bool $background_processing_enabled Background optimization is enabled.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
<div class="sui-notice sui-notice-grey wp-smush-auto-bulk-smush-notification sui-hidden">
|
||||
<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
|
||||
if( $background_processing_enabled ) {
|
||||
esc_html_e( 'Upon completion of the image recheck process, Smush will automatically proceed to initiate bulk image compression.', 'wp-smushit' );
|
||||
} else {
|
||||
esc_html_e( 'Once Smush completes the recheck process it will begin the Smush, it is recommended to keep this page open to initiate bulk image compression.', 'wp-smushit' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
23
wp-content/plugins/wp-smushit/app/views/bulk/cdn-upsell.php
Normal file
23
wp-content/plugins/wp-smushit/app/views/bulk/cdn-upsell.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* We also show up it via js after clicking on Bulk Smush Now.
|
||||
*
|
||||
* @see bulk-smush.js - background-process.js
|
||||
*
|
||||
* @var bool $background_in_processing Whether background is in processing or not.
|
||||
* @var string $bulk_upgrade_url CDN upgrade url.
|
||||
*/
|
||||
?>
|
||||
<div class="sui-box-body sui-margin-top wp-smush-upsell-cdn <?php echo ! $background_in_processing ? ' sui-hidden' : ''; ?>">
|
||||
<div class="smush-box-image">
|
||||
<img class="sui-image-icon" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/cdn-upsell-icon.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/cdn-upsell-icon@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush CDN Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="sui-box-content">
|
||||
<p>
|
||||
<?php esc_html_e( 'Want to serve images even faster? Get up to 2x more speed with Smush Pro’s CDN, which spans 45 servers worldwide.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url( $bulk_upgrade_url ); ?>" class="smush-upsell-link" target="_blank"><?php esc_html_e( 'Unlock now with Pro.', 'wp-smushit' ); ?></a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Show Unlimited upsell on Bulk Smush completed.
|
||||
* @var string $bulk_upgrade_url Upgrade pro url.
|
||||
* @var string $global_upsell_desc Upgrade pro notice description.
|
||||
*/
|
||||
?>
|
||||
<div class="sui-box-body sui-margin-top wp-smush-global-upsell wp-smush-upsell-on-completed sui-hidden">
|
||||
<div class="smush-box-image">
|
||||
<img class="sui-image-icon" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/global-upsell-icon.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/global-upsell-icon@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush Upsell Icon', 'wp-smushit' ); ?>">
|
||||
</div>
|
||||
<div class="sui-box-content">
|
||||
<p>
|
||||
<?php echo esc_html( $global_upsell_desc ); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url( $bulk_upgrade_url ); ?>" class="smush-upsell-link" target="_blank"><?php echo esc_html__( 'Upgrade to Pro and get 60% off', 'wp-smushit' ); ?></a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Limit reached notice metabox on bulk smush page.
|
||||
*
|
||||
* @var bool $with_resume_button With resume button or not.
|
||||
*/
|
||||
?>
|
||||
<div id="smush-limit-reached-notice" class="sui-notice sui-notice-warning sui-hidden smush-limit-reached-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
$is_directory_smush = 'smush-directory' === $this->get_slug();
|
||||
$upgrade_url = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => $is_directory_smush ? 'smush_directory_smush_paused_50_limit' : 'smush_bulk_smush_paused_50_limit',
|
||||
)
|
||||
);
|
||||
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
|
||||
$discount_text = '<strong>' . esc_html__( 'Get 60% off when you upgrade today.', 'wp-smushit' ) . '</strong>';
|
||||
printf(
|
||||
/* translators: %s1$d - bulk smush limit, %2$s - upgrade link, %3$s - <strong>, %4$s - </strong>, %5$s - Bulk Smush limit */
|
||||
esc_html__( 'The free version of Smush only allows you to compress %1$d images at a time. %2$s to compress %3$sunlimited images at once%4$s or click Resume to compress another %1$d images. %5$s', 'wp-smushit' ),
|
||||
Smush\Core\Core::MAX_FREE_BULK,
|
||||
'<a class="smush-upsell-link" href="' . esc_url( $upgrade_url ) . '" target="_blank"><strong>'. esc_html__('Upgrade to Smush Pro', 'wp-smushit') .'</strong></a>',
|
||||
'<strong>',
|
||||
'</strong>',
|
||||
$discount_text
|
||||
)
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
12
wp-content/plugins/wp-smushit/app/views/bulk/list-errors.php
Normal file
12
wp-content/plugins/wp-smushit/app/views/bulk/list-errors.php
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="smush-final-log sui-hidden">
|
||||
<div class="smush-bulk-errors"></div>
|
||||
<div class="smush-bulk-errors-actions sui-hidden">
|
||||
<a href="<?php echo esc_url( apply_filters( 'smush_unsmushed_media_filter_url', admin_url( 'upload.php?mode=list&attachment-filter=post_mime_type:image&smush-filter=failed_processing' ) ) ); ?>" class="sui-button">
|
||||
<i class="sui-icon-eye" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'View all in library', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<span class="sui-button sui-button-ghost wp_smush_ignore_all_failed_items">
|
||||
<?php esc_html_e( 'Ignore all', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
173
wp-content/plugins/wp-smushit/app/views/bulk/lossy-level.php
Normal file
173
wp-content/plugins/wp-smushit/app/views/bulk/lossy-level.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?php
|
||||
/**
|
||||
* Compression Level.
|
||||
*
|
||||
* @var $name string Compression field name.
|
||||
* @var $value mixed Current compression value.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
$settings = Settings::get_instance();
|
||||
$lossy_level_setting = $settings->get_lossy_level_setting();
|
||||
$level_basic = Settings::LEVEL_LOSSLESS;
|
||||
$level_super = Settings::LEVEL_SUPER_LOSSY;
|
||||
$level_ultra = Settings::LEVEL_ULTRA_LOSSY;
|
||||
$level_labels = array(
|
||||
Settings::LEVEL_LOSSLESS => __( 'Basic', 'wp-smushit' ),
|
||||
Settings::LEVEL_SUPER_LOSSY => __( 'Super', 'wp-smushit' ),
|
||||
Settings::LEVEL_ULTRA_LOSSY => __( 'Ultra', 'wp-smushit' ),
|
||||
);
|
||||
|
||||
$level_notices = array(
|
||||
Settings::LEVEL_LOSSLESS => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sBasic:%2$s Achieve flawless, lossless compression for pixel-perfect images. Minimal file size reduction, negligible impact on speed.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
Settings::LEVEL_SUPER_LOSSY => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sSuper:%2$s Harness the power of lossy compression for substantial file size reduction with excellent image clarity. Accelerate page loads for better performance.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
Settings::LEVEL_ULTRA_LOSSY => sprintf(
|
||||
/* translators: 1: opening <strong>, 2: closing </strong> */
|
||||
__( '%1$sUltra:%2$s Unlock unprecedented compression levels up to 5x greater than Super, while preserving remarkable image quality. The ultimate choice for unparalleled performance.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="sui-tabs sui-side-tabs wp-smush-lossy-level-tabs">
|
||||
<div role="tablist" class="sui-tabs-menu">
|
||||
<!-- Basic -->
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
id="lossy-level__basic"
|
||||
class="sui-tab-item<?php echo $level_basic === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-controls="lossy-level__basic-notice">
|
||||
<?php echo esc_html( $settings->get_lossy_level_label( $level_basic ) ); ?>
|
||||
</button>
|
||||
<input
|
||||
type="radio"
|
||||
class="sui-screen-reader-text"
|
||||
aria-hidden="true"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
value="<?php echo (int) $level_basic; ?>"
|
||||
<?php checked( $lossy_level_setting, $level_basic, true ); ?> />
|
||||
|
||||
<!-- Super -->
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
id="lossy-level__super"
|
||||
class="sui-tab-item<?php echo $level_super === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-controls="lossy-level__super-notice"
|
||||
tabindex="-1">
|
||||
<?php echo esc_html( $settings->get_lossy_level_label( $level_super ) ); ?>
|
||||
</button>
|
||||
<input
|
||||
type="radio"
|
||||
class="sui-screen-reader-text"
|
||||
aria-hidden="true"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
value="<?php echo (int) $level_super; ?>"
|
||||
<?php checked( $lossy_level_setting, $level_super, true ); ?> />
|
||||
|
||||
<!-- Ultra -->
|
||||
<?php if ( WP_Smush::is_pro() ) : ?>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
id="lossy-level__ultra"
|
||||
class="sui-tab-item<?php echo $level_ultra === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-controls="lossy-level__ultra-notice"
|
||||
tabindex="-1">
|
||||
<?php echo esc_html( $settings->get_lossy_level_label( $level_ultra ) ); ?>
|
||||
</button>
|
||||
<input
|
||||
type="radio"
|
||||
class="sui-screen-reader-text"
|
||||
aria-hidden="true"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
value="<?php echo (int) $level_ultra; ?>"
|
||||
<?php checked( $lossy_level_setting, $level_ultra, true ); ?> />
|
||||
<?php else :
|
||||
$utm_link = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_ultra_bulksmush_radio',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<a target="_blank" href="<?php echo esc_url( $utm_link ); ?>" class="sui-tab-item wp-smush-ultra-compression-link wp-smush-upsell-ultra-compression">
|
||||
<?php esc_html_e( '🚀 Ultra - unlock 5x more compression', 'wp-smushit' ); ?>
|
||||
<span class="sui-icon-open-new-window" aria-hidden="true"></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="sui-tabs-content">
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__basic-notice"
|
||||
class="sui-tab-content<?php echo $level_basic === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__basic"
|
||||
tabindex="0">
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_basic ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__super-notice"
|
||||
class="sui-tab-content<?php echo $level_super === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__super"
|
||||
tabindex="0"
|
||||
hidden>
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_super ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div role="tabpanel"
|
||||
id="lossy-level__ultra-notice"
|
||||
class="sui-tab-content<?php echo $level_ultra === $lossy_level_setting ? ' active' : ''; ?>"
|
||||
aria-labelledby="lossy-level__ultra"
|
||||
tabindex="0"
|
||||
hidden>
|
||||
<p>
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$level_notices[ $level_ultra ],
|
||||
array(
|
||||
'strong' => array(),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<div class="sui-message">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_attr_e( 'No attachments found - Upload some images', 'wp-smushit' ); ?>"
|
||||
class="sui-image"
|
||||
>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="sui-message-content">
|
||||
<p>
|
||||
<?php esc_html_e( 'We haven’t found any images in your media library yet so there’s no smushing to be done!', 'wp-smushit' ); ?><br>
|
||||
<?php esc_html_e( 'Once you upload images, reload this page and start playing!', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk Smush meta box header.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title">
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<small>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - a href opening tag, %2$s - a href closing tag */
|
||||
esc_html__( 'Smush individual images via your %1$sMedia Library%2$s', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( admin_url( 'upload.php' ) ) . '" title="' . esc_html__( 'Media Library', 'wp-smushit' ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</small>
|
||||
</div>
|
111
wp-content/plugins/wp-smushit/app/views/bulk/meta-box.php
Normal file
111
wp-content/plugins/wp-smushit/app/views/bulk/meta-box.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* Bulk Smush meta box.
|
||||
*
|
||||
* @since 2.9.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var Smush\Core\Core $core Instance of Smush\Core\Core
|
||||
* @var bool $can_use_background Check if user can use BO.
|
||||
* @var bool $total_count
|
||||
* @var integer $unsmushed_count Count of the images that need smushing.
|
||||
* @var integer $resmush_count Count of the images that need re-smushing.
|
||||
* @var integer $remaining_count Remaining count of all images to smush. Unsmushed images + images to re-smush.
|
||||
* @var string $bulk_upgrade_url Bulk Smush upgrade to PRO url.
|
||||
* @var string $upsell_cdn_url Upsell CDN URL.
|
||||
* @var bool $background_processing_enabled Background optimization is enabled.
|
||||
* @var bool $background_in_processing Background optimization in progressing or not.
|
||||
* @var string $background_in_processing_notice
|
||||
* @var string $in_processing_notice
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
use Smush\Core\Stats\Global_Stats;
|
||||
|
||||
if ( 0 !== absint( $total_count ) ) :
|
||||
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 endif; ?>
|
||||
|
||||
<?php
|
||||
// If there are no images in media library.
|
||||
if ( 0 === absint( $total_count ) ) {
|
||||
$this->view( 'media-lib-empty', array(), 'views/bulk' );
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view( 'auto-bulk-smush-notification', array(
|
||||
'background_processing_enabled' => $background_processing_enabled,
|
||||
), 'views/bulk' );
|
||||
|
||||
if ( ! $can_use_background ) {
|
||||
$this->view(
|
||||
'limit-reached-notice',
|
||||
array(),
|
||||
'views/bulk'
|
||||
);
|
||||
}
|
||||
// Progress bar.
|
||||
$this->view(
|
||||
'progress-bar',
|
||||
array(
|
||||
'count' => $remaining_count,
|
||||
'background_in_processing_notice' => $background_in_processing_notice,
|
||||
'background_processing_enabled' => $background_processing_enabled,
|
||||
'in_processing_notice' => $in_processing_notice,
|
||||
),
|
||||
'common'
|
||||
);
|
||||
|
||||
// All images are smushed.
|
||||
$this->view( 'all-images-smushed-notice', array( 'all_done' => empty( $remaining_count ) ), 'common' );
|
||||
|
||||
// List errors.
|
||||
$this->view( 'list-errors', array(), 'views/bulk' );
|
||||
|
||||
?>
|
||||
<div class="wp-smush-bulk-wrapper sui-border-frame<?php echo empty( $remaining_count ) || $background_in_processing ? ' sui-hidden' : ''; ?>">
|
||||
<div id="wp-smush-bulk-content">
|
||||
<?php WP_Smush::get_instance()->admin()->print_pending_bulk_smush_content( $remaining_count, $resmush_count, $unsmushed_count ); ?>
|
||||
</div>
|
||||
<?php
|
||||
$bulk_smush_class = $background_processing_enabled ? 'wp-smush-bo-start' : 'wp-smush-all';
|
||||
|
||||
if ( Global_Stats::get()->is_outdated() && ! $background_in_processing ) {
|
||||
$bulk_smush_class .= ' wp-smush-scan-and-bulk-smush';
|
||||
}
|
||||
|
||||
?>
|
||||
<button type="button" class="<?php echo esc_attr( $bulk_smush_class ); ?> sui-button sui-button-blue" title="<?php esc_attr_e( 'Click to start Bulk Smushing images in Media Library', 'wp-smushit' ); ?>">
|
||||
<?php esc_html_e( 'BULK SMUSH', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php
|
||||
if ( ! $can_use_background ) {
|
||||
$global_upsell_desc = __( 'Process images 2x faster, leave this page while Bulk Smush runs in the background, and serve streamlined next-gen images via Smush’s 114-point CDN and Local WebP features.', 'wp-smushit' );
|
||||
|
||||
$this->view(
|
||||
'global-upsell',
|
||||
array(
|
||||
'bulk_upgrade_url' => $bulk_upgrade_url,
|
||||
'global_upsell_desc' => $global_upsell_desc,
|
||||
),
|
||||
'views/bulk'
|
||||
);
|
||||
} elseif ( ! WP_Smush::is_pro() ) {
|
||||
$this->view(
|
||||
'cdn-upsell',
|
||||
array(
|
||||
'background_in_processing' => $background_in_processing,
|
||||
'bulk_upgrade_url' => $upsell_cdn_url,
|
||||
),
|
||||
'views/bulk'
|
||||
);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* CDN disabled meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-block-content-center">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-cdn-default.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-cdn-default@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush CDN', 'wp-smushit' ); ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<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>
|
||||
|
||||
<button class="sui-button sui-button-blue" id="smush-enable-cdn">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'GET STARTED', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* CDN meta box header.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title Title.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title">
|
||||
<?php esc_html_e( 'CDN', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<span class="sui-field-prefix">
|
||||
<?php esc_html_e( 'How Smush CDN works?', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-tooltip sui-tooltip-constrained sui-tooltip-top-right" data-tooltip="<?php esc_attr_e( 'When someone visits a page on your site, the CDN will check if images are cached on the CDN. Images that are cached will be immediately served from the server closest to the user. Any image that is not yet cached will first be sent to the Smush API for optimization, then cached so the next time it is requested, the cached version will be served.', 'wp-smushit' ); ?>">
|
||||
<span class="sui-icon-info" aria-hidden="true"></span>
|
||||
</span>
|
||||
</div>
|
122
wp-content/plugins/wp-smushit/app/views/cdn/meta-box.php
Normal file
122
wp-content/plugins/wp-smushit/app/views/cdn/meta-box.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* CDN meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $cdn_group CDN settings keys.
|
||||
* @var string $class CDN status class (for icon color).
|
||||
* @var array $settings Settings.
|
||||
* @var string $status CDN status.
|
||||
* @var string $status_msg CDN status messages.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
esc_html_e( 'Take a load off your server by delivering your images from our blazingly-fast CDN. The Smush CDN is a multi-location network ensuring faster delivery of site content, as users will be served optimized and cached versions of files from the server closest to them.', 'wp-smushit' );
|
||||
?>
|
||||
</p>
|
||||
|
||||
<div class="sui-notice sui-notice-<?php echo esc_attr( $class ); ?>">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-<?php echo 'enabled' === $status ? 'check-tick' : 'info'; ?> sui-md" aria-hidden="true"></i>
|
||||
<p><?php echo wp_kses_post( $status_msg ); ?></p>
|
||||
<?php if ( 'error' === $class && 'overcap' === $status ) : ?>
|
||||
<p>
|
||||
<a href="https://wpmudev.com/hub/account/" target="_blank" class="sui-button">
|
||||
<?php esc_html_e( 'Upgrade Plan', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Supported Media Types', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e( 'Here’s a list of the media types we serve from the CDN.', 'wp-smushit' );
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<span class="smush-filename-extension smush-extension-jpg">
|
||||
<?php esc_html_e( 'jpg', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="smush-filename-extension smush-extension-png">
|
||||
<?php esc_html_e( 'png', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="smush-filename-extension smush-extension-gif">
|
||||
<?php esc_html_e( 'gif', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<?php if ( $settings['webp'] ) : ?>
|
||||
<span class="smush-filename-extension smush-extension-webp">
|
||||
<?php esc_html_e( 'webp', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e(
|
||||
'At this time, we don’t support videos. We recommend uploading your media to a third-party provider and embedding the videos into your posts/pages.',
|
||||
'wp-smushit'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
foreach ( $cdn_group as $name ) {
|
||||
if ( 'cdn' === $name ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
do_action( 'wp_smush_render_setting_row', $name, $settings[ $name ] );
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e(
|
||||
'If you no longer require your images to be hosted from our CDN, you can disable this feature.',
|
||||
'wp-smushit'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<button class="sui-button sui-button-ghost" id="smush-cancel-cdn">
|
||||
<span class="sui-loading-text">
|
||||
<i class="sui-icon-power-on-off" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e(
|
||||
'Note: You won’t lose any images by deactivating, all of your attachments are still stored locally on your own server.',
|
||||
'wp-smushit'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Upsell CDN meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
use Smush\Core\Helper;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-block-content-center">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-cdn-free-tier.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-cdn-free-tier@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush CDN', 'wp-smushit' ); ?>">
|
||||
|
||||
<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>
|
||||
|
||||
<ol class="sui-upsell-list">
|
||||
<li>
|
||||
<span class="sui-icon-check sui-sm" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Fix Google PageSpeeds ‘properly size images’ suggestion', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-sm" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'WebP conversion with CDN', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="sui-icon-check sui-sm" aria-hidden="true"></span>
|
||||
<?php esc_html_e( 'Serve background images from the CDN', 'wp-smushit' ); ?>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<a href="<?php echo esc_url( Helper::get_url( 'smush_cdn_upgrade_button' ) ); ?>" class="sui-button sui-button-purple sui-margin-top" target="_blank">
|
||||
<?php esc_html_e( 'UNLOCK NOW WITH PRO', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
@ -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; ?>
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Directory Smush meta box.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var int $errors Number of errors during directory scan.
|
||||
* @var array $images Array of images with errors.
|
||||
* @var string $upgrade_url Upgrade URL.
|
||||
*
|
||||
* @var Smush\App\Pages\Directory $this Dashboard page.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wp-smush-scan-result">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img class="sui-image" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>" alt="<?php esc_html_e( 'Directory Smush - Choose Folder', 'wp-smushit' ); ?>">
|
||||
<?php endif; ?>
|
||||
<div class="sui-message-content">
|
||||
<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>
|
||||
|
||||
<button class="sui-button sui-button-blue wp-smush-browse">
|
||||
<?php esc_html_e( 'CHOOSE DIRECTORY', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Notices -->
|
||||
<?php $this->smush_result_notice(); ?>
|
||||
<div class="sui-notice sui-notice-info wp-smush-dir-limit sui-hidden">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s: a tag start, %2$s: closing a tag, %3$d: free image limit */
|
||||
esc_html__( '%1$sUpgrade to pro%2$s to bulk smush all your directory images with one click. Free users can smush %3$d images with each click.', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( $upgrade_url ) . '" target="_blank" title="' . esc_html__( 'Smush Pro', 'wp-smushit' ) . '">',
|
||||
'</a>',
|
||||
absint( \Smush\Core\Core::MAX_FREE_BULK )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( ! empty( $images ) ) : ?>
|
||||
<div class="smush-final-log">
|
||||
<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>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field( 'wp_smush_all', 'wp-smush-all' ); ?>
|
||||
</div>
|
108
wp-content/plugins/wp-smushit/app/views/email/bulk-smush.php
Normal file
108
wp-content/plugins/wp-smushit/app/views/email/bulk-smush.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="summary-compression" style="max-width:600px;margin:0px auto;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="margin:0px auto;padding:0 0;max-width:600px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="3" style="margin:0px auto;padding:0 0;max-width:600px;">
|
||||
<div style="padding:0 25px;margin:0px auto;max-width:600px;">
|
||||
<h2 style="color:#333;font-family:inherit;font-size: 25px;line-height:30px;color:inherit;margin:0px auto;max-width: 600px;padding-top:10px;padding-bottom: 35px">
|
||||
<?php
|
||||
$clean_site_url = preg_replace( '#http(s)?://(www.)?#', '', $site_url );
|
||||
printf(
|
||||
esc_html( $mail_title ),
|
||||
'<a href="' . esc_url( $site_url ) . '" style="text-decoration: none">' . esc_html( $clean_site_url ) . '</a>'
|
||||
);
|
||||
?>
|
||||
</h2>
|
||||
<p style="color: #1A1A1A; font-family: Roboto, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin:0px auto;max-width: 600px; padding: 0 0 24px; text-align: left; word-wrap: normal;">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s - Name */
|
||||
esc_html__( 'Hi %s,', 'wp-smushit' ),
|
||||
esc_html( $name )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p style="color: #1A1A1A; font-family: Roboto, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin:0px auto;max-width: 600px; padding: 0 0 32px; text-align: left; word-wrap: normal;letter-spacing: 0;">
|
||||
<span><?php echo esc_html( $mail_desc ); ?></span>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="margin:0px auto;max-width:600px;padding:3px 25px;border-top:1px solid #F8F8F8;border-bottom:1px solid #F8F8F8" class="smush-summary-row">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="color:#1A1A1A;font-family: Roboto, Arial, sans-serif; font-size: 16px; margin: 0 auto;max-width:600px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="width:30px;vertical-align:top;text-align:left; padding:10px 0 0 0;">
|
||||
<img style="max-width:100%;color:#666666;width:auto;height:16px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/info.png'; ?>" alt="ℹ" />
|
||||
</td>
|
||||
<td align="left" style="vertical-align:top;padding:10px 0;text-align:left;line-height: 25px;">
|
||||
<strong style="font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:500;letter-spacing:-0.25px;color:#1A1A1A;">
|
||||
<?php echo esc_html( $total_title ); ?>
|
||||
</strong>
|
||||
<span style="line-height:18px;padding-top:3px;display:block;font-family: Roboto, Arial, sans-serif;font-size: 13px;font-weight:400;letter-spacing:-0.307692px;color:#1A1A1A;"><?php echo esc_html( $total_desc ); ?></span>
|
||||
</td>
|
||||
<td align="right" width="60" style="vertical-align:top;padding:10px 0;text-align:right;white-space:nowrap;font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:800;color:#1A1A1A;">
|
||||
<?php echo number_format( $total_items ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="margin:0px auto;max-width:600px;padding:3px 25px;border-top:1px solid #F8F8F8;border-bottom:1px solid #F8F8F8" class="smush-summary-row">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="color:#1A1A1A;font-family: Roboto, Arial, sans-serif; font-size: 16px; margin: 0 auto;max-width:600px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="width:30px;vertical-align:top;text-align:left;padding:14px 0 0 0;">
|
||||
<img style="max-width:100%;color:#11bf9c;width:auto;height:16px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/success.png'; ?>" alt="✔" />
|
||||
</td>
|
||||
<td align="left" style="vertical-align:top;padding:14px 0;text-align:left;line-height: 25px;">
|
||||
<strong style="font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:500;letter-spacing:-0.25px;color:#1A1A1A;">
|
||||
<?php echo esc_html( $smushed_title ); ?>
|
||||
</strong>
|
||||
<span style="line-height:18px;padding-top:3px;display:block;font-family: Roboto, Arial, sans-serif;font-size: 13px;font-weight:400;letter-spacing:-0.307692px;color:#1A1A1A;"><?php echo esc_html( $smushed_desc ); ?></span>
|
||||
</td>
|
||||
<td align="right" width="60" style="vertical-align:top;padding:14px 0;text-align:right;white-space:nowrap;font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:800;color:#1A1A1A;">
|
||||
<?php echo number_format( $smushed_items ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="margin:0px auto;max-width:600px;padding:3px 25px;border-top:1px solid #F8F8F8;border-bottom:1px solid #F8F8F8" class="smush-summary-row">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="color:#1A1A1A;font-family: Roboto, Arial, sans-serif; font-size: 16px; margin: 0 auto;max-width:600px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="width:30px;vertical-align:top;text-align:left; padding:10px 0 0 0;">
|
||||
<img style="max-width:100%;color:#fb6e07;width:auto;height:16px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/warning.png'; ?>" alt="⚠" />
|
||||
</td>
|
||||
<td align="left" style="vertical-align:top;padding:10px 0;text-align:left;line-height: 25px;">
|
||||
<strong style="font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:500;letter-spacing:-0.25px;color:#1A1A1A;">
|
||||
<?php echo esc_html( $failed_title ); ?>
|
||||
</strong>
|
||||
<span style="line-height:18px;padding-top:3px;display:block;font-family: Roboto, Arial, sans-serif;font-size: 13px;font-weight:400;letter-spacing:-0.307692px;color:#1A1A1A;">
|
||||
<?php echo esc_html( $failed_desc ); ?>
|
||||
</span>
|
||||
</td>
|
||||
<td align="right" width="60" style="vertical-align:top;padding:10px 0;text-align:right;white-space:nowrap;font-family: Roboto, Arial, sans-serif;font-size: 16px;font-weight:800;color:#1A1A1A;">
|
||||
<?php echo number_format( $failed_items ); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="margin:27px 0 11px;padding: 0;text-align: center">
|
||||
<a class="button"
|
||||
style="background:#286EFA;border-radius: 6px;font-family: Roboto, Arial, sans-serif;font-size: 13px;width: 141px;height:40px;padding: 0!important;font-weight: 500;line-height: 40px;text-align: center;margin-bottom: 0;display:inline-block!important;color:#fff!important;text-decoration:none!important;"
|
||||
href="<?php echo esc_url( $redirect_url ); ?>"><?php esc_html_e( 'View full details', 'wp-smushit' ); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php //phpcs:enable ?>
|
5
wp-content/plugins/wp-smushit/app/views/email/footer.php
Normal file
5
wp-content/plugins/wp-smushit/app/views/email/footer.php
Normal file
@ -0,0 +1,5 @@
|
||||
<!-- END footer -->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
368
wp-content/plugins/wp-smushit/app/views/email/header.php
Normal file
368
wp-content/plugins/wp-smushit/app/views/email/header.php
Normal file
@ -0,0 +1,368 @@
|
||||
<!doctype html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
||||
<head>
|
||||
<title><?php echo esc_html( $title ); ?></title>
|
||||
<meta http-equiv="X-UA-Compatible">
|
||||
<!--[if !mso]><!-->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<!--<![endif]-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<meta name="supported-color-schemes" content="light dark">
|
||||
<style type="text/css">
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
supported-color-schemes:light dark;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
#outlook a {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-ms-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
table,
|
||||
td {
|
||||
border-collapse: collapse;
|
||||
mso-table-lspace: 0pt;
|
||||
mso-table-rspace: 0pt;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
height: auto;
|
||||
line-height: 100%;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin: 13px 0;
|
||||
}
|
||||
</style>
|
||||
<!--[if mso]>
|
||||
<xml>
|
||||
<o:OfficeDocumentSettings>
|
||||
<o:AllowPNG/>
|
||||
<o:PixelsPerInch>96</o:PixelsPerInch>
|
||||
</o:OfficeDocumentSettings>
|
||||
</xml>
|
||||
<![endif]-->
|
||||
<!--[if lte mso 11]>
|
||||
<style type="text/css">
|
||||
.mj-outlook-group-fix { width:100% !important; }
|
||||
</style>
|
||||
<![endif]-->
|
||||
<!--[if !mso]><!-->
|
||||
<link href="https://fonts.bunny.net/css?family=roboto:400,500,700&display=swap" rel="stylesheet" type="text/css">
|
||||
<style type="text/css">
|
||||
@import url(https://fonts.bunny.net/css?family=roboto:400,500,700&display=swap);
|
||||
</style>
|
||||
<style type="text/css">
|
||||
* {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.p-30 {
|
||||
margin-bottom: 30px !important;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 25px;
|
||||
line-height: 35px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
p,
|
||||
li {
|
||||
font-size: 14px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none !important;
|
||||
font-weight: 700 !important;
|
||||
color: #286EF1 !important;
|
||||
}
|
||||
|
||||
.hidden-img img {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.button a,
|
||||
a.button,
|
||||
a.button-cta {
|
||||
font-family: Roboto, arial, sans-serif;
|
||||
font-size: 13px !important;
|
||||
line-height: 20px;
|
||||
font-weight: bold;
|
||||
background: #286EF1;
|
||||
text-decoration: none !important;
|
||||
padding: 10px 15px;
|
||||
color: #ffffff !important;
|
||||
border-radius: 10px;
|
||||
display: inline-block;
|
||||
margin: 20px auto;
|
||||
text-transform: unset !important;
|
||||
min-width: unset !important;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 10px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.main-content img {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
p,
|
||||
li {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!--<![endif]-->
|
||||
<style type="text/css">
|
||||
@media only screen and (min-width:480px) {
|
||||
.mj-column-per-100 {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
@media only screen and (max-width:480px) {
|
||||
h2{
|
||||
font-size: 22px !important;
|
||||
line-height: 28px !important;
|
||||
}
|
||||
h3{
|
||||
font-size: 20px !important;
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
#smush-cdn-upto2x .smush-cdn-title-box{
|
||||
padding-top: 20px !important;
|
||||
}
|
||||
table.mj-full-width-mobile {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
td.mj-full-width-mobile {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
@media only screen and (max-width:430px) {
|
||||
h2{
|
||||
font-size: 20px !important;
|
||||
}
|
||||
h3 {
|
||||
font-size: 19px !important;
|
||||
}
|
||||
td.smush-cdn-title-box{
|
||||
width: 55% !important;
|
||||
}
|
||||
td.smush-cdn-image-box {
|
||||
width: 45% !important;
|
||||
}
|
||||
.smush-whitelabel-summary > tbody > tr > td{
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
.smush-summary-row span{
|
||||
padding-top: 6px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.summary-compression .button{
|
||||
margin-top: 45px !important;
|
||||
}
|
||||
#smush-cdn-upto2x .button{
|
||||
margin-top: 12px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
@media only screen and (max-width:360px) {
|
||||
.summary-compression td strong{
|
||||
font-size:14px!important;
|
||||
}
|
||||
.summary-compression td span{
|
||||
font-size:11px!important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
@media only screen and (prefers-color-scheme: dark) {
|
||||
.smush-mail-body {
|
||||
background: #1A1A1A !important;
|
||||
}
|
||||
.smush-header-logo{
|
||||
background: #2DC4E0 !important;
|
||||
}
|
||||
.smush-header-logo span{
|
||||
color: #fff !important;
|
||||
}
|
||||
.main-content,.main-content-inner,.main-content-outlook {
|
||||
background: #212121 !important;
|
||||
color:#F8F8F8;
|
||||
}
|
||||
.main-content .button {
|
||||
background: #286efa !important;
|
||||
color:#fff !important;
|
||||
}
|
||||
h2 {
|
||||
color: #f2f2f2 !important;
|
||||
}
|
||||
h2 a{
|
||||
color: #286EFA !important;
|
||||
}
|
||||
.main-content p, .summary-compression p,.summary-compression td, .summary-compression strong, .summary-compression span{
|
||||
color: #F8F8F8 !important;
|
||||
}
|
||||
.summary-compression .smush-summary-row {
|
||||
border-top-color: #323339 !important;
|
||||
border-bottom-color: #323339 !important;
|
||||
}
|
||||
#smush-cdn-upto2x {
|
||||
background: #C0EDF6 !important;
|
||||
color: #121212 !important;
|
||||
}
|
||||
#smush-cdn-upto2x li{
|
||||
color: #333333;
|
||||
}
|
||||
#smush-cdn-upto2x h3, #smush-cdn-upto2x p, #smush-cdn-upto2x td{
|
||||
color: #121212 !important;
|
||||
}
|
||||
.wpmudev-footer-logo{
|
||||
background: #EAF9FC !important;
|
||||
}
|
||||
.wpmudev-follow-us span, .wpmudev-follow-us td{
|
||||
color: #E6E6E6 !important;
|
||||
}
|
||||
.wpmudev-footer div{
|
||||
color: #aaa !important;
|
||||
}
|
||||
|
||||
.smush-light-img{
|
||||
display: inline-block !important;
|
||||
display: none !important;
|
||||
width:0 !important;
|
||||
margin:0 !important;
|
||||
padding:0 !important;
|
||||
visibility:hidden !important;
|
||||
}
|
||||
.smush-light-img img{
|
||||
display: none!important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
margin:0 !important;
|
||||
visibility:hidden !important;
|
||||
}
|
||||
|
||||
.smush-dark-img {
|
||||
display: inline !important;
|
||||
width:auto !important;
|
||||
visibility: visible !important;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
<!-- Dark mode for outlook -->
|
||||
<style>
|
||||
[data-ogsc] .smush-mail-body {
|
||||
background: #1A1A1A !important;
|
||||
}
|
||||
[data-ogsc] .smush-header-logo{
|
||||
background: #2DC4E0 !important;
|
||||
}
|
||||
[data-ogsc] .smush-header-logo span{
|
||||
color: #fff !important;
|
||||
}
|
||||
[data-ogsc] .main-content,[data-ogsc] .main-content-inner,[data-ogsc] .main-content-outlook {
|
||||
background: #212121 !important;
|
||||
color:#F8F8F8;
|
||||
}
|
||||
[data-ogsc] .main-content .button {
|
||||
background: #286efa !important;
|
||||
color:#fff !important;
|
||||
}
|
||||
[data-ogsc] h2 {
|
||||
color: #f2f2f2 !important;
|
||||
}
|
||||
[data-ogsc] h2 a{
|
||||
color: #286EFA !important;
|
||||
}
|
||||
[data-ogsc] .main-content p, [data-ogsc] .summary-compression p, [data-ogsc] .summary-compression td, [data-ogsc] .summary-compression strong, [data-ogsc] .summary-compression span{
|
||||
color: #F8F8F8 !important;
|
||||
}
|
||||
[data-ogsc] .summary-compression .smush-summary-row {
|
||||
border-top-color: #323339 !important;
|
||||
border-bottom-color: #323339 !important;
|
||||
}
|
||||
[data-ogsc] #smush-cdn-upto2x {
|
||||
background: #C0EDF6 !important;
|
||||
color: #121212 !important;
|
||||
}
|
||||
[data-ogsc] #smush-cdn-upto2x li{
|
||||
color: #333333;
|
||||
}
|
||||
[data-ogsc] #smush-cdn-upto2x h3, [data-ogsc] #smush-cdn-upto2x p, [data-ogsc] #smush-cdn-upto2x td{
|
||||
color: #121212 !important;
|
||||
}
|
||||
[data-ogsc] .wpmudev-footer-logo{
|
||||
background: #EAF9FC !important;
|
||||
}
|
||||
[data-ogsc] .wpmudev-follow-us span, [data-ogsc] .wpmudev-follow-us td{
|
||||
color: #E6E6E6 !important;
|
||||
}
|
||||
[data-ogsc] .wpmudev-footer div{
|
||||
color: #aaa !important;
|
||||
}
|
||||
|
||||
[data-ogsc] .smush-light-img{
|
||||
display: inline-block !important;
|
||||
display: none !important;
|
||||
width:0 !important;
|
||||
margin:0 !important;
|
||||
padding:0 !important;
|
||||
visibility:hidden !important;
|
||||
}
|
||||
[data-ogsc] .smush-light-img img{
|
||||
display: none!important;
|
||||
width: 0 !important;
|
||||
height: 0 !important;
|
||||
margin:0 !important;
|
||||
visibility:hidden !important;
|
||||
}
|
||||
|
||||
[data-ogsc] .smush-dark-img {
|
||||
display: inline !important;
|
||||
width:auto !important;
|
||||
visibility: visible !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="word-spacing:normal;background-color:#F6F6F6;">
|
||||
<div class="smush-mail-body" style="background-color:#F6F6F6;">
|
@ -0,0 +1,31 @@
|
||||
<?php require 'header.php'; ?>
|
||||
<!-- Main content -->
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="main-content-outlook" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div class="main-content" style="margin:0px auto;max-width:600px;">
|
||||
<table class="smush-whitelabel-summary" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin:0px auto;max-width:600px;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:45px 0 32px;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:550px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#fff;background-color:#fff;vertical-align:top;margin:0px auto;max-width: 600px;border-radius: 20px;border-top-left-radius: 20px;border-top-right-radius: 20px;border-bottom-left-radius: 20px;border-bottom-right-radius: 20px;overflow:hidden" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:45px 0;word-break:break-word;margin:0px auto;max-width: 600px;">
|
||||
<div style="margin:0px auto;max-width: 600px;font-family:Roboto, Arial, sans-serif;font-size:18px;letter-spacing:-.25px;line-height:30px;text-align:left;color:#1A1A1A;">
|
||||
<?php echo $content_body;//phpcs:ignore ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
<!-- END Main content -->
|
||||
<?php require 'footer.php'; ?>
|
272
wp-content/plugins/wp-smushit/app/views/email/index.php
Normal file
272
wp-content/plugins/wp-smushit/app/views/email/index.php
Normal file
@ -0,0 +1,272 @@
|
||||
<?php require 'header.php'; ?>
|
||||
<!-- Header image -->
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:38px 0 0;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="smush-header-logo" style="background-color:#2DC4E0;border-radius:15px 15px 0 0;vertical-align:top;padding:25px 0;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/email/logo.png' ); ?>" style="border:0;outline:none;text-decoration:none;height:30px;width:auto;vertical-align:middle;" alt="">
|
||||
<span style="color: #FFFFFF;font-family: Roboto, Arial, sans-serif;font-size: 20px;font-weight: 700;text-align: left;margin-left: 16px;line-height:30px; vertical-align:middle;">
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
<!-- END Header image -->
|
||||
<!-- Main content -->
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="main-content-outlook" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div style="margin:0px auto;max-width:600px;">
|
||||
<table class="main-content" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0 45px;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:550px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin:0px auto;max-width: 600px;vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" style="font-size:0px;padding:0;word-break:break-word;">
|
||||
<div style="margin:0px auto;max-width: 600px;font-family:Roboto, Arial, sans-serif;font-size:18px;letter-spacing:-.25px;line-height:30px;text-align:left;color:#1A1A1A;">
|
||||
<?php echo $content_body;//phpcs:ignore ?>
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="margin:0px auto;max-width: 600px;padding:0 0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="margin:0 0;padding:0 25px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="margin:0 auto;max-width:600px;padding:0;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="margin:0;padding:0 0 10px;">
|
||||
<!--Cheers block-->
|
||||
<p style="color:#1A1A1A;font-family:Roboto,Arial,sans-serif;font-size:16px;font-weight:normal;line-height:30px;margin:30px 0 0;padding:0;text-align:left;">
|
||||
<?php esc_html_e( 'Cheers,', 'wp-smushit' ); ?>
|
||||
<br/>
|
||||
<?php esc_html_e( 'The WPMU DEV Team.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<!--End Cheers block-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if( ! empty( $content_upsell ) ) {
|
||||
echo $content_upsell;//phpcs:ignore
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
<!-- END Main content -->
|
||||
<!-- Footer -->
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div style="margin:0px auto;border-radius:0 0 15px 15px;max-width:600px;">
|
||||
<table class="wpmudev-footer-logo" align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#E7F1FB;background-color:#E7F1FB;width:100%;border-radius:0 0 15px 15px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:168px;">
|
||||
<img height="auto" src="https://mcusercontent.com/53a1e972a043d1264ed082a5b/images/e60c4943-5368-4e02-3f35-021bbfc3eea4.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="168" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div class="wpmudev-follow-us" style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:25px 20px 15px;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:560px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:0;word-break:break-word;">
|
||||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" ><tr><td><![endif]-->
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
||||
<tr class="hidden-img">
|
||||
<td style="padding:1px;vertical-align:middle;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:transparent;border-radius:3px;width:0;">
|
||||
<tr>
|
||||
<td style="font-size:0;height:0;vertical-align:middle;width:0;">
|
||||
<img height="0" style="border-radius:3px;display:block;" width="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="vertical-align:middle;">
|
||||
<span style="color:#333333;font-size:13px;font-weight:700;font-family:Roboto, Arial, sans-serif;line-height:25px;text-decoration:none;"> Follow us </span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if mso | IE]></td><td><![endif]-->
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
||||
<tr>
|
||||
<td style="padding:1px;vertical-align:middle;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:transparent;border-radius:3px;width:25px;">
|
||||
<tr>
|
||||
<td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
|
||||
<a href="https://www.facebook.com/wpmudev" target="_blank">
|
||||
<span class="smush-light-img">
|
||||
<img height="25" src="https://mcusercontent.com/53a1e972a043d1264ed082a5b/images/2ebf5329-b6fa-d7ab-330a-376099e5186a.png" style="border-radius:3px;display:block;" width="25" alt="" />
|
||||
</span>
|
||||
<span class="smush-dark-img" style="display:inline-block;display:none;width:0;height:0;visibility:hidden;margin:0;padding:0">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/email/facebook-dark-mode.png' ); ?>" style="border-radius:3px;display:block;" width="25" height="25" alt="" />
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if mso | IE]></td><td><![endif]-->
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
||||
<tr>
|
||||
<td style="padding:1px;vertical-align:middle;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:transparent;border-radius:3px;width:25px;">
|
||||
<tr>
|
||||
<td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
|
||||
<a href="https://www.instagram.com/wpmu_dev/" target="_blank">
|
||||
<span class="smush-light-img">
|
||||
<img height="25" src="https://mcusercontent.com/53a1e972a043d1264ed082a5b/images/2fdea1f1-c823-e43d-68a2-279fc2f254a0.png" style="border-radius:3px;display:block;" width="25" alt="" />
|
||||
</span>
|
||||
<span class="smush-dark-img" style="display:inline-block;display:none;width:0;height:0;visibility:hidden;margin:0;padding:0">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/email/instagram-dark-mode.png' ); ?>" style="border-radius:3px;display:block;" width="25" height="25" alt="" />
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if mso | IE]></td><td><![endif]-->
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
||||
<tr>
|
||||
<td style="padding:1px;vertical-align:middle;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:transparent;border-radius:3px;width:25px;">
|
||||
<tr>
|
||||
<td style="font-size:0;height:25px;vertical-align:middle;width:25px;">
|
||||
<a href="https://twitter.com/wpmudev" target="_blank">
|
||||
<span class="smush-light-img">
|
||||
<img height="25" src="https://mcusercontent.com/53a1e972a043d1264ed082a5b/images/025ac077-8a43-38ac-89d8-c331106e1c35.png" style="border-radius:3px;display:block;" width="25" alt="" />
|
||||
</span>
|
||||
<span class="smush-dark-img" style="display:inline-block;display:none;width:0;height:0;visibility:hidden;margin:0;padding:0">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/email/twitter-dark-mode.png' ); ?>" style="border-radius:3px;display:block;" width="25" height="25" alt="" />
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
|
||||
<div class="wpmudev-footer" style="margin:0px auto;max-width:600px;">
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="direction:ltr;font-size:0px;padding:0;text-align:center;">
|
||||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
|
||||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:0 0 15px;word-break:break-word;">
|
||||
<div style="font-family:Roboto, Arial, sans-serif;font-size:9px;letter-spacing:-.25px;line-height:30px;text-align:center;color:#505050;">INCSUB PO BOX 163, ALBERT PARK, VICTORIA.3206 AUSTRALIA</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size:0px;padding:0 0 25px;word-break:break-word;">
|
||||
<div style="font-family:Roboto, Arial, sans-serif;font-size:10px;letter-spacing:-.25px;line-height:30px;text-align:center;color:#1A1A1A;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!--[if mso | IE]></td></tr></table><![endif]-->
|
||||
<?php require 'footer.php'; ?>
|
61
wp-content/plugins/wp-smushit/app/views/email/upsell-cdn.php
Normal file
61
wp-content/plugins/wp-smushit/app/views/email/upsell-cdn.php
Normal file
@ -0,0 +1,61 @@
|
||||
<div style="margin:0px auto;padding:0;max-width:600px;">
|
||||
<table id="smush-cdn-faster-delivery" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="max-width:600px;border-collapse:collapse;margin:10px auto 0;padding:0 0;color:#fff">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="smush-cdn-title-box" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;border:0;width:59.5%;max-width:222px;">
|
||||
</td>
|
||||
<td class="smush-cdn-image-box" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-spacing:0px;border:0;width:40.5%;max-width:222px;">
|
||||
<a href="#" style="text-decoration:none!important;cursor:default;max-width:222px!important;height:auto;display:block;"><img style="width:100%;max-width:222px!important;height:auto;display:block;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/faster-delivery-with-cdn.png'; ?>" alt=""></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="smush-cdn-upto2x" border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%" style="margin:0px auto;max-width:600px;border-collapse:collapse;padding:0 0;color:#fff;background:#2F1D4D;border-radius: 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="smush-cdn-title-box" border="0" cellpadding="0" cellspacing="0" style="width:59.5%;max-width:222px;border-collapse:collapse;border-spacing:0px;border:0;padding:32px 0 0 20px;vertical-align:top;">
|
||||
<h3 style="font-family:Roboto, Arial, sans-serif;font-size: 22px;letter-spacing:-0.25px;line-height:33px;font-weight: 600;color:inherit;margin:0;padding-bottom:10px;max-width: 316px;">
|
||||
<?php esc_html_e( 'Serve images 2X faster with Smush Pro’s CDN', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
</td>
|
||||
<td class="smush-cdn-image-box" border="0" cellpadding="0" cellspacing="0" style="width:40.5%;max-width:222px;border-collapse:collapse;border-spacing:0px;border:0;vertical-align:top;">
|
||||
<a href="#" style="text-decoration:none!important;cursor:default;"><img style="width:100%;max-width:222px!important;height:auto" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/upto-2x.png'; ?>" alt=""></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td border="0" cellpadding="0" cellspacing="0" colspan="2" style="border-collapse:collapse;border-spacing:0px;border:0;padding:4px 20px 0;">
|
||||
<p style="color:#fff;font-size:13px;font-weight:400;margin:0;padding:0;font-family:Roboto, Arial, sans-serif;line-height:22px;text-decoration:none;">
|
||||
<?php esc_html_e( 'Serve images closer to visitors and boost site speed with our 114-point CDN. Exclusive 60% welcome discount for Smush free users. Limited time only.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td border="0" cellpadding="0" cellspacing="0" colspan="2" style="border-collapse:collapse;border-spacing:0px;border:0;padding:13px 20px 0">
|
||||
<p style="padding-left:4px;letter-spacing:0px;font-family:Roboto, Arial, sans-serif;margin:0;line-height:24px;text-decoration:none;font-size:13px;maring:0;font-weight:600;font-style:normal;">
|
||||
<span class="smush-light-img">
|
||||
<img onerror="arguments[0].currentTarget.style.display='none'" style="width:16px;margin-top:16px;margin-right:12px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/valid.png'; ?>" />
|
||||
</span>
|
||||
<span class="smush-dark-img" style="display:inline-block;display:none;width:0;height:0;visibility:hidden;margin:0;padding:0">
|
||||
<img onerror="arguments[0].currentTarget.style.display='none'" style="width:16px;margin-top:16px;margin-right:12px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/valid-dark.png'; ?>" />
|
||||
</span>
|
||||
<?php esc_html_e( 'Includes better GIF performance', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<p style="padding-left:4px;letter-spacing:0px;font-family:Roboto, Arial, sans-serif;margin:0;line-height:24px;text-decoration:none;font-size:13px;maring:0;font-weight:600;font-style:normal;">
|
||||
<span class="smush-light-img">
|
||||
<img onerror="arguments[0].currentTarget.style.display='none'" style="width:16px;margin-top:16px;margin-right:12px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/valid.png'; ?>" />
|
||||
</span>
|
||||
<span class="smush-dark-img" style="display:inline-block;display:none;width:0;height:0;visibility:hidden;margin:0;padding:0">
|
||||
<img onerror="arguments[0].currentTarget.style.display='none'" style="width:16px;margin-top:16px;margin-right:12px;" src="<?php echo WP_SMUSH_URL . 'app/assets/images/email/valid-dark.png'; ?>" />
|
||||
</span>
|
||||
<?php esc_html_e( '60% off your first year', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<p style="margin:0;padding:20px 0 35px;">
|
||||
<a class="button"
|
||||
style="display:inline-block;background:#286EFA;border-radius:6px;font-family:Roboto,Arial,sans-serif;font-size:13px;width:176px;height:40px;padding:0!important;font-weight:500;line-height:40px;text-align:center;margin:0;display:inline-block!important;color:#fff!important;text-decoration:none!important;"
|
||||
href="<?php echo esc_url( $upsell_url ); ?>"><?php esc_html_e( 'Learn more about Pro', 'wp-smushit' ); ?></a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Integrations meta box
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $basic_features Basic features array.
|
||||
* @var bool $is_pro Is PRO user or not.
|
||||
* @var array $integration_group Integration group.
|
||||
* @var array $settings Settings array.
|
||||
*
|
||||
* @var Abstract_Page $this
|
||||
*/
|
||||
|
||||
use Smush\App\Abstract_Page;
|
||||
use Smush\Core\Helper;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
foreach ( $integration_group as $name ) {
|
||||
$is_integration_disabled = apply_filters( 'wp_smush_integration_status_' . $name, false ); // Disable setting.
|
||||
$is_pro_field = $this->settings->is_pro_field( $name ); // Gray out row, disable setting.
|
||||
$is_disabled_field = $is_integration_disabled || ( $is_pro_field && ! $is_pro );
|
||||
$value = $is_disabled_field || empty( $settings[ $name ] ) ? false : $settings[ $name ];
|
||||
do_action( 'wp_smush_render_setting_row', $name, $value, $is_disabled_field );
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( ! $is_pro ) : ?>
|
||||
<div class="sui-upsell-notice sui-padding sui-padding-bottom__desktop--hidden">
|
||||
<div class="sui-upsell-notice__content">
|
||||
<div class="sui-notice sui-notice-purple">
|
||||
<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( 'Smush Pro supports hosting images on Amazon S3 and optimizating NextGen Gallery images directly through NextGen Gallery settings. Try it with a WPMU DEV membership today!', 'wp-smushit' );
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<a href="<?php echo esc_url( Helper::get_url( 'smush-nextgen-settings-upsell' ) ); ?>" target="_blank" class="sui-button sui-button-purple">
|
||||
<?php esc_html_e( 'UNLOCK NOW WITH PRO', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Lazy loading disabled meta box.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-lazyload-default.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-lazyload-default@2x.png' ); ?> 2x"
|
||||
alt="<?php esc_html_e( 'Smush CDN', 'wp-smushit' ); ?>" class="sui-image">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="sui-message-content">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
715
wp-content/plugins/wp-smushit/app/views/lazyload/meta-box.php
Normal file
715
wp-content/plugins/wp-smushit/app/views/lazyload/meta-box.php
Normal file
@ -0,0 +1,715 @@
|
||||
<?php
|
||||
/**
|
||||
* Lazy loading meta box.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var array $conflicts Conflicting plugins.
|
||||
* @var array $cpts Custom post types.
|
||||
* @var array $settings Lazy loading settings.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// We need this for uploader to work properly.
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
|
||||
?>
|
||||
|
||||
<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 ( ! $conflicts || ! is_array( $conflicts ) || empty( $conflicts ) ) : ?>
|
||||
<div class="sui-notice sui-notice-success">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Lazy loading is active.', '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">
|
||||
<i class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %s - list of plugins */
|
||||
esc_html__( "We've detected another active plugin that offers Lazy Load: %s. Smush may not work as expected if Lazy Load is enabled in multiple plugins. For best results, activate Lazy Load in only one plugin at a time.", 'wp-smushit' ),
|
||||
'<strong>' . esc_html( join( ', ', $conflicts ) ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Media Types', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Choose which media types you want to lazy load.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<label for="format-jpeg" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[jpeg]' />
|
||||
<input type="checkbox" name="format[jpeg]" id="format-jpeg" <?php checked( $settings['format']['jpeg'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( '.jpeg', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="format-png" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[png]' />
|
||||
<input type="checkbox" name="format[png]" id="format-png" <?php checked( $settings['format']['png'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( '.png', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="format-webp" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[webp]' />
|
||||
<input type="checkbox" name="format[webp]" id="format-webp" <?php checked( ! isset( $settings['format']['webp'] ) || $settings['format']['webp'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( '.webp', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="format-gif" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[gif]' />
|
||||
<input type="checkbox" name="format[gif]" id="format-gif" <?php checked( $settings['format']['gif'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( '.gif', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="format-svg" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[svg]' />
|
||||
<input type="checkbox" name="format[svg]" id="format-svg" <?php checked( $settings['format']['svg'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( '.svg', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="format-iframe" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='format[iframe]' />
|
||||
<input type="checkbox" name="format[iframe]" id="format-iframe" <?php checked( ! isset( $settings['format']['iframe'] ) || $settings['format']['iframe'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( 'iframe', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Output Locations', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'By default we will lazy load all images, but you can refine this to specific media outputs too.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<label for="output-content" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='output[content]' />
|
||||
<input type="checkbox" name="output[content]" id="output-content" <?php checked( $settings['output']['content'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( 'Content', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="output-widgets" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='output[widgets]' />
|
||||
<input type="checkbox" name="output[widgets]" id="output-widgets" <?php checked( $settings['output']['widgets'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( 'Widgets', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="output-thumbnails" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='output[thumbnails]' />
|
||||
<input type="checkbox" name="output[thumbnails]" id="output-thumbnails" <?php checked( $settings['output']['thumbnails'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( 'Post Thumbnail', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label for="output-gravatars" class="sui-checkbox sui-checkbox-stacked">
|
||||
<input type='hidden' value='0' name='output[gravatars]' />
|
||||
<input type="checkbox" name="output[gravatars]" id="output-gravatars" <?php checked( $settings['output']['gravatars'] ); ?> />
|
||||
<span aria-hidden="true"></span>
|
||||
<span><?php esc_html_e( 'Gravatars', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Display & Animation', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Choose how you want preloading images to be displayed, as well as how they animate into view.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<strong><?php esc_html_e( 'Display', 'wp-smushit' ); ?></strong>
|
||||
<div class="sui-description">
|
||||
<?php esc_html_e( 'Choose how you want the non-loaded image to look.', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="sui-side-tabs sui-tabs">
|
||||
<div data-tabs>
|
||||
<label for="animation-fadein" class="sui-tab-item <?php echo 'fadein' === $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<input type="radio" name="animation[selected]" value="fadein" id="animation-fadein" <?php checked( $settings['animation']['selected'], 'fadein' ); ?> />
|
||||
<?php esc_html_e( 'Fade In', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<label for="animation-spinner" class="sui-tab-item <?php echo 'spinner' === $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<input type="radio" name="animation[selected]" value="spinner" id="animation-spinner" <?php checked( $settings['animation']['selected'], 'spinner' ); ?> />
|
||||
<?php esc_html_e( 'Spinner', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<label for="animation-placeholder" class="sui-tab-item <?php echo 'placeholder' === $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<input type="radio" name="animation[selected]" value="placeholder" id="animation-placeholder" <?php checked( $settings['animation']['selected'], 'placeholder' ); ?> />
|
||||
<?php esc_html_e( 'Placeholder', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<label for="animation-disabled" class="sui-tab-item <?php echo 'none' === $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<input type="radio" name="animation[selected]" value="none" id="animation-disabled" <?php checked( $settings['animation']['selected'], 'none' ); ?> />
|
||||
<?php esc_html_e( 'None', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
</div><!-- end data-tabs -->
|
||||
<div data-panes>
|
||||
<div class="sui-tab-boxed <?php echo 'fadein' === $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<strong><?php esc_html_e( 'Animation', 'wp-smushit' ); ?></strong>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Once the image has loaded, choose how you want the image to display when it comes into view.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<div class="sui-form-field-inline">
|
||||
<div class="sui-form-field">
|
||||
<label for="fadein-duration" class="sui-label"><?php esc_html_e( 'Duration', 'wp-smushit' ); ?></label>
|
||||
<input type='hidden' value='0' name='animation[duration]' />
|
||||
<input type="number" name="animation[duration]" placeholder="400" value="<?php echo absint( $settings['animation']['fadein']['duration'] ); ?>" id="fadein-duration" class="sui-form-control sui-input-sm sui-field-has-suffix">
|
||||
<span class="sui-field-suffix"><?php esc_html_e( 'ms', 'wp-smushit' ); ?></span>
|
||||
</div>
|
||||
<div class="sui-form-field">
|
||||
<label for="fadein-delay" class="sui-label"><?php esc_html_e( 'Delay', 'wp-smushit' ); ?></label>
|
||||
<input type='hidden' value='0' name='animation[delay]' />
|
||||
<input type="number" name="animation[delay]" placeholder="0" value="<?php echo absint( $settings['animation']['fadein']['delay'] ); ?>" id="fadein-delay" class="sui-form-control sui-input-sm sui-field-has-suffix">
|
||||
<span class="sui-field-suffix"><?php esc_html_e( 'ms', 'wp-smushit' ); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-tab-boxed <?php echo 'spinner' === $settings['animation']['selected'] ? 'active' : ''; ?>" id="smush-lazy-load-spinners">
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Display a spinner where the image will be during lazy loading. You can choose a predefined spinner, or upload your own GIF.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<label class="sui-label"><?php esc_html_e( 'Spinner', 'wp-smushit' ); ?></label>
|
||||
<div class="sui-box-selectors">
|
||||
<ul>
|
||||
<?php for ( $i = 1; $i <= 5; $i++ ) : ?>
|
||||
<li><label for="spinner-<?php echo absint( $i ); ?>" class="sui-box-selector">
|
||||
<input type="radio" name="animation[spinner-icon]" id="spinner-<?php echo absint( $i ); ?>" value="<?php echo absint( $i ); ?>" <?php checked( (int) $settings['animation']['spinner']['selected'] === $i ); ?> />
|
||||
<span>
|
||||
<img alt="<?php esc_attr_e( 'Spinner image', 'wp-smushit' ); ?> <?php echo absint( $i ); ?>" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-lazyloader-' . $i . '.gif' ); ?>" />
|
||||
</span>
|
||||
</label></li>
|
||||
<?php endfor; ?>
|
||||
|
||||
<?php foreach ( $settings['animation']['spinner']['custom'] as $image ) : ?>
|
||||
<?php $custom_link = wp_get_attachment_image_src( $image, 'full' ); ?>
|
||||
<li><label for="spinner-<?php echo absint( $image ); ?>" class="sui-box-selector">
|
||||
<input type="radio" name="animation[spinner-icon]" id="spinner-<?php echo absint( $image ); ?>" value="<?php echo absint( $image ); ?>" <?php checked( $image === $settings['animation']['spinner']['selected'] ); ?> />
|
||||
<span>
|
||||
<button class="remove-selector sui-button-icon sui-tooltip smush-ll-remove" data-id="<?php echo absint( $image ); ?>" data-tooltip="<?php esc_attr_e( 'Remove', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close" aria-hidden="true" data-id="<?php echo absint( $image ); ?>" data-type="spinner"></i>
|
||||
</button>
|
||||
|
||||
<img alt="<?php esc_attr_e( 'Spinner image', 'wp-smushit' ); ?> <?php echo absint( $image ); ?>" src="<?php echo esc_url( $custom_link[0] ); ?>" />
|
||||
</span>
|
||||
</label></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<div class="sui-upload">
|
||||
<input type="hidden" name="animation[custom-spinner]" id="smush-spinner-icon-file" value="">
|
||||
|
||||
<div class="sui-upload-image" aria-hidden="true">
|
||||
<div class="sui-image-mask"></div>
|
||||
<div role="button" class="sui-image-preview" id="smush-spinner-icon-preview" onclick="WP_Smush.Lazyload.addLoaderIcon()"></div>
|
||||
</div>
|
||||
|
||||
<a class="sui-upload-button" id="smush-upload-spinner" onclick="WP_Smush.Lazyload.addLoaderIcon()">
|
||||
<i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Upload file', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
|
||||
<div class="sui-upload-file" id="smush-remove-spinner">
|
||||
<span></span>
|
||||
<button aria-label="<?php esc_attr_e( 'Remove file', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-tab-boxed <?php echo 'placeholder' === $settings['animation']['selected'] ? 'active' : ''; ?>" id="smush-lazy-load-placeholder">
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Display a placeholder to display instead of the actual image during lazy loading. You can choose a predefined image, or upload your own.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<label class="sui-label"><?php esc_html_e( 'Image', 'wp-smushit' ); ?></label>
|
||||
<div class="sui-box-selectors">
|
||||
<ul>
|
||||
<?php for ( $i = 1; $i <= 2; $i++ ) : ?>
|
||||
<li><label for="placeholder-icon-<?php echo absint( $i ); ?>" class="sui-box-selector">
|
||||
<input type="radio" name="animation[placeholder-icon]" id="placeholder-icon-<?php echo absint( $i ); ?>" value="<?php echo absint( $i ); ?>" <?php checked( (int) $settings['animation']['placeholder']['selected'] === $i ); ?> />
|
||||
<span>
|
||||
<img alt="<?php esc_attr_e( 'Placeholder image', 'wp-smushit' ); ?> <?php echo absint( $i ); ?>" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-placeholder.png' ); ?>" />
|
||||
</span>
|
||||
</label></li>
|
||||
<?php endfor; ?>
|
||||
|
||||
<?php foreach ( $settings['animation']['placeholder']['custom'] as $image ) : ?>
|
||||
<?php $custom_link = wp_get_attachment_image_src( $image, 'full' ); ?>
|
||||
<li><label for="placeholder-icon-<?php echo absint( $image ); ?>" class="sui-box-selector">
|
||||
<input type="radio" name="animation[placeholder-icon]" id="placeholder-icon-<?php echo absint( $image ); ?>" value="<?php echo absint( $image ); ?>" <?php checked( $image === $settings['animation']['placeholder']['selected'] ); ?> />
|
||||
<span>
|
||||
<button class="remove-selector sui-button-icon sui-tooltip smush-ll-remove" data-tooltip="<?php esc_attr_e( 'Remove', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close" aria-hidden="true" data-id="<?php echo absint( $image ); ?>" data-type="placeholder"></i>
|
||||
</button>
|
||||
<img alt="<?php esc_attr_e( 'Placeholder image', 'wp-smushit' ); ?> <?php echo absint( $image ); ?>" src="<?php echo esc_url( $custom_link[0] ); ?>" />
|
||||
</span>
|
||||
</label></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<div class="sui-upload">
|
||||
<input type="hidden" name="animation[custom-placeholder]" id="smush-placeholder-icon-file" value="" />
|
||||
|
||||
<div class="sui-upload-image" aria-hidden="true">
|
||||
<div class="sui-image-mask"></div>
|
||||
<div role="button" class="sui-image-preview" id="smush-placeholder-icon-preview" onclick="WP_Smush.Lazyload.addLoaderIcon('placeholder')"></div>
|
||||
</div>
|
||||
|
||||
<a class="sui-upload-button" id="smush-upload-placeholder" onclick="WP_Smush.Lazyload.addLoaderIcon('placeholder')">
|
||||
<i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Upload file', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
|
||||
<div class="sui-upload-file" id="smush-remove-placeholder">
|
||||
<span></span>
|
||||
<button aria-label="<?php esc_attr_e( 'Remove file', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $color = isset( $settings['animation']['placeholder']['color'] ) ? $settings['animation']['placeholder']['color'] : '#F3F3F3'; ?>
|
||||
<label class="sui-label" for="smush-color-picker"><?php esc_html_e( 'Background color', 'wp-smushit' ); ?></label>
|
||||
<div class="sui-colorpicker-wrap">
|
||||
<div class="sui-colorpicker sui-colorpicker-hex" aria-hidden="true">
|
||||
<div class="sui-colorpicker-value">
|
||||
<span role="button">
|
||||
<span style="background-color: <?php echo esc_attr( $color ); ?>"></span>
|
||||
</span>
|
||||
<input type="text" value="<?php echo esc_attr( $color ); ?>" readonly="readonly" />
|
||||
<button><i class="sui-icon-close" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
<button class="sui-button"><?php esc_html_e( 'Select', 'wp-smushit' ); ?></button>
|
||||
</div>
|
||||
<input type="text" name="animation[color]" value="<?php echo esc_attr( $color ); ?>" id="smush-color-picker" class="sui-colorpicker-input" data-attribute="<?php echo esc_attr( $color ); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-notice <?php echo ! $settings['animation']['selected'] ? 'active' : ''; ?>">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Images will flash into view as soon as they are ready to display.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end data-panes -->
|
||||
</div><!-- end .sui-tabs -->
|
||||
</div><!-- end .sui-box-settings-col-2 -->
|
||||
<script>
|
||||
jQuery(document).ready(function($){
|
||||
var $suiPickerInputs = $('#smush-color-picker');
|
||||
|
||||
$suiPickerInputs.wpColorPicker({
|
||||
width: 300,
|
||||
change: function(event, ui) {
|
||||
$(this).val( ui.color.toCSS() ).trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
if ( $suiPickerInputs.hasClass('wp-color-picker') ) {
|
||||
$suiPickerInputs.each( function() {
|
||||
var $suiPickerInput = $(this),
|
||||
$suiPicker = $suiPickerInput.closest('.sui-colorpicker-wrap'),
|
||||
$suiPickerColor = $suiPicker.find('.sui-colorpicker-value span[role=button]'),
|
||||
$suiPickerValue = $suiPicker.find('.sui-colorpicker-value'),
|
||||
$wpPicker = $suiPickerInput.closest('.wp-picker-container'),
|
||||
$wpPickerButton = $wpPicker.find('.wp-color-result');
|
||||
|
||||
// Listen to color change
|
||||
$suiPickerInput.on('change', function() {
|
||||
// Change color preview
|
||||
$suiPickerColor.find('span').css({
|
||||
'background-color': $wpPickerButton.css('background-color')
|
||||
});
|
||||
|
||||
// Change color value
|
||||
$suiPickerValue.find('input').val( $suiPickerInput.val() );
|
||||
});
|
||||
|
||||
// Open iris picker
|
||||
$suiPicker.find('.sui-button, span[role=button]').on('click', function(e) {
|
||||
$wpPickerButton.trigger('click');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// Clear color value
|
||||
$suiPickerValue.find('button').on( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$wpPicker.find('.wp-picker-clear').trigger('click');
|
||||
$suiPickerValue.find('input').val('');
|
||||
$suiPickerInput.val('').trigger('change');
|
||||
$suiPickerColor.find('span').css({
|
||||
'background-color': ''
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
#smush-lazy-load-placeholder .sui-box-selector input + span,
|
||||
#smush-lazy-load-placeholder .sui-box-selector input:checked + span {
|
||||
background-color: <?php echo esc_attr( $color ); ?>;
|
||||
}
|
||||
</style>
|
||||
</div><!-- end .sui-box-settings-row -->
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Include/Exclude', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Disable lazy loading for specific pages, posts or image classes that you wish to prevent lazyloading on.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-form-field">
|
||||
<strong><?php esc_html_e( 'Post Types', 'wp-smushit' ); ?></strong>
|
||||
<div class="sui-description">
|
||||
<?php esc_html_e( 'Choose the post types you want to lazy load.', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
<table class="sui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Name', 'wp-smushit' ); ?></th>
|
||||
<th><?php esc_html_e( 'Type', 'wp-smushit' ); ?></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Frontpage', 'wp-smushit' ); ?></strong></td>
|
||||
<td>frontpage</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-frontpage">
|
||||
<input type='hidden' value='0' name='include[frontpage]' />
|
||||
<input type="checkbox" name="include[frontpage]" id="include-frontpage" <?php checked( $settings['include']['frontpage'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Blog', 'wp-smushit' ); ?></strong></td>
|
||||
<td>home</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-home">
|
||||
<input type='hidden' value='0' name='include[home]' />
|
||||
<input type="checkbox" name="include[home]" id="include-home" <?php checked( $settings['include']['home'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Pages', 'wp-smushit' ); ?></strong></td>
|
||||
<td>page</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-page">
|
||||
<input type='hidden' value='0' name='include[page]' />
|
||||
<input type="checkbox" name="include[page]" id="include-page" <?php checked( $settings['include']['page'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Posts', 'wp-smushit' ); ?></strong></td>
|
||||
<td>single</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-single">
|
||||
<input type='hidden' value='0' name='include[single]' />
|
||||
<input type="checkbox" name="include[single]" id="include-single" <?php checked( $settings['include']['single'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Archives', 'wp-smushit' ); ?></strong></td>
|
||||
<td>archive</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-archive">
|
||||
<input type='hidden' value='0' name='include[archive]' />
|
||||
<input type="checkbox" name="include[archive]" id="include-archive" <?php checked( $settings['include']['archive'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Categories', 'wp-smushit' ); ?></strong></td>
|
||||
<td>category</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-category">
|
||||
<input type='hidden' value='0' name='include[category]' />
|
||||
<input type="checkbox" name="include[category]" id="include-category" <?php checked( $settings['include']['category'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php esc_html_e( 'Tags', 'wp-smushit' ); ?></strong></td>
|
||||
<td>tag</td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-tag">
|
||||
<input type='hidden' value='0' name='include[tag]' />
|
||||
<input type="checkbox" name="include[tag]" id="include-tag" <?php checked( $settings['include']['tag'] ); ?>>
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php foreach ( $cpts as $custom_post_type ) : ?>
|
||||
<tr>
|
||||
<td><strong><?php echo esc_html( $custom_post_type->label ); ?></strong></td>
|
||||
<td><?php echo esc_html( $custom_post_type->name ); ?></td>
|
||||
<td>
|
||||
<label class="sui-toggle" for="include-<?php echo esc_attr( $custom_post_type->name ); ?>">
|
||||
<input type='hidden' value='0' name='include[<?php echo esc_attr( $custom_post_type->name ); ?>]' />
|
||||
<input type="checkbox" name="include[<?php echo esc_attr( $custom_post_type->name ); ?>]" id="include-<?php echo esc_attr( $custom_post_type->name ); ?>"
|
||||
<?php checked( ! isset( $settings['include'][ $custom_post_type->name ] ) || $settings['include'][ $custom_post_type->name ] ); ?> />
|
||||
<span class="sui-toggle-slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="sui-form-field">
|
||||
<strong><?php esc_html_e( 'Post, Pages & URLs', 'wp-smushit' ); ?></strong>
|
||||
<div class="sui-description">
|
||||
<?php esc_html_e( 'Add URLs to the posts and/or pages you want to disable lazy loading on.', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
<?php
|
||||
$strings = '';
|
||||
if ( is_array( $settings['exclude-pages'] ) ) {
|
||||
$strings = join( PHP_EOL, $settings['exclude-pages'] );
|
||||
}
|
||||
?>
|
||||
<textarea class="sui-form-control" name="exclude-pages" placeholder="<?php esc_attr_e( 'E.g. /page', 'wp-smushit' ); ?>"><?php echo esc_attr( $strings ); ?></textarea>
|
||||
<div class="sui-description">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - opening strong tag, %2$s - closing strong tag */
|
||||
esc_html__( 'Add page or post URLs one per line in relative format. I.e. %1$s/example-page%2$s or %1$s/example-page/sub-page/%2$s.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-form-field">
|
||||
<strong><?php esc_html_e( 'Classes & IDs', 'wp-smushit' ); ?></strong>
|
||||
<div class="sui-description">
|
||||
<?php esc_html_e( 'Additionally, you can specify classes or IDs to avoid lazy loading. This gives you absolute control over each image on a page, not just the page itself.', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
<?php
|
||||
$strings = '';
|
||||
if ( is_array( $settings['exclude-classes'] ) ) {
|
||||
$strings = join( PHP_EOL, $settings['exclude-classes'] );
|
||||
}
|
||||
?>
|
||||
<textarea class="sui-form-control" name="exclude-classes" placeholder="<?php esc_attr_e( 'Add classes or IDs, one per line', 'wp-smushit' ); ?>"><?php echo esc_attr( $strings ); ?></textarea>
|
||||
<div class="sui-description">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - opening strong tag, %2$s - closing strong tag */
|
||||
esc_html__( 'Add one class or ID per line, including the prefix. E.g %1$s#image-id%2$s or %1$s.image-class%2$s.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Scripts', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'By default we will load the required scripts in your footer for max performance benefits. If you are having issues, you can switch this to the header.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-form-field">
|
||||
<strong><?php esc_attr_e( 'Method', 'wp-smushit' ); ?></strong>
|
||||
<div class="sui-description">
|
||||
<?php esc_html_e( 'By default we will load the required scripts in your footer for max performance benefits. If you are having issues, you can switch this to the header.', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="sui-side-tabs sui-tabs">
|
||||
<div data-tabs>
|
||||
<label for="script-footer" class="sui-tab-item <?php echo $settings['footer'] ? 'active' : ''; ?>">
|
||||
<input type="radio" name="footer" value="on" id="script-footer" <?php checked( $settings['footer'] ); ?> />
|
||||
<?php esc_html_e( 'Footer', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
|
||||
<label for="script-header" class="sui-tab-item <?php echo $settings['footer'] ? '' : 'active'; ?>">
|
||||
<input type="radio" name="footer" value="off" id="script-header" <?php checked( $settings['footer'], false ); ?> />
|
||||
<?php esc_html_e( 'Header', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div data-panes>
|
||||
<div class="sui-notice active">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Your theme must be using the wp_footer() function.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Your theme must be using the wp_head() function.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Native lazy load', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Enable support for native browser lazy loading.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-form-field">
|
||||
<label for="native" class="sui-toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="native"
|
||||
name="native"
|
||||
aria-labelledby="native-label"
|
||||
aria-describedby="native-description"
|
||||
<?php checked( isset( $settings['native'] ) && $settings['native'] ); ?>
|
||||
/>
|
||||
<span class="sui-toggle-slider" aria-hidden="true"></span>
|
||||
<span id="native-label" class="sui-toggle-label">
|
||||
<?php esc_html_e( 'Enable native lazy loading', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span id="native-description" class="sui-description">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - opening a tag, %2$s - closing a tag */
|
||||
esc_html__( 'In some cases can cause the "Defer offscreen images" Google PageSpeed audit to fail. See browser compatibility %1$shere%2$s.', 'wp-smushit' ),
|
||||
'<a href="https://caniuse.com/#feat=loading-lazy-attr" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Disable Noscript', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Disable NoScript while lazy loading is enabled.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-form-field">
|
||||
<label for="noscript" class="sui-toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="noscript"
|
||||
name="noscript"
|
||||
aria-labelledby="noscript-label"
|
||||
aria-describedby="noscript-description"
|
||||
<?php checked( isset( $settings['noscript'] ) && $settings['noscript'] ); ?>
|
||||
/>
|
||||
<span class="sui-toggle-slider" aria-hidden="true"></span>
|
||||
<span id="noscript-label" class="sui-toggle-label">
|
||||
<?php esc_html_e( 'Disable Noscript', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span id="noscript-description" class="sui-description">
|
||||
<?php
|
||||
/* translators: %1$s - opening a tag, %2$s - closing a tag */
|
||||
esc_html_e( 'Sometimes W3C HTML5 Validation may give error due to No Script.', 'wp-smushit' );
|
||||
?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e(
|
||||
'No longer wish to use this feature? Turn it off instantly by hitting Deactivate.',
|
||||
'wp-smushit'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<button class="sui-button sui-button-ghost" id="smush-cancel-lazyload">
|
||||
<span class="sui-loading-text">
|
||||
<i class="sui-icon-power-on-off" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
71
wp-content/plugins/wp-smushit/app/views/meta-box.php
Normal file
71
wp-content/plugins/wp-smushit/app/views/meta-box.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Meta box layout.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var Abstract_Page $this
|
||||
*
|
||||
* @var array $args Array of arguments.
|
||||
* @var array $callback Callback for meta box content.
|
||||
* @var array $callback_footer Callback for meta box footer.
|
||||
* @var array $callback_header Callback for meta box header.
|
||||
* @var string $id Meta box DOM ID.
|
||||
* @var string $orig_id Meta box code ID.
|
||||
* @var string $title Meta box title.
|
||||
*/
|
||||
|
||||
use Smush\App\Abstract_Page;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="smush-box-<?php echo esc_attr( $id ); ?>" class="sui-<?php echo esc_attr( $id ); ?> <?php echo esc_attr( $args['box_class'] ); ?>">
|
||||
<?php if ( is_callable( $callback_header ) ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_header_class'] ); ?>">
|
||||
<?php call_user_func( $callback_header ); ?>
|
||||
</div>
|
||||
<?php elseif ( $this->view_exists( $orig_id . '/meta-box-header' ) ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_header_class'] ); ?>">
|
||||
<?php $this->view( $orig_id . '/meta-box-header', compact( 'title' ) ); ?>
|
||||
</div>
|
||||
<?php elseif ( $title ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_header_class'] ); ?>">
|
||||
<h3 class="sui-box-title"><?php echo esc_html( $title ); ?></h3>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $args['box_content_class'] ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_content_class'] ); ?>">
|
||||
<?php if ( is_callable( $callback ) ) : ?>
|
||||
<?php call_user_func( $callback ); ?>
|
||||
<?php else : ?>
|
||||
<?php $this->view( $orig_id . '-meta-box' ); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php elseif ( is_callable( $callback ) ) : ?>
|
||||
<?php call_user_func( $callback ); ?>
|
||||
<?php else : ?>
|
||||
<?php $this->view( $orig_id . '-meta-box' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( is_callable( $callback_footer ) ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_footer_class'] ); ?>">
|
||||
<?php call_user_func( $callback_footer ); ?>
|
||||
</div>
|
||||
<?php elseif ( $this->view_exists( $orig_id . '/meta-box-footer' ) ) : ?>
|
||||
<div class="<?php echo esc_attr( $args['box_footer_class'] ); ?>">
|
||||
<?php $this->view( $orig_id . '/meta-box-footer' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() && $this->view_exists( $orig_id . '/meta-box-upsell' ) ) : ?>
|
||||
<?php $this->view( $orig_id . '/meta-box-upsell' ); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php // Allows you to output any content within the stats box at the end. ?>
|
||||
<?php do_action( 'wp_smush_after_stats' ); ?>
|
||||
</div><!-- end box-<?php echo esc_attr( $id ); ?> -->
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* NextGen header meta box.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var string $title
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title">
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</h3>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<small>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s - a href opening tag, %2$s - a href closing tag */
|
||||
esc_html__( 'Smush individual images via your %1$sManage Galleries%2$s section', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( admin_url() . 'admin.php?page=nggallery-manage-gallery' ) . '" title="' . esc_html__( 'Manage Galleries', 'wp-smushit' ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</small>
|
||||
</div>
|
83
wp-content/plugins/wp-smushit/app/views/nextgen/meta-box.php
Normal file
83
wp-content/plugins/wp-smushit/app/views/nextgen/meta-box.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* NextGen meta box.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var int $total_images_to_smush Resmush + unsmushed image count.
|
||||
* @var Admin $ng NextGen admin class.
|
||||
* @var int $total_count Total count.
|
||||
* @var int $unsmushed_count Unsmushed images count.
|
||||
* @var array $resmush_count Resmush count.
|
||||
* @var string $url Media library URL.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( 0 !== absint( $total_count ) ) : ?>
|
||||
<p><?php esc_html_e( 'Bulk smush detects images that can be optimized and allows you to compress them in bulk.', 'wp-smushit' ); ?></p>
|
||||
<?php else : ?>
|
||||
<div class="sui-message">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-no-media.png' ); ?>" alt="<?php esc_attr_e( 'No attachments found - Upload some images', 'wp-smushit' ); ?>" class="sui-image">
|
||||
<?php endif; ?>
|
||||
<div class="sui-message-content">
|
||||
<p>
|
||||
<?php
|
||||
printf( /* translators: %1$s: opening a tga, %2$s: closing a tag */
|
||||
esc_html__(
|
||||
'We haven\'t found any images in your %1$sgallery%2$s yet, so there\'s no smushing to be done! Once you upload images, reload this page and start playing!',
|
||||
'wp-smushit'
|
||||
),
|
||||
'<a href="' . esc_url( admin_url( 'admin.php?page=ngg_addgallery' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<a class="sui-button sui-button-blue" href="<?php echo esc_url( admin_url( 'admin.php?page=ngg_addgallery' ) ); ?>">
|
||||
<?php esc_html_e( 'UPLOAD IMAGES', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php return; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $this->view( 'all-images-smushed-notice', array( 'all_done' => empty( $total_images_to_smush ) ), 'common' ); ?>
|
||||
|
||||
<?php
|
||||
$in_processing_notice = __( 'Bulk smush is currently running. You need to keep this page open for the process to complete.', 'wp-smushit' );
|
||||
$this->view( 'progress-bar',
|
||||
array(
|
||||
'count' => $total_count,
|
||||
'background_processing_enabled' => false,
|
||||
'background_in_processing_notice' => '',
|
||||
'in_processing_notice' => $in_processing_notice,
|
||||
),
|
||||
'common'
|
||||
);
|
||||
?>
|
||||
|
||||
<div class="smush-final-log sui-hidden">
|
||||
<div class="smush-bulk-errors"></div>
|
||||
<div class="smush-bulk-errors-actions">
|
||||
<a href="<?php echo esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ); ?>" class="sui-button sui-button-icon sui-button-ghost">
|
||||
<i class="sui-icon-photo-picture" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'View all', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wp-smush-bulk-wrapper sui-border-frame<?php echo empty( $total_images_to_smush ) ? ' sui-hidden' : ''; ?>">
|
||||
|
||||
<div id="wp-smush-bulk-content">
|
||||
<?php WP_Smush::get_instance()->admin()->print_pending_bulk_smush_content( $total_images_to_smush, $resmush_count, $unsmushed_count ); ?>
|
||||
</div>
|
||||
|
||||
<button type="button" class="sui-button sui-button-blue wp-smush-nextgen-bulk">
|
||||
<?php esc_html_e( 'BULK SMUSH', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Progress bar block.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var integer $count Total number of images to smush.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wp-smush-bulk-progress-bar-wrapper sui-hidden">
|
||||
<div class="sui-notice sui-notice-warning sui-hidden"></div>
|
||||
|
||||
<div id="wp-smush-running-notice" class="sui-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Bulk smush is currently running. You need to keep this page open for the process to complete.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-progress-block sui-progress-can-close">
|
||||
<div class="sui-progress">
|
||||
<span class="sui-progress-icon" aria-hidden="true">
|
||||
<i class="sui-icon-loader sui-loading"></i>
|
||||
</span>
|
||||
<div class="sui-progress-text">
|
||||
<span class="wp-smush-images-percent">0%</span>
|
||||
</div>
|
||||
<div class="sui-progress-bar">
|
||||
<span class="wp-smush-progress-inner" style="width: 0%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="sui-progress-close wp-smush-cancel-bulk" type="button">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button class="sui-progress-close sui-button-icon sui-tooltip wp-smush-all sui-hidden" type="button" data-tooltip="<?php esc_html_e( 'Resume scan.', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-play"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-progress-state">
|
||||
<span class="sui-progress-state-text">
|
||||
<span>0</span>/<span class="wp-smush-total-count"><?php echo absint( $count ); ?></span> <?php esc_html_e( 'images smushed', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="bulk-smush-resume-button" class="sui-hidden">
|
||||
<a class="wp-smush-all sui-button wp-smush-started wp-smush-resume-bulk-smush">
|
||||
<i class="sui-icon-play" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Resume', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* NextGen summary meta box.
|
||||
*
|
||||
* @package WP_Smuh
|
||||
*
|
||||
* @var int $image_count
|
||||
* @var bool $lossy_enabled
|
||||
* @var int $smushed_image_count
|
||||
* @var int $super_smushed_count
|
||||
* @var string $stats_human
|
||||
* @var string|int $stats_percent
|
||||
* @var int $total_count
|
||||
* @var string $percent_grade
|
||||
* @var int|float $percent_metric
|
||||
* @var int $percent_optimized
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$this->view(
|
||||
'circle-progress-bar',
|
||||
array(
|
||||
'percent_grade' => $percent_grade,
|
||||
'percent_optimized' => $percent_optimized,
|
||||
'percent_metric' => $percent_metric,
|
||||
'progressbar_description' => __( 'Images optimized in the NextGEN Gallery', 'wp-smushit' ),
|
||||
),
|
||||
'common'
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="sui-summary-segment">
|
||||
<div class="sui-summary-details wp-smush-count-total">
|
||||
<span class="sui-summary-large wp-smush-total-optimised">
|
||||
<?php echo absint( $image_count ); ?>
|
||||
</span>
|
||||
<span class="sui-summary-sub">
|
||||
<?php esc_html_e( 'Images smushed', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-summary-segment">
|
||||
<ul class="sui-list smush-stats-list-nextgen">
|
||||
<li class="smush-total-savings">
|
||||
<span class="sui-list-label">
|
||||
<?php esc_html_e( 'Total savings', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-list-detail wp-smush-stats wp-smush-savings">
|
||||
<?php wp_nonce_field( 'save_wp_smush_options', 'wp_smush_options_nonce', '' ); ?>
|
||||
<span class="wp-smush-stats-percent">
|
||||
<?php echo esc_html( $stats_percent ); ?>
|
||||
</span>%
|
||||
<span class="wp-smush-stats-sep">/</span>
|
||||
<span class="sui-summary-large wp-smush-stats-human">
|
||||
<?php echo esc_html( $stats_human ); ?>
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
<?php if ( apply_filters( 'wp_smush_show_nextgen_lossy_stats', true ) ) : ?>
|
||||
<li class="super-smush-attachments">
|
||||
<span class="sui-list-label">
|
||||
<?php esc_html_e( 'Super-Smushed images', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-list-detail wp-smush-stats">
|
||||
<?php if ( $lossy_enabled ) : ?>
|
||||
<span class="smushed-count"><?php echo (int) $super_smushed_count; ?></span>/<?php echo absint( $total_count ); ?>
|
||||
<?php else : ?>
|
||||
<span class="sui-tag sui-tag-disabled wp-smush-lossy-disabled">
|
||||
<?php esc_html_e( 'Disabled', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
77
wp-content/plugins/wp-smushit/app/views/settings-row.php
Normal file
77
wp-content/plugins/wp-smushit/app/views/settings-row.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Settings row layout.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var \Smush\App\Abstract_Page $this
|
||||
*
|
||||
* @var string $name Setting name.
|
||||
* @var bool $value Setting value.
|
||||
* @var bool $disable Disabled status.
|
||||
* @var bool $upsell Upsell status.
|
||||
*/
|
||||
|
||||
use Smush\Core\Settings;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row <?php echo $upsell ? 'sui-box-upsell-row' : ''; ?> <?php echo $disable && ! $upsell ? 'sui-disabled' : ''; ?> <?php echo esc_attr( $name ); ?>-settings-row" id="<?php echo esc_attr( $name ); ?>-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label <?php echo 'gutenberg' === $name ? 'sui-settings-label-with-tag' : ''; ?>">
|
||||
<?php echo esc_html( Settings::get_setting_data( $name, 'short-label' ) ); ?>
|
||||
<?php do_action( 'smush_setting_column_tag', $name ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php echo wp_kses_post( Settings::get_setting_data( $name, 'desc' ) ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2" id="column-<?php echo esc_attr( $name ); ?>">
|
||||
<?php if ( 'lossy' === $name ) : ?>
|
||||
<span style="font-weight:500" id="<?php echo esc_attr( $name . '-label' ); ?>" class="sui-toggle-label">
|
||||
<?php echo esc_html( Settings::get_setting_data( $name, 'label' ) ); ?>
|
||||
</span>
|
||||
<div class="sui-form-field">
|
||||
<?php
|
||||
$this->view(
|
||||
'lossy-level',
|
||||
array(
|
||||
'name' => $name,
|
||||
),
|
||||
'views/bulk'
|
||||
);
|
||||
?>
|
||||
<!-- Print/Perform action in right setting column -->
|
||||
<?php do_action( 'smush_setting_column_right_inside', $name ); ?>
|
||||
</div>
|
||||
<?php do_action( 'smush_setting_column_right_additional', $name ); ?>
|
||||
<?php elseif ( 'bulk' !== $name ) : ?>
|
||||
<div class="sui-form-field">
|
||||
<label for="<?php echo esc_attr( $name ); ?>" class="sui-toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="<?php echo esc_attr( $name ); ?>"
|
||||
name="<?php echo esc_attr( $name ); ?>"
|
||||
aria-labelledby="<?php echo esc_attr( $name . '-label' ); ?>"
|
||||
aria-describedby="<?php echo esc_attr( $name . '-desc' ); ?>"
|
||||
<?php checked( $value, 1, true ); ?>
|
||||
<?php disabled( $disable ); ?>
|
||||
/>
|
||||
<span class="sui-toggle-slider" aria-hidden="true"></span>
|
||||
<span id="<?php echo esc_attr( $name . '-label' ); ?>" class="sui-toggle-label">
|
||||
<?php echo esc_html( Settings::get_setting_data( $name, 'label' ) ); ?>
|
||||
</span>
|
||||
<!-- Print/Perform action in right setting column -->
|
||||
<?php do_action( 'smush_setting_column_right_inside', $name ); ?>
|
||||
</label>
|
||||
<?php do_action( 'smush_setting_column_right_additional', $name ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- Print/Perform action in right setting column -->
|
||||
<?php do_action( 'smush_setting_column_right_outside', $name ); ?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Accessibility settings meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var bool $accessible_colors High contrast mode status.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<p>
|
||||
<?php esc_html_e( 'Enable support for any accessibility enhancements available in the plugin interface.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'wp_smush_render_setting_row', 'accessible_colors', $accessible_colors ); ?>
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Data settings meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var bool $keep_data Keep data during uninstall.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<p>
|
||||
<?php esc_html_e( 'Control what to do with your settings and data. Settings are each module’s configuration options. Data includes the compression savings, statistics and other pieces of information stored over time.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label"><?php esc_html_e( 'Data', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Choose how you want us to handle your plugin data.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<strong><?php esc_html_e( 'Uninstallation', 'wp-smushit' ); ?></strong>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'When you uninstall the plugin, what do you want to do with your settings? You can save them for next time, or wipe them back to factory settings.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
|
||||
<div class="sui-side-tabs">
|
||||
<div class="sui-tabs-menu">
|
||||
<label for="keep_data-true" class="sui-tab-item <?php echo $keep_data ? 'active' : ''; ?>">
|
||||
<input type="radio" name="keep_data" value="1" id="keep_data-true" <?php checked( $keep_data ); ?>>
|
||||
<?php esc_html_e( 'Keep', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
|
||||
<label for="keep_data-false" class="sui-tab-item <?php echo $keep_data ? '' : 'active'; ?>">
|
||||
<input type="radio" name="keep_data" value="0" id="keep_data-false" <?php checked( ! $keep_data ); ?>>
|
||||
<?php esc_html_e( 'Delete', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<strong><?php esc_html_e( 'Reset Factory Settings', 'wp-smushit' ); ?></strong>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Need to revert back to the default settings? This button will instantly reset your settings to the defaults.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
|
||||
<button class="sui-button sui-button-ghost" data-modal-open="reset-settings-dialog" data-modal-open-focus="reset-setting-confirm" data-modal-mask="true">
|
||||
<i class="sui-icon-undo" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Reset Settings', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label"><?php esc_html_e( 'API Status', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( "If you're having issues with enabling pro features you can force the API to update your membership status here.", 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<button type="button" class="sui-button sui-button-ghost" id="update-api-status">
|
||||
<span class="sui-loading-text">
|
||||
<i class="sui-icon-undo" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Update API status', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* General settings meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var bool $detection Detection settings.
|
||||
* @var string $site_language Site language.
|
||||
* @var bool $tracking Tracking status.
|
||||
* @var string $translation_link Link to plugin translation page.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<p>
|
||||
<?php esc_html_e( 'Configure general settings for this plugin.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'wp_smush_render_setting_row', 'detection', $detection ); ?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label "><?php esc_html_e( 'Translations', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
printf( /* translators: %1$s: opening a tag, %2$s: closing a tag */
|
||||
esc_html__( 'By default, Smush will use the language you’d set in your %1$sWordPress Admin Settings%2$s if a matching translation is available.', 'wp-smushit' ),
|
||||
'<a href="' . esc_html( admin_url( 'options-general.php' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-form-field">
|
||||
<label for="language-input" class="sui-label">
|
||||
<?php esc_html_e( 'Active Translation', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<input type="text" id="language-input" class="sui-form-control" disabled="disabled" placeholder="<?php echo esc_attr( $site_language ); ?>">
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %1$s: opening a tag, %2$s: closing a tag */
|
||||
esc_html__( 'Not using your language, or have improvements? Help us improve translations by providing your own improvements %1$shere%2$s.', 'wp-smushit' ),
|
||||
'<a href="' . esc_html( $translation_link ) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'wp_smush_render_setting_row', 'usage', $tracking ); ?>
|
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Permissions settings meta box.
|
||||
*
|
||||
* @since 3.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var mixed $networkwide Network wide settings.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Subsite Controls', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'By default, subsites will inherit your network settings. Choose which modules you want to allow subsite admins to override.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<div class="sui-side-tabs sui-tabs">
|
||||
<div data-tabs>
|
||||
<?php $selected = is_array( $networkwide ) ? 'custom' : $networkwide; ?>
|
||||
<label for="access-none" class="sui-tab-item <?php echo ! $networkwide ? 'active' : ''; ?>">
|
||||
<input type="radio" name="wp-smush-subsite-access" value="0" id="access-none" <?php checked( $selected, false ); ?>>
|
||||
<?php esc_html_e( 'None', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<label for="access-all" class="sui-tab-item <?php echo '1' === $networkwide ? 'active' : ''; ?>">
|
||||
<input type="radio" name="wp-smush-subsite-access" value="1" id="access-all" <?php checked( $selected, '1' ); ?>>
|
||||
<?php esc_html_e( 'All', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
<label for="access-custom" class="sui-tab-item <?php echo is_array( $networkwide ) ? 'active' : ''; ?>">
|
||||
<input type="radio" name="wp-smush-subsite-access" value="custom" id="access-custom" <?php checked( $selected, 'custom' ); ?>>
|
||||
<?php esc_html_e( 'Custom', 'wp-smushit' ); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div data-panes>
|
||||
<div class="sui-notice sui-notice-info <?php echo ! $networkwide ? 'active' : ''; ?>">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( "Subsite admins can't override any module settings and will always inherit your network settings.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-notice sui-notice-info <?php echo '1' === $networkwide ? 'active' : ''; ?>">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'Subsite admins can override all module settings.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-tab-boxed <?php echo is_array( $networkwide ) ? 'active' : ''; ?>">
|
||||
<p class="sui-description">
|
||||
<?php esc_html_e( 'Choose which modules settings subsite admins have access to.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
|
||||
<input type="checkbox" id="module-bulk" name="wp-smush-access[]" value="bulk" <?php checked( ! is_array( $networkwide ) || in_array( 'bulk', $networkwide, true ) ); ?>>
|
||||
<span aria-hidden="true"> </span>
|
||||
<span><?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
|
||||
<input type="checkbox" id="module-integrations" name="wp-smush-access[]" value="integrations" <?php checked( ! is_array( $networkwide ) || in_array( 'integrations', $networkwide, true ) ); ?>>
|
||||
<span aria-hidden="true"> </span>
|
||||
<span><?php esc_html_e( 'Integrations', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
|
||||
<input type="checkbox" id="module-lazy_load" name="wp-smush-access[]" value="lazy_load" <?php checked( ! is_array( $networkwide ) || in_array( 'lazy_load', $networkwide, true ) ); ?>>
|
||||
<span aria-hidden="true"> </span>
|
||||
<span><?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
|
||||
<input type="checkbox" id="module-cdn" name="wp-smush-access[]" value="cdn" <?php checked( ! is_array( $networkwide ) || in_array( 'cdn', $networkwide, true ) ); ?>>
|
||||
<span aria-hidden="true"> </span>
|
||||
<span><?php esc_html_e( 'CDN', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<?php // Don't display if Dashboard's whitelabel is hiding documentation. ?>
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_doc_link', false ) ) : ?>
|
||||
<label class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm">
|
||||
<input type="checkbox" id="module-tutorials" name="wp-smush-access[]" value="tutorials" <?php checked( ! is_array( $networkwide ) || in_array( 'tutorials', $networkwide, true ) ); ?>>
|
||||
<span aria-hidden="true"> </span>
|
||||
<span><?php esc_html_e( 'Tutorials', 'wp-smushit' ); ?></span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Render Smush NextGen pages.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$this->do_meta_boxes( 'summary' );
|
||||
$this->do_meta_boxes( 'bulk' );
|
||||
|
||||
$this->view( 'footer-links', array(), 'common' );
|
80
wp-content/plugins/wp-smushit/app/views/smush-page.php
Normal file
80
wp-content/plugins/wp-smushit/app/views/smush-page.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Render Smush pages.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var Abstract_Page $this
|
||||
*/
|
||||
|
||||
use Smush\App\Abstract_Page;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Some pages don't need to have wrapped in a form.
|
||||
$page_has_form = ! in_array( $this->get_slug(), array( 'smush-tutorials', 'smush-webp' ), true );
|
||||
|
||||
$this->do_meta_boxes( 'summary' );
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( 'smush' === $this->get_slug() && ! apply_filters( 'wpmudev_branding_hide_doc_link', false ) && ! get_option( 'wp-smush-hide-tutorials' ) ) : ?>
|
||||
<div id="smush-dash-tutorials"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( 'smush-tutorials' === $this->get_slug() ) : ?>
|
||||
<div id="smush-box-tutorials"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->get_current_tab() ) : ?>
|
||||
<?php if ( $page_has_form ) : ?>
|
||||
<form id="<?php echo esc_attr( $this->get_slug() ); ?>-form" method="post">
|
||||
<?php endif; ?>
|
||||
<?php $this->do_meta_boxes(); ?>
|
||||
|
||||
<?php if ( 'smush-webp' === $this->get_slug() && $this->is_wizard() ) : ?>
|
||||
<div id="smush-box-webp-wizard" class="sui-webp-wizard sui-box"></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $page_has_form ) : ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php if ( 'configs' !== $this->get_current_tab() ) : ?>
|
||||
<form id="<?php echo esc_attr( $this->get_slug() ); ?>-form" method="post">
|
||||
<?php endif; ?>
|
||||
<div class="sui-row-with-sidenav">
|
||||
<?php $this->show_tabs(); ?>
|
||||
<?php $this->do_meta_boxes( $this->get_current_tab() ); ?>
|
||||
|
||||
<?php if ( 'configs' === $this->get_current_tab() ) : ?>
|
||||
<div id="smush-box-configs"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<input type="hidden" name="tab" value="<?php echo esc_attr( $this->get_current_tab() ); ?>">
|
||||
<?php if ( 'configs' !== $this->get_current_tab() ) : ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $this->has_meta_boxes( 'box-dashboard-left' ) || $this->has_meta_boxes( 'box-dashboard-right' ) ) : ?>
|
||||
<div class="sui-row">
|
||||
<div class="sui-col-lg-6">
|
||||
<?php $this->do_meta_boxes( 'box-dashboard-left' ); ?>
|
||||
</div>
|
||||
<div class="sui-col-lg-6">
|
||||
<?php $this->do_meta_boxes( 'box-dashboard-right' ); ?>
|
||||
<?php if ( ! is_multisite() || is_network_admin() ) : ?>
|
||||
<div id="smush-widget-configs"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( ! WP_Smush::is_pro() && 'smush' === $this->get_slug() ) {
|
||||
$this->view( 'footer-plugins-upsell', array(), 'common' );
|
||||
}
|
||||
|
||||
$this->view( 'footer-links', array(), 'common' );
|
222
wp-content/plugins/wp-smushit/app/views/smush-upgrade-page.php
Normal file
222
wp-content/plugins/wp-smushit/app/views/smush-upgrade-page.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
/**
|
||||
* Smush PRO upgrade page.
|
||||
*
|
||||
* @since 3.2.3
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
$upgrade_url = add_query_arg(
|
||||
array(
|
||||
'utm_source' => 'smush',
|
||||
'utm_medium' => 'plugin',
|
||||
),
|
||||
'https://wpmudev.com/project/wp-smush-pro/'
|
||||
);
|
||||
|
||||
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
|
||||
$can_use_background = $bg_optimization->can_use_background();
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-upgrade-page">
|
||||
<div class="sui-upgrade-page-header">
|
||||
<div class="sui-upgrade-page__container">
|
||||
<div class="sui-upgrade-page-header__content">
|
||||
<h1><?php esc_html_e( 'Upgrade to Smush Pro', 'wp-smushit' ); ?></h1>
|
||||
<p><?php esc_html_e( "Get Smush Pro and bulk optimize every image you've ever added to your site with one click. Smush images in the background and serve them in stunning high quality from 114 locations around the globe with our blazing-fast CDN.", 'wp-smushit' ); ?></p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Opening <strong>, 2: Closing </strong> */
|
||||
esc_html__( 'Automatically compress and resize huge images without any size limitations. %1$sGet up to 5x better savings with Ultra compression%2$s and fix your Google PageSpeed score with the best image optimizer WordPress has ever known.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url( add_query_arg( 'utm_campaign', 'smush_propage_topbutton', $upgrade_url ) ); ?>" class="sui-button sui-button-lg sui-button-purple" target="_blank">
|
||||
<?php esc_html_e( 'UPGRADE TO PRO', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<div class="sui-reviews">
|
||||
<span class="sui-reviews__stars"></span>
|
||||
<div class="sui-reviews__rating"><span class="sui-reviews-rating">-</span> / <?php esc_html_e( '5.0 rating from', 'wp-smushit' ); ?> <span class="sui-reviews-customer-count">-</span> <?php esc_html_e( 'customers', 'wp-smushit' ); ?></div>
|
||||
<a class="sui-reviews__link" href="https://www.reviews.io/company-reviews/store/wpmudev-org" target="_blank">
|
||||
Reviews.io<i class="sui-icon-arrow-right" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-upgrade-page-header__image"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="smush-stats">
|
||||
<div class="smush-stats-item">
|
||||
<div><span>65.83</span> <?php esc_html_e( 'Billion', 'wp-smushit' ); ?></div>
|
||||
<div class="smush-stats-description"><?php esc_html_e( 'Images Optimized', 'wp-smushit' ); ?></div>
|
||||
</div>
|
||||
<div class="smush-stats-item">
|
||||
<div><span>726,410</span></div>
|
||||
<div class="smush-stats-description"><?php esc_html_e( 'Sites Optimized', 'wp-smushit' ); ?></div>
|
||||
</div>
|
||||
<div class="smush-stats-item">
|
||||
<div><span>287,038</span> GB</div>
|
||||
<div class="smush-stats-description"><?php esc_html_e( 'Total Savings', 'wp-smushit' ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-upgrade-page-features">
|
||||
<div class="sui-upgrade-page-features__header" style="margin-top: 70px">
|
||||
<h2><?php esc_html_e( 'Optimize unlimited images with Smush Pro', 'wp-smushit' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Learn why Smush Pro is the best image optimization plugin.', 'wp-smushit' ); ?></p>
|
||||
<div class="thumbnail-container">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-thumbnail@2x.png' ); ?>" alt="<?php esc_attr_e( 'Play', 'wp-smushit' ); ?>" id="wistia-play-button" role="button">
|
||||
</div>
|
||||
<span id="wistia_oegnwrdag1"></span>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var trigger = document.getElementById("wistia-play-button");
|
||||
|
||||
window.wistiaSmushEmbed = null;
|
||||
window.wistiaInit = function(Wistia) {
|
||||
window.wistiaSmushEmbed = Wistia.embed("oegnwrdag1", {
|
||||
version: "v2",
|
||||
videoWidth: 1280,
|
||||
videoHeight: 720,
|
||||
playerColor: "14485f",
|
||||
videoQuality: "hd-only",
|
||||
popover: true,
|
||||
popoverPreventScroll: true,
|
||||
popoverContent: 'html'
|
||||
});
|
||||
};
|
||||
|
||||
if (trigger) {
|
||||
trigger.addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
if (window.wistiaSmushEmbed) {
|
||||
window.wistiaSmushEmbed.play();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-upgrade-page-features">
|
||||
<div class="sui-upgrade-page-features__header">
|
||||
<h2><?php esc_html_e( 'Pro Features', 'wp-smushit' ); ?></h2>
|
||||
<p><?php esc_html_e( 'Upgrading to Pro will get you the following benefits.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-upgrade-page__container">
|
||||
<div class="sui-upgrade-page-features__items">
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-performance" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Serve images faster with Ultra Compression', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Experience up to 5x better compression than Super Smush. Optimize your images even further and make your pages load faster than ever.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<?php if( ! $can_use_background ) : ?>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-unlock" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'No limits, no restrictions', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Need a one-click bulk optimization solution to quickly and easily compress your entire image library? Remove the ‘per batch’ bulk smushing restriction and increase the image size limit from 5MB to completely unlimited.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<span class="sui-icon-loader" aria-hidden="true"></span>
|
||||
<h3><?php esc_html_e( 'Compress images in the background', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Thanks to Background Optimization, you can leave the plugin interface while images are still being compressed. Smush will continue to work its magic in the background, leaving you free to do other things!', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-web-globe-world" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Streamline your images with Smush CDN', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Use the blazing-fast Smush image CDN to automatically resize your files to the perfect size and serve WebP files (25% smaller than PNG and JPG) from 114 locations around the globe.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-photo-picture" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Serve next-gen WebP images (without Smush CDN)', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( "Prefer not to use Smush CDN? Our standalone WebP feature allows you to serve next-gen images without sacrificing quality. You can also gracefully fall back to the older image formats for browsers that aren't compatible.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-wand-magic" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Auto-convert PNGs to JPEGs (lossy)', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( "Smush looks for additional savings and automatically converts PNG files to JPEG if it will further reduce the size without a visible drop in quality. Now that's smart image compression.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-hummingbird" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Get faster sites with Hummingbird Pro', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Optimize the performance of your site and ace that Google PageSpeed score with a full caching suite, automatic asset optimization, and our blazing-fast 114-point CDN.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-graph-bar" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Automated white label reports', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Customize, style, schedule and send white label client and developer reports in just a few clicks. Each report includes embedded performance, security, SEO, and analytics data.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-hub" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Manage unlimited WP sites with The Hub', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Automate site updates, backups, security, and performance – all from one central site management dashboard. Call on our expert 24/7 live support directly from your interface at anytime.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-gdpr" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Premium WordPress plugins', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( 'Along with Smush, you get WPMU DEV’s (the developers of Smush) full suite of premium WP plugins. Covering everything from security and backups, to marketing and SEO. Use these bonus tools on unlimited sites and keep them free, forever!', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-help-support" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( '24/7 live WordPress support', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( "We can’t stress this enough: Our outstanding WordPress support is available with live chat 24/7, and we’ll help you with absolutely any WordPress issue, not just our products. It’s an expert WordPress team on call whenever you need them.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-features__item">
|
||||
<i class="sui-icon-wpmudev-logo" aria-hidden="true"></i>
|
||||
<h3><?php esc_html_e( 'Zero risk, 30-day money-back guarantee', 'wp-smushit' ); ?></h3>
|
||||
<p><?php esc_html_e( "We offer a full 30-day money-back guarantee. So if Smush isn’t the best image optimizer you’ve ever used, let us know and we’ll refund all of your money immediately.", 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-upgrade-page-cta">
|
||||
<div class="sui-upgrade-page-cta__inner">
|
||||
<h2><?php esc_html_e( 'Join 1 Million+ Happy Users', 'wp-smushit' ); ?></h2>
|
||||
<p><?php esc_html_e( "Discover why we're trusted by 97% of our customers and unlock the ultimate image optimization capabilities to deliver blazing-fast websites with stunning visuals.", 'wp-smushit' ); ?></p>
|
||||
<div>
|
||||
<a href="<?php echo esc_url( add_query_arg( 'utm_campaign', 'smush_propage_bottombutton', $upgrade_url ) ); ?>" class="sui-button sui-button-lg sui-button-purple" target="_blank">
|
||||
<?php esc_html_e( 'Get Smush Pro for a faster WP SITE', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<small>
|
||||
<?php esc_html_e( 'Includes a 30-day money-back guarantee', 'wp-smushit' ); ?>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-footer">
|
||||
<?php esc_html_e( 'Made with', 'wp-smushit' ); ?> <i class="sui-icon-heart" aria-hidden="true"></i> <?php esc_html_e( 'by WPMU DEV', 'wp-smushit' ); ?>
|
||||
</div>
|
||||
|
||||
<ul class="sui-footer-nav">
|
||||
<li><a href="https://profiles.wordpress.org/wpmudev#content-plugins" target="_blank">
|
||||
<?php esc_html_e( 'Free Plugins', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wpmudev.com/roadmap/" target="_blank">
|
||||
<?php esc_html_e( 'Roadmap', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wordpress.org/support/plugin/wp-smushit" target="_blank">
|
||||
<?php esc_html_e( 'Support', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wpmudev.com/docs/" target="_blank">
|
||||
<?php esc_html_e( 'Docs', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wpmudev.com/hub-welcome/" target="_blank">
|
||||
<?php esc_html_e( 'The Hub', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wpmudev.com/terms-of-service/" target="_blank">
|
||||
<?php esc_html_e( 'Terms of Service', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://incsub.com/privacy-policy/" target="_blank">
|
||||
<?php esc_html_e( 'Privacy Policy', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
</ul>
|
@ -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>
|
36
wp-content/plugins/wp-smushit/app/views/tabs.php
Normal file
36
wp-content/plugins/wp-smushit/app/views/tabs.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Tabs layout
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var \Smush\App\Abstract_Page $this
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-sidenav smush-sidenav">
|
||||
<ul class="sui-vertical-tabs sui-sidenav-hide-md">
|
||||
<?php foreach ( $this->get_tabs() as $tab_id => $name ) : ?>
|
||||
<li class="sui-vertical-tab <?php echo esc_attr( 'smush-' . $tab_id ); ?> <?php echo ( $tab_id === $this->get_current_tab() ) ? 'current' : null; ?>">
|
||||
<a href="<?php echo esc_url( $this->get_tab_url( $tab_id ) ); ?>">
|
||||
<?php echo esc_html( $name ); ?>
|
||||
</a>
|
||||
<?php do_action( 'wp_smush_admin_after_tab_' . $this->get_slug(), $tab_id ); ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<div class="sui-sidenav-hide-lg">
|
||||
<label class="sui-label"><?php esc_html_e( 'Navigate', 'wp-smushit' ); ?></label>
|
||||
<select class="sui-mobile-nav" style="margin-bottom: 20px;">
|
||||
<?php foreach ( $this->get_tabs() as $tab_id => $name ) : ?>
|
||||
<option value="<?php echo esc_url( $this->get_tab_url( $tab_id ) ); ?>" <?php selected( $this->get_current_tab(), $tab_id ); ?>><?php echo esc_html( $name ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* WebP disabled meta box.
|
||||
*
|
||||
* @since 3.8.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-message sui-no-padding">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-webp-default.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/graphic-smush-webp-default@2x.png' ); ?> 2x" alt="<?php esc_html_e( 'Smush WebP', 'wp-smushit' ); ?>" class="sui-image" />
|
||||
<?php endif; ?>
|
||||
<div class="sui-message-content">
|
||||
<p>
|
||||
<?php esc_html_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 on JPEGs and PNGs for browsers that don\'t support WebP.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<button class="sui-button sui-button-blue" id="smush-toggle-webp-button" data-action="enable">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Get started', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* WebP meta box header.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var boolean $is_disabled Whether the WebP module is disabled.
|
||||
* @var boolean $is_configured Whether WebP images are being served.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3 class="sui-box-title">
|
||||
<?php esc_html_e( 'Local WebP', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
|
||||
<?php if ( ! WP_Smush::is_pro() ) : ?>
|
||||
<div class="sui-actions-left">
|
||||
<span class="sui-tag sui-tag-pro sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_attr_e( 'Join WPMU DEV to use this feature', 'wp-smushit' ); ?>">
|
||||
<?php esc_html_e( 'Pro', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $is_disabled ) : ?>
|
||||
<div class="sui-actions-right">
|
||||
<span class="sui-field-prefix"><?php esc_html_e( 'Made changes?', 'wp-smushit' ); ?></span>
|
||||
<button type="button" id="smush-webp-recheck" class="sui-button sui-button-ghost" data-is-configured="<?php echo $is_configured ? '1' : '0'; ?>">
|
||||
<span class="sui-loading-text"><i class="sui-icon-update"></i><?php esc_html_e( 'Re-check status', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
203
wp-content/plugins/wp-smushit/app/views/webp/webp-meta-box.php
Normal file
203
wp-content/plugins/wp-smushit/app/views/webp/webp-meta-box.php
Normal file
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
/**
|
||||
* WebP meta box.
|
||||
*
|
||||
* @since 3.8.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var Smush\App\Abstract_Page $this Page.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$is_configured = WP_Smush::get_instance()->core()->mod->webp->get_is_configured_with_error_message();
|
||||
?>
|
||||
|
||||
<p>
|
||||
<?php esc_html_e( "Locally 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>
|
||||
|
||||
<span class="sui-settings-label" style="font-size:13px;color:#333333;font-weight: bold;">
|
||||
<?php esc_html_e( 'Status', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
|
||||
<?php if ( true === $is_configured ) : ?>
|
||||
<div class="sui-notice sui-notice-success">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
esc_html_e( 'WebP conversion is active and working well.', 'wp-smushit' );
|
||||
|
||||
if ( isset( $_SERVER['WPMUDEV_HOSTED'] ) ) :
|
||||
if ( ! apply_filters( 'wpmudev_branding_hide_doc_link', false ) ) :
|
||||
esc_html_e( " Since your site is hosted with WPMU DEV, we've automatically preconfigured the conversion for you.", 'wp-smushit' );
|
||||
else :
|
||||
esc_html_e( ' Your hosting provider has preconfigured the conversion for you.', 'wp-smushit' );
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. opening 'b' tag, 2. closing 'b' tag, 3. opening 'a' tag, 4. closing 'a' tag */
|
||||
esc_html__( '%1$sNote:%2$s You need to use the %3$sBulk Smush%4$s tool to convert all your images as WebP format. ', 'wp-smushit' ),
|
||||
'<b>',
|
||||
'</b>',
|
||||
! is_multisite() ? '<a href="' . esc_url( $this->get_url( 'smush-bulk' ) ) . '">' : '',
|
||||
( ! is_multisite() ? '</a>' : '' )
|
||||
);
|
||||
|
||||
if ( ! is_multisite() ) :
|
||||
if ( ! $this->settings->get( 'auto' ) ) {
|
||||
printf(
|
||||
/* translators: %1$s - opening link tag, %2$s - </a> */
|
||||
esc_html__( 'You can also enable %3$sAutomatic Compression%2$s to convert newly uploaded image files automatically going forward.', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( network_admin_url( 'admin.php?page=smush' ) ) . '">',
|
||||
'</a>',
|
||||
'<a href="' . esc_url( $this->get_url( 'smush-bulk' ) ) . '#column-auto">'
|
||||
);
|
||||
} else {
|
||||
esc_html_e( 'Newly uploaded images will be automatically converted to WebP format.', 'wp-smushit' );
|
||||
}
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
<?php if ( $this->settings->get( 's3' ) && ! WP_Smush::get_instance()->core()->s3->setting_status() ) : ?>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. opening 'b' tag, 2. closing 'b' tag */
|
||||
esc_html__( '%1$sNote:%2$s We noticed the Amazon S3 Integration is enabled. Offloaded images will not be served in WebP format, but Smush will still create local WebP copies of all images. If this is undesirable, please deactivate the WebP module below.', 'wp-smushit' ),
|
||||
'<b>',
|
||||
'</b>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="sui-notice sui-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-warning-alert sui-md" aria-hidden="true"></i>
|
||||
<p><?php echo esc_html( $is_configured ); ?></p>
|
||||
|
||||
<?php if ( $this->settings->get( 's3' ) && ! WP_Smush::get_instance()->core()->s3->setting_status() ) : ?>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. opening 'b' tag, 2. closing 'b' tag */
|
||||
esc_html__( '%1$sNote:%2$s We noticed the Amazon S3 Integration is enabled. Offloaded images will not be served in WebP format, but Smush will still create local WebP copies of all images. If this is undesirable, please deactivate the WebP module below.', 'wp-smushit' ),
|
||||
'<b>',
|
||||
'</b>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<button id="smush-webp-toggle-wizard" type="button" class="sui-button" style="padding-left: 14px; margin-left: 26px;">
|
||||
<span class="sui-loading-text">
|
||||
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
|
||||
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Supported Media Types', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Here\'s a list of the media types that will be converted to WebP format.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sui-box-settings-col-2">
|
||||
<span class="smush-filename-extension smush-extension-jpg">
|
||||
<?php esc_html_e( 'jpg', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="smush-filename-extension smush-extension-png">
|
||||
<?php esc_html_e( 'png', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. opening 'a' tag to docs, 2. closing 'a' tag. */
|
||||
esc_html__( 'To verify if the JPG and PNG images are being served correctly as WebP files, please refer to our %1$sDocumentation%2$s.', 'wp-smushit' ),
|
||||
'<a href="https://wpmudev.com/docs/wpmu-dev-plugins/smush/#verifying-webp-output" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Revert WebP Conversion', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'If your server storage space is full, use this feature to revert the WebP conversions by deleting all generated files. The files will fall back to normal PNGs or JPEGs once you delete them.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
<button
|
||||
type="button"
|
||||
class="sui-button sui-button-ghost"
|
||||
id="wp-smush-webp-delete-all-modal-open"
|
||||
data-modal-open="wp-smush-wp-delete-all-dialog"
|
||||
data-modal-close-focus="wp-smush-webp-delete-all-modal-open"
|
||||
>
|
||||
<span class="sui-loading-text">
|
||||
<i class="sui-icon-trash" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Delete WebP Files', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
<span class="sui-description">
|
||||
<?php
|
||||
esc_html_e( 'This feature won’t delete the WebP files converted via CDN, only the files generated via the local WebP feature.', 'wp-smushit' );
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-row">
|
||||
<div class="sui-box-settings-col-1">
|
||||
<span class="sui-settings-label">
|
||||
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'If you no longer require your images to be served in WebP format, you can disable this feature.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-settings-col-2">
|
||||
|
||||
<button class="sui-button sui-button-ghost" id="smush-toggle-webp-button" data-action="disable">
|
||||
<span class="sui-loading-text">
|
||||
<i class="sui-icon-power-on-off" aria-hidden="true"></i><?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
<span class="sui-description">
|
||||
<?php esc_html_e( 'Deactivation won’t delete existing WebP images.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user