Skip to content

Refactor: simplify sitemap services and cache invalidation - #1

Merged
cbarrilliez-beapi merged 3 commits into
mainfrom
ver/1.1.0
Sep 25, 2026
Merged

cbarrilliez-beapi merged 3 commits into
mainfrom
ver/1.1.0

Conversation

@cbarrilliez-beapi

@cbarrilliez-beapi cbarrilliez-beapi commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes sitemap routing, 404 behavior for inactive languages, and cache invalidation paths that affect public XML output; PHP 8.1+ is now required.

Overview
Release 1.1.0 refactors the plugin around a small injected service graph in Plugin (Url_Helper, Router, Sitemap_Cache, Rank_Math_Overrides, Index_Expander) and drops the separate Language_Context, Sitemap_Availability, and Transient_Versions classes. Static helpers become instance services; activation/deactivation flow through Plugin::on_activation() / on_deactivation().

Sitemap routing and languages: Router now owns request-time language setup (moved from Language_Context), registers rewrite rules for all Polylang languages—including inactive Pro languages—so prefixed sitemap URLs set rm_sitemap_lang and can 404 instead of serving the default language. Url_Helper adds URI-based language detection when the query var is missing.

Index and cache: Per-language index availability probing lives in Index_Expander::has_urlset_for_language(); results are cached via Sitemap_Cache (availability transients + version bumps merged into one class). Language term edits trigger a full cache clear, rewrite re-registration, and flush so inactive languages drop out of the index.

Platform: Minimum PHP 8.1 (Composer/dev tooling updated accordingly). Tests follow the instance APIs and add coverage for cache transient keys and request URI language detection.

Reviewed by Cursor Bugbot for commit 6407dd0. Bugbot is set up for automated code reviews on this repo. Configure here.

@cbarrilliez-beapi
cbarrilliez-beapi merged commit 893e4d7 into main Sep 25, 2026
2 checks passed
@cbarrilliez-beapi
cbarrilliez-beapi deleted the ver/1.1.0 branch September 25, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant