You've already forked wp-bootstrap
-
WP Bootstrap 1.1.2
Stablereleased this
2026-03-01 00:02:21 +00:00 | 2 commits to main since this releaseSecurity
- WidgetRenderer regex hardening: Combined two separate
preg_replacecalls for h2→h4 heading downgrade into a single regex that only matches<h2>elements with thewp-block-headingclass. The previous approach replaced all</h2>tags unconditionally, risking mismatched tags if a widget contained non-block h2 elements.
Performance
- O(n) comment tree building (
ContextBuilder): Replaced O(n²) recursive scan with a parent-indexed lookup map built in a single pass. Each recursion level now iterates only direct children instead of all comments. - Consolidated sidebar queries (
ContextBuilder): Merged three separate sidebar detection branches (is_home,is_page+sidebar,is_singularpost) into a single boolean check with onegetSidebarData()call, eliminating up to 2 redundant calls per request. - Transient caching for sidebar data (
ContextBuilder):getSidebarRecentPosts()andgetSidebarTags()results cached in WordPress transients (1 hour TTL). Invalidation hooks onsave_post(recent posts) andcreate/edit/delete_post_tag(tags).
Changed
- Hex-to-RGB consolidation (
functions.php):wp_bootstrap_hex_to_rgb()now delegates towp_bootstrap_hex_to_rgb_array()instead of duplicating hex parsing logic. Addedctype_xdigit()validation and return type hints to all color utility functions.
Downloads
- WidgetRenderer regex hardening: Combined two separate