Files
heretek-control-core/tests
John SmithandClaude 448e46ff18 feat(migrate): real backup/restore/sync engine + HMAC connector, AI Chat hygiene
The fork's Pro merge left Backup/Restore/Migrate/Sync as placeholders (4 naive
files): no restore path, migrate-site was a canned-success stub, sync-to-live
touched only wp_options, and the connector exposed only a /status route. This
makes the story real at a bounded scope and fixes the wiring/doc drift found in
a feature-parity review against upstream Pro.

- search-replace engine: byte-accurate serialized fixer (length-delta, never
  unserializes), JSON escaped+unescaped URL pair replace (_elementor_data), and
  a site-wide table walker; legacy EMCP_Tools_Search_Replace now delegates.
- backups: streamed DB export (bounded chunks, explicit-column INSERTs), richer
  .emcp manifest (format version, site_url, php/wp/db, DB sha256 + row stats),
  opt-in include_files bundling of uploads/plugins/themes.
- restore: hardened statement-aware importer (skips transaction-control
  directives, ';'-in-string safe); new Restore_Engine (hash-verified -> import
  -> URL rewrite -> traversal-guarded file placement); admin Restore/Download/
  Delete + restore-history panel (nonce + manage_options, admin-only).
- migrate-site: real push to a standalone HMAC connector (2 MB signed packets ->
  assemble -> verify -> self-contained restore -> pollable job). confirm:true
  required; direction "pull" returns unsupported.
- sync-to-live: real site-wide serialized-safe URL search-replace across
  options/posts/postmeta/comments/term+usermeta + prefixed tables, ledger-
  recorded for History rollback.
- remove 3 never-registered ghost tools (list-syncable-changes,
  sync-content-item, discard-sync-change) from catalog/slugs/seeding.
- AI Chat: canonical module id 'ai-chat' (admin toggle now works, legacy
  ai_chat read-back), /emcp/v1/chat route gated on module state, default on.
- docs: correct README/readme.txt over-claims (WooCommerce op list, addon slugs,
  atomic wording, SEO/forms counts), tidy pro-manifest.txt; bump 3.16.0.

Tests: extended tests/test-migrate-packager.php (8 suites, all passing) covering
byte-accurate SR, export/import round trip, directive-skip, quote-safe split,
and packager create/read/list/delete.

Co-Authored-By: Claude <[email protected]>
2026-09-03 01:09:03 -04:00
..
2026-09-02 11:35:42 +05:00