[wp-meta] [Making WordPress.org] #5910: Block Directory: Plugins are suggested for missing core blocks
Making WordPress.org
noreply at wordpress.org
Tue Sep 21 19:39:06 UTC 2021
#5910: Block Directory: Plugins are suggested for missing core blocks
------------------------------+--------------------
Reporter: ryelle | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone:
Component: Plugin Directory | Keywords:
------------------------------+--------------------
See https://core.trac.wordpress.org/ticket/54113. When a core block is
unregistered, but still used in the content, the missing block search can
turn up unexpected results.
In the core ticket, the `core/gallery` block is unregistered. On a post
with an existing gallery block, the missing block suggests they install
[https://wordpress.org/plugins/thron/ THRON]. This is because the THRON
plugin re-registers a few `core/*` blocks, and these are picked up as
"blocks provided by THRON". This plugin doesn't actually provide the
gallery block, though, it's just a method of overriding the render
function.
Usually, when a block is missing, the editor searches the block directory
for suggestions. In this case, the editor searches for any block-plugins
or plugins that provide the `core/gallery` blockā¦ and returns THRON.
Installing this plugin won't fix the block error, though.
I think we have a few possibilities here, and can do any number of them:
- In the editor (gutenberg), don't run the block suggestion code if the
block is `core/*`
- In the wporg API, always return an empty result for `core/*` blocks
- When processing block-directory blocks, skip `core/*`, so they aren't
added as `block_name` meta values (and thus won't be returned in the API)
We already have a validation rule that prevents block-plugins from using
the `core` namespace, but
[https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
/wp-content/plugins/plugin-directory/api/routes/class-query-
plugins.php#L85 the API falls back to any plugin with blocks]. Maybe it
shouldn't do that?
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/5910>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list