kphoen/sitemap-generator
A framework-agnostic PHP library for building XML sitemaps. Add URLs with optional metadata, then render standards-compliant sitemap or sitemap index files, optionally gzipped. Simple, dependency-free API for keeping search engines up to date.
What the package is. A thin, ORM-agnostic abstraction for assembling sitemap XML, with "sources" for Propel and Doctrine. It predates the modern Laravel ecosystem (last release 2015‑01‑12), is formally archived, has 16 stars and zero dependents. In practice it is a reference implementation, not a dependency.
Architecture fit — poor. The package makes three assumptions that conflict with a current Laravel codebase:
Integration feasibility — mechanically possible, strategically weak. MIT license and a small API surface mean it can be installed, wrapped, and vendored. But because the value-add over a hand-rolled generator or an actively maintained alternative is marginal, feasibility is not the constraint — justification is.
Technical risk — high.
lastmod values, 50,000-URL / 50 MB uncompressed limits per file, sitemap index generation, and gzip output. These are the failure cases that actually matter and none are evidenced by stars, dependents, or test coverage we can see.Key questions to resolve before any commitment:
composer why show for its transitive dependencies?TPM recommendation: Treat as a reference design, not a dependency. The opportunity score (13) and archived status both point the same direction. The realistic options are (a) adopt a maintained Laravel-native sitemap package, or (b) write an in-house generator behind an artisan command — either of which is cheaper to own than resurrecting this.
Stack fit. Effectively zero for a modern Laravel/PHP 8.x stack. There is a narrow legitimate fit only in an inherited PHP 5.x application already using Propel or Doctrine, where the adapters do real work. Outside that, the package contributes an XML writer and nothing else.
Migration path (if forced to use it).
lazy() or chunkById) that streams model rows without hydration.SitemapBuilder::generate(): string) so the implementation stays swappable and the eventual migration off the fork is a binding change, not a refactor.Compatibility work required. Composer constraint audit, a PHP 8.x syntax and deprecation sweep, and a check on ext-simplexml/ext-zlib availability in the deploy image. Budget this explicitly; it is not free.
Sequencing. Run a strict timeboxed spike (1–2 days, one engineer): install, generate a 50k-URL sitemap with hostile data (ampersands, unicode, very long URLs), inspect output against the sitemap protocol, and measure peak memory. Gate on that result:
Do not sequence this as a dependency of a larger feature. It is self-contained, low-blast-radius, and should be resolved in a single iteration.
Maintenance — you own it indefinitely. Archiving is a permanent state, not a phase. Every future PHP minor, every Laravel major, and every dependency bump is an unassisted fix. Estimate the real cost as "a small permanent maintenance tax plus one unbudgeted breakage per platform upgrade," and compare that against the ~1–2 days to build the equivalent natively.
Support — none. No maintainer, no issue triage, no security advisories. Internal knowledge will concentrate in whichever engineer did the integration; if they leave, the fork becomes an orphan inside the org. Mitigate by keeping the wrapper interface thin and documenting the sitemap-protocol invariants in-repo, not in the package.
Scaling — adequate for small sites, unproven beyond. The generator runs in-process and, with ORM sources, risks hydrating full entity graphs into memory. For catalogues in the tens of thousands of URLs this is tolerable; at the 50,000-URL boundary or on memory-constrained workers it is not. If volume is material, generation belongs in a queued job writing to object storage behind a CDN-cached route, with the sitemap index rebuilt last so crawlers never see a partial index. The package provides none of this; it is our build either way.
Failure modes to instrument for:
&, quotes, or unicode in slugs, yielding a sitemap that fails Search Console validation silently from the app's perspective.Guardrails: a validation step in CI (XML schema + URL-count/size assertions) and an alert on sitemap generation job failure. Both are cheap and catch the two failure modes that actually damage SEO.
Ramp-up — low but lopsided. The API is small enough that any PHP developer is productive in under a day. The risk is not the learning curve, it is that the operational knowledge (the fork, the patches, the protocol invariants, the validation harness) lives with one person. Ramp-up cost is therefore low for writing code and high for safely changing it.
Bottom line for planning: no migration blocker, no scaling blocker at small volume, but a standing ownership liability with no upside over the alternatives. Fund the spike, expect it to fail, and hold the in-house or maintained-package path as the default.
How can I help you explore Laravel packages today?