pwa->get_filetypes(); $filetypes = []; foreach ( $all_filetypes as $key => $details ) { $filetypes[ $key ] = $details['label']; } $cache_first_defaults = [ 'images', 'scripts', 'styles', 'fonts' ]; $network_first_defaults = []; /** * WIP $all_pages = get_pages(); $pages = []; foreach ( $all_pages as $page ) { $pages [ $page->ID ] = $page->post_title; } */ $pwa_enabled = ( function_exists( 'wp_register_service_worker_caching_route' ) && class_exists( 'WP_Service_Worker_Caching_Routes' ) ); $is_https = ( false !== strpos( home_url(), 'https' ) ); // Is the JS compiler enabled? $is_http2 = Fusion_Dynamic_JS::is_http2(); if ( $is_http2 ) { $js_compiler_enabled = ( isset( $settings['js_compiler'] ) && ( '1' === $settings['js_compiler'] || 1 === $settings['js_compiler'] || true === $settings['js_compiler'] ) ); } else { $js_compiler_enabled = ( ! isset( $settings['js_compiler'] ) || ( '1' === $settings['js_compiler'] || 1 === $settings['js_compiler'] || true === $settings['js_compiler'] ) ); } $sections['performance'] = [ 'label' => esc_html__( 'Performance', 'Avada' ), 'id' => 'heading_performance', 'is_panel' => true, 'priority' => 25, 'icon' => 'el-icon-time-alt', 'alt_icon' => 'fusiona-check', 'fields' => [ 'pw_jpeg_quality' => [ 'label' => esc_html__( 'WordPress jpeg Quality', 'Avada' ), /* translators: "Regenerate Thumbnails" plugin link. */ 'description' => sprintf( esc_html__( 'Controls the quality of the generated image sizes for every uploaded image. Ranges between 0 and 100 percent. Higher values lead to better image qualities but also higher file sizes. NOTE: After changing this value, please install and run the %s plugin once.', 'Avada' ), '' . esc_html__( 'Regenerate Thumbnails', 'Avada' ) . '' ), 'id' => 'pw_jpeg_quality', 'default' => '82', 'type' => 'slider', 'choices' => [ 'min' => '1', 'max' => '100', 'step' => '1', ], // No need to refresh the page. 'transport' => 'postMessage', ], 'wp_big_image_size_threshold' => [ 'label' => esc_html__( 'WordPress Big Image Size Threshold', 'Avada' ), 'description' => esc_html__( 'Sets the threshold for image height and width, above which WordPress will scale down newly uploaded images to this values as max-width or max-height. Set to "0" to disable the threshold completely.', 'Avada' ), 'id' => 'wp_big_image_size_threshold', 'default' => '2560', 'type' => 'slider', 'choices' => [ 'min' => '0', 'max' => '5000', 'step' => '1', ], // No need to refresh the page. 'transport' => 'postMessage', ], 'lazy_load' => [ 'label' => esc_html__( 'Enable Lazy Loading', 'Avada' ), 'description' => esc_html__( 'Enable lazy loading for your website\'s images to improve performance.', 'Avada' ), 'id' => 'lazy_load', 'default' => '0', 'type' => 'switch', 'transport' => 'postMessage', // No need to refresh the page. ], 'font_face_display' => [ 'label' => esc_html__( 'Font Face Rendering', 'Avada' ), 'description' => esc_html__( 'Choose "Swap All" for faster rendering with possible flash of unstyled text (FOUT) or "Block" for clean rendering but longer wait time until first paint. "Swap Non-Icon Fonts" will use a mix of the first 2 methods ("swap" for text fonts and "block" for icon-fonts).', 'Avada' ), 'id' => 'font_face_display', 'default' => 'block', 'type' => 'radio-buttonset', 'choices' => [ 'block' => esc_html__( 'Block', 'Avada' ), 'swap' => esc_html__( 'Swap Non-Icon Fonts', 'Avada' ), 'swap-all' => esc_html__( 'Swap All', 'Avada' ), ], 'transport' => 'postMessage', // No need to refresh the page. ], 'emojis_disabled' => [ 'label' => esc_html__( 'Emojis Script', 'Avada' ), 'description' => esc_html__( 'If you don\'t use emojis you can improve performance by removing WordPress\' emojis script.', 'Avada' ), 'id' => 'emojis_disabled', 'default' => 'enabled', 'type' => 'radio-buttonset', 'choices' => [ 'enabled' => esc_html__( 'Enable', 'Avada' ), 'disabled' => esc_html__( 'Disable', 'Avada' ), ], // No need to refresh the page. 'transport' => 'postMessage', ], 'defer_styles' => [ 'label' => esc_html__( 'Load Stylesheets In Footer', 'Avada' ), 'description' => esc_html__( 'Set to \'on\' to defer loading of the stylesheets to the footer of the page. This improves page load time by making the styles non-render-blocking. Depending on the connection speed, a flash of unstyled content (FOUC) might occur.', 'Avada' ), 'id' => 'defer_styles', 'default' => '0', 'type' => 'switch', ], 'dynamic_compiler_section' => [ 'label' => esc_html__( 'Dynamic CSS & JS', 'Avada' ), 'id' => 'dynamic_compiler_section', 'icon' => true, 'type' => 'info', ], 'css_cache_method' => [ 'label' => esc_html__( 'CSS Compiling Method', 'Avada' ), 'description' => esc_html__( 'Select "File" mode to compile the dynamic CSS to files (a separate file will be created for each of your pages & posts inside of the uploads/fusion-styles folder), "Database" mode to cache the CSS in your database, or select "Disabled" to disable.', 'Avada' ), 'id' => 'css_cache_method', 'default' => 'file', 'type' => 'radio-buttonset', 'choices' => [ 'file' => esc_html__( 'File', 'Avada' ), 'db' => esc_html__( 'Database', 'Avada' ), 'off' => esc_html__( 'Disabled', 'Avada' ), ], 'transport' => 'postMessage', // No need to refresh the page. ], 'media_queries_async' => [ 'label' => esc_html__( 'Load Media-Queries Files Asynchronously', 'Avada' ), 'description' => esc_html__( 'When enabled, the CSS media-queries will be enqueued separately and then loaded asynchronously, improving performance on mobile and desktop. Please note that this option is only partly compatible with older IE versions and will force mobile viewport on those browsers.', 'Avada' ), 'id' => 'media_queries_async', 'default' => '0', 'type' => 'switch', 'transport' => 'postMessage', // No need to refresh the page. ], 'css_vars' => [ 'label' => esc_html__( 'Enable CSS Variables', 'Avada' ), 'description' => sprintf( /* translators: Link properties. */ __( 'Enable this option to use CSS Variables (Custom Properties). Makes compilations faster and lighter, but is not compatible with older IE browsers.', 'Avada' ), 'href="https://caniuse.com/#feat=css-variables" target="_blank" rel="external nofollow noopener noreferrer"' ), 'id' => 'css_vars', 'default' => '0', 'type' => 'switch', 'transport' => 'postMessage', // No need to refresh the page. ], 'cache_server_ip' => [ 'label' => esc_html__( 'Cache Server IP', 'Avada' ), 'description' => esc_html__( 'For unique cases where you are using cloud flare and a cache server, ex: varnish cache. Enter your cache server IP to clear the theme options dynamic CSS cache. Consult with your server admin for help.', 'Avada' ), 'id' => 'cache_server_ip', 'default' => '', 'type' => 'text', 'transport' => 'postMessage', // No need to refresh the page. ], 'js_compiler_note' => ( apply_filters( 'fusion_compiler_js_file_is_readable', ( get_transient( 'fusion_dynamic_js_readable' ) || ! $js_compiler_enabled ) ) ) ? [] : [ 'label' => '', 'description' => '
uploads/fusion-styles. %2$s: uploads/fusion-scripts. */
'description' => ( is_multisite() && is_main_site() ) ? sprintf( esc_html__( 'Resets all Dynamic CSS & Dynamic JS, cleans-up the database and deletes the %1$s and %2$s folders. When resetting the caches on the main site of a multisite installation, caches for all sub-sites will be reset. IMPORTANT NOTE: On large multisite installations with a low PHP timeout setting, bulk-resetting the caches may timeout.', 'Avada' ), 'uploads/fusion-styles', 'uploads/fusion-scripts' ) : sprintf( esc_html__( 'Resets all Dynamic CSS & Dynamic JS, cleans-up the database and deletes the %1$s and %2$s folders.', 'Avada' ), 'uploads/fusion-styles', 'uploads/fusion-scripts' ),
'id' => 'reset_caches_button',
'default' => '',
'type' => 'raw',
'content' => '' . esc_html__( 'Reset Avada Caches', 'Avada' ) . '',
'full_width' => false,
'transport' => 'postMessage', // No need to refresh the page.
'hide_on_front' => true,
],
'pwa_section' => [
'label' => esc_html__( 'Progressive Web App', 'Avada' ),
'id' => 'pwa_section',
'icon' => true,
'type' => 'info',
],
'pwa_required_notice' => ! $pwa_enabled ? [
'label' => '',
'description' => sprintf(
/* translators: URL for the plugins page. */
'