PluginProbe
Flying Images: Optimize and Lazy Load Images for Faster Page Speed / 2.4.2
Flying Images: Optimize and Lazy Load Images for Faster Page Speed v2.4.2
trunk 1.0.0 1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 2.0.0 2.1.0 2.1.1 2.2.0 2.2.1 All 57 releases
nazy-load / settings / compression.php

compression.php in Flying Images: Optimize and Lazy Load Images for Faster Page Speed 2.4.2, at settings/compression.php

50 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 function flying_pages_settings_compression() {
3 if (isset($_POST['submit'])) {
4 update_option('flying_images_enable_compression', sanitize_text_field($_POST['enable_compression']));
5 update_option('flying_images_quality', sanitize_text_field($_POST['quality']));
6 }
7
8 $enable_cdn = get_option('flying_images_enable_cdn');
9 $enable_compression = get_option('flying_images_enable_compression');
10 $quality = get_option('flying_images_quality');
11
12 if(!$enable_cdn) echo '<br/><div class="notice notice-error is-dismissible"><p>CDN must be enabled for Compression</p></div>';
13
14 ?>
15 <form method="POST">
16 <?php wp_nonce_field('flying-images', 'flying-images-settings-form'); ?>
17 <table class="form-table" role="presentation">
18 <tbody>
19 <tr>
20 <th scope="row"><label>Enable Compression</label></th>
21 <td>
22 <input name="enable_compression" type="checkbox" value="1" <?php if ($enable_compression) {echo "checked";} ?>>
23 <p class="description">Compress images on the fly. If your images are already compressed using other plugins you can turn this off</p>
24 </td>
25 </tr>
26 <tr>
27 <th scope="row"><label>Compression Quality</label></th>
28 <td>
29 <select name="quality" value="<?php echo $quality; ?>">
30 <option value="100" <?php if ($quality == 100) {echo 'selected';} ?>>100%</option>
31 <option value="90" <?php if ($quality == 90) {echo 'selected';} ?>>90%</option>
32 <option value="80" <?php if ($quality == 80) {echo 'selected';} ?>>80%</option>
33 <option value="70" <?php if ($quality == 70) {echo 'selected';} ?>>70%</option>
34 <option value="60" <?php if ($quality == 60) {echo 'selected';} ?>>60%</option>
35 <option value="50" <?php if ($quality == 50) {echo 'selected';} ?>>50%</option>
36 <option value="40" <?php if ($quality == 40) {echo 'selected';} ?>>40%</option>
37 <option value="30" <?php if ($quality == 30) {echo 'selected';} ?>>30%</option>
38 <option value="20" <?php if ($quality == 20) {echo 'selected';} ?>>20%</option>
39 <option value="10" <?php if ($quality == 10) {echo 'selected';} ?>>10%</option>
40 </select>
41 <td>
42 </tr>
43 </tbody>
44 </table>
45 <p class="submit">
46 <input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes">
47 </p>
48 </form>
49 <?php
50 }