Architecture And Load Order

Version 1.9.3

StageCore behaviorExtension use
plugins_loadedLoads translations.Load translation-dependent extension labels after this point.
initRegisters frontend block/shortcodes and several feature modules.Register integration feature modules, extra blocks, or config panels.
rest_api_initScans REST endpoint directories and registers method pairs.Add endpoint directories through alsp_rest_paths.
wp_enqueue_scriptsRegisters frontend assets and prints localized data.Use alsp_frontend_data to add small safe values.
CronInitializes mail queue, autoclose, needs-attention, trash, attachment cleanup, and email-piping jobs.Schedule operational jobs carefully and make them idempotent.
ActivationCreates roles, capabilities, options, and custom tables.Run migrations separately; do not assume activation re-runs on every update.

Dynamic REST endpoint router rules:

  • Core endpoint directory: classes/api/rest/v1.
  • Extra endpoint directories are provided by the alsp_rest_paths filter.
  • Endpoint file my_feature.php maps to class ALSP_REST_V1_Endpoint_My_Feature.
  • Method pairs are create/can_create, read/can_read, edit/can_edit, and delete/can_delete.
  • The router registers both /endpoint and /endpoint/{id}.
  • Admin users bypass endpoint permission checks in ALSP_REST_V1_Endpoint::can(); all other users rely on endpoint-specific permission callbacks.