Sitemap regeneration is unbounded, runs on every save, and leaks non-public URLs #100
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
SitemapBuilder::generate()(plg_system_mokoog/src/Helper/SitemapBuilder.php:33-95) has scaling and disclosure issues, and is invoked synchronously fromonContentAfterSaveon every article save.loadObjectList()of every published article with noLIMIT/batching, building the whole XML in memory, on each save (MokoOG.php:821-839). Heavy on large sites; pathological if frontend submissions trigger it.state = 1only (line 44); registered/special-access articles are written into the public sitemap (information disclosure). Thenoindexlookup (lines 50-57) also ignores access level.index.php?option=com_content&view=article&id=Ninstead of SEF/canonical URLs, creating duplicate-content signals against the canonical tags the plugin itself emits.Fix
access IN (public viewing levels)and per-language.Routed canonical URLs.Branch created:
feature/100-sitemap-regeneration-is-unbounded-runs-oPartially addressed in PR #109 (merged to
dev):sitemap.xml.rename, so concurrent saves can't expose a half-written file.Still open (kept):
onContentAfterSave.index.php?option=...; generating correct SEF URLs from the admin/save context is non-trivial and deferred to avoid emitting wrong URLs.Remaining items fixed in PR #116 (merged to
dev):onContentAfterSaveRebuildSitemapregenerates at most once per 60s (SITEMAP_MIN_INTERVAL), so bulk edits/imports no longer rebuild the whole sitemap on every save (eventually consistent within the window).Route::link('site', …)so the sitemap matches the plugin's canonical URLs, with a try/catch fallback to the non-SEFindex.phpURL if routing fails (worst case = prior behavior, never broken).Combined with the earlier access-level filtering + atomic write (PR #109), all four original concerns are addressed. Closing.
Minor optional follow-up (separate, low priority): per-language sitemap files — the current build emits one combined sitemap. Open a new issue if that's wanted.