Περιγραφή
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).
Εγκατάσταση
- Upload the plugin folder to
/wp-content/plugins/. - Activate the plugin through the Plugins menu in WordPress.
- Open the block editor and use the “Block Weight Inspector” sidebar.
Συχνές Ερωτήσεις
-
Does this load assets on the front-end?
-
No. The inspector only runs in the block editor and does not enqueue anything on the front-end.
-
Why is a size shown as “remote/unknown”?
-
Only local files are measured by default. You can optionally enable remote size lookup in the inspector panel or Tools page, and the preference is saved per user.
-
Are the suggested dequeue rules safe?
-
They are suggestions only. Some plugins enqueue assets for reasons outside of blocks. Always review before using.
Κριτικές
Δεν υπάρχουν αξιολογήσεις για αυτό το πρόσθετο.
Συνεισφέροντες & Προγραμματιστές
“Block Weight Inspector” είναι λογισμικό ανοιχτού κώδικα. Οι παρακάτω έχουν συνεισφέρει στη δημιουργία του.
ΣυντελεστέςΜεταφράστε το “Block Weight Inspector” στην γλώσσα σας.
Ενδιαφέρεστε για την ανάπτυξη;
Περιηγηθείτε στον κώδικα, ανατρέξτε στο αποθετήριο SVN ή εγγραφείτε στο αρχείο καταγραφής αλλαγών ανάπτυξης μέσω RSS .
Σύνοψη αλλαγών
0.1.0
- Initial release.
