spacedmonkey
c009f9d719
Script Loader: Fix performance issues in wp_common_block_scripts_and_styles
.
...
In [52069] the function `wp_common_block_scripts_and_styles` was changed load individual theme stylesheets, if the current theme supports block styles and loading separate core block assets. To do this, the function calls many expensive file operation functions, such as `glob`, `file_exists` and `file_get_contents`. This is wasteful, as these functions are loaded on every page request, even request that do not include blocks, like REST API calls. In [56044] all core block styles are registered in a single place. In `register_core_block_style_handles` calls `glob` to get all css styles in block directories. While registering style and editor styles, also register block theme styles, under a new style handle. Example `wp-block-avatar-theme`. If the current theme supports block styles, also request the block to enqueue the theme style on the front end. As these new stylesheets have a path attribute set, the function `wp_maybe_inline_styles` will automatically inline the styles for you.
Props spacedmonkey, flixos90, oandregal, costdev, audrasjb, mukesh27.
Fixes #58560 .
Built from https://develop.svn.wordpress.org/trunk@56064
git-svn-id: http://core.svn.wordpress.org/trunk@55576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 11:28:28 +00:00
..
2023-05-09 14:13:25 +00:00
2022-04-12 09:26:16 +00:00
2023-06-27 08:48:24 +00:00
2023-06-27 11:28:28 +00:00
2023-06-25 21:13:21 +00:00
2023-05-19 13:27:20 +00:00
2023-05-09 11:19:21 +00:00
2022-10-04 02:08:11 +00:00
2023-04-04 14:56:22 +00:00
2023-01-20 01:36:10 +00:00
2023-06-24 14:32:20 +00:00
2022-12-08 19:31:17 +00:00
2023-03-17 14:22:22 +00:00
2023-06-22 14:57:24 +00:00
2023-04-05 13:12:26 +00:00
2023-06-27 11:13:27 +00:00
2023-02-03 13:35:20 +00:00
2023-04-30 14:08:23 +00:00
2023-06-26 23:44:29 +00:00
2023-05-12 08:51:22 +00:00
2023-06-19 18:27:27 +00:00
2023-06-22 14:36:26 +00:00
2023-06-05 21:05:22 +00:00
2022-04-21 11:24:17 +00:00
2023-05-14 17:58:24 +00:00
2023-06-27 00:23:23 +00:00
2023-06-27 11:13:27 +00:00
2023-06-23 06:29:23 +00:00
2023-06-27 10:15:28 +00:00
2023-06-27 11:28:28 +00:00
2023-06-22 14:57:24 +00:00
2023-02-21 16:39:19 +00:00
2022-10-10 18:22:11 +00:00
2022-10-10 18:22:11 +00:00
2023-06-22 14:36:26 +00:00
2022-11-29 15:51:14 +00:00
2023-02-04 15:18:16 +00:00
2023-06-05 11:16:18 +00:00
2022-06-17 11:20:13 +00:00
2023-02-03 13:35:20 +00:00
2022-06-17 11:20:13 +00:00
2023-02-13 09:08:23 +00:00
2020-07-21 12:58:02 +00:00
2023-02-11 12:43:22 +00:00
2023-04-05 13:12:26 +00:00
2023-05-12 21:35:21 +00:00
2023-02-03 13:35:20 +00:00
2023-06-06 00:30:20 +00:00
2023-02-07 14:05:20 +00:00
2023-06-11 09:27:18 +00:00
2023-06-12 06:12:24 +00:00
2023-03-21 20:00:19 +00:00
2022-09-12 15:47:14 +00:00
2023-05-08 22:37:24 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2023-06-27 00:45:38 +00:00
2023-06-27 00:45:38 +00:00
2023-06-27 00:45:38 +00:00
2022-09-12 15:47:14 +00:00
2023-04-27 22:29:18 +00:00
2022-09-12 15:47:14 +00:00
2023-05-08 22:37:24 +00:00
2023-06-23 06:29:23 +00:00
2022-09-12 15:47:14 +00:00
2023-04-21 10:43:25 +00:00
2022-11-23 21:30:13 +00:00
2023-06-27 05:54:19 +00:00
2023-06-22 14:36:26 +00:00
2023-04-24 16:37:22 +00:00
2023-02-07 17:10:21 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:57:24 +00:00
2023-02-07 17:10:21 +00:00
2023-02-07 17:10:21 +00:00
2022-09-12 15:47:14 +00:00
2023-05-02 15:45:22 +00:00
2023-06-22 14:36:26 +00:00
2022-11-25 15:12:16 +00:00
2022-11-25 15:12:16 +00:00
2023-06-26 10:17:25 +00:00
2023-06-22 14:57:24 +00:00
2023-02-21 16:39:19 +00:00
2023-02-23 10:38:21 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2023-05-11 11:43:21 +00:00
2023-06-24 17:17:23 +00:00
2023-04-11 22:06:22 +00:00
2023-06-22 14:57:24 +00:00
2022-09-12 15:47:14 +00:00
2023-06-22 14:36:26 +00:00
2022-12-15 21:32:17 +00:00
2022-12-15 21:32:17 +00:00
2022-09-12 15:47:14 +00:00
2023-06-07 06:40:20 +00:00
2023-06-22 14:36:26 +00:00
2022-09-19 22:53:10 +00:00
2023-02-22 14:25:25 +00:00
2022-10-07 19:17:12 +00:00
2023-06-13 04:46:23 +00:00
2023-02-08 17:08:21 +00:00
2023-02-15 23:37:17 +00:00
2022-09-12 15:47:14 +00:00
2023-06-22 14:36:26 +00:00
2023-05-11 11:15:24 +00:00
2023-06-27 05:54:19 +00:00
2023-03-10 16:30:03 +00:00
2023-06-22 14:57:24 +00:00
2023-03-14 16:55:19 +00:00
2022-11-13 13:51:20 +00:00
2023-06-22 14:36:26 +00:00
2022-09-12 15:47:14 +00:00
2023-06-22 14:36:26 +00:00
2022-09-12 15:47:14 +00:00
2023-06-24 16:50:24 +00:00
2022-10-04 03:59:13 +00:00
2023-05-02 15:45:22 +00:00
2023-02-21 15:59:18 +00:00
2022-09-12 15:47:14 +00:00
2023-05-02 15:45:22 +00:00
2023-06-26 10:17:25 +00:00
2022-09-12 15:47:14 +00:00
2022-10-24 14:56:16 +00:00
2023-06-26 13:42:23 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2023-06-22 14:36:26 +00:00
2022-09-12 15:47:14 +00:00
2023-05-02 15:45:22 +00:00
2023-05-25 12:55:19 +00:00
2023-04-27 23:15:17 +00:00
2023-04-21 09:24:22 +00:00
2022-09-12 15:47:14 +00:00
2023-01-30 15:24:13 +00:00
2023-02-07 17:10:21 +00:00
2023-05-29 08:36:23 +00:00
2022-10-11 15:00:12 +00:00
2023-06-23 13:50:20 +00:00
2023-05-06 11:40:24 +00:00
2023-06-27 08:48:24 +00:00
2023-06-19 16:04:22 +00:00
2023-06-22 14:36:26 +00:00
2022-09-12 15:47:14 +00:00
2023-05-08 22:37:24 +00:00
2022-09-12 15:47:14 +00:00
2022-09-12 15:47:14 +00:00
2023-02-21 16:39:19 +00:00
2023-06-26 10:17:25 +00:00
2023-06-22 14:36:26 +00:00
2023-06-23 12:17:24 +00:00
2022-09-20 14:17:12 +00:00
2022-09-20 14:17:12 +00:00
2022-09-20 14:17:12 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:36:26 +00:00
2023-06-24 13:54:23 +00:00
2023-06-22 14:36:26 +00:00
2022-06-17 11:20:13 +00:00
2023-06-26 19:57:25 +00:00
2023-06-26 08:57:25 +00:00
2023-06-26 16:17:23 +00:00
2022-06-17 11:20:13 +00:00
2022-08-19 22:06:09 +00:00
2023-05-02 15:45:22 +00:00
2022-11-26 21:01:17 +00:00
2023-02-12 18:08:21 +00:00
2023-06-22 14:36:26 +00:00
2023-06-26 10:17:25 +00:00
2023-06-26 10:17:25 +00:00
2023-06-26 13:42:23 +00:00
2023-01-15 14:57:13 +00:00
2023-06-26 10:17:25 +00:00
2023-06-27 08:48:24 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:36:26 +00:00
2023-06-26 23:44:29 +00:00
2023-06-23 16:03:25 +00:00
2023-06-27 06:02:22 +00:00
2023-06-26 19:57:25 +00:00
2023-06-19 23:20:21 +00:00
2023-06-26 16:17:23 +00:00
2023-05-19 12:46:24 +00:00
2023-06-22 14:57:24 +00:00
2022-07-14 13:35:13 +00:00
2023-02-24 01:23:20 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:36:26 +00:00
2023-06-24 16:50:24 +00:00
2023-06-22 14:57:24 +00:00
2023-05-02 11:26:24 +00:00
2023-06-22 14:57:24 +00:00
2023-05-11 11:15:24 +00:00
2023-02-16 00:04:21 +00:00
2023-06-21 08:18:19 +00:00
2023-06-27 05:54:19 +00:00
2023-06-27 10:41:30 +00:00
2023-06-26 16:17:23 +00:00
2023-06-08 07:54:22 +00:00
2023-02-21 16:39:19 +00:00
2023-06-22 14:36:26 +00:00
2023-05-17 18:31:24 +00:00
2023-06-27 06:02:22 +00:00
2023-03-10 16:30:03 +00:00
2023-06-27 05:54:19 +00:00
2023-06-22 14:36:26 +00:00
2023-06-22 14:36:26 +00:00
2023-04-10 19:31:18 +00:00
2023-06-27 11:28:28 +00:00
2023-06-22 14:57:24 +00:00
2023-05-17 12:06:19 +00:00
2023-06-14 23:51:22 +00:00
2023-06-22 14:36:26 +00:00
2022-09-21 11:43:13 +00:00
2023-02-19 15:05:22 +00:00
2023-06-27 07:25:22 +00:00
2023-06-22 05:25:29 +00:00
2023-06-27 05:11:27 +00:00
2023-06-22 14:57:24 +00:00
2023-06-22 14:57:24 +00:00
2023-06-27 11:28:28 +00:00
2023-06-22 14:57:24 +00:00
2022-07-21 22:45:11 +00:00
2020-02-06 06:33:11 +00:00