v0.1.4
Pre-release
Pre-release
Added
- Vendored
league/html-to-markdown(v5.1.1) with namespace scoping (MdfAnalytics\Vendor\League\HTMLToMarkdown) to eliminate class-redeclaration collisions if another plugin also vendors the same upstream library. No Composer required at runtime — the library is source-committed. Scoped viahumbug/php-scoper, built bybuild-vendor.sh. - Pre-build markdown cache pipeline: all published posts are converted to CommonMark on save (via WP-Cron background job) and served to clients that send
Accept: text/markdown. Markdown is never served for a URL until a pre-built.mdfile actually exists for it — no live-conversion fallback. - Cache directory at
wp-content/uploads/mdf-cache/with flatposts/layout, per-post{post_id}.md+{post_id}.meta.jsonsidecars, and amanifest.jsonaggregate. - Settings toggle "Offer markdown to agents" — enabling it auto-queues a full backfill of all published posts. Disabling stops markdown serving immediately.
save_posthook computes content hash (SHA-256 ofthe_content()post-filter output) and skips rebuilds when unchanged. Atomic temp-file + rename writes keep the old.mdservable throughout a rebuild.template_redirectnegotiation gating: checksfile_exists()against the cached.md(single filesystem stat, no sidecar JSON read at request time), setsVary: AcceptandContent-Type: text/markdownonly when cached content exists.- Backfill uses batched WP-Cron (
mdf_backfill_batch) to avoid flooding the cron queue; admin notice shows progress during backfill.
Fixed
- Manifest read-modify-write race:
manifest.jsonupdates are now wrapped withflock(LOCK_EX), preventing concurrent WP-Cron-driven writes (e.g. overlappingmdf_markdown_rebuildandmdf_backfill_batchevents) from silently clobbering each other. The lock provides advisory exclusion aroundmdf_manifest_record_result()and the backfill-completion path; the existing atomic temp-file + rename is retained for reader safety.