| Stage | Core behavior | Extension use |
|---|---|---|
plugins_loaded | Loads translations. | Load translation-dependent extension labels after this point. |
init | Registers frontend block/shortcodes and several feature modules. | Register integration feature modules, extra blocks, or config panels. |
rest_api_init | Scans REST endpoint directories and registers method pairs. | Add endpoint directories through alsp_rest_paths. |
wp_enqueue_scripts | Registers frontend assets and prints localized data. | Use alsp_frontend_data to add small safe values. |
| Cron | Initializes mail queue, autoclose, needs-attention, trash, attachment cleanup, and email-piping jobs. | Schedule operational jobs carefully and make them idempotent. |
| Activation | Creates 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_pathsfilter. - Endpoint file
my_feature.phpmaps to classALSP_REST_V1_Endpoint_My_Feature. - Method pairs are
create/can_create,read/can_read,edit/can_edit, anddelete/can_delete. - The router registers both
/endpointand/endpoint/{id}. - Admin users bypass endpoint permission checks in
ALSP_REST_V1_Endpoint::can(); all other users rely on endpoint-specific permission callbacks.