PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | templates/images/lazyload.php +30 -10 3.2.7 → 4.7.0 View file →
@@ -1,9 +1,11 @@
1 -<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
1 +<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
2 2 <?php
3 3 $lazyload_options = $options->get_option('lazyload', array(
4 4 'images' => false,
5 + 'backgrounds' => false,
5 6 'iframes' => false,
7 + 'youtube_preview' => false,
6 8 'skip_classes' => '',
7 9 ));
8 10
9 11 $read_more_link = 'https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/';
@@ -10,27 +12,45 @@
10 12
11 13 ?>
12 14
13 15 <div id="wpo_lazy_load_settings">
14 - <h3 class="wpo-first-child"><?php _e('Lazy-load images'); ?></h3>
16 + <h3 class="wpo-first-child"><?php esc_html_e('Lazy-load images', 'wp-optimize'); ?></h3>
15 17 <div class="wpo-fieldgroup premium-only">
16 18 <p>
17 - <?php _e('Lazy-loading is technique that defers loading of non-critical resources (images, video) at page load time. Instead, these non-critical resources are loaded at the point they are needed (e.g. the user scrolls down to them).', 'wp-optimize'); ?>
19 + <?php
20 + $message = __('Lazy-loading is a technique that defers loading of non-critical resources (images, video) at page load time.', 'wp-optimize');
21 + $message .= ' ';
22 + $message .= __('Instead, these non-critical resources are loaded at the point they are needed (e.g. the user scrolls down to them).', 'wp-optimize');
23 + echo esc_html($message);
24 + ?>
18 25 <br>
19 - <a href="<?php echo $read_more_link; ?>" target="_blank"><?php _e('Follow this link to read more about lazy-loading images and video', 'wp-optimize'); ?></a>
26 + <?php $wp_optimize->wp_optimize_url($read_more_link, __('Follow this link to read more about lazy-loading images and video', 'wp-optimize')); ?>
20 27 </p>
21 28 <ul>
22 - <li><label><input type="checkbox" name="lazyload[images]" <?php checked($lazyload_options['images']); ?> disabled /><?php _e('Images', 'wp-optimize'); ?></label></li>
23 - <li><label><input type="checkbox" name="lazyload[iframes]" <?php checked($lazyload_options['iframes']); ?> disabled /><?php _e('Iframes and Videos', 'wp-optimize'); ?></label></li>
29 + <li><label><input type="checkbox" name="lazyload[images]" <?php checked($lazyload_options['images']); ?> disabled /><?php esc_html_e('Images', 'wp-optimize'); ?></label></li>
30 + <li><label><input type="checkbox" name="lazyload[backgrounds]" <?php checked($lazyload_options['backgrounds']); ?> disabled /><?php esc_html_e('Background images', 'wp-optimize'); ?></label></li>
31 + <li><label><input type="checkbox" name="lazyload[iframes]" <?php checked($lazyload_options['iframes']); ?> disabled /><?php esc_html_e('Iframes and Videos', 'wp-optimize'); ?></label></li>
32 + <li>
33 + <label> <input type="checkbox" name="lazyload[youtube_preview]" <?php checked($lazyload_options['youtube_preview']); ?> disabled /><?php esc_html_e('Replace YouTube iframe with thumbnail image', 'wp-optimize'); ?>
34 + </label>
35 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Improves page loading time when YouTube videos are present on the page.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
36 + </li>
24 37 </ul>
25 38
26 39 <p>
27 - <?php _e('Skip image classes', 'wp-optimize');?><br>
40 + <?php esc_html_e('Skip image classes', 'wp-optimize');?><br>
28 41 <input type="text" name="lazyload[skip_classes]" id="wpo_lazyload_skip_classes" value="<?php echo esc_attr($lazyload_options['skip_classes']); ?>" disabled readonly /><br>
29 - <small><?php _e('Enter the image class or classes comma-separated. Supports wildcards. Example: image-class1, image-class2, thumbnail*, ...', 'wp-optimize'); ?></small>
42 + <?php
43 + $message = __('Enter the image class or classes comma-separated.', 'wp-optimize');
44 + $message .= ' ';
45 + $message .= __('Supports wildcards.', 'wp-optimize');
46 + $message .= ' ';
47 + $message .= __('Example: image-class1, image-class2, thumbnail*, ...', 'wp-optimize');
48 + ?>
49 + <small><?php echo esc_html($message); ?></small>
30 50 </p>
31 51
32 52 <div class="wpo-unused-image-sizes__premium-mask">
33 - <a class="wpo-unused-images__premium-link" href="<?php esc_attr_e($wp_optimize->premium_version_link); ?>" target="_blank"><?php _e('Enable Lazy-loading with WP-Optimize Premium.', 'wp-optimize'); ?></a>
53 + <a class="wpo-unused-images__premium-link" href="<?php echo esc_url($wp_optimize->premium_version_link);?>&utm_content=enable-lazy-loading" target="_blank"><?php esc_html_e('Enable Lazy-loading with WP-Optimize Premium.', 'wp-optimize'); ?></a>
34 54 </div>
35 55 </div>
36 -</div>
56 +</div>