HSLG Media

AutoSync.php

AutoSync.php

Source file: wordpress/hslg-docs-publisher/src/AutoSync.php

Module: wordpress-hslg-docs-publisher

Size: 121 lines

SHA-256: e2f36b32a2a1eb06f9789a912a2d38a4a499247533e2427009b6ebc71e74d8f0

Responsibility

Imports versioned documentation automatically when activated or upgraded; keeps stable WordPress page IDs, ownership metadata, unlimited post revisions and collision protection.

Declared entry points

  • HSLG_Docs_AutoSync — source line 9.
  • APPLIED — source line 10.
  • STATUS — source line 11.
  • CRON — source line 12.
  • boot — source line 14.
  • bundle_hash — source line 23.
  • is_current — source line 28.
  • on_activation — source line 33.
  • on_admin_request — source line 39.
  • on_upgrade — source line 45.
  • schedule_if_needed — source line 54.
  • on_scheduled_run — source line 60.
  • run — source line 66.
  • record_failure — source line 102.
  • admin_notice — source line 113.

Imports and dependencies

No direct import declarations detected in this file.

Behaviour and audit locations

  • Line 5: * No public endpoint, nonce-free URL action, or need for CLI/root credentials.

Publication lifecycle

This class listens for activation, upgrade, administrative requests and a scheduled retry. It compares the installed bundle hash to the last applied hash, uses a temporary update lock and records success or blocked status. It does not expose an anonymous route that writes pages and it does not require the operator to run WP-CLI. Publication conflicts are reported to administrators rather than solved by deleting pages or overriding manual edits.

Relationship to the system

This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.

Change verification

Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.