Add DB migration + filter back-compat for inline_glossary rename - #56
Open
ilicfilip wants to merge 1 commit into
Open
Add DB migration + filter back-compat for inline_glossary rename#56ilicfilip wants to merge 1 commit into
ilicfilip wants to merge 1 commit into
Conversation
Existing installs on the old pp_glossary identifiers would orphan their data on upgrade. This adds a 1.4.0 migration that renames the stored DB identifiers so entries and settings carry over: - Post type: pp_glossary -> inline_glossary - Meta key: _pp_glossary_data -> _inline_glossary_data - Option: pp_glossary_settings -> inline_glossary_settings - Block name in post content: wp:pp-glossary/... -> wp:inline-glossary/... Also: - Fix the 1.1.0 consolidation migration to read the legacy _pp_glossary_* meta keys (they only ever existed under the pp_glossary prefix). - Deprecate the pp_glossary_excluded_tags and pp_glossary_disabled_post_types filters with _doing_it_wrong notices; old names still work. - Bump version 1.3.1 -> 1.4.0 (the bump is what fires the migration) and add a changelog entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
ilicfilip
force-pushed
the
rename/inline-glossary-migration
branch
from
June 20, 2026 05:16
322c71e to
f0d1615
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks onto #55. That PR renames all code identifiers to
inline_glossarybut, as its own description flags, leaves DB-stored identifiers unmigrated — so any existing install would silently orphan its glossary entries and settings on upgrade. This adds the migration to fix that, plus filter back-compat.What this adds
DB migration (
migrate_to_1_4_0) — gated ondb_version < 1.4.0, renames the stored identifiers so data carries over:pp_glossaryinline_glossary_pp_glossary_data_inline_glossary_datapp_glossary_settingsinline_glossary_settingspost_contentwp:pp-glossary/glossary-listwp:inline-glossary/glossary-listFlushes rewrite rules afterward (post type slug changed).
run_migrations()now also falls back to the old option name when readingdb_version, so the upgrade path is detected.Bug fix in the 1.1.0 migration — #55 renamed the legacy read keys (
_pp_glossary_short_description, etc.) to_inline_glossary_*. Those keys only ever existed under thepp_glossaryprefix, so the consolidation would never match real pre-1.1.0 data. Reverted those reads to the legacy names; the consolidation runs in thepp_glossarynamespace and the later 1.4.0 step renames toinline_glossary.Filter back-compat —
pp_glossary_excluded_tagsandpp_glossary_disabled_post_typesstill fire, with_doing_it_wrongnotices pointing to theinline_glossary_*names.Version bump 1.3.1 → 1.4.0 — the bump is what actually fires the migration on existing installs. Updates the header,
INLINE_GLOSSARY_VERSION,Stable tag, and adds a changelog entry.Verification
composer lint,composer phpstan, andcomposer check-csall pass.Note
The migration uses direct
$wpdbqueries (post type may not be registered under the old slug at migration time) and is not idempotent-guarded beyond the version gate — it relies ondb_versionto run once, consistent with the existing 1.1.0 migration. A site already oninline_glossarydata with nodb_versionbump won't be affected since there's nothing under the old names to rename.🤖 Generated with Claude Code