Make WordPress Core

Opened 6 months ago

Last modified 5 months ago

#61405 new defect (bug)

Residual of block found in `get_blocks_metadata` even when block is unregistered using `unregister_block_type()`.

Reported by: thekt12's profile thekt12 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch
Focuses: performance Cc:

Description

The get_blocks_metadata() function retrieves all registered blocks using WP_Block_Type_Registry::get_all_registered(). It updates its internal static variable with new blocks but does not account for blocks that have been unregistered. Consequently, residual blocks remain in the static variable and are processed in functions consuming get_blocks_metadata(), such as wp_add_global_styles_for_blocks. This oversight can lead to unnecessary processing overhead.

Change History (5)

This ticket was mentioned in PR #6764 on WordPress/wordpress-develop by @thekt12.


6 months ago
#1

  • Keywords has-patch added

#2 @sabernhardt
6 months ago

  • Component changed from General to Editor

#3 @thekt12
6 months ago

  • Focuses performance added

This ticket was mentioned in Slack in #core-performance by thekt12. View the logs.


6 months ago

This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.


5 months ago

Note: See TracTickets for help on using tickets.