
內容簡介
總結:Block Weight Inspector是一個WordPress外掛,新增了一個側邊欄面板在區塊編輯器中,將當前文章/頁面中的區塊與其註冊的CSS和JS資源進行映射。它估計了本地資源的大小,突出顯示主要問題,並導出JSON報告。它還可以生成建議的條件式加載片段,以幫助您在區塊不存在時取消佇列資源。
- 這個外掛在區塊編輯器中新增了一個側邊欄面板,能夠對當前文章/頁面中的區塊與其註冊的CSS和JS資源進行映射。
- 它能夠估計本地資源的大小,突出顯示主要問題,並導出JSON報告。
- 外掛還能生成建議的條件式加載片段,以幫助您在區塊不存在時取消佇列資源。
- 外掛還添加了一個在「工具」>「Block Weight Inspector」頁面進行現有文章審核的功能,而不用打開編輯器。
- 注意:在分析內容時,檢查員會保留區塊註釋定界符,從而使parse_blocks()在消毒後仍然準確。
<html>
<ul>
<li>這個外掛在區塊編輯器中新增了一個側邊欄面板,能夠對當前文章/頁面中的區塊與其註冊的CSS和JS資源進行映射。</li>
<li>它能夠估計本地資源的大小,突出顯示主要問題,並導出JSON報告。</li>
<li>外掛還能生成建議的條件式加載片段,以幫助您在區塊不存在時取消佇列資源。</li>
<li>外掛還添加了一個在「工具」>「Block Weight Inspector」頁面進行現有文章審核的功能,而不用打開編輯器。</li>
<li>注意:在分析內容時,檢查員會保留區塊註釋定界符,從而使parse_blocks()在消毒後仍然準確。</li>
</ul>
</html>
外掛標籤
開發者團隊
原文外掛簡介
Block Weight Inspector adds a sidebar panel in the block editor that maps blocks in the current post/page to the CSS and JS assets they register. It estimates local asset sizes, highlights top offenders, and exports a JSON report. It can also generate a suggested conditional-loading snippet to help you dequeue assets when a block is not present.
It also adds a Tools -> Block Weight Inspector screen for auditing existing posts without opening the editor.
Note: The inspector preserves block comment delimiters when analyzing content so parse_blocks() remains accurate after sanitization.
Key features:
Block -> asset mapping using registered block metadata.
Estimated size for local assets.
Top offenders summary and full asset list.
JSON export for sharing or auditing.
Suggested conditional-loading rules (review before use).
