From 591c7a3cf616be2eb42312fd5491e357ecf42b29 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 25 Jul 2021 22:18:53 -0700 Subject: [PATCH] Eliminate disabling script concatenation when SW installed since precaching not used --- wp-includes/default-filters.php | 2 -- wp-includes/service-workers.php | 23 ----------------------- 2 files changed, 25 deletions(-) diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index ee7328c44..7ca1524fa 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -24,5 +24,3 @@ add_action( 'wp_head', 'wp_add_error_template_no_robots' ); add_action( 'error_head', 'wp_add_error_template_no_robots' ); } - -add_action( 'admin_init', 'wp_disable_script_concatenation' ); diff --git a/wp-includes/service-workers.php b/wp-includes/service-workers.php index 95106d276..61054f89d 100644 --- a/wp-includes/service-workers.php +++ b/wp-includes/service-workers.php @@ -228,29 +228,6 @@ function wp_ajax_wp_service_worker() { die(); } -/** - * Disables concatenating scripts to leverage caching the assets via Service Worker instead. - */ -function wp_disable_script_concatenation() { - global $concatenate_scripts; - - /* - * This cookie is set when the service worker registers successfully, avoiding unnecessary result - * for browsers that don't support service workers. Note that concatenation only applies in the admin, - * for authenticated users without full-page caching. - */ - if ( isset( $_COOKIE['wordpress_sw_installed'] ) ) { - $concatenate_scripts = false; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited - } - - // phpcs:disable - // @todo This is just here for debugging purposes. - if ( isset( $_GET['wp_concatenate_scripts'] ) ) { - $concatenate_scripts = rest_sanitize_boolean( $_GET['wp_concatenate_scripts'] ); - } - // phpcs:enable -} - /** * Checks if Service Worker should skip waiting in case of update and update automatically. *