first
This commit is contained in:
62
wp-content/plugins/wp-smushit/app/modals/directory-list.php
Normal file
62
wp-content/plugins/wp-smushit/app/modals/directory-list.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Output the content for Directory smush list dialog content.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-lg">
|
||||
<div
|
||||
role="dialog"
|
||||
id="wp-smush-list-dialog"
|
||||
class="sui-modal-content wp-smush-list-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="list-dialog-title"
|
||||
aria-describedby="list-dialog-description"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header">
|
||||
<h3 class="sui-box-title" id="list-dialog-title">
|
||||
<?php esc_html_e( 'Choose Directory', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<button class="sui-button-icon sui-button-float--right" data-modal-close="" id="dialog-close-div">
|
||||
<i class="sui-icon-close sui-md" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text"><?php esc_html_e( 'Close', 'wp-smushit' ); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-body">
|
||||
<p id="list-dialog-description">
|
||||
<?php esc_html_e( 'Choose which directory you wish to smush. Smush will automatically include any images in subdirectories of your selected directory.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<div class="sui-toggle-content" style="margin-left: 0px;margin-bottom: 30px">
|
||||
<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( 'Note: the wp-admin and wp-includes directories contain core WordPress files and are not selectable. Similarly, the auto-generated media directories in wp-content/uploads are not selectable here as they are processed by Bulk Smush.', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content"></div>
|
||||
|
||||
<?php wp_nonce_field( 'smush_get_dir_list', 'list_nonce' ); ?>
|
||||
<?php wp_nonce_field( 'smush_get_image_list', 'image_list_nonce' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-footer sui-content-right">
|
||||
<button class="sui-modal-close sui-button sui-button-blue" disabled id="wp-smush-select-dir">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Choose directory', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
191
wp-content/plugins/wp-smushit/app/modals/onboarding.php
Normal file
191
wp-content/plugins/wp-smushit/app/modals/onboarding.php
Normal file
@ -0,0 +1,191 @@
|
||||
<?php
|
||||
/**
|
||||
* Onboarding modal.
|
||||
*
|
||||
* @since 3.1
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var $cta_url string CTA URL.
|
||||
*/
|
||||
|
||||
use Smush\Core\Helper;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
$should_show_tracking_confirmation = ! is_multisite();
|
||||
$is_pro = WP_Smush::is_pro();
|
||||
$lossy_title = $is_pro ? __( 'Ultra Smush', 'wp-smushit' ) : __( 'Super Smush', 'wp-smushit' );
|
||||
$lossy_description = $is_pro ? esc_html__( 'Optimize images up to 5x more than Super Smush with our professional grade multi-pass lossy compression.', 'wp-smushit' )
|
||||
: esc_html__( 'Optimize images up to 2x more than regular smush with our multi-pass lossy compression.', 'wp-smushit' );
|
||||
$lossy_action_label = $is_pro ? __( 'Enable Ultra Smush', 'wp-smushit' ) : __( 'Enable Super Smush', 'wp-smushit' );
|
||||
?>
|
||||
|
||||
<script type="text/template" id="smush-onboarding" data-cta-url="<?php echo esc_js( $cta_url ); ?>" data-type="<?php echo WP_Smush::is_pro() ? 'pro' : 'free'; ?>">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-sides--90">
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<figure class="sui-box-banner" aria-hidden="true">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding/graphic-onboarding-' ); ?>{{{ data.slide }}}.png"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding/graphic-onboarding-' ); ?>{{{ data.slide }}}.png 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding/graphic-onboarding-' ); ?>{{{ data.slide }}}@2x.png 2x"
|
||||
alt="<?php esc_attr_e( 'Smush Onboarding Modal', 'wp-smushit' ); ?>" class="sui-image sui-image-center"
|
||||
>
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
|
||||
<h3 class="sui-box-title sui-lg" id="smush-title-onboarding-dialog">
|
||||
<# if ( data.first_slide === data.slide ) { #>
|
||||
<?php
|
||||
|
||||
/* translators: %s: current user name */
|
||||
printf( esc_html__( 'Hey, %s!', 'wp-smushit' ), esc_html( Helper::get_user_name() ) );
|
||||
?>
|
||||
<# } else if ( 'auto' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Automatic Compression', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lossy' === data.slide ) { #>
|
||||
<?php echo esc_html( $lossy_title ); ?>
|
||||
<# } else if ( 'strip_exif' === data.slide ) { #>
|
||||
<?php esc_html_e( 'EXIF Metadata', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'original' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Full Size Images', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lazy_load' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?>
|
||||
<# } #>
|
||||
</h3>
|
||||
|
||||
<p class="sui-description" id="smush-description-onboarding-dialog">
|
||||
<# if ( data.first_slide === data.slide ) { #>
|
||||
<?php esc_html_e( "Nice work installing Smush! Let's get started by choosing how you want this plugin to work, and then let Smush do all the heavy lifting for you.", 'wp-smushit' ); ?>
|
||||
<# } else if ( 'auto' === data.slide ) { #>
|
||||
<?php esc_html_e( 'When you upload images to your site, Smush can automatically optimize and compress them for you saving you having to do this manually.', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lossy' === data.slide ) { #>
|
||||
<?php echo esc_html( $lossy_description ); ?>
|
||||
<# } else if ( 'strip_exif' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Photos often store camera settings in the file, i.e., focal length, date, time and location. Removing EXIF data reduces the file size. Note: it does not strip SEO metadata.', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'original' === data.slide ) { #>
|
||||
<?php esc_html_e( 'You can also have Smush compress your original images - this is helpful if your theme serves full size images.', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lazy_load' === data.slide ) { #>
|
||||
<?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>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="sui-box-body sui-content-center sui-spacing-sides--0">
|
||||
<# if ( data.first_slide === data.slide ) { #>
|
||||
<?php if ( $should_show_tracking_confirmation ) : ?>
|
||||
<div class="smush-onboarding-tracking-box">
|
||||
<label for="{{{ data.slide }}}" class="sui-checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="{{{ data.slide }}}"
|
||||
aria-labelledby="{{{ data.slide }}}-label"
|
||||
<# if ( data.value ) { #>checked<# } #>/>
|
||||
|
||||
<span aria-hidden="true"></span>
|
||||
|
||||
<span id="{{{ data.slide }}}-label">
|
||||
<?php
|
||||
/* translators: %1$: start bold tag %2$: end of the bold tag */
|
||||
echo sprintf( esc_html__( 'Share %1$sanonymous%2$s usage data to help us improve your Smush experience (recommended).', 'wp-smushit' ), '<strong>', '</strong>' );
|
||||
?>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a class="sui-button sui-button-blue sui-button-icon-right next" onclick="WP_Smush.onboarding.next(this)">
|
||||
<?php esc_html_e( 'Begin setup', 'wp-smushit' ); ?>
|
||||
<i class="sui-icon-chevron-right" aria-hidden="true"> </i>
|
||||
</a>
|
||||
<# } else { #>
|
||||
<div class="sui-box-selectors">
|
||||
<label for="{{{ data.slide }}}" class="sui-toggle">
|
||||
<input type="checkbox" id="{{{ data.slide }}}" aria-labelledby="{{{ data.slide }}}-label" <# if ( data.value ) { #>checked<# } #>>
|
||||
<span class="sui-toggle-slider" aria-hidden="true"> </span>
|
||||
<span id="{{{ data.slide }}}-label" class="sui-toggle-label">
|
||||
<# if ( 'auto' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Automatically optimize new uploads', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lossy' === data.slide ) { #>
|
||||
<?php echo esc_html( $lossy_action_label ); ?>
|
||||
<# } else if ( 'strip_exif' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Strip my image metadata', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'original' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Compress my full size images', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'lazy_load' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Enable Lazy Loading', 'wp-smushit' ); ?>
|
||||
<# } #>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
<# if ( 'original' === data.slide ) { #>
|
||||
<p class="sui-description" style="padding: 0 90px">
|
||||
<?php esc_html_e( 'Note: By default we will store a copy of your original uploads just in case you want to revert in the future - you can turn this off at any time.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<# } else if ( data.last ) { #>
|
||||
<button type="submit" class="sui-button sui-button-blue sui-button-icon-left" data-modal-close="">
|
||||
<i class="sui-icon-check" aria-hidden="true"> </i>
|
||||
<?php esc_html_e( 'Finish setup wizard', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<# } #>
|
||||
|
||||
<# if ( data.first_slide !== data.slide && ! data.last ) { #>
|
||||
<a class="sui-button sui-button-gray next" onclick="WP_Smush.onboarding.next(this)">
|
||||
<?php esc_html_e( 'Next', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<# } #>
|
||||
|
||||
<div class="smush-onboarding-arrows">
|
||||
<a href="#" class="previous <# if ( data.first ) { #>sui-hidden<# } #>" onclick="WP_Smush.onboarding.next(this)">
|
||||
<i class="sui-icon-chevron-left" aria-hidden="true"> </i>
|
||||
</a>
|
||||
<a href="#" class="next <# if ( data.last ) { #>sui-hidden<# } #>" onclick="WP_Smush.onboarding.next(this)">
|
||||
<i class="sui-icon-chevron-right" aria-hidden="true"> </i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-footer sui-flatten sui-content-center">
|
||||
<div class="sui-box-steps sui-sm">
|
||||
<button onclick="WP_Smush.onboarding.goTo(data.first_slide)" class="<# if ( data.first_slide === data.slide ) { #>sui-current<# } #>" <# if ( data.first_slide === data.slide ) { #>disabled<# } #>>
|
||||
<?php esc_html_e( 'First step', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button onclick="WP_Smush.onboarding.goTo('auto')" class="<# if ( 'auto' === data.slide ) { #>sui-current<# } #>" <# if ( 'auto' === data.slide ) { #>disabled<# } #>>
|
||||
<?php esc_html_e( 'Automatic Compression', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button onclick="WP_Smush.onboarding.goTo('lossy')" class="<# if ( 'lossy' === data.slide ) { #>sui-current<# } #>" <# if ( 'lossy' === data.slide ) { #>disabled<# } #>>
|
||||
<?php echo esc_html( $lossy_title ); ?>
|
||||
</button>
|
||||
<button onclick="WP_Smush.onboarding.goTo('strip_exif')" class="<# if ( 'strip_exif' === data.slide ) { #>sui-current<# } #>" <# if ( 'strip_exif' === data.slide ) { #>disabled<# } #>>
|
||||
<?php esc_html_e( 'EXIF Metadata', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<?php if ( WP_Smush::is_pro() ) : ?>
|
||||
<button onclick="WP_Smush.onboarding.goTo('original')" class="<# if ( 'original' === data.slide ) { #>sui-current<# } #>" <# if ( 'original' === data.slide ) { #>disabled<# } #>>
|
||||
<?php esc_html_e( 'Full Size Images', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<button onclick="WP_Smush.onboarding.goTo('lazy_load')" class="<# if ( 'lazy_load' === data.slide ) { #>sui-current<# } #>" <# if ( 'lazy_load' === data.slide ) { #>disabled<# } #>>
|
||||
<?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<div class="sui-modal sui-modal-md">
|
||||
<div
|
||||
role="dialog"
|
||||
id="smush-onboarding-dialog"
|
||||
class="sui-modal-content smush-onboarding-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-title-onboarding-dialog"
|
||||
aria-describedby="smush-description-onboarding-dialog"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div id="smush-onboarding-content" aria-live="polite"></div>
|
||||
<input type="hidden" id="smush_quick_setup_nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'smush_quick_setup' ) ); ?>">
|
||||
</div>
|
||||
<button class="sui-modal-skip smush-onboarding-skip-link">
|
||||
<?php esc_html_e( 'Skip this, I’ll set it up later', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
113
wp-content/plugins/wp-smushit/app/modals/progress-dialog.php
Normal file
113
wp-content/plugins/wp-smushit/app/modals/progress-dialog.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* Output the progress dialog for the Directory smush list dialog
|
||||
*
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
use Smush\Core\Core;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-lg">
|
||||
<div
|
||||
role="dialog"
|
||||
id="wp-smush-progress-dialog"
|
||||
class="sui-modal-content wp-smush-progress-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="progress-dialog-title"
|
||||
aria-describedby="progress-dialog-description"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header">
|
||||
<h3 class="sui-box-title" id="progress-dialog-title">
|
||||
<?php esc_html_e( 'Choose Directory', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
<button class="sui-button-icon sui-button-float--right" data-modal-close="" id="dialog-close-div">
|
||||
<i class="sui-icon-close sui-md" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text"><?php esc_html_e( 'Close', 'wp-smushit' ); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-body">
|
||||
<p id="progress-dialog-description">
|
||||
<?php esc_html_e( 'Bulk smushing is in progress, you need to leave this tab open until the process completes.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$this->view( 'bulk/limit-reached-notice' );
|
||||
?>
|
||||
|
||||
<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>0%</span>
|
||||
</div>
|
||||
<div class="sui-progress-bar" aria-hidden="true">
|
||||
<span style="width: 0"></span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="sui-button-icon sui-tooltip" id="cancel-directory-smush" type="button" data-tooltip="<?php esc_attr_e( 'Cancel', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-progress-state">
|
||||
<span class="sui-progress-state-text">
|
||||
<?php esc_html_e( '-/- images optimized', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="smush-scan-error-notice" class="sui-notice sui-notice-error">
|
||||
<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
|
||||
$support_url = WP_Smush::is_pro() ? 'https://wpmudev.com/hub2/support/#get-support' : 'https://wordpress.org/support/plugin/wp-smushit/';
|
||||
|
||||
printf(
|
||||
/* translators: error message placeholder */
|
||||
esc_html__( 'Smush has encountered a %s error while attempting to compress the selected images.', 'wp-smushit' ),
|
||||
'<span id="smush-scan-error"></span>'
|
||||
)
|
||||
?>
|
||||
<span class="smush-403-error-message">
|
||||
<?php esc_html_e( 'This blockage may be caused by an active plugin, firewall, or file permission setting. Disable or reconfigure the blocker before trying again.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. opening 'a' tag with the support link, 2. closing 'a' tag */
|
||||
esc_html__( 'Please contact our %1$ssupport%2$s team if the issue persists.', 'wp-smushit' ),
|
||||
'<a href="' . esc_url( $support_url ) . '" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-footer">
|
||||
<button class="sui-modal-close sui-button sui-button-ghost wp-smush-cancel-dir" data-modal-closez="">
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'CANCEL', 'wp-smushit' ); ?></span>
|
||||
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
|
||||
</button>
|
||||
|
||||
<button class="sui-button wp-smush-resume-scan">
|
||||
<span class="sui-icon-play" aria-hidden="true"></span><?php esc_html_e( 'RESUME', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
46
wp-content/plugins/wp-smushit/app/modals/reset-settings.php
Normal file
46
wp-content/plugins/wp-smushit/app/modals/reset-settings.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Reset settings modal.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-sm">
|
||||
<div
|
||||
role="dialog"
|
||||
id="reset-settings-dialog"
|
||||
class="sui-modal-content reset-settings-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="reset-settings-dialog-title"
|
||||
aria-describedby="reset-settings-dialog-description"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--40">
|
||||
<h3 class="sui-box-title sui-lg" id="reset-settings-dialog-title">
|
||||
<?php esc_html_e( 'Reset Settings', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
|
||||
<p class="sui-description" id="reset-settings-dialog-description">
|
||||
<?php esc_html_e( 'Are you sure you want to reset Smush’s settings back to the factory defaults?', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="sui-box-body sui-content-center">
|
||||
<input type="hidden" id="wp_smush_reset" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( 'wp_smush_reset' ) ); ?>">
|
||||
<a class="sui-button sui-button-ghost" data-modal-close="">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<a class="sui-button sui-button-ghost sui-button-red sui-button-icon-left" onclick="WP_Smush.helpers.resetSettings()" id="reset-setting-confirm">
|
||||
<i class="sui-icon-trash" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Reset settings', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
179
wp-content/plugins/wp-smushit/app/modals/restore-images.php
Normal file
179
wp-content/plugins/wp-smushit/app/modals/restore-images.php
Normal file
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
/**
|
||||
* Restore images modal.
|
||||
*
|
||||
* @since 3.2.2
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/template" id="smush-bulk-restore">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
|
||||
<# if ( 'progress' === data.slide ) { #>
|
||||
<i class="sui-icon-loader sui-loading sui-lg" aria-hidden="true"></i>
|
||||
<# } else if ( 'finish' === data.slide ) { #>
|
||||
<i class="sui-icon-check sui-lg" aria-hidden="true"></i>
|
||||
<# } #>
|
||||
<h3 class="sui-box-title sui-lg" id="smush-restore-images-dialog-title">
|
||||
<# if ( 'start' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Restore Thumbnails', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'progress' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Restoring images...', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'finish' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Restore complete', 'wp-smushit' ); ?>
|
||||
<# } #>
|
||||
</h3>
|
||||
|
||||
<button class="sui-button-icon sui-button-float--right" onclick="WP_Smush.restore.cancel()">
|
||||
<i class="sui-icon-close sui-md" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text"><?php esc_html_e( 'Close this modal', 'wp-smushit' ); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-body sui-flatten sui-content-center sui-spacing-top--20 sui-spacing-bottom--50">
|
||||
<p class="sui-description" id="smush-restore-images-dialog-description">
|
||||
<# if ( 'start' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Are you sure you want to restore all image thumbnails to their original, non-optimized states?', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'progress' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Your bulk restore is still in progress, please leave this tab open while the process runs.', 'wp-smushit' ); ?>
|
||||
<# } else if ( 'finish' === data.slide ) { #>
|
||||
<?php esc_html_e( 'Your bulk restore has finished running.', 'wp-smushit' ); ?>
|
||||
<# } #>
|
||||
</p>
|
||||
|
||||
<div class="sui-block-content-center">
|
||||
<# if ( 'start' === data.slide ) { #>
|
||||
<button class="sui-button sui-button-ghost" onclick="WP_Smush.restore.cancel()" data-modal-close="">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button class="sui-button" id="smush-bulk-restore-button">
|
||||
<?php esc_html_e( 'Confirm', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<# } else if ( 'progress' === data.slide ) { #>
|
||||
<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>0%</span>
|
||||
</div>
|
||||
<div class="sui-progress-bar" aria-hidden="true">
|
||||
<span style="width: 0"></span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="sui-button-icon sui-tooltip" onclick="WP_Smush.restore.cancel()" type="button" data-tooltip="<?php esc_attr_e( 'Cancel', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-progress-state">
|
||||
<span class="sui-progress-state-text">
|
||||
<?php esc_html_e( 'Initializing restore...', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
<# } else if ( 'finish' === data.slide ) { #>
|
||||
<# if ( 0 === data.errors.length ) { #>
|
||||
<div class="sui-notice sui-notice-success" style="text-align: left">
|
||||
<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>{{{ data.success }}}
|
||||
<?php esc_html_e( 'images were successfully restored.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="sui-button" onclick="window.location.reload()" data-modal-close="" type="button">
|
||||
<?php esc_html_e( 'Finish', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<# } else { #>
|
||||
<div class="sui-notice sui-notice-warning" style="text-align: left">
|
||||
<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>{{{ data.success }}}/{{{ data.total }}}
|
||||
<?php esc_html_e( 'images were successfully restored but some were unrecoverable. You can try again, or re-upload these images.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
<# } #>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<# if ( 'finish' === data.slide && 0 < data.errors.length ) { #>
|
||||
<div class="smush-final-log">
|
||||
<div class="smush-bulk-errors" style="margin-top: -30px;">
|
||||
<# for ( let i = 0, len = data.errors.length; i < len; i++ ) { #>
|
||||
<div class="smush-bulk-error-row sui-no-margin">
|
||||
<div class="smush-bulk-image-data">
|
||||
<# if ( data.errors[i].thumb ) { #>
|
||||
{{{ data.errors[i].thumb }}}
|
||||
<# } else { #>
|
||||
<i class="sui-icon-photo-picture" aria-hidden="true"></i>
|
||||
<# } #>
|
||||
<span class="smush-image-name">{{{ data.errors[i].src }}}</span>
|
||||
</div>
|
||||
<div class="smush-bulk-image-actions">
|
||||
<a class="sui-button-icon" href="{{{ data.errors[i].link }}}">
|
||||
<i class="sui-icon-arrow-right" aria-hidden="true"></i>
|
||||
</a>
|
||||
<span class="sui-screen-reader-text">
|
||||
<?php esc_html_e( 'View item in Media Library', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="sui-description sui-margin-left sui-margin-right">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Open a link <a>, 2: Close the link </a> */
|
||||
esc_html__( "Note: You can find all the images which couldn't be restored (still smushed) in your %1\$sMedia Library%2\$s.", 'wp-smushit' ),
|
||||
'<a href="' . esc_url( admin_url( 'upload.php' ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<div class="sui-box-footer sui-flatten sui-no-padding-top">
|
||||
<div class="sui-actions-left">
|
||||
<button class="sui-button sui-button-ghost" onclick="WP_Smush.restore.cancel()" data-modal-close="">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<button class="sui-button" id="smush-bulk-restore-button">
|
||||
<i class="sui-icon-update" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Retry', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
</script>
|
||||
|
||||
|
||||
<div class="sui-modal sui-modal-sm">
|
||||
<div
|
||||
role="dialog"
|
||||
id="smush-restore-images-dialog"
|
||||
class="sui-modal-content smush-restore-images-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-restore-images-dialog-title"
|
||||
aria-describedby="smush-restore-images-dialog-description"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div id="smush-bulk-restore-content" aria-live="polite"></div>
|
||||
<?php wp_nonce_field( 'smush_bulk_restore' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Scan error notice for lower resource site on background dead.
|
||||
*/
|
||||
|
||||
use Smush\Core\Helper;
|
||||
|
||||
$recheck_images_link = Helper::get_recheck_images_link();
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-sm">
|
||||
<div
|
||||
role="dialog"
|
||||
id="smush-retry-scan-notice"
|
||||
class="sui-modal-content smush-retry-scan-notice"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-retry-scan-notice-title"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
|
||||
<button type="button" class="sui-button-icon sui-button-float--right" data-modal-close="">
|
||||
<span class="sui-icon-close sui-md" aria-hidden="true"></span>
|
||||
<span class="sui-screen-reader-text">
|
||||
<?php esc_html_e( 'Close this dialog.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</button>
|
||||
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Smush Encountered an Error', 'wp-smushit' ); ?></h3>
|
||||
</div>
|
||||
<div class="sui-box-body sui-content-center sui-spacing-sides--30">
|
||||
<div class="smush-retry-scan-notice-content">
|
||||
<div class="sui-notice sui-notice-error">
|
||||
<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( 'Oops! Our scan hit an error due to limited resources on your site.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<?php esc_html_e( 'No worries, we have adjusted the scan to use fewer resources the next time.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--40">
|
||||
<a href="<?php echo esc_url( $recheck_images_link ); ?>" class="sui-button sui-button-ghost smush-retry-scan-notice-button">
|
||||
<?php esc_html_e( 'Retry Scan', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
47
wp-content/plugins/wp-smushit/app/modals/stop-scanning.php
Normal file
47
wp-content/plugins/wp-smushit/app/modals/stop-scanning.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Stop scanning media library modal.
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-md">
|
||||
<div
|
||||
role="dialog"
|
||||
id="smush-stop-scanning-dialog"
|
||||
class="sui-modal-content smush-stop-scanning-dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-stop-scanning-dialog-title"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
|
||||
<button type="button" class="sui-button-icon sui-button-float--right" data-modal-close="">
|
||||
<span class="sui-icon-close sui-md" aria-hidden="true"></span>
|
||||
<span class="sui-screen-reader-text">
|
||||
<?php esc_html_e( 'Close this dialog.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</button>
|
||||
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Stop Scanning Media Library', 'wp-smushit' ); ?></h3>
|
||||
<p class="sui-description">
|
||||
<?php esc_html_e( 'Are you sure you want to cancel the media library scan? This is an irreversible process and will require a rescan for accurate statistics.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="sui-box-footer sui-flatten sui-content-center">
|
||||
<button type="button" class="sui-button sui-button-ghost" data-modal-close="">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button type="button" class="sui-button smush-stop-scanning-dialog-button" data-modal-close="">
|
||||
<?php esc_html_e( 'Stop Scan', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?>
|
||||
<div class="smush-stop-scanning-dialog-footer-background">
|
||||
<figure class="sui-box-banner" aria-hidden="true">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/stop-scanning/background.png' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/stop-scanning/background.png' ); ?> 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/stop-scanning/background' ); ?>@2x.png 2x"
|
||||
alt="<?php esc_attr_e( 'Background stop scanning modal', 'wp-smushit' ); ?>" class="sui-image sui-image-center">
|
||||
</figure>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
59
wp-content/plugins/wp-smushit/app/modals/updated.php
Normal file
59
wp-content/plugins/wp-smushit/app/modals/updated.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Show Updated Features modal.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @var string $cta_url URL for the modal's CTA button.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-md">
|
||||
<div
|
||||
role="dialog"
|
||||
id="smush-updated-dialog"
|
||||
class="sui-modal-content smush-updated-dialog wp-smush-modal-dark-background"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-title-updated-dialog"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-sides--20">
|
||||
<figure class="sui-box-banner" aria-hidden="true">
|
||||
<img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/smush-ultra-compression.jpg' ); ?>"
|
||||
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/smush-ultra-compression.jpg' ); ?> 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/bulk-smush/smush-ultra-compression' ); ?>@2x.jpg 2x"
|
||||
alt="<?php esc_attr_e( 'Smush Updated Modal', 'wp-smushit' ); ?>" class="sui-image sui-image-center">
|
||||
</figure>
|
||||
|
||||
<button class="sui-button-icon sui-button-float--right sui-button-white" style="box-shadow:none!important" onclick="WP_Smush.onboarding.hideUpgradeModal(event, this)">
|
||||
<i class="sui-icon-close sui-md" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-body sui-content-center sui-spacing-sides--30 sui-spacing-top--40 sui-spacing-bottom--40">
|
||||
<h3 class="sui-box-title sui-lg" id="smush-title-updated-dialog" style="white-space: normal">
|
||||
<?php esc_html_e( 'New: Serve images faster with Ultra Smush', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
|
||||
<p class="sui-description">
|
||||
<?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. Level up your site performance with Ultra Smush now.', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<?php
|
||||
if ( $cta_url ) {
|
||||
?>
|
||||
<a href="<?php echo esc_js( $cta_url ); ?>" class="sui-button sui-button-blue" onclick="WP_Smush.onboarding.hideUpgradeModal(event, this)">
|
||||
<?php esc_html_e( 'Go to Settings', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
64
wp-content/plugins/wp-smushit/app/modals/webp-delete-all.php
Normal file
64
wp-content/plugins/wp-smushit/app/modals/webp-delete-all.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Delete all webp files modal.
|
||||
*
|
||||
* @since 3.8.0
|
||||
* @package WP_Smush
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-modal sui-modal-sm">
|
||||
<div
|
||||
role="dialog"
|
||||
id="wp-smush-wp-delete-all-dialog"
|
||||
class="sui-modal-content smush-dawif sui-content-fade-in"
|
||||
aria-modal="true"
|
||||
aria-labelledby="smush-dawif-title"
|
||||
aria-describedby="smush-dawif-description"
|
||||
>
|
||||
<div class="sui-box">
|
||||
<div id="smush-dawif-content">
|
||||
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
|
||||
<button type="button" class="sui-button-icon sui-button-float--right" data-modal-close>
|
||||
<i class="sui-icon-close sui-md" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text"><?php esc_html_e( 'Close this modal', 'wp-smushit' ); ?></span>
|
||||
</button>
|
||||
|
||||
<h3 class="sui-box-title sui-lg" id="smush-dawif-title">
|
||||
<?php esc_html_e( 'Delete WebP files', 'wp-smushit' ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="sui-box-body sui-flatten sui-content-center sui-spacing-top--20 sui-spacing-bottom--50">
|
||||
<p class="sui-description" id="smush-dawif-description" style="margin-bottom:15px;">
|
||||
<?php esc_html_e( 'Are you sure you want to delete all WebP files?', 'wp-smushit' ); ?>
|
||||
</p>
|
||||
<div
|
||||
id="wp-smush-webp-delete-all-error-notice"
|
||||
class="sui-notice sui-notice-error"
|
||||
style="margin-bottom:15px;"
|
||||
role="alert"
|
||||
aria-live="assertive"
|
||||
></div>
|
||||
<div class="sui-block-content-center" style="padding-top:15px;">
|
||||
<button type="button" class="sui-button sui-button-ghost" data-modal-close="">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
id="wp-smush-webp-delete-all"
|
||||
class="sui-button sui-button-red"
|
||||
>
|
||||
<span class="sui-loading-text"><?php esc_html_e( 'Delete', 'wp-smushit' ); ?></span>
|
||||
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user