Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Wp Match Blocks Laravel Package

alleyinteractive/wp-match-blocks

A WordPress utility for matching Gutenberg blocks in post content. Detect whether a post contains a given block type or attributes, so themes and plugins can conditionally load assets or change rendering based on the blocks actually used.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Headless / decoupled architecture: alleyinteractive/wp-match-blocks gives PHP a reliable way to walk Gutenberg block trees server-side. That underpins a real product decision: render WordPress-authored content inside a Laravel app (Blade/Inertia/Livewire) rather than proxying the WP front-end theme. It is the plumbing that makes "WordPress as a CMS, Laravel as the product" credible instead of a regex-driven hack.
  • Block migrations and content rewrites: when you rename a block, change an attribute schema, or deprecate a block type, you need to find every instance in stored post_content and rewrite it safely. This package is the traversal layer for that work — the difference between a scripted migration you can run in a queued job and a manual editorial sweep.
  • Feature scoping for editorial surfaces: extracting blocks by name or attribute is how you build things like "most-referenced embeds," content audits, table-of-contents generation, related-content-by-block, or per-block analytics. It lets you scope those as thin features over existing content instead of new authoring tools.
  • Build vs. buy: the core parse_blocks() is WordPress-provided, but recursive matching and safe re-serialization is ~100–200 lines of fiddly, edge-case-heavy code (nesting, inner blocks, whitespace, escaping). Adopting a small maintained package is cheaper than owning that logic — provided the maintenance signal holds.
  • Release posture: v4.4.0 is a minor version bump with release notes that only link to the changelog — no documented breaking changes, deprecations, or headline features. Treat it as a low-risk, routine upgrade: pin the minor, read the changelog diff before bumping, and don't build roadmap commitments on it. The signal here is stability, not new capability.

When to Consider This Package

Adopt it when all of the following are true:

  • You are storing or receiving Gutenberg block markup (<!-- wp:... -->) and need to inspect or transform it server-side in PHP, not in JS.
  • You need recursive matching across nested/inner blocks — flat string matching is already failing you.
  • A WordPress runtime (or at least the block parser) is available in your process. This is a WordPress-ecosystem package consumed via Composer, not a Laravel-first library; in a Laravel app you will be pulling in or shimming WP functions, and that dependency needs an explicit owner.
  • The content-rewrite surface is growing (migrations, audits, multi-channel rendering) rather than a one-off.

Look elsewhere or build in-house when:

  • You have a single, stable block type and a one-time need — parse_blocks() plus a short recursive helper is less total risk than a dependency.
  • You do all block handling in JavaScript (editor-side, @wordpress/blocks) and PHP only ever stores opaque markup.
  • You need guarantees the project can't offer: check release cadence, PHP version support, test coverage, and responsiveness on issues before making it load-bearing. Low-velocity is fine for a parser; it is not fine for something you plan to extend.
  • You need block validation against block.json schemas or full block rendering — this is traversal, not a validator or renderer. Pair it with WordPress's server-side renderer or handle rendering yourself.
  • You're on a hard security/audit review path and an unmaintained transitive WordPress dependency is a blocker — in that case vendor a minimal fork.

How to Pitch It (Stakeholders)

To executives: This is a small, single-purpose open-source library that lets our PHP application read and safely rewrite WordPress block content. It supports a strategic option we keep evaluating — using WordPress purely as an authoring tool while our Laravel product owns the experience — and it de-risks content migrations by replacing hand-rolled parsing code with something tested. The v4.4.0 release is a routine minor update: no breaking changes, no deprecations, no new surface area. Cost is negligible; the real cost is the WordPress runtime dependency, which we should accept deliberately rather than by accident.

To engineering: wp-match-blocks (Alley Interactive) provides recursive block matching and block escaping over parsed block arrays. It replaces ad-hoc regex and hand-written tree walks in our content pipeline — the code most likely to silently corrupt posts during a migration. Composer-installable, narrow API, easy to wrap behind our own BlockRepository interface so we can swap it out. Two cautions: (1) it assumes WordPress block-parser primitives are available, so containerize that; (2) release notes for v4.4.0 are changelog-link-only, so review the diff, pin the version, and cover our usage with contract tests before upgrading. If the dependency ever looks stale, the wrapper makes a fork or in-house replacement a contained, sub-day change.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource