-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget Visibility: Disable in Block Editor #17413
Widget Visibility: Disable in Block Editor #17413
Conversation
Currently, on `widget_admin_setup`, in the Widget Visibility module we'll run heavy operations to retrieve a bunch of entities, but we only really use those on the widgets page. Among those entities include all pages, categories, tags, custom taxonomy terms, all registered post types, users. For sites that don't leverage cache and have many pages with a lot of content, this can cause significant delays in TTFB and even end up in OOM errors. The reason for this is that since Gutenberg 8.3 we'll call the `widget_admin_setup` hook on the block editor, too (see WordPress/gutenberg#22807), but never actually use this data in the block editor. This means that we can disable the heavy logic on the block editor pages. This is what this PR does.
Caution: This PR has changes that must be merged to WordPress.com |
Suggest future replacing with `wp_should_load_block_editor_scripts_and_styles()`
Scheduled Jetpack release: November 3, 2020. E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17413 Thank you for the great PR description! When this PR is ready for review, please apply the |
Not sure why the wpcom check reports tests as failed, but they actually passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should do the trick for now. 👍
How does this behave with latest Gutenberg plugin and Block editor Widget screen enabled? |
I don't think this screen is affected in any way. The new block editor widget screen is essentially a new page in the admin, and doesn't even call the |
@jeherve thanks a bunch for the review 🙌 would be really appreciated if you could take a look at the corresponding diff, too. Thanks! |
FYI @adamziel in context of WordPress/gutenberg#25836 |
Currently, on
widget_admin_setup
, in the Widget Visibility module we'll run heavy operations to retrieve a bunch of entities, but we only really use those on the widgets page. Among those entities include all pages, categories, tags, custom taxonomy terms, all registered post types, users. For sites that don't leverage cache and have many pages with a lot of content, this can cause significant delays in TTFB and even end up in OOM errors.The reason for this is that since Gutenberg 8.3 we call the
widget_admin_setup
hook on the block editor, too (see WordPress/gutenberg#22807), but never actually use this data in the block editor. This means that we can disable the heavy logic on the block editor pages. This is what this PR does.Note that this intentionally touches WP.com files. We'd like this improvement to be done there, too.
Changes proposed in this Pull Request:
Jetpack product discussion
No related discussion. This is related to recent block editor perf improvements in p4TIVU-9uP-p2. See p7H4VZ-2KJ-p2 for more information.
Does this pull request change what data or activity we track or use?
Not at all.
Testing instructions:
Proposed changelog entry for your changes: