wordpress-develop/tests/phpunit/data/themedir1
Jonny Harris 3ad20183b0 Editor: Improve performance of _register_theme_block_patterns function.
The `_register_theme_block_patterns` function imposed a significant resource overhead. This issue primarily stems from themes, such as TT4, that register a substantial number of block patterns. These patterns necessitate numerous file operations, including file lookups, file reading into memory, and related processes. To provide an overview, the _register_theme_block_patterns function performed the following file operations:

- is_dir
- is_readable
- file_exists
- glob
- file_get_contents (utilized via get_file_data)

To address these issues, caching using a transient has been added to a new function call `_wp_get_block_patterns`. If theme development mode is disabled and theme exists, the block patterns are saved in a transient cache. This cache is used all requests after that, saving file lookups and reading files into memory. Cache invalidation is done, when themes are switched, deleted or updated. Meaning that block patterns are not stored in the cache incorrectly. 

Props flixos90, joemcgill, peterwilsoncc, costdev, swissspidy, aristath, westonruter, spacedmonkey.
Fixes #59490

git-svn-id: https://develop.svn.wordpress.org/trunk@56765 602fd350-edb4-49c9-b593-d223f7449a82
2023-10-03 15:16:55 +00:00
..
block_theme-[0.4.0] REST API: Support . in theme directory names in WP_REST_Global_Styles_Controller, WP_REST_Templates_Controller, and WP_REST_Themes_Controller. 2021-12-21 04:12:06 +00:00
block-theme Editor: Fix bug where it was not possible to style custom block elements in theme.json. 2023-07-18 00:00:49 +00:00
block-theme-child Editor: Introduce get_block_asset_url Utility Function. 2023-09-25 17:47:27 +00:00
block-theme-child-deprecated-path Themes: Improve performance of get_block_theme_folders function 2023-09-19 16:15:52 +00:00
block-theme-child-no-theme-json Themes: Introduce wp_theme_has_theme_json() for public consumption. 2023-01-18 11:38:16 +00:00
block-theme-child-with-fluid-layout Editor: Don't use fluid layout value in typography. 2023-09-01 04:01:23 +00:00
block-theme-child-with-fluid-typography Editor: Add test data for Fluid Typography. 2022-10-11 19:50:46 +00:00
block-theme-child-with-fluid-typography-config Editor: add configurable viewport sizes for fluid typography. 2023-09-07 04:28:45 +00:00
block-theme-deprecated-path Themes: Accept valid block themes. 2022-05-20 00:47:45 +00:00
block-theme-non-latin REST API: Only use Latin characters in test filenames. 2023-02-17 18:37:24 +00:00
block-theme-patterns Editor: Improve performance of _register_theme_block_patterns function. 2023-10-03 15:16:55 +00:00
block-theme-post-content-default Editor: Fix post editor layout when Post Content has no attributes. 2023-09-20 01:24:32 +00:00
block-theme-with-hooked-blocks Tests: Cover Block Hooks integration with a custom block theme 2023-10-03 08:27:51 +00:00
broken-theme Tests: Add a placeholder file to the broken-theme directory so it isn't removed when synced to git. 2014-01-06 18:26:07 +00:00
camelCase Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
child-parent-itself Themes: Report theme as broken that sets itself as its parent. 2017-09-26 08:53:20 +00:00
custom-internationalized-theme I18N: Introduce WP_Textdomain_Registry to store text domains and their language directory paths. 2022-08-11 12:37:05 +00:00
default Themes: Allow template loading functions to pass additional arguments to the template via the $args parameter. 2020-07-07 11:00:21 +00:00
default-child-no-theme-json Themes: Introduce wp_theme_has_theme_json() for public consumption. 2023-01-18 11:38:16 +00:00
empty-fontface-theme Themes: Add internal-only theme.json's webfonts handler (stopgap). 2022-04-26 14:46:37 +00:00
fonts-block-theme Introduce font-face styles generator and printer. 2023-08-31 21:47:40 +00:00
internationalized-theme I18N: Remove the requirement to call load_plugin_textdomain() / load_theme_textdomain(). 2016-05-10 20:04:52 +00:00
page-templates Docs: Improve inline comments per the documentation standards. 2020-01-29 00:43:23 +00:00
page-templates-child Themes: Add files missed in [41975]. 2017-10-23 20:22:44 +00:00
rest-api REST API: Add additional fields to the themes controller. 2020-06-07 06:44:08 +00:00
sandbox Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
stylesheetonly General: Ensure svn:eol-style is consistently set for all recently added files. 2021-06-27 12:44:45 +00:00
subdir REST API: Support . in theme directory names in WP_REST_Global_Styles_Controller, WP_REST_Templates_Controller, and WP_REST_Themes_Controller. 2021-12-21 04:12:06 +00:00
theme1 Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
theme1-dupe Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
update-uri-theme Themes: Add support for Update URI header. 2022-08-23 17:46:46 +00:00