CMS Project Sync

This commit is contained in:
2026-04-15 15:59:53 -04:00
parent 015ea75186
commit a747e2a1d9
11220 changed files with 2590467 additions and 0 deletions
@@ -0,0 +1,184 @@
<?php
/**
* Deactivation Survey Modal
*/
use Smush\Core\Helper;
use Smush\Core\Hub_Connector;
use Smush\Core\Membership\Membership;
$docs_link = Helper::get_utm_link(
array(
'utm_campaign' => 'smush_deactivation_survey_help',
),
'https://wpmudev.com/hub2/support/'
);
?>
<div class="<?php echo esc_attr( WP_SHARED_UI_VERSION ); ?>">
<div class="sui-wrap">
<div class="sui-modal sui-modal-lg">
<div
role="dialog"
id="wp-smush-deactivation-survey-modal"
class="sui-modal-content wp-smush-deactivation-survey-modal"
aria-modal="true"
aria-labelledby="title-wp-smush-deactivation-survey-modal"
aria-describedby="desc-wp-smush-deactivation-survey-modal"
>
<div class="sui-box" role="document">
<div class="sui-box-header">
<h3 class="sui-box-title" style="white-space: nowrap;">
<img style="margin-right:6px" src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-config-icon.png' ); ?>" width="30" srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/smush-config-icon.png' ); ?> 2x" alt="<?php esc_attr_e( 'Smush', 'wp-smushit' ); ?>" aria-hidden="true" />
<?php esc_html_e( 'Deactivate Smush?', 'wp-smushit' ); ?>
</h3>
<div class="sui-actions-right">
<button type="button" class="sui-button-icon" onclick="window.SUI?.closeModal( true );">
<span class="sui-icon-close sui-md" aria-hidden="true"></span>
<span class="sui-screen-reader-text"><?php esc_html_e( 'Close this dialog window', 'wp-smushit' ); ?></span>
</button>
</div>
</div>
<div class="sui-box-body">
<p class="sui-description">
<?php
printf(
/* translators: %s: Support link */
esc_html__( 'Please tell us why. Your feedback helps us improve. %s', 'wp-smushit' ),
''
);
?>
</p>
<div class="smush-deactivation-field-row">
<label for="smush-temp-deactivate-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'What issue are you debugging? (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-temp-deactivate-field"
aria-labelledby="label-smush-temp-deactivate-field"
value="temp_deactivate"
/>
<span aria-hidden="true"></span>
<span id="label-smush-temp-deactivate-field"><?php esc_html_e( 'Temporary deactivation for debugging', 'wp-smushit' ); ?></span>
</label>
</div>
<div class="smush-deactivation-field-row">
<label for="smush-not-working-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'What issue did you face? (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-not-working-field"
aria-labelledby="label-smush-not-working-field"
value="not_working"
/>
<span aria-hidden="true"></span>
<span id="label-smush-not-working-field"><?php esc_html_e( "Can't make it work", 'wp-smushit' ); ?></span>
</label>
</div>
<div class="smush-deactivation-field-row">
<label for="smush-breaks-site-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'What issue did you face? (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-breaks-site-field"
aria-labelledby="label-smush-breaks-site-field"
value="breaks_site"
/>
<span aria-hidden="true"></span>
<span id="label-smush-breaks-site-field"><?php esc_html_e( 'Breaks the site or other plugins/services', 'wp-smushit' ); ?></span>
</label>
</div>
<?php
if ( Hub_Connector::is_logged_in() || Membership::get_instance()->is_api_hub_access_required() ) :
?>
<div class="smush-deactivation-field-row">
<label for="requires-hub-connection" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'Tell us more (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="requires-hub-connection"
aria-labelledby="label-requires-hub-connection"
value="requires_hub_connection"
/>
<span aria-hidden="true"></span>
<span id="label-requires-hub-connection"><?php esc_html_e( 'Requires connecting site to Smush API', 'wp-smushit' ); ?></span>
</label>
</div>
<?php endif; ?>
<div class="smush-deactivation-field-row">
<label for="smush-expected-beter-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'What could we do better? (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-expected-beter-field"
aria-labelledby="label-smush-expected-beter-field"
value="expected_better"
/>
<span aria-hidden="true"></span>
<span id="label-smush-expected-beter-field"><?php esc_html_e( "Doesn't meet expectations", 'wp-smushit' ); ?></span>
</label>
</div>
<div class="smush-deactivation-field-row">
<label for="smush-found-better-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'Which plugin and how is it better? (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-found-better-field"
aria-labelledby="label-smush-found-better-field"
value="found_better"
/>
<span aria-hidden="true"></span>
<span id="label-smush-found-better-field"><?php esc_html_e( 'Found a better plugin', 'wp-smushit' ); ?></span>
</label>
</div>
<div class="smush-deactivation-field-row">
<label for="smush-not-required-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'Please tell us why. (optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-not-required-field"
aria-labelledby="label-smush-not-required-field"
value="not_required"
/>
<span aria-hidden="true"></span>
<span id="label-smush-not-required-field"><?php esc_html_e( 'No longer required', 'wp-smushit' ); ?></span>
</label>
</div>
<div class="smush-deactivation-field-row">
<label for="smush-other-field" class="sui-radio smush-deactivation-field" data-placeholder="<?php esc_html_e( 'Please tell us why. (Optional)', 'wp-smushit' ); ?>">
<input
type="radio"
name="deactivation_reason"
id="smush-other-field"
aria-labelledby="label-smush-other-field"
value="other_issues"
/>
<span aria-hidden="true"></span>
<span id="label-smush-other-field"><?php esc_html_e( 'Other', 'wp-smushit' ); ?></span>
</label>
<div id="smush-deactivation-user-message-field" class="sui-hidden" style="padding-left:25px; margin:10px 0;">
<textarea
placeholder="<?php esc_html_e( 'Please tell us why. (optional)', 'wp-smushit' ); ?>"
class="sui-form-control"
aria-labelledby="label-smush-deactivation-user-message"
style="height: 40px"
aria-describedby="error-smush-deactivation-user-message description-smush-deactivation-user-message"
></textarea>
</div>
</div>
</div>
<div class="sui-box-footer">
<button type="button" class="sui-button-ghost sui-button smush-skip-deactivate-button"><?php esc_html_e( 'Skip & Deactivate', 'wp-smushit' ); ?></button>
<div class="sui-actions-right">
<button type="button" class="sui-button-blue sui-button smush-submit-deactivate-button"><?php esc_html_e( 'Submit & Deactivate', 'wp-smushit' ); ?></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -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>
@@ -0,0 +1,52 @@
<?php
/**
* Disable backup original images modal.
*
* @since 3.24.0
* @package WP_Smush
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
?>
<div class="sui-modal sui-modal-sm">
<div
role="dialog"
id="smush-backup-original-images-dialog"
class="sui-modal-content smush-backup-original-images-dialog"
aria-modal="true"
aria-labelledby="smush-backup-original-images-dialog-title"
aria-describedby="smush-backup-original-images-dialog-description"
>
<div class="sui-box">
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
<h3 class="sui-box-title sui-lg">
<?php esc_html_e( 'Turn off backups?', 'wp-smushit' ); ?>
</h3>
<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>
</div>
<div class="sui-box-body sui-flatten sui-content-center sui-spacing-top--20 sui-spacing-bottom--50">
<p class="sui-description">
<?php esc_html_e( 'If you turn this off, Smush wont save backups of your originals, and you wont be able to restore them later.', 'wp-smushit' ); ?>
</p>
<div class="sui-block-content-center">
<button type="button" class="sui-button sui-button-ghost" data-modal-close="">
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
</button>
<button class="sui-button" onclick="document.getElementById('backup').checked=false;" data-modal-close="">
<?php esc_html_e( 'Proceed', 'wp-smushit' ); ?>
</button>
</div>
</div>
</div>
</div>
</div>
@@ -0,0 +1,75 @@
<?php
/**
* Disconnect site modal.
*
* @since 3.22.0
* @package Smush
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<div class="sui-modal sui-modal-sm">
<div
role="dialog"
id="smush-disconnect-site-modal"
class="sui-modal-content smush-disconnect-site-modal"
aria-modal="true"
aria-labelledby="smush-disconnect-site-modal-title"
>
<div class="sui-box">
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
<button class="sui-button-icon sui-button-float--right" id="dialog-close-div" 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 window', 'wp-smushit' ); ?></span>
</button>
<h3 id="smush-disconnect-site-modal-title" class="sui-box-title sui-lg" style="white-space: inherit">
<?php esc_html_e( 'Disconnect Site?', 'wp-smushit' ); ?>
</h3>
<p class="sui-description">
<?php esc_html_e( 'Disconnecting this site will disable key Bulk Smush features and other connected WPMU DEV tools and services.', 'wp-smushit' ); ?>
</p>
</div>
<div class="sui-box-body sui-spacing-top--20">
<div class="smush-disconnect-notice">
<div class="sui-notice-content">
<div class="sui-notice-message">
<h4><?php esc_html_e( 'Youll lose the following key Smush features:', 'wp-smushit' ); ?></h4>
<ul>
<li><span class="sui-icon-cross-close" aria-hidden="true"></span><?php esc_html_e( 'Bulk Smush', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-cross-close" aria-hidden="true"></span><?php esc_html_e( 'Image Optimization', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-cross-close" aria-hidden="true"></span><?php esc_html_e( 'Automatic Compression', 'wp-smushit' ); ?></li>
<li style="display:flex"><span class="sui-icon-cross-close" aria-hidden="true"></span><?php esc_html_e( 'Premium WPMU DEV services and site management tools', 'wp-smushit' ); ?></li
</ul>
</div>
</div>
</div>
<div class="sui-form-field" style="margin-top: 20px;">
<textarea
placeholder="<?php esc_attr_e( 'Mind sharing why youre disconnecting?', 'wp-smushit' ); ?>"
id="smush-disconnect-site-message"
class="sui-form-control"
style="height:40px"
></textarea>
</div>
</div>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--40">
<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 sui-button-gray" onclick="WP_Smush.adminAjax.disconnectSite(this);">
<span class="sui-button-text-default">
<span class="sui-icon-plug-disconnected" aria-hidden="true"></span>
<?php esc_html_e( 'Disconnect site', 'wp-smushit' ); ?>
</span>
<span class="sui-button-text-onload">
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
<?php esc_html_e( 'Disconnect site', 'wp-smushit' ); ?>
</span>
</button>
</div>
</div>
</div>
</div>
@@ -0,0 +1,108 @@
<?php
/**
* Site connected modal.
*
* @since 3.22.0
* @package Smush
*/
use Smush\Core\Membership\Membership;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$feature_list = array(
__( 'Instant access to Bulk Smush API.', 'wp-smushit' ),
);
$feature_list = array_merge(
$feature_list,
array(
__( 'Unlimited bulk smushing.', 'wp-smushit' ),
__( 'Directory Smush.', 'wp-smushit' ),
__( 'Auto smushing on upload.', 'wp-smushit' ),
)
);
?>
<div class="sui-modal sui-modal-sm">
<div
role="dialog"
id="smush-hub-connection-success-modal"
class="sui-modal-content smush-hub-connection-success-modal"
aria-modal="true"
aria-labelledby="smush-hub-connection-success-modal-title"
>
<div class="sui-box">
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60">
<button class="sui-button-icon sui-button-float--right" id="dialog-close-div" 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 window', 'wp-smushit' ); ?></span>
</button>
<span class="sui-icon-check-tick sui-success sui-xl" aria-hidden="true"></span>
<h3 id="smush-hub-connection-success-modal-title" class="sui-box-title sui-lg" style="white-space: inherit">
<?php esc_html_e( 'Site connected successfully!', 'wp-smushit' ); ?>
</h3>
</div>
<div class="sui-box-body sui-spacing-bottom--30">
<p style="text-align: center">
<?php
echo '<strong>' . esc_html__( 'Congratulations!', 'wp-smushit' ) . ' </strong> ';
esc_html_e( 'Your site is now successfully connected, unlocking powerful tools to keep your site running smoothly.', 'wp-smushit' );
?>
</p>
<ul>
<?php foreach ( $feature_list as $feature ) : ?>
<li>
<span class="sui-icon-check" aria-hidden="true"></span>
<?php
echo esc_html( $feature );
?>
</li>
<?php endforeach; ?>
</li>
</ul>
</div>
<?php
$button_text = __( 'Bulk Smush Now', 'wp-smushit' );
$button_link = $this->get_url( 'smush-bulk&smush-action=start-bulk-smush' );
if ( is_network_admin() ) {
$button_text = __( 'Go to Subsite Controls', 'wp-smushit' );
$button_link = $this->get_url( 'smush-settings&view=permissions' );
}
?>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--50">
<a href="<?php echo esc_url( $button_link ); ?>" class="sui-button sui-button-blue wp-smush-modal-link-close">
<span class="sui-button-text-default">
<?php echo esc_html( $button_text ); ?>
</span>
</a>
</div>
</div>
</div>
</div>
<script>
window.addEventListener("load", function(){
const modalId = 'smush-hub-connection-success-modal';
const options = {
focusAfterClosed: 'wpbody-content',
focusWhenOpen: undefined,
hasOverlayMask: true,
isCloseOnEsc: true,
isAnimated: true,
};
window.SUI.openModal(
modalId,
options.focusAfterClosed,
options.focusWhenOpen,
options.hasOverlayMask,
options.isCloseOnEsc,
options.isAnimated
);
});
</script>
@@ -0,0 +1,51 @@
<?php
/**
* Bulk Smush retry dialog.
*/
$docs_link = $this->get_utm_link(
array(
'utm_campaign' => 'smush_bulksmush_loopback_notice',
),
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#loopback-request-issue'
);
?>
<div class="sui-modal sui-modal-md">
<div
role="dialog"
id="smush-loopback-error-dialog"
class="sui-modal-content smush-retry-modal smush-loopback-error-dialog"
aria-modal="true"
aria-labelledby="smush-loopback-error-title"
>
<div class="sui-box">
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60 sui-spacing-bottom--10">
<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>
<i class="sui-notice-icon sui-icon-info sui-lg" aria-hidden="true"></i>
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Error Encountered!', 'wp-smushit' ); ?></h3>
</div>
<div class="sui-box-body sui-flatten sui-content-center sui-no-padding-top sui-spacing-bottom--30">
<p class="sui-description">
<?php
printf(
/* translators: 1: Open link, 2: Close the link */
esc_html__( 'Your site seems to have an issue with loopback requests. Please retry or refer to our %1$stroubleshooting guide%2$s to help resolve this.', 'wp-smushit' ),
'<a target="_blank" href="' . esc_url( $docs_link ) . '">',
'</a>'
);
?>
</p>
</div>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--60">
<a href="#wp-smush-bulk-content" data-action="Retry" class="sui-button smush-retry-process-button" data-modal-close="">
<?php esc_html_e( 'Retry', 'wp-smushit' ); ?>
</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,406 @@
<?php
/**
* Onboarding modal.
*
* @since 3.1
* @package WP_Smush
*
* @var $cta_url string CTA URL.
*/
use Smush\Core\Helper;
use Smush\Core\Array_Utils;
use Smush\Core\Hub_Connector;
use Smush\Core\Media\Media_Item_Query;
use Smush\Core\Membership\Membership;
use Smush\Core\Settings;
if ( ! defined( 'WPINC' ) ) {
die;
}
$array_utils = new Array_Utils();
$setup_steps = array(
'tracking' => array(
'heading' => __( 'Ready To Speed Up Your Site?', 'wp-smushit' ),
'description' => __( 'Lets scan your Media Library to find the hefty images slowing things down, so Smush can work its optimizing magic.', 'wp-smushit' ),
'fields' => array(
'usage' => array(
'label' => __( 'Help us make Smush better for everyone', 'wp-smushit' ),
'default' => false,
'tooltip' => __( 'Enable anonymous tracking to boost plugin performance. No personal data collected.', 'wp-smushit' ),
),
),
),
'scan_completed' => array(
'heading' => __( 'Yup, Your Site Could Definitely Be Faster', 'wp-smushit' ),
'description' => __( 'Based on the scan results, we can potentially reduce file sizes and improve the site speed.', 'wp-smushit' ),
'fields' => array(),
),
'configure' => array(
'heading' => __( 'First, Lets Check Your Settings', 'wp-smushit' ),
'description' => __( 'We recommend enabling these features for best performance.', 'wp-smushit' ),
'fields' => array(
'lossy' => array(
'label' => __( 'Super Smush', 'wp-smushit' ),
'default' => true,
'tooltip' => __( 'Compress images up to 2x more than regular smush with multi-pass lossy compression.', 'wp-smushit' ),
),
'auto' => array(
'label' => __( 'Automatic Compression', 'wp-smushit' ),
'default' => true,
'tooltip' => __( 'Automatically optimize and compress images you upload to your site.', 'wp-smushit' ),
),
'lazy_load' => array(
'label' => __( 'Lazy Load', 'wp-smushit' ),
'default' => true,
'tooltip' => __( 'Delay loading off-screen images until visitors scroll to them. Make your page load faster, use less bandwidth, and fix "Defer offscreen images" Google PSI audit.', 'wp-smushit' ),
),
'compress_backup' => array(
'label' => __( 'Compress & Backup my Original Images', 'wp-smushit' ),
'default' => true,
'tooltip' => __( 'Smush compresses your original images — helpful if your theme serves full-size images.', 'wp-smushit' ),
),
'ultra' => array(
'label' => __( '5x Compression with Ultra', 'wp-smushit' ),
'is_pro_feature' => true,
'tooltip' => __( '5x image compression for faster-loading pages.', 'wp-smushit' ),
),
'nextgen_cdn' => array(
'label' => __( 'Next-Gen Conversion & Global Edge CDN', 'wp-smushit' ),
'is_pro_feature' => true,
'tooltip' => __( 'One-click WebP and AVIF conversion for superior performance, plus a global CDN with 119 locations for instant worldwide delivery.', 'wp-smushit' ),
),
),
),
'finish' => array(
'heading' => __( 'Youre Almost There!', 'wp-smushit' ),
'description' => __( 'To start smushing your images, create a free WPMU DEV account — quick and easy, no credit card required & no fiddly API key copy-pasting involved.', 'wp-smushit' ),
'fields' => array(),
),
);
if ( Membership::get_instance()->has_access_to_hub() ) {
unset( $setup_steps['finish'] );
}
/**
* Body content for tracking slide.
*
* @param Array_Utils $array_utils.
* @param mixed $setup_steps Array of setup_steps.
* @return void
*/
function smush_onboarding_tracking_body( $array_utils, $setup_steps ) {
$should_show_tracking_confirmation = ! is_multisite();
?>
<?php if ( $should_show_tracking_confirmation ) : ?>
<div class="smush-onboarding-tracking-box">
<label for="usage" class="sui-toggle" style="display:inline-block;width:auto;">
<input type="checkbox" id="usage" aria-labelledby="usage-label" <# if ( data.fields.usage ) { #>checked<# } #>/>
<span class="sui-toggle-slider" aria-hidden="true"> </span>
<strong id="usage-label" class="sui-toggle-label" style="text-align: left;">
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'tracking', 'fields', 'usage', 'label' ) ) ); ?>
</strong>
</label>
<span style="position:relative;top:3px;" class="sui-tooltip sui-tooltip-top-right sui-tooltip-constrained" data-tooltip="<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'tracking', 'fields', 'usage', 'tooltip' ) ) ); ?>">
<span class="sui-icon-info" aria-hidden="true"></span>
</span>
</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( 'Start Scan', 'wp-smushit' ); ?>
<i class="sui-icon-chevron-right" aria-hidden="true"> </i>
</a>
<?php
}
/**
* Body content for scan slide.
*/
function smush_onboarding_scan_completed_body() {
$media_item_query = new Media_Item_Query();
$attachment_count = (int) $media_item_query->get_image_attachment_count();
$smushed_count = (int) $media_item_query->get_smushed_count();
$remaining_count = $attachment_count - $smushed_count;
?>
<div class="smush-onboarding-scan" style="max-width:360px;margin:-15px auto 0;">
<div class="smush-onboarding-scan-content">
<div class="progress-bar-wrapper">
<div class="sui-progress">
<span class="sui-progress-icon" aria-hidden="true">
<span class="sui-icon-loader sui-loading"></span>
</span>
<span class="sui-progress-text" aria-live="polite">0%</span>
<div class="sui-progress-bar" aria-hidden="true">
<span style="width:0%"></span>
</div>
</div>
</div>
<div class="scan-stats sui-hidden">
<div class="sui-description">
<?php
if ( $remaining_count ) {
/* translators: %s - seconds remaining */
printf( esc_html__( 'Smush found %s image attachments that can be optimized to reduce file size and improve site speed.', 'wp-smushit' ), (int) $remaining_count );
} else {
esc_html_e( 'Smush found 0 image attachments that can be optimized.', 'wp-smushit' );
}
?>
</div>
<ul>
<li><span class="sui-icon-check" aria-hidden="true"></span><?php esc_html_e( 'Save up to 30% in file size with zero quality loss.', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-check" aria-hidden="true"></span><?php esc_html_e( 'Boost Core Web Vitals (LCP & CLS).', 'wp-smushit' ); ?></li>
</ul>
</div>
</div>
<a class="sui-button sui-button-blue next" onclick="WP_Smush.onboarding.next(this)" >
<?php esc_html_e( 'Configure Smush', 'wp-smushit' ); ?>
</a>
</div>
<?php
}
/**
* Body content for configure slide.
*
* @param Array_Utils $array_utils.
* @param mixed $setup_steps Array of setup_steps.
* @return void
*/
function smush_onboarding_configure_body( $array_utils, $setup_steps ) {
$fields = $array_utils->get_array_value( $setup_steps, array( 'configure', 'fields' ), array() );
$upsell_url = Helper::get_utm_link(
array(
'utm_campaign' => 'smush_wizard',
'utm_content' => 'view_plans_wizard',
)
);
?>
<div class="smush-onboarding-configure">
<div class="sui-field-list">
<div class="sui-field-list-body">
<?php
foreach ( $fields as $name => $field ) :
$is_checked = ! empty( $field['default'] );
$is_pro_feature = ! empty( $field['is_pro_feature'] );
?>
<div class="sui-field-list-item">
<label
class="sui-field-list-item-label"
for="<?php echo esc_attr( $name ); ?>"
>
<?php echo esc_html( $field['label'] ); ?>
<button class="sui-button-icon sui-tooltip sui-tooltip-top-center sui-tooltip-constrained" data-tooltip="<?php echo esc_html( $field['tooltip'] ); ?>">
<span class="sui-icon-info" aria-hidden="true"></span>
</button>
</label>
<?php if ( $is_pro_feature ) : ?>
<span class="sui-tag sui-tag-pro" data-pro-feature="<?php echo esc_attr( $name ); ?>"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
<?php else : ?>
<label class="sui-toggle">
<input type="checkbox" id="<?php echo esc_attr( $name ); ?>" name="<?php echo esc_attr( $name ); ?>" <# if ( data.fields.<?php echo esc_attr( $name ); ?> ) { #>checked<# } #> />
<span class="sui-toggle-slider"></span>
</label>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="smush-onboarding-buttons">
<div>
<?php if ( Membership::get_instance()->has_access_to_hub() ) : ?>
<?php if ( Settings::get_instance()->has_bulk_smush_page() ) : ?>
<button type="submit" class="sui-button sui-button-blue next" style="width:100%">
<?php $cta_label = is_network_admin() ? __( 'Go To Bulk Smush', 'wp-smushit' ) : __( 'Bulk Smush Now', 'wp-smushit' ); ?>
<span class="sui-button-text-default">
<?php echo esc_html( $cta_label ); ?>
</span>
<span class="sui-button-text-onload">
<span
class="sui-icon-loader sui-loading"
aria-hidden="true"
></span>
<?php echo esc_html( $cta_label ); ?>
</span>
</button>
<?php endif; ?>
<?php else : ?>
<a class="sui-button sui-button-blue next" style="width:100%;" onclick="WP_Smush.onboarding.next(this)" >
<?php esc_html_e( 'SET UP MY FREE ACCOUNT', 'wp-smushit' ); ?>
</a>
<?php endif; ?>
</div>
<a class="smush-upsell-link smush-btn-pro-upsell" style="font-size:11px" target="_blank" href="<?php echo esc_url( $upsell_url ); ?>">
<?php
/* translators: %s: plugin discount */
esc_html_e( 'What can I get with Smush Pro?', 'wp-smushit' );
?>
</a>
</div>
</div>
<?php
}
/**
* Body content for finish slide.
*/
function smush_onboarding_finish_body() {
?>
<div class="smush-onboarding-finish" style="max-width:400px;margin:0 auto;">
<div class="smush-onboarding-finish-content">
<h3><?php esc_html_e( 'When you connect, youll get:', 'wp-smushit' ); ?></h3>
<ul>
<li><span class="sui-icon-check-tick" aria-hidden="true"></span><?php esc_html_e( 'Instant access to Bulk Smush API.', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-check-tick" aria-hidden="true"></span><?php esc_html_e( 'Unlimited bulk smushing.', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-check-tick" aria-hidden="true"></span><?php esc_html_e( 'Directory Smush.', 'wp-smushit' ); ?></li>
<li><span class="sui-icon-check-tick" aria-hidden="true"></span><?php esc_html_e( 'Auto smushing on upload.', 'wp-smushit' ); ?></li>
</ul>
</div>
<button class="sui-button sui-button-blue smush-button-dark-blue next" type="submit" >
<span class="sui-button-text-default">
<?php esc_html_e( 'CONNECT MY SITE', 'wp-smushit' ); ?>
</span>
<span class="sui-button-text-onload">
<span
class="sui-icon-loader sui-loading"
aria-hidden="true"
></span>
<?php esc_html_e( 'CONNECT MY SITE', 'wp-smushit' ); ?>
</span>
</button>
</div>
<?php
}
$onboarding_slide_keys = array_keys( $setup_steps );
$onboarding_slide_fields = array_reduce(
$setup_steps,
function ( $fields, $step ) {
if ( isset( $step['fields'] ) && is_array( $step['fields'] ) ) {
foreach ( $step['fields'] as $key => $field ) {
if ( ! empty( $field['is_pro_feature'] ) ) {
continue;
}
$fields[ $key ] = ! empty( $field['default'] );
}
}
return $fields;
},
array()
);
?>
<script>
var onBoardingData = {
slideKeys: <?php echo wp_json_encode( $onboarding_slide_keys ); ?>,
slideFields: <?php echo wp_json_encode( $onboarding_slide_fields ); ?>,
connectSiteUrl: <?php echo wp_json_encode( Hub_Connector::get_connect_site_url( 'smush-bulk', 'smush_wizard_connect' ) ); ?>,
startBulkSmushURL: <?php echo wp_json_encode( $this->get_url( 'smush-bulk&smush-action=start-bulk-smush' ) ); ?>,
isSiteConnected: <?php echo Membership::get_instance()->has_access_to_hub() ? 'true' : 'false'; ?>
};
</script>
<script type="text/template" id="smush-onboarding-free" data-cta-url="<?php echo esc_js( $cta_url ); ?>">
<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-free/graphic-onboarding-' ); ?>{{{ data.slide }}}.png"
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding-free/graphic-onboarding-' ); ?>{{{ data.slide }}}.png 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding-free/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; ?>
<!-- Heading -->
<h3 class="sui-box-title sui-lg" id="smush-title-onboarding-dialog" style="white-space: normal;">
<# if ( 'tracking' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'tracking', 'heading' ) ) ); ?>
<# } else if ( 'scan_completed' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'scan_completed', 'heading' ) ) ); ?>
<# } else if ( 'configure' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'configure', 'heading' ) ) ); ?>
<# } else if ( 'finish' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'finish', 'heading' ) ) ); ?>
<# } #>
</h3>
<!-- End Heading -->
<!-- Description -->
<p class="sui-description" id="smush-description-onboarding-dialog">
<# if ( 'tracking' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'tracking', 'description' ) ) ); ?>
<# } else if ( 'scan_completed' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'scan_completed', 'description' ) ) ); ?>
<# } else if ( 'configure' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'configure', 'description' ) ) ); ?>
<# } else if ( 'finish' === data.slide ) { #>
<?php echo esc_html( $array_utils->get_array_value( $setup_steps, array( 'finish', 'description' ) ) ); ?>
<# } #>
</p>
<!-- End Description -->
</div>
<!-- Main body -->
<div class="sui-box-body sui-content-center sui-spacing-sides--0">
<# if ( 'tracking' === data.slide ) { #>
<?php smush_onboarding_tracking_body( $array_utils, $setup_steps ); ?>
<# } else if( 'scan_completed' === data.slide ) { #>
<?php smush_onboarding_scan_completed_body(); ?>
<# } else if( 'configure' === data.slide ) { #>
<?php smush_onboarding_configure_body( $array_utils, $setup_steps ); ?>
<# } else if( 'finish' === data.slide ) { #>
<?php smush_onboarding_finish_body( $array_utils, $setup_steps ); ?>
<# } #>
<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>
<!-- End Main body -->
<!-- Footer -->
<div class="sui-box-footer sui-flatten sui-content-center">
<div class="sui-box-steps sui-sm">
<button onclick="WP_Smush.onboarding.goTo('tracking')" class="<# if ( 'tracking' === data.slide ) { #>sui-current<# } #>" <# if ( 'tracking' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'First step', 'wp-smushit' ); ?>
</button>
<button onclick="WP_Smush.onboarding.goTo('scan_completed')" class="<# if ( 'scan_completed' === data.slide ) { #>sui-current<# } #>" <# if ( 'scan_completed' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'Scan_completed', 'wp-smushit' ); ?>
</button>
<button onclick="WP_Smush.onboarding.goTo('configure')" class="<# if ( 'configure' === data.slide ) { #>sui-current<# } #>" <# if ( 'configure' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'Configure', 'wp-smushit' ); ?>
</button>
<?php if ( isset( $setup_steps['finish'] ) ) : ?>
<button onclick="WP_Smush.onboarding.goTo('finish')" class="<# if ( 'finish' === data.slide ) { #>sui-current<# } #>" <# if ( 'finish' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'Finish', 'wp-smushit' ); ?>
</button>
<?php endif; ?>
</div>
</div>
<!-- End Footer -->
</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, Ill set it up later', 'wp-smushit' ); ?>
</button>
</div>
</div>
@@ -0,0 +1,303 @@
<?php
/**
* Onboarding modal.
*
* @since 3.1
* @package WP_Smush
*
* @var $cta_url string CTA URL.
*/
use Smush\Core\Helper;
use Smush\App\Admin;
if ( ! defined( 'WPINC' ) ) {
die;
}
$should_show_tracking_confirmation = ! is_multisite();
// Lossy feature.
$lossy_title = __( 'Super Smush', 'wp-smushit' );
$lossy_description = esc_html__( 'Optimize images up to 2x more than regular smush with our multi-pass lossy compression.', 'wp-smushit' );
$lossy_action_label = __( 'Enable Super Smush', 'wp-smushit' );
// Pro features.
$total_cdn_locations = Admin::get_cdn_pop_locations();
$upsell_url = $this->get_utm_link(
array(
'utm_campaign' => 'smush_wizard',
'utm_content' => 'view_plans_wizard',
)
);
$pro_features = array(
'ultra' => array(
'title' => __( 'Ultra Smush - 5x Compression', 'wp-smushit' ),
'description' => __( '5x higher compression for snappier site loads.', 'wp-smushit' ),
),
'cdn' => array(
'title' => __( 'Global Edge CDN', 'wp-smushit' ),
'description' => sprintf(
/* translators: %d: total CDN locations */
__( 'Spread over %d locations for instant worldwide delivery.', 'wp-smushit' ),
$total_cdn_locations
),
),
'auto_resizing' => array(
'title' => __( 'Automatic Image Resizing', 'wp-smushit' ),
'description' => __( 'Smart auto-resize images to fit image containers perfectly.', 'wp-smushit' ),
),
'next_gen' => array(
'title' => __( 'Next-Gen Conversions', 'wp-smushit' ),
'description' => __( '1-click WebP and AVIF Conversion for superior performance.', 'wp-smushit' ),
),
'preload_images' => array(
'title' => __( 'Preload Critical Images', 'wp-smushit' ),
'description' => __( 'Identifies and immediately preloads important above-the-fold images.', 'wp-smushit' ),
),
'background_optimization' => array(
'title' => __( 'Continuous Background Optimization', 'wp-smushit' ),
'description' => __( 'Bulk Smush continues even when you leave the page.', 'wp-smushit' ),
),
);
?>
<script type="text/template" id="smush-onboarding" data-cta-url="<?php echo esc_js( $cta_url ); ?>" data-type="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 ( 'preload_images' === data.slide ) { #>
<?php esc_html_e( 'Preload Critical Images', 'wp-smushit' ); ?>
<span class="sui-tag sui-tag-sm sui-tag-green" style="margin-left:6px; padding:0px 8px;min-height:0;" aria-hidden="true"><?php esc_html_e( 'New', 'wp-smushit' ); ?></span>
<# } else if ( 'lazy_load' === data.slide ) { #>
<?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?>
<# } else if ( 'pro_upsell' === data.slide ) { #>
<?php esc_html_e( 'Upgrade to Smush Pro', '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 ( 'preload_images' === data.slide ) { #>
<?php esc_html_e( 'Automatically identify and immediately preload important above-the-fold images, like your Largest Contentful Paint element. This ensures your key visuals appear instantly, which can significantly improve perceived page load speed and your Google PageSpeed LCP score.', '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' ); ?>
<# } else if ( 'pro_upsell' === data.slide ) { #>
<?php esc_html_e( 'Level Up Your Performance Smarter, Faster, Effortless!', '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 */
printf( 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 { #>
<# if ( 'pro_upsell' !== data.slide ) { #>
<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 ( 'preload_images' === data.slide ) { #>
<?php esc_html_e( 'Enable Preload Critical Images', 'wp-smushit' ); ?>
<# } else if ( 'lazy_load' === data.slide ) { #>
<?php esc_html_e( 'Enable Lazy Loading', 'wp-smushit' ); ?>
<# } #>
</span>
</label>
</div>
<# } else { #>
<div class="sui-field-list">
<div class="sui-field-list-body">
<?php foreach ( $pro_features as $name => $feature ) : ?>
<div class="sui-field-list-item">
<label
class="sui-field-list-item-label"
for="<?php echo esc_attr( $name ); ?>"
>
<?php echo esc_html( $feature['title'] ); ?>
<button class="sui-button-icon sui-tooltip sui-tooltip-top-center sui-tooltip-constrained" data-tooltip="<?php echo esc_html( $feature['description'] ); ?>">
<span class="sui-icon-info" aria-hidden="true"></span>
</button>
</label>
<label class="sui-toggle">
<input type="checkbox" name="<?php echo esc_attr( $name ); ?>" disabled />
<span class="sui-toggle-slider"></span>
</label>
</div>
<?php endforeach; ?>
</div>
</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>
<# } #>
<# if ( data.last ) { #>
<# if ( 'pro_upsell' === data.slide ) { #>
<div class="smush-onboarding-buttons">
<div class="smush-onboarding-buttons-group">
<a class="sui-button sui-button-blue smush-btn-pro-upsell" target="_blank" href="<?php echo esc_url( $upsell_url ); ?>">
<?php
/* translators: %s: plugin discount */
esc_html_e( 'Get Smush Pro', 'wp-smushit' );
?>
</a>
<button type="submit" class="sui-button sui-button-grey sui-button-icon-left" data-modal-close="">
<span class="sui-button-text-default">
<?php esc_html_e( 'Complete Setup', 'wp-smushit' ); ?>
</span>
<span class="sui-button-text-onload">
<span
class="sui-icon-loader sui-loading"
aria-hidden="true"
></span>
<?php esc_html_e( 'Complete Setup', 'wp-smushit' ); ?>
</span>
</button>
</div>
</div>
<# } else { #>
<button type="submit" class="sui-button sui-button-blue sui-button-icon-left" data-modal-close="">
<span class="sui-button-text-default">
<i class="sui-icon-check" aria-hidden="true"> </i>
<?php esc_html_e( 'Finish setup wizard', 'wp-smushit' ); ?>
</span>
<span class="sui-button-text-onload">
<span
class="sui-icon-loader sui-loading"
aria-hidden="true"
></span>
<?php esc_html_e( 'Finish setup wizard', 'wp-smushit' ); ?>
</span>
</button>
<# } #>
<# } else 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('usage')" 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>
<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>
<button onclick="WP_Smush.onboarding.goTo('preload_images')" class="<# if ( 'preload_images' === data.slide ) { #>sui-current<# } #>" <# if ( 'preload_images' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'Preload Critical Images', 'wp-smushit' ); ?>
</button>
<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>
<button onclick="WP_Smush.onboarding.goTo('pro_upsell')" class="<# if ( 'pro_upsell' === data.slide ) { #>sui-current<# } #>" <# if ( 'pro_upsell' === data.slide ) { #>disabled<# } #>>
<?php esc_html_e( 'Upgrade to Smush Pro', '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, Ill set it up later', 'wp-smushit' ); ?>
</button>
</div>
</div>
@@ -0,0 +1,118 @@
<?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',
array(
'smush_type' => 'directory-smush',
)
);
?>
<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 = '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>
@@ -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 Smushs 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>
@@ -0,0 +1,207 @@
<?php
/**
* Restore images modal.
*
* @since 3.2.2
* @package WP_Smush
*
* @var $restore_image_count int Restore Image count.
*/
use Smush\Core\Helper;
if ( ! defined( 'WPINC' ) ) {
die;
}
$backup_link = '<a onclick="window.location.reload();" href="' . esc_url( Helper::get_page_url( 'smush-bulk#backup' ) ) . '"><strong>';
$backup_link_close = '</strong></a>';
?>
<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 all images?', '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 printf(
/* translators: %s: strong tag */
esc_html__( 'This will restore all %1$s %2$s images%3$s thumbnails to their original, non-optimized states. Want more control? Use the Media Library to restore specific images.', 'wp-smushit' ),
'<strong>',
$restore_image_count,
'</strong>'
); ?>
<# } 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( 'Restore', '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 restored successfully.', 'wp-smushit' ); ?>
<# if ( data.missingBackupCount > 0 && data.errorCopyCount > 0 ) { #>
<?php echo ' '; ?>{{ data.missingBackupCount }}
<?php esc_html_e( 'couldn\'t be restored as no backup exists.', 'wp-smushit' ); ?>
<?php echo ' '; ?>{{ data.errorCopyCount }}
<?php esc_html_e( 'due to a backup copy error.', 'wp-smushit' ); ?>
<# } else if ( data.missingBackupCount > 0 ) { #>
<?php echo ' '; ?>{{ data.missingBackupCount }}
<?php esc_html_e( 'couldn\'t be restored as no backup exists.', 'wp-smushit' ); ?>
<# } else if ( data.errorCopyCount > 0 ) { #>
<?php echo ' '; ?>{{ data.errorCopyCount }}
<?php esc_html_e( 'couldn\'t be restored due to a backup copy error.', 'wp-smushit' ); ?>
<# } #>
<?php
echo ' ';
/* translators: 1: link start tag, 2: link end tag */
printf( esc_html__( 'Ensure %1$sBackup original images%2$s is enabled to keep copies of your originals.', 'wp-smushit' ), $backup_link, $backup_link_close );
?>
</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,56 @@
<?php
/**
* Scan error notice for lower resource site on background dead.
*/
use Smush\Core\Helper;
$recheck_images_link = Helper::get_recheck_images_link();
$docs_link = $this->get_utm_link(
array(
'utm_campaign' => 'smush_troubleshooting_docs',
'utm_content' => 'scan_failed_modal',
),
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#troubleshooting-guide'
);
?>
<div class="sui-modal sui-modal-md">
<div
role="dialog"
id="smush-retry-scan-notice"
class="sui-modal-content smush-retry-modal 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 sui-spacing-bottom--10">
<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>
<i class="sui-notice-icon sui-icon-info sui-lg" aria-hidden="true"></i>
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Scan Failed!', 'wp-smushit' ); ?></h3>
</div>
<div class="sui-box-body sui-flatten sui-content-center sui-no-padding-top sui-spacing-bottom--30">
<p class="sui-description">
<?php
printf(
/* translators: 1: Open link, 2: Close the link */
esc_html__( 'Scan failed due to limited resources on your site. We have adjusted the scan to use fewer resources the next time. Please retry or refer to our %1$stroubleshooting guide%2$s to help resolve this.', 'wp-smushit' ),
'<a target="_blank" href="' . esc_url( $docs_link ) . '">',
'</a>'
);
?>
</p>
</div>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--60">
<a href="<?php echo esc_url( $recheck_images_link ); ?>" class="sui-button smush-retry-scan-notice-button">
<?php esc_html_e( 'Retry', 'wp-smushit' ); ?>
</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,60 @@
<?php
/**
* Scan error notice for lower resource site on background dead.
*/
$docs_link = $this->get_utm_link(
array(
'utm_campaign' => 'smush_troubleshooting_docs',
'utm_content' => 'smush_cancel_modal',
),
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#troubleshooting-guide'
);
?>
<div class="sui-modal sui-modal-md">
<div
role="dialog"
id="smush-stop-bulk-smush-modal"
class="sui-modal-content smush-retry-modal smush-stop-bulk-smush-modal"
aria-modal="true"
aria-labelledby="smush-stop-bulk-smush-title"
>
<div class="sui-box">
<div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60 sui-spacing-bottom--10">
<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>
<i class="sui-notice-icon sui-warning-icon sui-icon-info sui-lg" aria-hidden="true"></i>
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Bulk Smush Hasnt Finished Yet!', 'wp-smushit' ); ?></h3>
</div>
<div class="sui-box-body sui-flatten sui-content-center sui-no-padding-top sui-spacing-bottom--30">
<p class="sui-description">
<?php
$notice = esc_html__( 'You have unsmushed images. Are you sure you want to cancel?', 'wp-smushit' );
if ( ! apply_filters( 'wpmudev_branding_hide_doc_link', false ) ) {
$notice .= sprintf(
/* translators: 1: Open link, 2: Close the link */
esc_html__( ' If youre facing issues with Bulk Smush, please refer to our %1$stroubleshooting guide%2$s.', 'wp-smushit' ),
'<a target="_blank" href="' . esc_url( $docs_link ) . '">',
'</a>'
);
}
echo wp_kses_post( $notice );
?>
</p>
</div>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--60">
<a href="#" data-action="Continue" data-modal-close="" class="sui-button">
<?php esc_html_e( 'Continue Smushing', 'wp-smushit' ); ?>
</a>
<a href="#" data-action="Cancel" data-modal-close="" class="sui-button sui-button-ghost smush-stop-bulk-smush-button">
<?php esc_html_e( 'Cancel Anyway', 'wp-smushit' ); ?>
</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,55 @@
<?php
/**
* Stop scanning media library modal.
*/
$docs_link = $this->get_utm_link(
array(
'utm_campaign' => 'smush_troubleshooting_docs',
'utm_content' => 'scan_cancel_modal',
),
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#troubleshooting-guide'
);
?>
<div class="sui-modal sui-modal-md">
<div
role="dialog"
id="smush-stop-scanning-dialog"
class="sui-modal-content smush-retry-modal 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 sui-spacing-bottom--10">
<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>
<i class="sui-notice-icon sui-warning-icon sui-icon-info sui-lg" aria-hidden="true"></i>
<h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Scan Hasnt Finished Yet!', 'wp-smushit' ); ?></h3>
</div>
<div class="sui-box-body sui-flatten sui-content-center sui-no-padding-top sui-spacing-bottom--30">
<p class="sui-description">
<?php
printf(
/* translators: 1: Open link, 2: Close the link */
esc_html__( 'Cancelling the scan would result in inaccurate statistics. Are you sure you want to cancel? If youre facing issues, please refer to our %1$stroubleshooting guide%2$s.', 'wp-smushit' ),
'<a target="_blank" href="' . esc_url( $docs_link ) . '">',
'</a>'
);
?>
</p>
</div>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--60">
<a href="#" data-action="Continue" data-modal-close="" class="sui-button">
<?php esc_html_e( 'Continue Scanning', 'wp-smushit' ); ?>
</a>
<a href="#" data-action="Cancel" data-modal-close="" class="sui-button sui-button-ghost smush-stop-scanning-dialog-button">
<?php esc_html_e( 'Cancel Anyway', 'wp-smushit' ); ?>
</a>
</div>
</div>
</div>
</div>
@@ -0,0 +1,106 @@
<?php
/**
* Show Updated Features modal.
*
* @package WP_Smush
*
* @since 3.7.0
*
* @var string $cta_url URL for the modal's CTA button.
* @var bool $show_cta_button Indicates whether the CTA button should be displayed.
*/
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"
data-esc-close="false"
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/updated/updated.png' ); ?>"
srcset="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/updated/updated.png' ); ?> 1x, <?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/updated/updated' ); ?>@2x.png 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-grey" 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--30">
<h3 class="sui-box-title sui-lg" id="smush-title-updated-dialog" style="white-space: normal">
<?php esc_html_e( 'New: Advanced Image Sizing', 'wp-smushit' ); ?>
<span class="sui-tag sui-tag-pro" style="font-size: 10px; line-height: 12px;">
<?php esc_html_e( 'Pro', 'wp-smushit' ); ?>
</span>
</h3>
<p class="sui-description">
<?php esc_html_e( 'We\'ve streamlined the image sizing tools for ease of use. All resizing and detection features are now in one place - The Lazy Loading page.', 'wp-smushit' ); ?>
</p>
<div class="sui-modal-list" style="text-align: left; background-color: #F8F8F8; padding: 15px; border-radius: 5px;">
<h4>
<?php esc_html_e( 'What\'s New?', 'wp-smushit' ); ?>
</h4>
<ul>
<li>
<h3>
<span class="sui-icon-check-tick sui-sm sui-success" aria-hidden="true"></span>
<?php esc_html_e( 'New Automatic Resizing', 'wp-smushit' ); ?>
</h3>
</li>
<li>
<h3>
<span class="sui-icon-check-tick sui-sm sui-success" aria-hidden="true"></span>
<?php esc_html_e( 'Add Missing Dimensions', 'wp-smushit' ); ?>
</h3>
</li>
</ul>
</div>
</div>
<?php
$cta_config = array(
'label' => __( 'Get Smush Pro ', 'wp-smushit' ),
'target' => '_blank',
'classes' => array(
'sui-button',
'wp-smush-upgrade-modal-cta',
'sui-button-grey',
'sui-button-purple',
),
'show_icon' => true,
);
$class_string = implode( ' ', $cta_config['classes'] );
?>
<?php if ( $show_cta_button ) : ?>
<div class="sui-box-footer sui-flatten sui-content-center sui-spacing-bottom--50">
<a href="<?php echo esc_url( $cta_url ); ?>"
target="<?php echo esc_attr( $cta_config['target'] ); ?>"
class="<?php echo esc_attr( $class_string ); ?>"
onclick="WP_Smush.onboarding.hideUpgradeModal(event, this)">
<?php echo esc_html( $cta_config['label'] ); ?>
<?php if ( $cta_config['show_icon'] ) : ?>
<span class="sui-icon-open-new-window" aria-hidden="true"></span>
<?php endif; ?>
</a>
</div>
<?php endif; ?>
</div>
</div>
</div>