-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve loading method for block styles (#28358)
* Inline styles if size is smaller than a threshold * Add a global pool to avoid too many inline styles * change default max pool size to 20k * Add the original block-name as a param in filters * Refactor the should-inline calculations * Use a transient to cache file sizes * Cleanup * make sure size is an integer * Change threshold to 1500 * Remove the total size checks * Completely refactor the implementation * Break the loop when appropriate * changed limit to 20k * simplify * more tweaks * Use wp_style_add_data, props @gziolo * Simplify condition - props @gziolo * Add file_exists check back * simplify sorting function * rename var from $stylesheet to $style * typecasting not needed here * rename functions * Add basic phpunit tests for the minify function * Allow inlining the common.css file if possible * improve inline doc * inline docs tweak * Add wp_style_add_data in docs example * docs
- Loading branch information
Showing
4 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters