feat: Enhance post type fields retrieval with fallback cache #72
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.
This pull request introduces several important enhancements and fixes to the WP Loupe plugin, focusing on schema migration, plugin auto-update management, improved test coverage, and REST API robustness. The most notable changes include a migration routine to ensure the presence of the
post_datefield in all indexes, a new settings-driven auto-update toggle, and expanded tests and documentation. Additionally, the REST API handler is now more robust and testable.Schema Migration & Indexing Improvements
WP_Loupe_Migrationclass to ensure thepost_datefield exists for all post types, automatically migrating older installations and triggering a reindex (inline for ≤2000 posts, scheduled otherwise). Admins can opt out viaWP_LOUPE_DISABLE_AUTO_REINDEX.WP_Loupe_Indexerto include a migration helper (ensure_required_columns) that checks and adds thepost_datecolumn and index to the SQLite documents table if missing, preventing fatal errors on upgrade. [1] [2]Plugin Auto-Update Management
WP_Loupe_Auto_Updateclass to enable or disable automatic plugin updates via a settings toggle (defaults to enabled). This respects a constant-based opt-out (WP_LOUPE_DISABLE_AUTO_UPDATE) and user preferences.REST API Enhancements
Testing & Documentation
CHANGELOG.mdwith detailed notes on new features, migration strategies, fixes, and internal refactors.These changes collectively improve the plugin's upgrade safety, maintainability, and extensibility, while providing clearer documentation and better test coverage.