checking-files.php
6 years ago
directory-list.php
4 years ago
onboarding.php
5 years ago
progress-dialog.php
4 years ago
reset-settings.php
4 years ago
restore-images.php
6 years ago
updated.php
4 years ago
webp-delete-all.php
5 years ago
onboarding.php
178 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Onboarding modal. |
| 4 | * |
| 5 | * @since 3.1 |
| 6 | * @package WP_Smush |
| 7 | */ |
| 8 | |
| 9 | use Smush\Core\Helper; |
| 10 | |
| 11 | if ( ! defined( 'WPINC' ) ) { |
| 12 | die; |
| 13 | } |
| 14 | |
| 15 | ?> |
| 16 | |
| 17 | <script type="text/template" id="smush-onboarding" data-type="<?php echo WP_Smush::is_pro() ? 'pro' : 'free'; ?>" data-tracking="<?php echo ! is_multisite() ? 'true' : 'false'; ?>"> |
| 18 | <div class="sui-box-header sui-flatten sui-content-center sui-spacing-sides--90"> |
| 19 | <?php if ( ! apply_filters( 'wpmudev_branding_hide_branding', false ) ) : ?> |
| 20 | <figure class="sui-box-banner" aria-hidden="true"> |
| 21 | <img src="<?php echo esc_url( WP_SMUSH_URL . 'app/assets/images/onboarding/graphic-onboarding-' ); ?>{{{ data.slide }}}.png" |
| 22 | 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" |
| 23 | alt="<?php esc_attr_e( 'Smush Onboarding Modal', 'wp-smushit' ); ?>" class="sui-image sui-image-center" |
| 24 | > |
| 25 | </figure> |
| 26 | <?php endif; ?> |
| 27 | |
| 28 | <h3 class="sui-box-title sui-lg" id="smush-title-onboarding-dialog"> |
| 29 | <# if ( 'start' === data.slide ) { #> |
| 30 | <?php |
| 31 | |
| 32 | /* translators: %s: current user name */ |
| 33 | printf( esc_html__( 'Hey, %s!', 'wp-smushit' ), esc_html( Helper::get_user_name() ) ); |
| 34 | ?> |
| 35 | <# } else if ( 'auto' === data.slide ) { #> |
| 36 | <?php esc_html_e( 'Automatic Compression', 'wp-smushit' ); ?> |
| 37 | <# } else if ( 'lossy' === data.slide ) { #> |
| 38 | <?php esc_html_e( 'Advanced Compression', 'wp-smushit' ); ?> |
| 39 | <# } else if ( 'strip_exif' === data.slide ) { #> |
| 40 | <?php esc_html_e( 'EXIF Metadata', 'wp-smushit' ); ?> |
| 41 | <# } else if ( 'original' === data.slide ) { #> |
| 42 | <?php esc_html_e( 'Full Size Images', 'wp-smushit' ); ?> |
| 43 | <# } else if ( 'lazy_load' === data.slide ) { #> |
| 44 | <?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?> |
| 45 | <# } else if ( 'usage' === data.slide ) { #> |
| 46 | <?php esc_html_e( 'Usage Data', 'wp-smushit' ); ?> |
| 47 | <# } #> |
| 48 | </h3> |
| 49 | |
| 50 | <p class="sui-description" id="smush-description-onboarding-dialog"> |
| 51 | <# if ( 'start' === data.slide ) { #> |
| 52 | <?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' ); ?> |
| 53 | <# } else if ( 'auto' === data.slide ) { #> |
| 54 | <?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' ); ?> |
| 55 | <# } else if ( 'lossy' === data.slide ) { #> |
| 56 | <?php esc_html_e( 'Optimize images up to 2x more than regular smush with our multi-pass lossy compression.', 'wp-smushit' ); ?> |
| 57 | <# } else if ( 'strip_exif' === data.slide ) { #> |
| 58 | <?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' ); ?> |
| 59 | <# } else if ( 'original' === data.slide ) { #> |
| 60 | <?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' ); ?> |
| 61 | <# } else if ( 'lazy_load' === data.slide ) { #> |
| 62 | <?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' ); ?> |
| 63 | <# } else if ( 'usage' === data.slide ) { #> |
| 64 | <?php esc_html_e( 'Help us improve Smush by letting our product designers gain insight into what features need improvement. We don’t track any personalized data, it’s all basic stuff.', 'wp-smushit' ); ?> |
| 65 | <# } #> |
| 66 | </p> |
| 67 | |
| 68 | </div> |
| 69 | |
| 70 | <div class="sui-box-body sui-content-center sui-spacing-sides--0"> |
| 71 | <# if ( 'start' === data.slide ) { #> |
| 72 | <a class="sui-button sui-button-blue sui-button-icon-right next" onclick="WP_Smush.onboarding.next(this)"> |
| 73 | <?php esc_html_e( 'Begin setup', 'wp-smushit' ); ?> |
| 74 | <i class="sui-icon-chevron-right" aria-hidden="true"> </i> |
| 75 | </a> |
| 76 | <# } else { #> |
| 77 | <div class="sui-box-selectors"> |
| 78 | <label for="{{{ data.slide }}}" class="sui-toggle"> |
| 79 | <input type="checkbox" id="{{{ data.slide }}}" aria-labelledby="{{{ data.slide }}}-label" <# if ( data.value ) { #>checked<# } #>> |
| 80 | <span class="sui-toggle-slider" aria-hidden="true"> </span> |
| 81 | <span id="{{{ data.slide }}}-label" class="sui-toggle-label"> |
| 82 | <# if ( 'auto' === data.slide ) { #> |
| 83 | <?php esc_html_e( 'Automatically optimize new uploads', 'wp-smushit' ); ?> |
| 84 | <# } else if ( 'lossy' === data.slide ) { #> |
| 85 | <?php esc_html_e( 'Enable enhanced multi-pass lossy compression', 'wp-smushit' ); ?> |
| 86 | <# } else if ( 'strip_exif' === data.slide ) { #> |
| 87 | <?php esc_html_e( 'Strip my image metadata', 'wp-smushit' ); ?> |
| 88 | <# } else if ( 'original' === data.slide ) { #> |
| 89 | <?php esc_html_e( 'Compress my full size images', 'wp-smushit' ); ?> |
| 90 | <# } else if ( 'lazy_load' === data.slide ) { #> |
| 91 | <?php esc_html_e( 'Enable Lazy Loading', 'wp-smushit' ); ?> |
| 92 | <# } else if ( 'usage' === data.slide ) { #> |
| 93 | <?php esc_html_e( 'Allow usage data tracking', 'wp-smushit' ); ?> |
| 94 | <# } #> |
| 95 | </span> |
| 96 | </label> |
| 97 | </div> |
| 98 | <# } #> |
| 99 | |
| 100 | <# if ( 'original' === data.slide ) { #> |
| 101 | <p class="sui-description" style="padding: 0 90px"> |
| 102 | <?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' ); ?> |
| 103 | </p> |
| 104 | <# } else if ( data.last ) { #> |
| 105 | <button type="submit" class="sui-button sui-button-blue sui-button-icon-left" data-modal-close=""> |
| 106 | <i class="sui-icon-check" aria-hidden="true"> </i> |
| 107 | <?php esc_html_e( 'Finish setup wizard', 'wp-smushit' ); ?> |
| 108 | </button> |
| 109 | <# } #> |
| 110 | |
| 111 | <# if ( 'start' !== data.slide && ! data.last ) { #> |
| 112 | <a class="sui-button sui-button-gray next" onclick="WP_Smush.onboarding.next(this)"> |
| 113 | <?php esc_html_e( 'Next', 'wp-smushit' ); ?> |
| 114 | </a> |
| 115 | <# } #> |
| 116 | |
| 117 | <div class="smush-onboarding-arrows"> |
| 118 | <a href="#" class="previous <# if ( data.first ) { #>sui-hidden<# } #>" onclick="WP_Smush.onboarding.next(this)"> |
| 119 | <i class="sui-icon-chevron-left" aria-hidden="true"> </i> |
| 120 | </a> |
| 121 | <a href="#" class="next <# if ( data.last ) { #>sui-hidden<# } #>" onclick="WP_Smush.onboarding.next(this)"> |
| 122 | <i class="sui-icon-chevron-right" aria-hidden="true"> </i> |
| 123 | </a> |
| 124 | </div> |
| 125 | </div> |
| 126 | |
| 127 | <div class="sui-box-footer sui-flatten sui-content-center"> |
| 128 | <div class="sui-box-steps sui-sm"> |
| 129 | <button onclick="WP_Smush.onboarding.goTo('start')" class="<# if ( 'start' === data.slide ) { #>sui-current<# } #>" <# if ( 'start' === data.slide ) { #>disabled<# } #>> |
| 130 | <?php esc_html_e( 'First step', 'wp-smushit' ); ?> |
| 131 | </button> |
| 132 | <button onclick="WP_Smush.onboarding.goTo('auto')" class="<# if ( 'auto' === data.slide ) { #>sui-current<# } #>" <# if ( 'auto' === data.slide ) { #>disabled<# } #>> |
| 133 | <?php esc_html_e( 'Automatic Compression', 'wp-smushit' ); ?> |
| 134 | </button> |
| 135 | <?php if ( WP_Smush::is_pro() ) : ?> |
| 136 | <button onclick="WP_Smush.onboarding.goTo('lossy')" class="<# if ( 'lossy' === data.slide ) { #>sui-current<# } #>" <# if ( 'lossy' === data.slide ) { #>disabled<# } #>> |
| 137 | <?php esc_html_e( 'Advanced Compression', 'wp-smushit' ); ?> |
| 138 | </button> |
| 139 | <?php endif; ?> |
| 140 | <button onclick="WP_Smush.onboarding.goTo('strip_exif')" class="<# if ( 'strip_exif' === data.slide ) { #>sui-current<# } #>" <# if ( 'strip_exif' === data.slide ) { #>disabled<# } #>> |
| 141 | <?php esc_html_e( 'EXIF Metadata', 'wp-smushit' ); ?> |
| 142 | </button> |
| 143 | <?php if ( WP_Smush::is_pro() ) : ?> |
| 144 | <button onclick="WP_Smush.onboarding.goTo('original')" class="<# if ( 'original' === data.slide ) { #>sui-current<# } #>" <# if ( 'original' === data.slide ) { #>disabled<# } #>> |
| 145 | <?php esc_html_e( 'Full Size Images', 'wp-smushit' ); ?> |
| 146 | </button> |
| 147 | <?php endif; ?> |
| 148 | <button onclick="WP_Smush.onboarding.goTo('lazy_load')" class="<# if ( 'lazy_load' === data.slide ) { #>sui-current<# } #>" <# if ( 'lazy_load' === data.slide ) { #>disabled<# } #>> |
| 149 | <?php esc_html_e( 'Lazy Load', 'wp-smushit' ); ?> |
| 150 | </button> |
| 151 | <?php if ( ! is_multisite() ) : ?> |
| 152 | <button onclick="WP_Smush.onboarding.goTo('usage')" class="<# if ( 'usage' === data.slide ) { #>sui-current<# } #>" <# if ( 'usage' === data.slide ) { #>disabled<# } #>> |
| 153 | <?php esc_html_e( 'Usage Data', 'wp-smushit' ); ?> |
| 154 | </button> |
| 155 | <?php endif; ?> |
| 156 | </div> |
| 157 | </div> |
| 158 | </script> |
| 159 | |
| 160 | <div class="sui-modal sui-modal-md"> |
| 161 | <div |
| 162 | role="dialog" |
| 163 | id="smush-onboarding-dialog" |
| 164 | class="sui-modal-content smush-onboarding-dialog" |
| 165 | aria-modal="true" |
| 166 | aria-labelledby="smush-title-onboarding-dialog" |
| 167 | aria-describedby="smush-description-onboarding-dialog" |
| 168 | > |
| 169 | <div class="sui-box"> |
| 170 | <div id="smush-onboarding-content" aria-live="polite"></div> |
| 171 | <input type="hidden" id="smush_quick_setup_nonce" name="_wpnonce" value="<?php echo wp_create_nonce( 'smush_quick_setup' ); ?>"> |
| 172 | </div> |
| 173 | <button class="sui-modal-skip smush-onboarding-skip-link"> |
| 174 | <?php esc_html_e( 'Skip this, I’ll set it up later', 'wp-smushit' ); ?> |
| 175 | </button> |
| 176 | </div> |
| 177 | </div> |
| 178 |