WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

[Tracking] Block Manager Enhancements #28572

Open ntsekouras opened 3 years ago

ntsekouras commented 3 years ago

Block Manager is the place where we can select which blocks we want to hide/show from the inserter in the editor.

There are enhancements that need to be made and this serves as a small tracking issue.

Regarding the redesign of Block Manager here is the gif from the original issue: 2020-11-18 18 44 58

bph commented 3 years ago

We recently took a site live were multiple team members collaborated designing the site and adding content, each aiming for the best outcome with blocks.

Some installed additional blocks from plugins to test and provide options or just do a proof of concept.

Before we took the site live, we noticed there are now 148 blocks available over 4 additional plugins + core.

We now have no way to find out which blocks were used over 40 pages and posts. I looked at a few Block managers plugins and none seems to be able to provide an answer to a fairly basic question: Which blocks did we actually use throughout the site?

We would need the information to decide on which plugin can we safely uninstall.and which should we keep.

A revamp of Block managers could - and should- provide an answer.

Just a decision on switching off a block for a site that has been used for a while should be an educated decision to avoid that a used block is turned off inadvertently and can't be edited anymore.

jimmy19742 commented 3 years ago

@bph Dear Ms Birgit , I'm absolutely sure that Nick Hamze ( might not be spelled correctly) built such a plugin due to his personal encounter with this issue about an year ago. I will eloborate :He didn't know if he deleted a blocks plugin where any of the blocks shipped with it had been on his sites and much more. I am also absolutely sure that his plugin was covered by Justin Tadlodk that is WP Tavern.

I think it's proprietary and not in the official repo but on some of his sites. However I'm not absolutely sure about that. Why don't you( Gutenberg team) reach out to him and ask him? He's a skilled young React developer . I'm not!!! On the hand I have not seen him lately. On Twitter , I mean.

susancycles commented 3 years ago

"Which blocks did we actually use throughout the site?"

This would be so helpful. If you're getting rid of plugins that aren't being used enough to justify the weight they add to the site, it would be so much simpler if you knew where blocks are being used.

skorasaurus commented 3 years ago

I don't know whether Nick Hamze has a plugin that describes what you're looking for but there's also one by Eddy Sims - https://github.com/eddysims/find-my-blocks

bph commented 3 years ago

Thanks @jimmy19742 @susancycles and @skorasaurus šŸŽ‰ Thanks for the tip with the plugin.

If the Gutenberg team is going through the motions to refactor Block manager, might as well elevate the functionality from the earlier iteration and add useful information. šŸ™‚

bph commented 3 years ago

A simple "found in 2 posts" next to the block might be sufficient. Screen Shot 2021-02-01 at 2 12 49 PM

Example from the Find my blocks plugin Screen Shot 2021-02-01 at 2 10 37 PM

susancycles commented 3 years ago

Identifying the number of instances is helpful if I want to remove unused blocks/collections, but I'll need to know where the instances are if I want to convert a page/post to a different block collection as I'm tidying things up down the road. I can see a two-step process where core tells me I've used a specific block X number of times, then using a plugin to locate them. Is that what you envision, @bph ?

bph commented 3 years ago

Yes, @susancycles that's pretty much what we did. We consolidated the use of 3 different post grid blocks to one.

But I wouldn't need more help from the Interface. Once I know which blocks are actually used, I can use Search in the post / page admins to find out which particular block string is use in which post or pages.

An example: the list tells me we used the block gb-post-grid. The screenshot shows the search results right in the pages list.

Screen Shot 2021-02-02 at 7 53 09 AM

Having a link to the search would be great. I am ok with just having the information which block string I need to search for. That's just me though....

susancycles commented 3 years ago

Oh that's good thinking. That will work perfectly!

ntsekouras commented 3 years ago

Thank you all for the interesting input/feedback. It seems that showing information about block usage is a needed feature. I'll add it in the PR's description for now and later create a ticket for it.

Zealth57 commented 3 years ago

Knowing how many posts use a particular block seems like and edge case needed to know when to uninstall a plugin, not on every single page. Iā€™m not sure how this would even be accomplished in a performant way across tens or hundreds of thousands of posts. Think about news site with tons of blocks and posts in the database having to maintain that count.

bph commented 3 years ago

@Zealth57 It might just be that the site with tenth of thousands of posts is actually the edge case. I would think there are many more DIY Bloggers and Site owners or even smaller teams who can use this, to keep the Kitchen drawer chaos in check. šŸ„°

The 'Find My Blocks' plugin has a nice feature to switch off the information for core/blocks.

Zealth57 commented 3 years ago

Sites with thousands of posts aren't edge cases, especially considering blocks will be used across pages, posts, and any custom post type you register. The plugin referenced here loops through every post, parses every block, and builds counts every time you edit or create a page. That couldn't be scalable at all and would waste resources for something I would consider niche. Is it a nice feature? Sure. But is it something 80%+ of users would use? I don't think so, and it should stay in plugin territory which one already exists rather than bake into core. If it was in core it wouldn't be a trivial task if it's done correctly. It should include cached counts similar to how taxonomy counts work. Taxonomy counts are cached because even at a few hundred or thousand posts you can't be counting stuff on the fly.

ntsekouras commented 3 years ago

Hey šŸ‘‹ - I've created a separate ticket for showing the blocks count here: https://github.com/WordPress/gutenberg/issues/28693

Please continue there any related discussions to be grouped better. Thanks!

-cc @bph and @Zealth57

CodingSamurai commented 2 months ago

@Zealth57 It might just be that the site with tenth of thousands of posts is actually the edge case. I would think there are many more DIY Bloggers and Site owners or even smaller teams who can use this, to keep the Kitchen drawer chaos in check. šŸ„°

There may be more DIY Bloggers & small biz site owners but please do NOT discount the Enterprise WordPress users as some sort of "edge case". Hundreds of large enterprises are now investing in WordPress and WordPress has a bad enough reputation around performance that it does a GREAT disservice to handwave away performance impacts for large sites as an "edge case".

We have a site with over 500,000 posts and two others with tens of thousands of posts and we're not unique when large organizations like Vox Media and the White House are running on WordPress.