-
Notifications
You must be signed in to change notification settings - Fork 0
/
tidio-do-not-minify-tidio-scripts.php
30 lines (25 loc) · 958 Bytes
/
tidio-do-not-minify-tidio-scripts.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
<?php
/**
* Plugin Name: Tidio | Do not minify Tidio scripts
* Description: Based on WP Rocket | External JS Hosts plugin. Prevents WP Rocket’s minification process for Tidio scripts.
* Version: 0.0.1
* Plugin URI: https://github.com/dominiczaq/wp-rocket-tidiochat
* Author: Grzegorz Dominiczak
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
*/
namespace Tidio\Helpers;
// Standard plugin security, keep this line in place.
defined( 'ABSPATH' ) or die();
/**
* Exclude external scripts from WP Rocket’s file optimization.
*
* @param array $external_js_urls Array of external domains
* @return array Extended array of external domains
*/
function tidioDomains( $external_js_hosts ) {
$external_js_hosts[] = 'code.tidio.co';
return $external_js_hosts;
}
add_filter( 'rocket_minify_excluded_external_js', __NAMESPACE__ . '\tidioDomains' );