PluginProbe
Flying Images: Optimize and Lazy Load Images for Faster Page Speed / trunk
Flying Images: Optimize and Lazy Load Images for Faster Page Speed vtrunk
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 / init-config.php

init-config.php in Flying Images: Optimize and Lazy Load Images for Faster Page Speed trunk, at init-config.php

43 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Set default config on plugin load if not set
3 function flying_images_set_default_config() {
4
5 if (FLYING_IMAGES_VERSION !== get_option('FLYING_IMAGES_VERSION')) {
6
7 // Lazy loading
8 if (get_option('flying_images_enable_lazyloading') === false)
9 update_option('flying_images_enable_lazyloading', true);
10
11 if (get_option('flying_images_lazymethod') === false)
12 update_option('flying_images_lazymethod', "javascript");
13
14 if (get_option('flying_images_margin') === false)
15 update_option('flying_images_margin', 500);
16
17 if (get_option('flying_images_exclude_keywords') === false)
18 update_option('flying_images_exclude_keywords', ['your-logo.png']);
19
20 // CDN
21 if (get_option('flying_images_enable_cdn') === false)
22 update_option('flying_images_enable_cdn', true);
23
24 if (get_option('flying_images_cdn_exclude_keywords') === false)
25 update_option('flying_images_cdn_exclude_keywords', []);
26
27 // Compression
28 if (get_option('flying_images_enable_compression') === false)
29 update_option('flying_images_enable_compression', true);
30
31 if (get_option('flying_images_quality') === false)
32 update_option('flying_images_quality', 100);
33
34 // Responsiveness
35 if (get_option('flying_images_enable_responsive_images') === false)
36 update_option('flying_images_enable_responsive_images', true);
37
38 update_option('FLYING_IMAGES_VERSION', FLYING_IMAGES_VERSION);
39 }
40 }
41
42 add_action('plugins_loaded', 'flying_images_set_default_config');
43