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

Pure Text Laravel Package

yasser-elgammal/pure-text

Pure Text is a lightweight Laravel package that converts rich HTML content into clean, readable plain text. Strip tags, decode entities, normalize whitespace, and generate search-friendly excerpts for notifications, previews, and indexes through a simple, expressive API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. Unchanged and still good. v2.0.0 keeps the idiomatic Laravel shape — service provider with config publishing, facade-style API, Blade directives, middleware. The 2.0 release explicitly bundles "Unicode/Arabic support, refactoring, and new features," which is the right direction: the filter pipeline is now claimed to handle the encoding surface that matters for this product's content. The caveat is that "refactoring" plus a major version bump is a euphemism for an API we have not yet seen. Fit remains good; certainty about the surface does not.

Integration feasibility. Still low-friction to install, but no longer a straight require. A major bump means the integration recipe in the prior assessment (publish config → seed lexicon → register middleware) must be re-validated end to end, because published config keys, middleware registration/alias, and facade or helper signatures are all plausible breakage points. Budget shifts from "hours to first filtered request" to "half a day to first filtered request after a changelog audit," assuming an UPGRADE.md or migration guide exists — and the release notes give no evidence it does.

Technical risk.

Risk Severity Notes
v2 breaking-change surface undocumented High "Refactoring" + major bump, with release notes that name no changed config keys, method signatures, or removed features. Must be diffed from source, not from notes.
Release hygiene Medium → High The entire release is one PR (#6) bundling three concerns, plus a merge from the maintainer's fork main (#5). Not reviewable, not bisectable, no per-change rationale.
Bus-factor of one High Unchanged. Still a single maintainer with effectively no downstream validation of v2.
Word list quality/coverage High Now more consequential: if v2 changed or expanded the lexicon, our tuned overrides may silently drift.
Evasion resistance Medium Unchanged. Leetspeak/spacing/tatweel/homoglyph arms race; normalization changes in v2 could help or hurt, unverified.
Performance of matching Medium A refactor can regress matching cost. The v1 benchmark is void — re-baseline.
False positives Medium Arabic Unicode normalization changes false-positive behavior. New normalization = new precision profile, not an improved one.
Test/CI transparency Medium The "Unicode support" claim is now shipped rather than aspirational, but still only as trustworthy as the suite behind it.

Risks retired or reduced: the Unicode claim is no longer a forward-looking promise — v2 ships it as a feature, which removes one unknown from the v1 assessment.

Risks introduced: upgrading is now an event with unknown blast radius, and the release notes actively withhold the information needed to scope it. A major version with a one-line changelog is a smell.

Key questions.

  1. Is there an UPGRADE.md or a v1→v2 diff guide? If not, what exactly broke — config keys, facade methods, middleware alias, Blade directive syntax?
  2. Did the Laravel/PHP support floor move (e.g. to Laravel 10+ / PHP 8.2+), and is that matrix CI-tested?
  3. What does "Unicode/Arabic support" concretely normalize — alef/hamza variants, tatweel, diacritics, Arabic-Indic digits — and at which stage, before or after matching?
  4. Did the bundled lexicon change between v1 and v2? If so, what was added/removed, and is the list versioned?
  5. Is the v2 matcher faster, slower, or unchanged at 1k/5k/20k terms, and is there still no request-size guard?
  6. Was the v1 facade API preserved as a compatibility layer, or is v2 a clean break?
  7. What in PR #6 is "refactoring" versus "new features" — can that be split for review or is it a single opaque commit?

Verdict (revised): Adopt v2 as a mechanics layer behind an internal TextFilter interface — the abstraction is now more valuable, not less, because it insulates us from an unannounced breaking-change cadence. Treat the lexicon as our content from day one. Do not adopt v2 on the strength of its release notes; adopt it after reading its diff.

Integration Approach

Stack fit. Unchanged in principle, but the v2 support matrix must be re-pinned. Assume nothing: a major bump commonly raises the PHP/Laravel floor and may add or drop ext-intl/ext-mbstring requirements. If v2 now requires ext-intl for normalization (likely, given the Unicode feature), that becomes a runtime prerequisite to verify across our deploy images, not just the dev box.

Migration path. v1→v2 is now a real migration even for greenfield adopters, because the config we were about to seed may not match the v2 schema. Two paths:

  • Greenfield: install ^2.0, publish config, and read the published config file rather than the docs — the config is the most honest changelog this release provides. Diff it against the v1 config shape in the assessment above to spot renamed/removed/retyped keys.
  • Already on v1 (or on a fork of v1): upgrade in a scratch branch, then run our v1 fixture set — evasion vectors, false-positive samples, Arabic normalization cases, known-good strings — against v2 and diff the outputs string by string. Any change in output is either the Unicode feature or a regression; the release notes don't tell us which.

Compatibility. Three axes now, not two:

  • Framework matrix — run the package's own suite against our exact Laravel/PHP versions; do not trust the constraint string.
  • Encoding — v2's normalization pass may alter output on input v1 left untouched. Pin fixtures for raw UTF-8, pre-normalized UTF-8, mixed Arabic/Latin, and RTL-shaping cases.
  • API surface — enumerate facade methods, middleware alias, and Blade directive signatures in v1 vs v2 before writing integration code.

Sequencing.

  1. Upgrade audit (half day): read PR #6 and the v1→v2 diff. Extract the actual breaking changes and the actual lexicon delta. This replaces guesswork and is the highest-value half day in the plan.
  2. Spike (1–2 days): benchmark 1k/5k/20k-term lists on v2, measure p95 added latency on a representative endpoint, and re-run the evasion/false-positive corpus. Do not reuse v1 numbers.
  3. Abstraction (2–3 days): internal TextFilter contract with filter(), filterMany(), inspect(). Now also the upgrade seam — it means the next major bump is a one-file change.
  4. Shadow rollout: middleware in log-only mode on UGC endpoints; review volume and precision with content ops. Re-baseline precision versus the v1 measurements, since normalization changed.
  5. Enforce: display rendering first, write-time rejection last.
  6. Own the lexicon: move lists into our config/DB, version them, review workflow. Now urgent — v2 may have moved the bundled list under us.

Scope the middleware to writes and rendered UGC only, as before.

Operational Impact

Maintenance. The fork budget is now a live cost, not a contingency. A 2.0.0 shipped as an opaque single-PR release tells us upstream upgrades will arrive without migration guidance; we will be reading diffs to upgrade. Pin ^2.0 (or an exact 2.0.x) and treat every upstream release — major or minor — as a deliberate, fixture-tested event. Estimate a few days per year of patch-carrying plus lexicon curation, with a spike of effort now for the v1→v2 move. If we had already forked v1, rebasing onto a refactor-heavy v2 may be cheaper to skip than to merge; decide explicitly rather than drifting onto an abandoned fork.

Support. Unchanged: no vendor, no SLA, no advisory channel. v2 does not improve this, and the release-note quality slightly worsens our ability to self-support. Acceptable for a content filter; unacceptable as a compliance control. Keep human moderation and a report-and-review path.

Scaling. Cost centers unchanged, but all v2 numbers are unmeasured:

  • Lexicon load — verify whether v2 changed how lists are stored/loaded (a refactor is exactly where a per-request file read sneaks in). Target zero per-request file I/O; precompile at deploy.
  • Matching — re-benchmark at 10× expected peak term count. If v2 added normalization passes, per-request CPU may be higher even if matching is faster. Keep the request-body size cap.

Stateless, so horizontal scaling is fine; the risk remains latency and CPU per request.

Failure modes.

Mode Impact Mitigation
Silent behavioral change from v2 normalization Filter no-ops or over-matches with no error — worst case Fixture-diff v1 vs v2 outputs before enforcing; snapshot tests in CI
Undocumented breaking config/API change Integration breaks on upgrade, or config silently ignored Read the diff, not the notes; assert config values are actually consumed
Lexicon drift in v2 Coverage loss or new false positives Version the list in-repo; diff bundled list against our overrides
False positive on legitimate Arabic text User-facing rejection/garble, trust damage Shadow mode, allowlist, per-surface strategy, appeal path
Evasion (leet, spacing, tatweel, homoglyph) Moderation gap Layered detection + human reports; list alone is insufficient
Regex backtracking / oversized input Latency spike, 5xx Body size cap, timeout, matcher benchmark in CI
Upstream abandonment or opaque 3.0 Stuck, unupgradeable Internal TextFilter abstraction + fork readiness
Release-quality erosion Every upgrade becomes archaeology Pin versions; treat release review as scheduled work

The dangerous failure is still quiet: a filter that matches nothing after a normalization change, now with a higher prior because v2 changed the normalization layer and did not document how.

Ramp-up. Still low for a Laravel developer — half a day to a filtered request once the v2 shape is understood — but add the upgrade-audit step before that clock starts. The non-obvious cost remains domain review: someone who reads Arabic UGC must own the lexicon, and they must re-review it after v2 because the bundled list and normalization both plausibly moved. Set a monthly curation cadence and a documented add/remove process, or precision decays without anyone noticing.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route