-
Notifications
You must be signed in to change notification settings - Fork 4
/
default-wp-rocket.php
41 lines (29 loc) · 1.24 KB
/
default-wp-rocket.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Plugin Name: Be API - WP Rocket config
* Description: Default option for WP Rocket
* Version: 1.0
* Author: BeAPI
* Author URI: http://beapi.fr/
*/
namespace BEAPI\Plugin_Defaults\WP_Rocket;
// Enable caching for mobile devices
add_filter( 'pre_get_rocket_option_cache_mobile', '__return_true' );
// Load async css
add_filter( 'pre_get_rocket_option_async_css', '__return_true' );
// Minifying css files
add_filter( 'pre_get_rocket_option_minify_css', '__return_true' );
// Minifying js files
add_filter( 'pre_get_rocket_option_minify_js', '__return_true' );
// Defer all js
add_filter( 'pre_get_rocket_option_defer_all_js', '__return_true' );
// Optimizing css loading by default
add_filter( 'pre_get_rocket_option_optimize_css_delivery', '__return_true' );
// Activate preloading
add_filter( 'pre_get_rocket_option_sitemap_preload_url_crawl', '__return_true' );
// Enable preloading of links
add_filter( 'pre_get_rocket_option_preload_links', '__return_true' );
// Enable control Heartbeat
add_filter( 'pre_get_rocket_option_control_heartbeat', '__return_true' );
// Disable the wprocket 'wp_cache' constant in wp_config to prevent fatal error due to pre-existing constant
add_filter( 'rocket_set_wp_cache_constant', '__return_false' );