PluginProbe
Flying Scripts: Delay JavaScript to Improve Site Speed & Performance / 1.2.0
Flying Scripts: Delay JavaScript to Improve Site Speed & Performance v1.2.0
trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4
flying-scripts / init-config.php

init-config.php in Flying Scripts: Delay JavaScript to Improve Site Speed & Performance 1.2.0, at init-config.php

21 lines 732 B
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_scripts_set_default_config() {
4
5 if (FLYING_SCRIPTS_VERSION !== get_option('FLYING_SCRIPTS_VERSION')) {
6
7 if (get_option('flying_scripts_timeout') === false)
8 update_option('flying_scripts_timeout', 5);
9
10 if (get_option('flying_scripts_include_list') === false)
11 update_option('flying_scripts_include_list', []);
12
13 if (get_option('flying_scripts_disabled_pages') === false)
14 update_option('flying_scripts_disabled_pages', []);
15
16 update_option('FLYING_SCRIPTS_VERSION', FLYING_SCRIPTS_VERSION);
17 }
18 }
19
20 add_action('plugins_loaded', 'flying_scripts_set_default_config');
21