Skip to content

Conversation

@n7studios
Copy link
Contributor

@n7studios n7studios commented Nov 25, 2025

Summary

This update refines how Gutenberg blocks are registered by detecting whether register_block_type() is running on the frontend or within an admin/editor context.

When the call occurs on the frontend, we now skip loading editor-only block properties. These properties are not required for frontend rendering and can trigger unnecessary resource refresh operations (forms, landing pages, products), which may be contributing to the elevated 401 Unauthorized errors noted here: https://linear.app/kit/issue/WP-48/wordpress-investigate-high-count-of-401-unauthorized-errors.

By avoiding these unnecessary initialisations, we reduce API calls and lower memory usage.

Before:
before

After:
after

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Nov 25, 2025
@n7studios n7studios mentioned this pull request Nov 25, 2025
6 tasks
@github-actions
Copy link

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team November 25, 2025 13:12
@n7studios n7studios marked this pull request as ready for review November 25, 2025 13:12
@n7studios n7studios merged commit 78681e3 into main Nov 26, 2025
290 of 300 checks passed
@n7studios n7studios deleted the register-blocks-frontend-performance branch December 5, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants