PluginProbe
Loading Page with Loading Screen / 1.2.7
Loading Page with Loading Screen v1.2.7
1.2.8 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 46 releases
loading-page / loading-page.php

loading-page.php in Loading Page with Loading Screen 1.2.7, at loading-page.php

1,281 lines 62.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 Plugin Name: Loading Page
4 Plugin URI: http://wordpress.dwbooster.com/content-tools/loading-page
5 Description: Loading Page plugin performs a pre-loading of images on your website and displays a loading progress screen with percentage of completion. Once everything is loaded, the screen disappears.
6 Version: 1.2.7
7 Author: CodePeople
8 Author URI: http://wordpress.dwbooster.com/content-tools/loading-page
9 License: GPLv2
10 Text Domain: loading-page
11 */
12
13 require_once 'banner.php';
14 $codepeople_promote_banner_plugins['codepeople-loading-page'] = array(
15 'plugin_name' => 'Loading Page',
16 'plugin_url' => 'https://wordpress.org/support/plugin/loading-page/reviews/#new-post',
17 );
18
19 // CONST.
20 define( 'LOADING_PAGE_PLUGIN_DIR', dirname( __FILE__ ) );
21 define( 'LOADING_PAGE_PLUGIN_URL', plugins_url( '', __FILE__ ) );
22 define( 'LOADING_PAGE_TD', 'loading-page' );
23
24 // Feedback system.
25 require_once 'feedback/cp-feedback.php';
26 new CP_FEEDBACK( plugin_basename( dirname( __FILE__ ) ), __FILE__, 'https://wordpress.dwbooster.com/contact-us' );
27
28 require LOADING_PAGE_PLUGIN_DIR . '/includes/admin_functions.php';
29
30 add_filter( 'option_sbp_settings', 'loading_page_troubleshoot' );
31 if ( ! function_exists( 'loading_page_troubleshoot' ) ) {
32 /**
33 * Troubleshoot
34 *
35 * @param array $option checks values entered by third-party plugins.
36 */
37 function loading_page_troubleshoot( $option ) {
38 if ( ! is_admin() ) {
39 // Solves a conflict caused by the "Speed Booster Pack" plugin.
40 if ( is_array( $option ) && isset( $option['jquery_to_footer'] ) ) {
41 unset( $option['jquery_to_footer'] );
42 }
43 if ( is_array( $option ) && isset( $option['defer_parsing'] ) ) {
44 unset( $option['defer_parsing'] );
45 }
46 }
47 return $option;
48 } // End loading_page_troubleshoot.
49 }
50
51 /**
52 * Plugin activation
53 */
54 register_activation_hook( __FILE__, 'loading_page_install' );
55 if ( ! function_exists( 'loading_page_install' ) ) {
56 /**
57 * Default options
58 */
59 function _loading_page_options() {
60 $loading_page_options = get_option( 'loading_page_options', array() );
61 if ( ! empty( $loading_page_options ) ) {
62 return;
63 }
64
65 // Set the default options here.
66 $loading_page_options = array(
67 'foregroundColor' => '#000000',
68 'backgroundColor' => '#ffffff',
69 'enabled_loading_screen' => true,
70 'close_btn' => true,
71 'remove_in_on_load' => false,
72 'loading_screen' => 'logo',
73 'lp_loading_screen_display_in' => 'all',
74 'once_per_session' => 'always',
75 'lp_loading_screen_display_in_pages' => '',
76 'lp_loading_screen_display_post_types' => '',
77 'lp_loading_screen_include_from_urls' => array(),
78 'lp_loading_screen_exclude_from_pages' => '',
79 'lp_loading_screen_exclude_from_post_types' => '',
80 'lp_loading_screen_exclude_from_urls' => array(),
81 'displayPercent' => true,
82 'backgroundImage' => '',
83 'backgroundImageRepeat' => 'repeat',
84 'fullscreen' => 0,
85 'pageEffect' => 'none',
86 'deepSearch' => true,
87 'modifyDisplayRule' => false,
88 // For the logo screen.
89 'lp_ls' => array( 'logo' => array( 'image' => plugins_url( 'loading-screens/logo/images/05.svg', __FILE__ ) ) ),
90 );
91
92 update_option( 'loading_page_options', $loading_page_options );
93 }
94
95 /**
96 * Install
97 *
98 * @param boolean $networkwide indicates if it is a multisite WordPress installation.
99 */
100 function loading_page_install( $networkwide ) {
101 global $wpdb;
102
103 if ( function_exists( 'is_multisite' ) && is_multisite() ) {
104 if ( $networkwide ) {
105 $old_blog = $wpdb->blogid;
106 // Get all blog ids.
107 $blogids = get_sites( array( 'fields' => 'ids' ) );
108 foreach ( $blogids as $blog_id ) {
109 switch_to_blog( $blog_id );
110 _loading_page_options();
111 }
112 switch_to_blog( $old_blog );
113 return;
114 }
115 }
116 _loading_page_options();
117 } // End loading_page_install.
118 } // End plugin activation.
119
120 /**
121 * Patch to solve the conflict with the previous version that was using animated gifs.
122 */
123 function loading_page_gifs_replacement_patch() {
124 $opt = get_option( 'loading_page_options', array() );
125 if (
126 ! empty( $opt ) &&
127 ! empty( $opt['lp_ls'] ) &&
128 ! empty( $opt['lp_ls']['logo'] ) &&
129 ! empty( $opt['lp_ls']['logo']['image'] )
130 ) {
131 $path = $opt['lp_ls']['logo']['image'];
132 // Only to solve an issue with the previous version of the plugin when where used .gif.
133 $path = preg_replace( '/\/loading\-screens\/logo\/gifs\/(\d+)\.gif/i', '/loading-screens/logo/images/$1.svg', $path );
134 $opt['lp_ls']['logo']['image'] = $path;
135 update_option( 'loading_page_options', $opt );
136 }
137 }
138
139 /**
140 * Replaces the animated gifts
141 *
142 * @param object $upgrader_object unused parameter.
143 * @param array $options plugins identifiers.
144 */
145 function loading_page_upgrade_completed_gifs_patch( $upgrader_object, $options ) {
146 $our_plugin = plugin_basename( __FILE__ );
147 if ( 'update' === $options['action'] && 'plugin' === $options['type'] && isset( $options['plugins'] ) ) {
148 foreach ( $options['plugins'] as $plugin ) {
149 if ( $plugin === $our_plugin ) {
150 loading_page_gifs_replacement_patch();
151 }
152 }
153 }
154 }
155 add_action( 'upgrader_process_complete', 'loading_page_upgrade_completed_gifs_patch', 10, 2 );
156 /**
157 * Calls the gifs replacement patch
158 *
159 * @param string $plugin plugin name.
160 * @param boolean $network_activation plugins activate into a WordPress multisite installation.
161 */
162 function loading_page_activated_gifs_patch( $plugin, $network_activation ) {
163 if ( plugin_basename( __FILE__ ) === $plugin ) {
164 loading_page_gifs_replacement_patch();
165 }
166 }
167 add_action( 'activated_plugin', 'loading_page_activated_gifs_patch', 10, 2 );
168
169 /**
170 * A new blog has been created in a multisite WordPress
171 */
172 add_action( 'wpmu_new_blog', 'loading_page_new_blog', 10, 6 );
173 /**
174 * New blog creation
175 *
176 * @param integer $blog_id blog id.
177 * @param integer $user_id user id.
178 * @param string $domain blog domain.
179 * @param string $path blog path.
180 * @param integer $site_id site id.
181 * @param array $meta metadata.
182 */
183 function loading_page_new_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
184 global $wpdb;
185 $file = basename( __FILE__ );
186 $dir = basename( dirname( __FILE__ ) );
187 if ( is_plugin_active_for_network( $dir . '/' . $file ) ) {
188 $current_blog = $wpdb->blogid;
189 switch_to_blog( $blog_id );
190 _loading_page_options();
191 switch_to_blog( $current_blog );
192 }
193 } // End loading_page_new_blog.
194
195 // Redirecting the user to the settings page of the plugin.
196 add_action( 'activated_plugin', 'loading_page_redirect_to_settings', 10, 2 );
197 if ( ! function_exists( 'loading_page_redirect_to_settings' ) ) {
198 /**
199 * Redirects the user to the settings page
200 *
201 * @param string $plugin plugin name.
202 * @param boolean $network_activation multisite activation.
203 */
204 function loading_page_redirect_to_settings( $plugin, $network_activation ) {
205 if (
206 empty( $_REQUEST['_ajax_nonce'] ) &&
207 plugin_basename( __FILE__ ) === $plugin &&
208 ( ! isset( $_POST['action'] ) || 'activate-selected' !== $_POST['action'] ) && // phpcs:ignore WordPress.Security.NonceVerification
209 ( ! isset( $_POST['action2'] ) || 'activate-selected' !== $_POST['action2'] ) // phpcs:ignore WordPress.Security.NonceVerification
210 ) {
211 wp_safe_redirect( admin_url( 'options-general.php?page=loading-page.php' ) );
212 remove_all_actions( 'shutdown' );
213 exit;
214 }
215 }
216 }
217
218 if ( ! function_exists( 'loading_page_get_settings' ) ) {
219 function loading_page_get_settings() {
220 global $wp, $_loading_page_settings_global_var;
221 if ( empty( $_loading_page_settings_global_var ) ) {
222 $current_url = home_url( add_query_arg( array(), $wp->request ) );
223 $_loading_page_settings_global_var = apply_filters( 'loading_page_settings', get_option( 'loading_page_options', [] ), $current_url );
224 }
225 return $_loading_page_settings_global_var;
226 } // End loading_page_get_settings
227 }
228
229 /*
230 * Plugin initializing
231 */
232 add_action( 'init', 'loading_page_init' );
233 if ( ! function_exists( 'loading_page_init' ) ) {
234 /**
235 * Enqueuen script if loading page is enabled
236 */
237 function loading_page_init() {
238 if ( ! is_admin() && empty( $_REQUEST['elementor-preview'] ) ) {
239
240 $op = loading_page_get_settings();
241
242 if ( ! empty( $op ) && is_array( $op ) && ! empty( $op['enabled_loading_screen'] ) ) {
243 if (
244 ! defined( 'DOING_AJAX' ) &&
245 ! empty( $op['once_per_session'] ) &&
246 'always' != $op['once_per_session'] &&
247 session_id() == '' &&
248 ! headers_sent()
249 ) {
250 @session_start();
251 }
252
253 add_action( 'wp_enqueue_scripts', 'loading_page_enqueue_scripts', 1 );
254 }
255 }
256 } // End loading_page_init.
257 }
258
259 /*
260 * Admin initionalizing
261 */
262 add_action( 'admin_init', 'loading_page_admin_init' );
263 if ( ! function_exists( 'loading_page_admin_init' ) ) {
264 /**
265 * Initialize the plugin admin
266 */
267 function loading_page_admin_init() {
268 // Load the associated text domain.
269 load_plugin_textdomain( 'loading-page', false, LOADING_PAGE_PLUGIN_DIR . '/languages/' );
270
271 // Set plugin links.
272 $plugin = plugin_basename( __FILE__ );
273 add_filter( 'plugin_action_links_' . $plugin, 'loading_page_links' );
274
275 // Load resources.
276 add_action( 'admin_enqueue_scripts', 'loading_page_admin_resources' );
277 } // End loading_page_admin_init.
278 }
279
280 if ( ! function_exists( 'loading_page_links' ) ) {
281 /**
282 * Set plugins section links
283 *
284 * @param array $links links array.
285 */
286 function loading_page_links( $links ) {
287 // Custom link.
288 $custom_link = '<a href="http://wordpress.dwbooster.com/contact-us" target="_blank">' . __( 'Request custom changes', 'loading-page' ) . '</a>';
289 array_unshift( $links, $custom_link );
290
291 // Settings link.
292 $settings_link = '<a href="options-general.php?page=loading-page.php">' . __( 'Settings', 'loading-page' ) . '</a>';
293 array_unshift( $links, $settings_link );
294
295 return $links;
296 } // End loading_page_links.
297 }
298
299 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'loading_page_customization_link' );
300 if ( ! function_exists( 'loading_page_customization_link' ) ) {
301 /**
302 * Redirects the user to the WordPress forum
303 *
304 * @param array $links links array.
305 */
306 function loading_page_customization_link( $links ) {
307 array_unshift( $links, '<a href="https://wordpress.org/support/plugin/loading-page/#new-post" target="_blank">' . __( 'Help', 'loading-page' ) . '</a>' );
308 return $links;
309 }
310 }
311
312 // Set the settings menu option.
313 add_action( 'admin_menu', 'loading_page_settings_menu' );
314 if ( ! function_exists( 'loading_page_settings_menu' ) ) {
315 /**
316 * WordPress menu option
317 */
318 function loading_page_settings_menu() {
319 /**
320 * Add to admin_menu
321 * - The capability has been modified, from "edit_posts" to "manage_options"
322 * - Now only the administrators can now edit the "Loading Page" settings.
323 */
324 add_options_page( 'Loading Page', 'Loading Page', 'manage_options', 'loading-page.php', 'loading_page_settings_page' );
325 } // End loading_page_settings_menu.
326 }
327
328 if ( ! function_exists( 'loading_page_add_code_block' ) ) {
329 /**
330 * Embed the code block on page
331 */
332 function loading_page_add_code_block() {
333 $codeblock = '';
334 $op = loading_page_get_settings();
335 if ( ! empty( $op ) && ! empty( $op['codeBlock'] ) ) {
336 $codeblock = '<div id="loading_page_codeBlock">' . $op['codeBlock'] . '</div>';
337 }
338 return $codeblock;
339 }
340 }
341
342 if ( ! function_exists( 'loading_page_admin_resources' ) ) {
343 /**
344 * Enqueue admin resources
345 *
346 * @param string $hook hook name.
347 */
348 function loading_page_admin_resources( $hook ) {
349 if ( strpos( $hook, 'loading-page' ) !== false ) {
350 wp_enqueue_media();
351 wp_enqueue_style( 'farbtastic' );
352 wp_enqueue_script( 'farbtastic' );
353 wp_enqueue_style( 'thickbox' );
354 wp_enqueue_script( 'thickbox' );
355
356 wp_enqueue_script( 'lp-admin-script', LOADING_PAGE_PLUGIN_URL . '/js/loading-page-admin.js', array( 'jquery', 'thickbox', 'farbtastic' ), 'free-1.2.7', true );
357 }
358 } // End loading_page_admin_resources.
359 }
360
361 if ( ! function_exists( 'loading_page_coming_soon_active' ) ) {
362 function loading_page_coming_soon_active() {
363 // For Elementor coming soon and Maintenance mode.
364 if (
365 defined( 'ELEMENTOR_VERSION' ) &&
366 false !== ( $elementor_mode = get_option( 'elementor_maintenance_mode_mode' ) ) &&
367 in_array( $elementor_mode, ['coming_soon', 'maintenance'] )
368 ) {
369 $elementor_exclude = get_option( 'elementor_maintenance_mode_exclude_mode' );
370 $current_user = wp_get_current_user();
371
372 if ( $current_user->ID == 0 ) return true;
373
374 if ( 'custom' == $elementor_exclude ) {
375 $elementor_exclude_roles = get_option( 'elementor_maintenance_mode_exclude_roles' );
376
377 if (
378 ! empty( $elementor_exclude_roles ) &&
379 ! count( array_intersect( $elementor_exclude_roles, $current_user->roles ) )
380 ) {
381 return true;
382 }
383 }
384 }
385 return false;
386 } // End loading_page_coming_soon_active.
387 }
388
389 if ( ! function_exists( 'loading_page_loading_screen' ) ) {
390 /**
391 * Deciding to include the loading screen
392 */
393 function loading_page_loading_screen() {
394 global $post;
395
396 $is_bot = function () {
397 if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
398 $system = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
399 if ( ! empty( $system ) ) {
400 return preg_match( '/(Googlebot)|(Baiduspider)|(ia_archiver)|(R6_FeedFetcher)|(NetcraftSurveyAgent)|(Sogou web spider)|(bingbot)|(Yahoo\! Slurp)|(facebookexternalhit)|(PrintfulBot)|(msnbot)|(Twitterbot)|(UnwindFetchor)|(urlresolver)/i', $system );
401 }
402 }
403
404 return false;
405 };
406
407 $op = loading_page_get_settings();
408 $loading_screen = 0;
409
410 if ( $is_bot() ) {
411 return $loading_screen;
412 }
413
414 if (
415 ! empty( $op['enabled_loading_screen'] )
416 ) {
417 global $wp;
418 $current_url = home_url( add_query_arg( array(), $wp->request ) );
419 $_permalink = md5( $current_url );
420
421 if (
422 empty( $op['lp_loading_screen_devices'] ) ||
423 'both' == $op['lp_loading_screen_devices'] ||
424 ( 'desktop' == $op['lp_loading_screen_devices'] && ! wp_is_mobile() ) ||
425 ( 'mobile' == $op['lp_loading_screen_devices'] && wp_is_mobile() )
426 ) {
427 if ( ! empty( $op['once_per_session'] ) && 'always' != $op['once_per_session'] ) {
428 if(
429 ! empty( $_SESSION['loading_page_once_per_session'] ) &&
430 (
431 'site' == $op['once_per_session'] ||
432 (
433 'page' == $op['once_per_session'] &&
434 is_array( $_SESSION['loading_page_once_per_session'] ) &&
435 ! empty( $_SESSION['loading_page_once_per_session'][ $_permalink ] )
436 )
437 )
438 ) {
439 return $loading_screen;
440 }
441
442 if ( empty( $_SESSION['loading_page_once_per_session'] ) || ! is_array( $_SESSION['loading_page_once_per_session'] ) ) {
443 $_SESSION['loading_page_once_per_session'] = array();
444 }
445 $_SESSION['loading_page_once_per_session'][ $_permalink ] = 1;
446 }
447
448 $pages = ( ! empty( $op['lp_loading_screen_display_in_pages'] ) ) ? $op['lp_loading_screen_display_in_pages'] : '';
449 $pages = str_replace( ' ', '', $pages );
450 $pages = explode( ',', $pages );
451
452 $post_types = ( ! empty( $op['lp_loading_screen_display_post_types'] ) ) ? $op['lp_loading_screen_display_post_types'] : '';
453 $post_types = str_replace( ' ', '', $post_types );
454 $post_types = explode( ',', $post_types );
455
456 $exclude_pages = ( ! empty( $op['lp_loading_screen_exclude_from_pages'] ) ) ? $op['lp_loading_screen_exclude_from_pages'] : '';
457 $exclude_pages = str_replace( ' ', '', $exclude_pages );
458 $exclude_pages = explode( ',', $exclude_pages );
459
460 $exclude_post_types = ( ! empty( $op['lp_loading_screen_exclude_from_post_types'] ) ) ? $op['lp_loading_screen_exclude_from_post_types'] : '';
461 $exclude_post_types = str_replace( ' ', '', $exclude_post_types );
462 $exclude_post_types = explode( ',', $exclude_post_types );
463
464 $exclude_pages_urls = ( ! empty( $op['lp_loading_screen_exclude_from_urls'] ) ) ? $op['lp_loading_screen_exclude_from_urls'] : array();
465
466 $include_pages_urls = ( ! empty( $op['lp_loading_screen_include_from_urls'] ) ) ? $op['lp_loading_screen_include_from_urls'] : array();
467
468 $exclude_elementor_maintenance = (
469 ! empty( $op['lp_loading_screen_exclude_from_elementor_maintenance'] ) &&
470 loading_page_coming_soon_active()
471 ) ? true : false;
472
473 // Initialize current URL
474 $protocol = ( ( ! empty( $_SERVER['HTTPS'] ) && 'off' !== $_SERVER['HTTPS'] ) || ( isset( $_SERVER['SERVER_PORT'] ) && 443 === $_SERVER['SERVER_PORT'] ) ) ? 'https://' : 'http://';
475 $current_url = esc_url_raw( $protocol . ( isset( $_SERVER['HTTP_HOST'] ) ? wp_unslash( $_SERVER['HTTP_HOST'] ) : '' ) . ( isset( $_SERVER['REQUEST_URI'] ) ? wp_unslash( $_SERVER['REQUEST_URI'] ) : '' ) );
476
477 $match_url = function ( $urls_array ) use ( $current_url ) {
478 foreach ( $urls_array as $url ) {
479 $url = preg_quote( $url, '/' );
480 $url = str_replace( '\*', '.*', $url );
481 if ( preg_match( '/^' . $url . '$/i', $current_url ) ) {
482 return true;
483 }
484 }
485
486 return false;
487 };
488
489 if (
490 ! $exclude_elementor_maintenance &&
491 ( empty( $op['lp_loading_screen_display_in'] ) ||
492 ('all' === $op['lp_loading_screen_display_in'] && ( empty( $include_pages_urls ) || $match_url( $include_pages_urls ) ) ) ||
493 ( 'home' === $op['lp_loading_screen_display_in'] && ( is_home() || is_front_page() ) ) ||
494 ( 'pages' === $op['lp_loading_screen_display_in'] && is_singular() && isset( $post ) && in_array( $post->ID, $pages ) ) ||
495 ( 'post_type' === $op['lp_loading_screen_display_in'] && is_singular() && isset( $post ) && in_array( $post->post_type, $post_types, true ) )
496 ) &&
497 ( empty( $post ) ||
498 empty( $post->ID ) ||
499 (
500 ( empty( $exclude_pages ) ||
501 ! in_array( $post->ID, $exclude_pages )
502 )
503 &&
504 ( empty( $exclude_post_types ) ||
505 ! in_array( $post->post_type, $exclude_post_types, true )
506 )
507 )
508 )
509 ) {
510 if ( ! empty( $exclude_pages_urls ) && $match_url( $exclude_pages_urls ) ) return;
511
512 add_filter( 'body_class', function( $classes ){ $classes[] = 'lp_loading_screen_body'; return $classes; } );
513 $loading_screen = 1;
514 add_action( 'wp_head', 'loading_page_replace_the_header', 99 );
515 add_filter( 'autoptimize_filter_js_dontmove', 'loading_page_autoptimize_exclude', 10, 1 );
516 }
517 }
518 }
519 return $loading_screen;
520 }
521 }
522
523 if ( ! function_exists( 'loading_page_autoptimize_exclude' ) ) {
524 /**
525 * Excluding the plugin resources from Autoptimize
526 *
527 * @param array $to_exclude to exclude URLs.
528 */
529 function loading_page_autoptimize_exclude( $to_exclude ) {
530 $to_exclude[] = 'loading-page.min.js';
531 $to_exclude[] = '/loading-screens/';
532 return $to_exclude;
533 }
534 }
535
536 if ( ! function_exists( 'loading_page_replace_the_header' ) ) {
537 /**
538 * Including styles in the page header section
539 */
540 function loading_page_replace_the_header() {
541 $opt = loading_page_get_settings();
542 if ( empty( $opt ) || empty( $opt['modifyDisplayRule'] ) ) {
543 echo '<style id="loading-page-inline-style">body{visibility:hidden;}</style><noscript><style>body{visibility:visible;}</style></noscript>';
544 } else {
545 echo '<style id="loading-page-inline-style">body{display:none;}</style><noscript><style>body{display:block;}</style></noscript>';
546 }
547
548 if (
549 ! empty( $opt ) &&
550 ! empty( $opt['lp_ls'] ) &&
551 ! empty( $opt['lp_ls']['logo'] ) &&
552 ! empty( $opt['lp_ls']['logo']['image'] )
553 ) {
554 $path = $opt['lp_ls']['logo']['image'];
555 echo '<link rel="preload" href="' . esc_attr( $path ) . '" as="image" type="image/svg+xml">';
556 }
557 } // End loading_page_replace_the_header.
558 }
559
560 if ( ! function_exists( 'loading_page_hex2rgb' ) ) {
561 /**
562 * Transform colors code
563 *
564 * @param array/string $colour color code.
565 */
566 function loading_page_hex2rgb( $colour, $percentage = 80 ) {
567 if ( '#' === $colour[0] ) {
568 $colour = substr( $colour, 1 );
569 }
570 if ( 6 === strlen( $colour ) ) {
571 list($r, $g, $b) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
572 } elseif ( 3 === strlen( $colour ) ) {
573 list($r, $g, $b) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
574 } else {
575 return $colour;
576 }
577 $r = hexdec( $r );
578 $g = hexdec( $g );
579 $b = hexdec( $b );
580
581 return 'rgba(' . $r . ',' . $g . ',' . $b . ',' . ( $percentage / 100 ) . ')';
582 }
583 }
584
585 if ( ! function_exists( 'loading_page_enqueue_scripts' ) ) {
586 /**
587 * Enqueue public scripts
588 */
589 function loading_page_enqueue_scripts() {
590 global $post;
591
592 $op = loading_page_get_settings();
593 $loading_screen = loading_page_loading_screen();
594 if ( $loading_screen && ! empty( $op['from_trigger'] ) ) {
595 wp_enqueue_script( 'codepeople-loading-page-link-script', LOADING_PAGE_PLUGIN_URL . '/js/links.min.js', array( 'jquery' ), 'free-1.2.7', false );
596 }
597
598 if ( $loading_screen ) {
599 $loading_page_settings = array(
600 'loadingScreen' => $loading_screen,
601 'closeBtn' => ( ! isset( $op['close_btn'] ) || $op['close_btn'] ) ? true : false,
602 'removeInOnLoad' => ( ! empty( $op['remove_in_on_load'] ) ) ? $op['remove_in_on_load'] : false,
603 'codeblock' => loading_page_add_code_block(),
604 'backgroundColor' => ( ! isset( $op['transparency'] ) || $op['transparency'] )
605 ? loading_page_hex2rgb(
606 $op['backgroundColor'],
607 (
608 ! isset( $op['transparencyPercentage'] ) ||
609 ! is_numeric( $op['transparencyPercentage'] )
610 ? 80
611 : max( min( intval( $op['transparencyPercentage'] ), 100 ), 0 )
612 )
613 )
614 : $op['backgroundColor'],
615 'foregroundColor' => $op['foregroundColor'],
616 'backgroundImage' => $op['backgroundImage'],
617 'additionalSeconds' => ( ! empty( $op['additionalSeconds'] ) ) ? $op['additionalSeconds'] : 0,
618 'pageEffect' => $op['pageEffect'],
619 'backgroundRepeat' => $op['backgroundImageRepeat'],
620 'fullscreen' => ( ( ! empty( $op['fullscreen'] ) ) ? 1 : 0 ),
621 'graphic' => $op['loading_screen'],
622 'text' => ( ( ! empty( $op['displayPercent'] ) ) ? $op['displayPercent'] : 0 ),
623 'lp_ls' => ( ( ! empty( $op['lp_ls'] ) ) ? $op['lp_ls'] : 0 ),
624 'screen_size' => ( ( ! empty( $op['screen_size'] ) ) ? $op['screen_size'] : 'all' ),
625 'screen_width' => ( ( ! empty( $op['screen_width'] ) ) ? $op['screen_width'] : 0 ),
626 'deepSearch' => ( ( empty( $op['deepSearch'] ) ) ? 0 : 1 ),
627 'modifyDisplayRule' => ( ( empty( $op['modifyDisplayRule'] ) ) ? 0 : 1 ),
628 'triggerLinkScreenNeverClose' => empty( $op['triggerLinkScreenNeverClose'] ) ? 0 : 1,
629 'triggerLinkScreenCloseAfter' => ! empty( $op['triggerLinkScreenCloseAfter'] ) ? intval( $op['triggerLinkScreenCloseAfter'] ) : 4,
630 );
631
632 $required = array( 'jquery' );
633 wp_enqueue_script( 'jquery' );
634 wp_enqueue_style( 'codepeople-loading-page-style', LOADING_PAGE_PLUGIN_URL . '/css/loading-page.css', array(), 'free-1.2.7', false );
635 wp_enqueue_style( 'codepeople-loading-page-style-effect', LOADING_PAGE_PLUGIN_URL . '/css/loading-page' . ( ( 'none' !== $op['pageEffect'] ) ? '-' . $op['pageEffect'] : '' ) . '.css', array(), 'free-1.2.7', false );
636
637 $s = loading_page_get_screen( $op['loading_screen'] );
638 if ( $s ) {
639 if ( ! empty( $s['style'] ) ) {
640 wp_enqueue_style( 'codepeople-loading-page-style-' . $s['id'], $s['style'], array(), 'free-1.2.7', false );
641 }
642
643 if ( ! empty( $s['script'] ) ) {
644 wp_enqueue_script( 'codepeople-loading-page-script-' . $s['id'], $s['script'], array( 'jquery' ), 'free-1.2.7', false );
645 $required[] = 'codepeople-loading-page-script-' . $s['id'];
646 }
647 }
648 wp_enqueue_script( 'codepeople-loading-page-script', LOADING_PAGE_PLUGIN_URL . '/js/loading-page.min.js', $required, 'free-1.2.7', false );
649 if ( function_exists( 'wp_add_inline_script' ) ) {
650 wp_add_inline_script( 'codepeople-loading-page-script', 'loading_page_settings=' . wp_json_encode( $loading_page_settings ) . ';', 'before' );
651 } else {
652 wp_localize_script( 'codepeople-loading-page-script', 'loading_page_settings', $loading_page_settings );
653 }
654 }
655 } // End loading_page_enqueue_scripts.
656 }
657
658 if ( ! function_exists( 'loading_page_sanitize_array' ) ) {
659 /**
660 * Sanitize mutilevel array
661 *
662 * @param array/string $array values to sanitize.
663 */
664 function loading_page_sanitize_array( $array ) {
665 if ( is_array( $array ) ) {
666 foreach ( $array as $key => $value ) {
667 if ( is_array( $value ) ) {
668 $array[ $key ] = loading_page_sanitize_array( $value );
669 } else {
670 $array[ $key ] = sanitize_text_field( wp_unslash( $value ) );
671 }
672 }
673 return $array;
674 } else {
675 return sanitize_text_field( wp_unslash( $array ) );
676 }
677 } // End loading_page_sanitize_array.
678 }
679
680 if ( ! function_exists( 'loading_page_settings_page' ) ) {
681 /**
682 * Plugin settings page
683 */
684 function loading_page_settings_page() {
685 if ( isset( $_POST['loading_page_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['loading_page_nonce'] ) ), __FILE__ ) ) {
686
687 $allowed_tags = wp_kses_allowed_html( 'post' );
688
689 $allowed_tags['source'] = array(
690 'src' => true,
691 'type' => true
692 );
693
694 if ( current_user_can( 'manage_options' ) ) {
695 $allowed_tags['script'] = true;
696 $allowed_tags['style'] = true;
697 $allowed_tags['link'] = true;
698 }
699
700 $additional_seconds = isset( $_POST['lp_additionalSeconds'] ) && is_numeric( $_POST['lp_additionalSeconds'] ) ? intval( $_POST['lp_additionalSeconds'] ) : 0;
701 $code_block = isset( $_POST['lp_codeBlock'] ) ? wp_kses( wp_unslash( $_POST['lp_codeBlock'] ), $allowed_tags ) : '';
702
703 $lp_loading_screen_exclude_from_urls = isset( $_POST['lp_loading_screen_exclude_from_urls'] ) ? sanitize_textarea_field( wp_unslash( $_POST['lp_loading_screen_exclude_from_urls'] ) ) : '';
704 $lp_loading_screen_exclude_from_urls = explode( "\n", $lp_loading_screen_exclude_from_urls );
705 foreach ( $lp_loading_screen_exclude_from_urls as $key => $url ) {
706 $url = trim( $url );
707 if ( '' === $url ) {
708 unset( $lp_loading_screen_exclude_from_urls[ $key ] );
709 } else {
710 $lp_loading_screen_exclude_from_urls[ $key ] = $url;
711 }
712 }
713
714 $lp_loading_screen_include_from_urls = isset( $_POST['lp_loading_screen_include_from_urls'] ) ? sanitize_textarea_field( wp_unslash( $_POST['lp_loading_screen_include_from_urls'] ) ) : '';
715 $lp_loading_screen_include_from_urls = explode( "\n", $lp_loading_screen_include_from_urls );
716 foreach ( $lp_loading_screen_include_from_urls as $key => $url ) {
717 $url = trim( $url );
718 if ( '' === $url ) {
719 unset( $lp_loading_screen_include_from_urls[ $key ] );
720 } else {
721 $lp_loading_screen_include_from_urls[ $key ] = $url;
722 }
723 }
724
725 $lp_screen_width = '';
726 if ( ! empty( $_POST['lp_screen_width'] ) ) {
727 $lp_screen_width = preg_replace( '/[^\\d\\.]/', '', sanitize_text_field( wp_unslash( $_POST['lp_screen_width'] ) ) );
728 }
729
730 // Set the default options here.
731 $loading_page_options = array(
732 'foregroundColor' => ( ! empty( $_POST['lp_foregroundColor'] ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_foregroundColor'] ) ) : '#FFFFFF',
733 'backgroundColor' => ( ! empty( $_POST['lp_backgroundColor'] ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_backgroundColor'] ) ) : '#000000',
734 'transparency' => ( ! empty( $_POST['lp_backgroundTransparency'] ) ) ? true : false,
735 'transparencyPercentage' => (
736 ! isset( $_POST['lp_backgroundTransparencyPercentage'] ) ||
737 ! is_numeric( $_POST['lp_backgroundTransparencyPercentage'] )
738 ? 80
739 : max( min( intval( $_POST['lp_backgroundTransparencyPercentage'] ), 100 ), 0 )
740 ),
741 'backgroundImage' => isset( $_POST['lp_backgroundImage'] ) ? esc_url_raw( wp_unslash( $_POST['lp_backgroundImage'] ) ) : '',
742 'backgroundImageRepeat' => ( isset( $_POST['lp_backgroundRepeat'] ) && in_array( $_POST['lp_backgroundRepeat'], array( 'repeat', 'no-repeat' ), true ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_backgroundRepeat'] ) ) : 'repeat',
743 'additionalSeconds' => $additional_seconds,
744 'codeBlock' => wp_unslash( $code_block ),
745 'fullscreen' => ( isset( $_POST['lp_fullscreen'] ) ) ? 1 : 0,
746 'enabled_loading_screen' => ( isset( $_POST['lp_enabled_loading_screen'] ) ) ? true : false,
747 'from_trigger' => ( isset( $_POST['lp_from_trigger'] ) ) ? true : false,
748 'close_btn' => ( isset( $_POST['lp_close_btn'] ) ) ? true : false,
749 'remove_in_on_load' => ( isset( $_POST['lp_remove_in_on_load'] ) ) ? true : false,
750 'screen_size' => ( isset( $_POST['lp_screen_size'] ) && in_array( $_POST['lp_screen_size'], array( 'all', 'greater', 'lesser' ), true ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_screen_size'] ) ) : 'all',
751 'screen_width' => is_numeric( $lp_screen_width ) ? $lp_screen_width : '',
752 'lp_loading_screen_display_in' => ( isset( $_POST['lp_loading_screen_display_in'] ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_display_in'] ) ) : 'all',
753 'once_per_session' => ( ! isset( $_POST['once_per_session'] ) ||
754 ! in_array( $_POST['once_per_session'], array( 'always', 'site', 'page' ), true )
755 ) ? 'always' : sanitize_text_field( wp_unslash( $_POST['once_per_session'] ) ),
756 'lp_loading_screen_display_in_pages' => isset( $_POST['lp_loading_screen_display_in_pages'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_display_in_pages'] ) ) : '',
757 'lp_loading_screen_display_post_types' => isset( $_POST['lp_loading_screen_display_post_types'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_display_post_types'] ) ) : '',
758 'lp_loading_screen_devices' => isset( $_POST['lp_loading_screen_devices'] ) && in_array( $_POST['lp_loading_screen_devices'], array( 'desktop', 'mobile', 'both' ) ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_devices'] ) ) : 'both',
759 'lp_loading_screen_exclude_from_pages' => isset( $_POST['lp_loading_screen_exclude_from_pages'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_exclude_from_pages'] ) ) : '',
760 'lp_loading_screen_exclude_from_post_types' => isset( $_POST['lp_loading_screen_exclude_from_post_types'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen_exclude_from_post_types'] ) ) : '',
761 'lp_loading_screen_include_from_urls' => $lp_loading_screen_include_from_urls,
762 'lp_loading_screen_exclude_from_urls' => $lp_loading_screen_exclude_from_urls,
763 'lp_loading_screen_exclude_from_elementor_maintenance' => ( isset( $_POST['lp_loading_screen_exclude_from_elementor_maintenance'] ) ) ? true : false,
764 'deepSearch' => ( isset( $_POST['lp_deactivateDeepSearch'] ) ) ? false : true,
765 'modifyDisplayRule' => ( isset( $_POST['lp_modifyDisplayRule'] ) ) ? true : false,
766 'loading_screen' => isset( $_POST['lp_loading_screen'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_loading_screen'] ) ) : '',
767 'displayPercent' => ( isset( $_POST['lp_displayPercent'] ) ) ? true : false,
768 'pageEffect' => isset( $_POST['lp_pageEffect'] ) ? sanitize_text_field( wp_unslash( $_POST['lp_pageEffect'] ) ) : '',
769 'triggerLinkScreenNeverClose' => isset( $_POST['lp_triggerLinkScreenNeverClose'] ) ? true : false,
770 'triggerLinkScreenCloseAfter' => isset( $_POST['lp_triggerLinkScreenCloseAfter'] ) && is_numeric( $_POST['lp_triggerLinkScreenCloseAfter'] ) ? intval( $_POST['lp_triggerLinkScreenCloseAfter'] ) : '',
771 );
772
773 if ( isset( $_POST['lp_ls'] ) ) {
774 $loading_page_options['lp_ls'] = loading_page_sanitize_array( $_POST['lp_ls'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput
775 }
776
777 update_option( 'loading_page_video_tutorial', ( ! empty( $_POST['loading_page_video_tutorial'] ) && 'collapsed' === $_POST['loading_page_video_tutorial'] ) ? 'collapsed' : 'expanded' );
778
779 if ( update_option( 'loading_page_options', $loading_page_options ) ) {
780 print '<div class="updated">' . esc_html__( 'The Loading Page has been stored successfully', 'loading-page' ) . '</div>';
781 } else {
782 print '<div class="error">' . esc_html__( 'The Loading Page settings could not be stored', 'loading-page' ) . '</div>';
783 }
784 }
785
786 $loading_page_options = get_option( 'loading_page_options', [] );
787
788 $loading_page_video_tutorial = get_option( 'loading_page_video_tutorial', 'expanded' );
789 $loading_page_video_tutorial_open_close = ( 'expanded' === $loading_page_video_tutorial ) ? 'X' : '+';
790 $loading_page_video_tutorial_status = ( 'collapsed' === $loading_page_video_tutorial ) ? 'lp-video-collapsed' : '';
791
792 ?>
793 <style>
794 .lp-video-container {
795 overflow: hidden;
796 position: relative;
797 width: 100%;
798 }
799
800 .lp-video-container::after {
801 padding-top: 56.25%;
802 display: block;
803 content: '';
804 }
805
806 .lp-video-container iframe {
807 position: absolute;
808 top: 0;
809 left: 0;
810 width: 100%;
811 height: 100%;
812 }
813
814 .lp-video-collapsed {
815 display: none;
816 }
817 .lp-upgrade-message{
818 border:3px solid #e5c012;
819 margin-top:10px;
820 margin-bottom:10px;
821 padding:10px;
822 display:block;
823 width:100%;
824 box-sizing:border-box;
825 font-weight:500;
826 }
827 </style>
828 <div class="wrap">
829 <form method="post">
830 <input type="hidden" name="loading_page_nonce" value="<?php print( esc_attr( wp_create_nonce( __FILE__ ) ) ); ?>" />
831 <h2><?php esc_html_e( 'Loading Page Settings', 'loading-page' ); ?></h2>
832 <div class="postbox">
833 <h3 class='hndle' style="padding:5px;"><span><?php esc_html_e( 'Video Tutorial', 'loading-page' ); ?></span><a href="javascript:void(0);" onclick="loading_page_collapse_expand_video_tutorial(this);" style="float:right;font-size:1.3em;text-decoration:none;"><?php print esc_html( $loading_page_video_tutorial_open_close ); ?></a></h3>
834 <div class="inside lp-video-tutorial <?php echo esc_attr( $loading_page_video_tutorial_status ); ?>" style="position:relative;">
835 <input type="hidden" name="loading_page_video_tutorial" value="<?php echo esc_attr( $loading_page_video_tutorial ); ?>" />
836 <div class="lp-video-container">
837 <iframe title="<?php esc_attr_e( 'Video tutorial', 'loading-page' ); ?>" src="https://www.youtube.com/embed/5x_LtjoCFUY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
838 </div>
839 </div>
840 </div>
841 <div class="postbox">
842 <h3 class='hndle' style="padding:5px;"><span><?php esc_html_e( 'Loading Screen', 'loading-page' ); ?></span></h3>
843 <div class="inside">
844 <p style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;"><?php esc_html_e( 'If you want test the premium version of Loading Page go to the following links:', 'loading-page' ); ?><br /> <a href="https://demos.dwbooster.com/loading-page/wp-login.php" target="_blank"><?php esc_html_e( 'Administration area: Click to access the administration area demo', 'loading-page' ); ?></a><br />
845 <a href="https://demos.dwbooster.com/loading-page/" target="_blank"><?php esc_html_e( 'Public page: Click to access the Loading Page', 'loading-page' ); ?></a><br />
846 <a href="https://wordpress.org/support/plugin/loading-page/#new-post" target="_blank"><?php esc_html_e( 'If you need additional help', 'loading-page' ); ?></a>
847 </p>
848 <p>
849 <?php
850 esc_html_e(
851 'Displays a loading screen until the webpage is ready, the screen shows the loading percent.',
852 'loading-page'
853 );
854 ?>
855 </p>
856 <table class="form-table">
857 <tr>
858 <th><?php esc_html_e( 'Enable loading screen', 'loading-page' ); ?></th>
859 <td><input aria-label="<?php esc_attr_e( 'Enable loading screen', 'loading-page' ); ?>" type="checkbox" name="lp_enabled_loading_screen" <?php echo ( ( ! empty( $loading_page_options['enabled_loading_screen'] ) ) ? 'CHECKED' : '' ); ?> /></td>
860 </tr>
861 <tr>
862 <th style="border-top:2px dashed green;border-left:2px dashed green;border-bottom:2px dashed green;padding-left:10px;"><?php esc_html_e( 'Show loading screen when clicking on link', 'loading-page' ); ?></th>
863 <td style="border-top:2px dashed green;border-right:2px dashed green;border-bottom:2px dashed green;padding-left:10px;"><input aria-label="<?php esc_attr_e( 'Show loading screen when clicking on link', 'loading-page' ); ?>" type="checkbox" name="lp_from_trigger" <?php print ! empty( $loading_page_options['from_trigger'] ) ? 'CHECKED' : ''; ?> /> <i style="color:green;"><?php esc_html_e( 'Display the loading screen as soon as the link on the current page is clicked, and not only when the next page is loaded.', 'loading-page' ); ?></i><br><i style="color:green;"><?php esc_html_e( 'Apply the class name "no-loading-screen" to the links you want to exclude from this behavior.', 'loading-page' ); ?></i></td>
864 </tr>
865 <tr>
866 <th><?php esc_html_e( 'Display a close screen button', 'loading-page' ); ?></th>
867 <td><input aria-label="<?php esc_attr_e( 'Display a close screen button', 'loading-page' ); ?>" type="checkbox" name="lp_close_btn" <?php echo ( ( ! isset( $loading_page_options['close_btn'] ) || $loading_page_options['close_btn'] ) ? 'CHECKED' : '' ); ?> /></td>
868 </tr>
869 <tr>
870 <th><?php esc_html_e( 'Hide the loading screen in the window onload event', 'loading-page' ); ?></th>
871 <td><input aria-label="<?php esc_attr_e( 'Hide the loading screen in the onload event', 'loading-page' ); ?>" type="checkbox" name="lp_remove_in_on_load" <?php echo ( ( ! empty( $loading_page_options['remove_in_on_load'] ) ) ? 'CHECKED' : '' ); ?> /> <i><?php esc_html_e( 'Hides the loading screen in the onload event of window - or - as soon as possible', 'loading-page' ); ?></i></td>
872 </tr>
873 <tr>
874 <th><?php esc_html_e( 'Display the loading screen on', 'loading-page' ); ?></th>
875 <td>
876 <select aria-label="<?php esc_attr_e( 'Screen size', 'loading-page' ); ?>" name="lp_screen_size" style="float:left;">
877 <option value="all"
878 <?php
879 if (
880 isset( $loading_page_options['screen_size'] ) &&
881 'all' === $loading_page_options['screen_size']
882 ) {
883 print 'SELECTED';
884 }
885 ?>
886 ><?php esc_html_e( 'All Screens', 'loading-page' ); ?></option>
887 <option value="greater"
888 <?php
889 if (
890 isset( $loading_page_options['screen_size'] ) &&
891 'greater' === $loading_page_options['screen_size']
892 ) {
893 print 'SELECTED';
894 }
895 ?>
896 ><?php esc_html_e( 'Greater Than', 'loading-page' ); ?></option>
897 <option value="lesser"
898 <?php
899 if (
900 isset( $loading_page_options['screen_size'] ) &&
901 'lesser' === $loading_page_options['screen_size']
902 ) {
903 print 'SELECTED';
904 }
905 ?>
906 ><?php esc_html_e( 'Lesser Than', 'loading-page' ); ?></option>
907 </select>
908 <div id="lp_width_container" style="float:left; padding-left:10px;
909 <?php
910 if ( ! isset( $loading_page_options['screen_size'] ) || 'all' === $loading_page_options['screen_size'] ) {
911 echo 'display:none;';
912 } else {
913 echo 'display:block;';
914 }
915 ?>
916 ">
917 <?php esc_html_e( 'Width', 'loading-page' ); ?>:
918 <input aria-label="<?php esc_attr_e( 'Screen width', 'loading-page' ); ?>" type="text" name="lp_screen_width" value="<?php
919 if ( isset( $loading_page_options['screen_width'] ) ) {
920 echo esc_attr( $loading_page_options['screen_width'] );
921 }
922 ?>" /> px
923 </div>
924 <script>
925 jQuery('[name="lp_screen_size"]').on('change',function() {
926 jQuery('#lp_width_container')[(this.value == 'all') ? 'hide' : 'show']();
927 })
928 </script>
929 </td>
930 </tr>
931 <tr>
932 <th><?php esc_html_e( 'Display the loading screen', 'loading-page' ); ?></th>
933 <td>
934 <?php
935 if (
936 ! isset( $loading_page_options['once_per_session'] ) ||
937 false === $loading_page_options['once_per_session']
938 ) {
939 $loading_page_options['once_per_session'] = 'always';
940 } elseif ( true === $loading_page_options['once_per_session'] ) {
941 $loading_page_options['once_per_session'] = 'site';
942 }
943 ?>
944 <input aria-label="<?php esc_attr_e( 'Always', 'loading-page' ); ?>" type="radio" value="always" name="once_per_session" <?php echo ( ( 'always' === $loading_page_options['once_per_session'] ) ? 'CHECKED' : '' ); ?> /> <span><?php esc_html_e( 'always', 'loading-page' ); ?></span><br />
945 <input aria-label="<?php esc_attr_e( 'Once per session', 'loading-page' ); ?>" type="radio" value="site" name="once_per_session" <?php echo ( ( 'site' === $loading_page_options['once_per_session'] ) ? 'CHECKED' : '' ); ?> /> <span><?php esc_html_e( 'once per session', 'loading-page' ); ?></span><br />
946 <input aria-label="<?php esc_attr_e( 'Once per page', 'loading-page' ); ?>" type="radio" value="page" name="once_per_session" <?php echo ( ( 'page' === $loading_page_options['once_per_session'] ) ? 'CHECKED' : '' ); ?> /> <span><?php esc_html_e( 'once per page', 'loading-page' ); ?></span>
947
948 </td>
949 </tr>
950 <tr>
951 <th><?php esc_html_e( 'Display loading screen in', 'loading-page' ); ?></th>
952 <td>
953 <div style="margin-bottom:10px;"><input aria-label="<?php esc_attr_e( 'Homepage', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_display_in" value="home" <?php echo ( ( isset( $loading_page_options['lp_loading_screen_display_in'] ) && 'home' === $loading_page_options['lp_loading_screen_display_in'] ) ? 'CHECKED' : '' ); ?> /> <?php esc_html_e( 'homepage only', 'loading-page' ); ?></div>
954
955 <div style="margin-bottom:10px;"><input aria-label="<?php esc_attr_e( 'All pages', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_display_in" value="all" <?php echo ( ( isset( $loading_page_options['lp_loading_screen_display_in'] ) && 'all' === $loading_page_options['lp_loading_screen_display_in'] ) ? 'CHECKED' : '' ); ?> /> <?php esc_html_e( 'all pages', 'loading-page' ); ?>
956
957 <div style="margin-left:20px;margin-top:10px;">
958 <?php esc_html_e( 'Display the loading screen only on pages with the URLs (If this field is left empty, the loading screen will be displayed on all pages.)', 'loading-page' ); ?>
959 <textarea aria-label="<?php esc_attr_e( 'URLs of the pages to include', 'loading-page' ); ?>" name="lp_loading_screen_include_from_urls" style="width:100%" rows="6"><?php
960 print esc_textarea(
961 ( ! empty( $loading_page_options['lp_loading_screen_include_from_urls'] ) )
962 ? implode( "\n", $loading_page_options['lp_loading_screen_include_from_urls'] ) : ''
963 );
964 ?></textarea>
965 <i><?php esc_html_e( 'Enter a URL per row (use the * symbol as wildcard)', 'loading-page' ); ?></i>
966 </div>
967 </div>
968
969 <div style="margin-bottom:20px;"><input aria-label="<?php esc_attr_e( 'Specific pages', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_display_in" value="pages" <?php echo ( ( isset( $loading_page_options['lp_loading_screen_display_in'] ) && 'pages' === $loading_page_options['lp_loading_screen_display_in'] ) ? 'CHECKED' : '' ); ?> /> <?php esc_html_e( 'specific pages', 'loading-page' ); ?>
970 <div style="margin-left:20px;margin-top:10px;">
971 <input aria-label="<?php esc_attr_e( 'Pages/posts ids', 'loading-page' ); ?>" type="text" name="lp_loading_screen_display_in_pages" value="<?php
972 if ( ! empty( $loading_page_options['lp_loading_screen_display_in_pages'] ) ) {
973 print esc_attr( $loading_page_options['lp_loading_screen_display_in_pages'] );}
974 ?>" style="width:100%;">
975 <i><?php esc_html_e( 'Type one, or more post/pages IDs, separated by commas ","', 'loading-page' ); ?></i>
976 </div>
977 </div>
978
979 <div style="margin-bottom:20px;"><input aria-label="<?php esc_attr_e( 'specific post types', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_display_in" value="post_type" <?php echo ( ( isset( $loading_page_options['lp_loading_screen_display_in'] ) && 'post_type' === $loading_page_options['lp_loading_screen_display_in'] ) ? 'CHECKED' : '' ); ?> /> <?php esc_html_e( 'specific post types', 'loading-page' ); ?>
980 <div style="margin-left:20px;margin-top:10px;">
981 <input aria-label="<?php esc_attr_e( 'Post types', 'loading-page' ); ?>" type="text" name="lp_loading_screen_display_post_types" value="<?php
982 if ( ! empty( $loading_page_options['lp_loading_screen_display_post_types'] ) ) {
983 print esc_attr( $loading_page_options['lp_loading_screen_display_post_types'] );}
984 ?>" style="width:100%;">
985 <i><?php esc_html_e( 'Type one or more post types, separated by commas ","', 'loading-page' ); ?></i>
986 </div>
987 </div>
988 </td>
989 </tr>
990 <tr>
991 <th><?php esc_html_e( 'Devices', 'loading-page' ); ?></th>
992 <td>
993 <label><input aria-label="<?php esc_attr_e( 'Display the loading screen only on the desktop', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_devices" value="desktop" <?php
994 if ( ! empty( $loading_page_options['lp_loading_screen_devices'] ) && 'desktop' == $loading_page_options['lp_loading_screen_devices'] ) {
995 print 'CHECKED';}
996 ?>> <?php esc_html_e( 'Display the loading screen only on desktops', 'loading-page' ); ?></label><br>
997 <label><input aria-label="<?php esc_attr_e( 'Display the loading screen only on mobiles', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_devices" value="mobile" <?php
998 if ( ! empty( $loading_page_options['lp_loading_screen_devices'] ) && 'mobile' == $loading_page_options['lp_loading_screen_devices'] ) {
999 print 'CHECKED';}
1000 ?>> <?php esc_html_e( 'Display the loading screen only on mobiles', 'loading-page' ); ?></label><br>
1001 <label><input aria-label="<?php esc_attr_e( 'Display the loading screen on both desktops and mobiles', 'loading-page' ); ?>" type="radio" name="lp_loading_screen_devices" value="both" <?php
1002 if ( empty( $loading_page_options['lp_loading_screen_devices'] ) || 'both' == $loading_page_options['lp_loading_screen_devices'] ) {
1003 print 'CHECKED';}
1004 ?>> <?php esc_html_e( 'Display the loading screen on both desktops and mobiles', 'loading-page' ); ?></label><br>
1005 </td>
1006 </tr>
1007 <tr>
1008 <td colspan="2">
1009 <hr />
1010 </td>
1011 </tr>
1012 <tr>
1013 <th><?php esc_html_e( 'Exclude loading screen from', 'loading-page' ); ?></th>
1014 <td><input aria-label="<?php esc_attr_e( 'Pages/posts ids separated by comma', 'loading-page' ); ?>" type="text" name="lp_loading_screen_exclude_from_pages" value="<?php
1015 if ( ! empty( $loading_page_options['lp_loading_screen_exclude_from_pages'] ) ) {
1016 print esc_attr( $loading_page_options['lp_loading_screen_exclude_from_pages'] );}
1017 ?>"> <i><?php esc_html_e( 'Type one, or more post/pages IDs, separated by commas ","', 'loading-page' ); ?></i></td>
1018 </tr>
1019 <tr>
1020 <th><?php esc_html_e( 'Exclude loading screen from post types', 'loading-page' ); ?></th>
1021 <td><input aria-label="<?php esc_attr_e( 'Post types separated by comma', 'loading-page' ); ?>" type="text" name="lp_loading_screen_exclude_from_post_types" value="<?php
1022 if ( ! empty( $loading_page_options['lp_loading_screen_exclude_from_post_types'] ) ) {
1023 print esc_attr( $loading_page_options['lp_loading_screen_exclude_from_post_types'] );}
1024 ?>"> <i><?php esc_html_e( 'Type one, or more post/pages types, separated by commas ","', 'loading-page' ); ?></i></td>
1025 </tr>
1026 <tr>
1027 <th><?php esc_html_e( 'Exclude loading screen from pages with the URL', 'loading-page' ); ?></th>
1028 <td><textarea aria-label="<?php esc_attr_e( 'URLs of the pages to exclude', 'loading-page' ); ?>" name="lp_loading_screen_exclude_from_urls" style="width:100%" rows="6"><?php
1029 print esc_textarea(
1030 ( ! empty( $loading_page_options['lp_loading_screen_exclude_from_urls'] ) )
1031 ? implode( "\n", $loading_page_options['lp_loading_screen_exclude_from_urls'] ) : ''
1032 );
1033 ?></textarea>
1034 <i><?php esc_html_e( 'Enter a URL per row (use the * symbol as wildcard)', 'loading-page' ); ?></i>
1035 </td>
1036 </tr>
1037 <tr>
1038 <th colspan="2">
1039 <?php esc_html_e( 'Exclude the loading screen if Elementor Maintenance or Coming Soon modes are enabled', 'loading-page' ); ?>
1040 <input aria-label="<?php esc_attr_e( 'Disable the loading screen from Coming Soon or Maintenance modes', 'loading-page' ); ?>" type="checkbox" name="lp_loading_screen_exclude_from_elementor_maintenance" <?php echo ( ( ! empty( $loading_page_options['lp_loading_screen_exclude_from_elementor_maintenance'] ) ) ? 'CHECKED' : '' ); ?> />
1041 </th>
1042 </tr>
1043 <tr>
1044 <td colspan="2">
1045 <hr />
1046 </td>
1047 </tr>
1048 <tr>
1049 <?php $loading_screens = loading_page_get_screen_list(); ?>
1050 <th><?php esc_html_e( 'Select the loading screen', 'loading-page' ); ?></th>
1051 <td>
1052 <select aria-label="<?php esc_attr_e( 'Loading screen', 'loading-page' ); ?>" name="lp_loading_screen">
1053 <?php
1054 foreach ( $loading_screens as $screen ) {
1055 print '<option value="' . esc_attr( $screen['id'] ) . '" ' . ( ( isset( $loading_page_options['loading_screen'] ) && $loading_page_options['loading_screen'] === $screen['id'] ) ? 'SELECTED' : '' ) . ' title="' . ( ( ! empty( $screen['tips'] ) ) ? esc_attr( $screen['tips'] ) : '' ) . '" >' . esc_html( $screen['name'] ) . '</option>';
1056 }
1057 ?>
1058 </select>
1059 <span class="lp-upgrade-message">
1060 <?php
1061 esc_html_e( 'The free version of the plugin includes the "Bar", "Logo", and "Text" screens. If they are not sufficient to your website, the commercial version of the plugin includes additional loading screens.', 'loading-page' );
1062 ?> <a href="http://wordpress.dwbooster.com/content-tools/loading-page" target="_blank"><?php esc_html_e( 'CLICK HERE', 'loading-page' ); ?></a>
1063 </span>
1064 </td>
1065 </tr>
1066 <?php
1067 foreach ( $loading_screens as $screen ) {
1068 if ( ! empty( $screen['adminsection'] ) ) {
1069 include_once $screen['adminsection'];
1070 }
1071 if ( ! empty( $screen['adminscript'] ) ) {
1072 wp_enqueue_script( $screen['adminscript'], $screen['adminscript'], array(), 'free-1.2.7', true );
1073 }
1074 }
1075 ?>
1076 <tr>
1077 <th><?php esc_html_e( 'Select foreground color', 'loading-page' ); ?></th>
1078 <td><input aria-label="<?php esc_attr_e( 'Foreground color', 'loading-page' ); ?>" type="text" name="lp_foregroundColor" id="lp_foregroundColor" value="<?php
1079 if ( isset( $loading_page_options['foregroundColor'] ) ) {
1080 print( esc_attr( $loading_page_options['foregroundColor'] ) );}
1081 ?>" />
1082 <div id="lp_foregroundColor_picker"></div>
1083 </td>
1084 </tr>
1085 <tr>
1086 <th><?php esc_html_e( 'Select background color', 'loading-page' ); ?></th>
1087 <td>
1088 <div style="display: flex;flex-direction: row;align-items: center; gap: 10px;">
1089 <input aria-label="<?php esc_attr_e( 'Background color', 'loading-page' ); ?>" type="text" name="lp_backgroundColor" id="lp_backgroundColor" value="<?php
1090 if ( isset( $loading_page_options['backgroundColor'] ) ) {
1091 print( esc_attr( $loading_page_options['backgroundColor'] ) );}
1092 ?>" />
1093
1094 <input aria-label="<?php esc_attr_e( 'Apply transparency', 'loading-page' ); ?>" type="checkbox" name="lp_backgroundTransparency" <?php print ( ! isset( $loading_page_options['transparency'] ) || $loading_page_options['transparency'] ) ? 'CHECKED' : ''; ?> /><?php esc_html_e( 'Apply transparency', 'loading-page' ); ?>
1095
1096 <input type="range" id="lp_backgroundTransparencyPercentage" name="lp_backgroundTransparencyPercentage" min="0" max="100" value="<?php print esc_attr(
1097 ! isset( $loading_page_options['transparencyPercentage'] ) ||
1098 ! is_numeric( $loading_page_options['transparencyPercentage'] )
1099 ? 80
1100 : max( min( intval( $loading_page_options['transparencyPercentage'] ), 100 ), 0 )
1101 ); ?>" style="flex-grow:1;visibility:hidden;" />
1102
1103 <span id="lp_backgroundTransparencyPercentageCaption" style="visibility:hidden;"></span>
1104 </div>
1105 <div id="lp_backgroundColor_picker"></div>
1106 </td>
1107 </tr>
1108 <tr>
1109 <th><?php esc_html_e( 'Select image as background', 'loading-page' ); ?></th>
1110 <td>
1111 <input aria-label="<?php esc_attr_e( 'Background image', 'loading-page' ); ?>" type="text" name="lp_backgroundImage" id="lp_backgroundImage" value="<?php
1112 if ( isset( $loading_page_options['backgroundImage'] ) ) {
1113 print( esc_attr( $loading_page_options['backgroundImage'] ) );}
1114 ?>" />
1115 <input type="button" value="Browse" onclick="loading_page_selected_image('lp_backgroundImage');" />
1116 <select aria-label="<?php esc_attr_e( 'Background position', 'loading-page' ); ?>" id="lp_backgroundRepeat" name="lp_backgroundRepeat">
1117 <option value="repeat"
1118 <?php
1119 if ( isset( $loading_page_options['backgroundImageRepeat'] ) && 'repeat' === $loading_page_options['backgroundImageRepeat'] ) {
1120 echo 'SELECTED';}
1121 ?>
1122 >Tile</option>
1123 <option value="no-repeat"
1124 <?php
1125 if ( isset( $loading_page_options['backgroundImageRepeat'] ) && 'no-repeat' === $loading_page_options['backgroundImageRepeat'] ) {
1126 echo 'SELECTED';}
1127 ?>
1128 >Center</option>
1129 </select>
1130
1131 </td>
1132 </tr>
1133 <tr>
1134 <th><?php esc_html_e( 'Display image in fullscreen', 'loading-page' ); ?></th>
1135 <td>
1136 <input aria-label="<?php esc_attr_e( 'Fullscreen', 'loading-page' ); ?>" type="checkbox" name="lp_fullscreen" id="lp_fullscreen" <?php echo ( ( isset( $loading_page_options['fullscreen'] ) && $loading_page_options['fullscreen'] ) ? 'CHECKED' : '' ); ?> />
1137 <i><?php esc_html_e( '(The fullscreen attribute can fail in some browsers)', 'loading-page' ); ?></i>
1138 </td>
1139 </tr>
1140 <tr>
1141 <th><?php esc_html_e( 'Additional seconds', 'loading-page' ); ?></th>
1142 <td>
1143 <input aria-label="<?php esc_attr_e( 'Additional seconds', 'loading-page' ); ?>" type="text" name="lp_additionalSeconds" id="lp_additionalSeconds" value="<?php
1144 if ( isset( $loading_page_options['additionalSeconds'] ) ) {
1145 print( esc_attr( $loading_page_options['additionalSeconds'] ) );}
1146 ?>" />
1147 <i><?php esc_html_e( 'Show the loading screen some few seconds after loading the page', 'loading-page' ); ?></i>
1148 </td>
1149 </tr>
1150 <tr>
1151 <th><?php esc_html_e( 'Include an ad, or your own block of code', 'loading-page' ); ?></th>
1152 <td>
1153 <textarea aria-label="<?php esc_attr_e( 'Ad or block of code', 'loading-page' ); ?>" name="lp_codeBlock" id="lp_codeBlock" rows="6" style="width:80%;"><?php
1154 if ( isset( $loading_page_options['codeBlock'] ) ) {
1155 print( esc_textarea( $loading_page_options['codeBlock'] ) );}
1156 ?></textarea>
1157 <p><i><b><?php esc_html_e( 'Trick', 'loading-page' ); ?></b>:
1158 <?php esc_html_e( 'As the block of code you can insert a pair of &lt;style&gt;&lt;/style&gt; tags to customize the appearance of loading screen. For example: for changing the font-family of the loading text: <b>&lt;style&gt;.lp-screen-text{font-family:Georgia !important;}&lt;/style&gt;</b>', 'loading-page' ); ?></i></p>
1159 </td>
1160 </tr>
1161 <tr>
1162 <th><?php esc_html_e( 'Apply the effect on page', 'loading-page' ); ?></th>
1163 <td>
1164 <select aria-label="<?php esc_attr_e( 'Animation effect', 'loading-page' ); ?>" name="lp_pageEffect">
1165 <?php
1166 $page_effects = array( 'none', 'rotateInLeft' );
1167
1168 foreach ( $page_effects as $value ) {
1169 print '<option value="' . esc_attr( $value ) . '" ' . ( ( isset( $loading_page_options['pageEffect'] ) && $loading_page_options['pageEffect'] === $value ) ? 'SELECTED' : '' ) . '>' . esc_html( $value ) . '</option>';
1170 }
1171 ?>
1172
1173 </select>
1174 <div class="lp-upgrade-message"><?php esc_html_e( 'The premium version of plugin add the following effects: collapseIn, risingFromBottom, expandIn, fadeIn, fallFromTop, rotateInLeft, rotateInRight, rotateInRightWithoutToKeyframe, slideInSkew, tumbleIn, whirlIn.', 'loading-page' ); ?><br><a href="http://wordpress.dwbooster.com/content-tools/loading-page" target="_blank"><?php esc_html_e( 'CLICK HERE', 'loading-page'); ?></a></div>
1175 </td>
1176 </tr>
1177 <tr>
1178 <th><?php esc_html_e( 'Display loading percent', 'loading-page' ); ?></th>
1179 <td><input aria-label="<?php esc_attr_e( 'Display loading percent', 'loading-page' ); ?>" type="checkbox" name="lp_displayPercent" <?php echo ( ( ! empty( $loading_page_options['displayPercent'] ) ) ? 'CHECKED' : '' ); ?> /></td>
1180 </tr>
1181 </table>
1182 <div style="border: 1px solid #DADADA; padding:10px;">
1183 <h3><?php esc_html_e( 'Troubleshoot Area - Loading Screen', 'loading-page' ); ?></h3>
1184 <table class="form-table">
1185 <tr>
1186 <th><?php esc_html_e( 'Disable the search in deep', 'loading-page' ); ?></th>
1187 <td>
1188 <input aria-label="<?php esc_attr_e( 'Disable search in deep', 'loading-page' ); ?>" type="checkbox" name="lp_deactivateDeepSearch" <?php echo ( ( empty( $loading_page_options['deepSearch'] ) ) ? 'CHECKED' : '' ); ?> /> <i><?php esc_html_e( 'If the loading screen stops in some percentage, tick the checkbox', 'loading-page' ); ?></i>
1189 </td>
1190 </tr>
1191 <tr>
1192 <th><?php esc_html_e( 'The pages\' background is visible', 'loading-page' ); ?></th>
1193 <td>
1194 <input aria-label="<?php esc_attr_e( 'Tick if page visible', 'loading-page' ); ?>" type="checkbox" name="lp_modifyDisplayRule" <?php echo ( ( ! empty( $loading_page_options['modifyDisplayRule'] ) ) ? 'CHECKED' : '' ); ?> /> <i><?php esc_html_e( 'If website\'s background is visible before the loading screen, tick the checkbox', 'loading-page' ); ?></i>
1195 </td>
1196 </tr>
1197 <tr>
1198 <td colspan="2" style="padding-left:0;">
1199 <?php esc_html_e( 'You have ticked the box "show loading screen on link click", but the loading screen disappears too quickly, before loading the content of the next page.', 'loading-page' ); ?><br /><br />
1200 <input aria-label="<?php esc_attr_e( 'Loading screen disappear too quickly', 'loading-page' ); ?>" type="checkbox" name="lp_triggerLinkScreenNeverClose" <?php echo ( ( ! empty( $loading_page_options['triggerLinkScreenNeverClose'] ) ) ? 'CHECKED' : '' ); ?>/> <?php esc_html_e( 'Do not hide the loading screen', 'loading-page' ); ?>&nbsp;
1201 <?php esc_html_e( '- or close after ', 'loading-page' ); ?>&nbsp;
1202 <input type="number" name="lp_triggerLinkScreenCloseAfter" aria-label="<?php esc_attr_e( 'Close after X seconds', 'loading-page' ); ?>" value="<?php print esc_attr( isset( $loading_page_options['triggerLinkScreenCloseAfter'] ) ? $loading_page_options['triggerLinkScreenCloseAfter'] : 4 ); ?>" />&nbsp;
1203 <?php esc_html_e( 'seconds', 'loading-page' ); ?>
1204 </td>
1205 </tr>
1206 </table>
1207 </div>
1208 </div>
1209 </div>
1210 <div class="postbox">
1211 <h3 class='hndle' style="padding:5px;"><span><?php esc_html_e( 'Lazy Loading', 'loading-page' ); ?></span></h3>
1212 <div class="inside">
1213 <p>
1214 <?php
1215 esc_html_e(
1216 'To load only the images visible in the viewport to improve the loading rate of your website and reduce the bandwidth consumption.',
1217 'loading-page'
1218 );
1219 ?>
1220 </p>
1221 <p class="lp-upgrade-message">
1222 <?php esc_html_e( 'The lazy loading of images is available only in the commercial version of plugin.', 'loading-page' ); ?> <a href="http://wordpress.dwbooster.com/content-tools/loading-page" target="_blank"><?php esc_html_e( 'CLICK HERE', 'loading-page' ); ?></a>
1223 </p>
1224 <p><img alt="<?php esc_attr_e( 'Lazy loading chart', 'loading-page' ); ?>" src="<?php print( esc_attr( LOADING_PAGE_PLUGIN_URL . '/images/consumption_graph.png' ) ); ?>" style="max-width:100%;" /></p>
1225 <table class="form-table">
1226 <tr>
1227 <th><?php esc_html_e( 'Enable lazy loading', 'loading-page' ); ?></th>
1228 <td><input aria-label="<?php esc_attr_e( 'Enable lazy loading', 'loading-page' ); ?>" type="checkbox" DISABLED /></td>
1229 </tr>
1230 <tr>
1231 <th><?php esc_html_e( 'Select the image to load by default', 'loading-page' ); ?></th>
1232 <td>
1233 <input aria-label="<?php esc_attr_e( 'Image to load by default', 'loading-page' ); ?>" type="text" DISABLED /><input type="button" value="Browse" DISABLED />
1234 </td>
1235 </tr>
1236 <tr>
1237 <th><?php esc_html_e( 'Exclude lazy loading from', 'loading-page' ); ?></th>
1238 <td><input aria-label="<?php esc_attr_e( 'Pages/posts ids separated by comma', 'loading-page' ); ?>" type="text" DISABLED /> <i><?php esc_html_e( 'Type one, or more post/pages IDs, separated by commas ","', 'loading-page' ); ?></i></td>
1239 </tr>
1240 </table>
1241 <div style="border: 1px solid #DADADA; padding:10px;">
1242 <h3><?php esc_html_e( 'Troubleshoot Area - Lazy Loading', 'loading-page' ); ?></h3>
1243 <table class="form-table">
1244 <tr>
1245 <th><?php esc_html_e( 'Exclude images whose tag includes the class or attribute', 'loading-page' ); ?></th>
1246 <td>
1247 <input aria-label="<?php esc_attr_e( 'Class or attributes names', 'loading-page' ); ?>" type="text" style="width:100%;" disabled /><br />
1248 <p><i><?php esc_html_e( 'Don\'t apply the lazy loading to the images with the classes or attributes (separated by commas ",")', 'loading-page' ); ?></i></p>
1249 </td>
1250 </tr>
1251 </table>
1252 </div>
1253 </div>
1254 </div>
1255 <div><input type="submit" value="Update Settings" class="button-primary" /></div>
1256 </form>
1257 </div>
1258 <?php
1259 } // End loading_page_settings_page.
1260 }
1261
1262 /** ListeSpeed Cache integration **/
1263
1264 add_filter( 'litespeed_optimize_css_excludes', function( $p ){
1265 $p[] = LOADING_PAGE_PLUGIN_URL;
1266 return $p;
1267 } );
1268 add_filter( 'litespeed_optimize_js_excludes', function( $p ){
1269 $p[] = 'jquery.js';
1270 $p[] = 'jquery.min.js';
1271 $p[] = 'loading_page_settings';
1272 $p[] = LOADING_PAGE_PLUGIN_URL;
1273 return $p;
1274 } );
1275 add_filter( 'litespeed_optm_js_defer_exc', function( $p ){
1276 $p[] = 'jquery.js';
1277 $p[] = 'jquery.min.js';
1278 $p[] = 'loading_page_settings';
1279 $p[] = LOADING_PAGE_PLUGIN_URL;
1280 return $p;
1281 } );