@codigodoleo/wp-kit 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -267,6 +267,11 @@ export async function runPrompts({ defaults = false } = {}) {
267
267
  defaultAnswers.gitProvider = envGitProvider;
268
268
  }
269
269
 
270
+ // WP_KIT_SSH_TRANSPORT: overrides ssh_transport (used for non-interactive E2E generation).
271
+ if (process.env.WP_KIT_SSH_TRANSPORT) {
272
+ defaultAnswers.ssh_transport = process.env.WP_KIT_SSH_TRANSPORT;
273
+ }
274
+
270
275
  const enabledModules = Object.keys(modulePromptDefs).filter(
271
276
  (mod) => defaultAnswers[`enable_${mod.replace(/-/g, "_")}`] === true,
272
277
  );
@@ -1,9 +1,10 @@
1
1
  # CI — {{projectName}}
2
2
  #
3
3
  # Quality gate and deploy pipeline using hekivo/gha-workflows shared actions.
4
- # Secrets are resolved via 1Password Connect (Connect server at vars.OP_CONNECT_HOST,
5
- # authenticated with secrets.OP_CONNECT_TOKEN). Update the op:// paths below to
6
- # match your project's vault items before first run.
4
+ # Deploy jobs resolve secrets via a 1Password Service Account (single repo
5
+ # secret: OP_SERVICE_ACCOUNT_TOKEN). The quality job keeps org-level Connect
6
+ # (org secret OP_CONNECT_TOKEN — contract of quality.yml@v1). Update the
7
+ # op:// paths below to match your project's vault items before first run.
7
8
 
8
9
  name: CI
9
10
 
@@ -37,7 +38,7 @@ permissions:
37
38
  {{/if}}
38
39
 
39
40
  concurrency:
40
- group: ci-${{'{{'}} github.ref {{'}}'}}
41
+ group: ci-$\{{ github.ref }}
41
42
  cancel-in-progress: true
42
43
 
43
44
  env:
@@ -56,17 +57,18 @@ jobs:
56
57
  quality:
57
58
  uses: hekivo/gha-workflows/.github/workflows/quality.yml@v1
58
59
  with:
59
- php-version: ${{'{{'}} env.PHP_VERSION {{'}}'}}
60
- node-version: ${{'{{'}} env.NODE_VERSION {{'}}'}}
60
+ php-version: "{{phpVersion}}"
61
+ node-version: "{{nodeVersion}}"
61
62
  {{#if ci.build.sage}}
62
- theme-path: ${{'{{'}} env.THEME_PATH {{'}}'}}
63
+ theme-path: {{ci.theme.paths.themeRoot}}
63
64
  {{/if}}
64
65
  mago-lint-continue-on-error: false
65
66
  secrets:
66
- OP_CONNECT_TOKEN: ${{'{{'}} secrets.OP_CONNECT_TOKEN {{'}}'}}
67
+ # org-level Connect (ACF no quality) — deploys usam SA-mode
68
+ OP_CONNECT_TOKEN: $\{{ secrets.OP_CONNECT_TOKEN }}
67
69
  {{#if enable_acf_pro}}
68
- ACF_CONNECT_USERNAME: ${{'{{'}} secrets.ACF_CONNECT_USERNAME {{'}}'}}
69
- ACF_CONNECT_PASSWORD: ${{'{{'}} secrets.ACF_CONNECT_PASSWORD {{'}}'}}
70
+ ACF_CONNECT_USERNAME: $\{{ secrets.ACF_CONNECT_USERNAME }}
71
+ ACF_CONNECT_PASSWORD: $\{{ secrets.ACF_CONNECT_PASSWORD }}
70
72
  {{/if}}
71
73
 
72
74
  {{#if ci.deploy.docker}}
@@ -75,7 +77,7 @@ jobs:
75
77
  needs: quality
76
78
  uses: hekivo/gha-workflows/.github/workflows/docker-build.yml@v1
77
79
  with:
78
- image-name: ${{'{{'}} github.repository {{'}}'}}
80
+ image-name: $\{{ github.repository }}
79
81
  platforms: linux/amd64
80
82
  permissions:
81
83
  packages: write
@@ -89,10 +91,10 @@ jobs:
89
91
  (github.event_name == 'workflow_dispatch' && inputs.deploy == true)
90
92
  uses: hekivo/gha-workflows/.github/workflows/docker-publish.yml@v1
91
93
  with:
92
- source-image: ${{'{{'}} needs.docker-build.outputs.image-ref {{'}}'}}
94
+ source-image: $\{{ needs.docker-build.outputs.image-ref }}
93
95
  registry-type: {{docker_registry}}
94
- image-name: ${{'{{'}} github.repository {{'}}'}}
95
- image-tag: ${{'{{'}} github.ref_name {{'}}'}}
96
+ image-name: $\{{ github.repository }}
97
+ image-tag: $\{{ github.ref_name }}
96
98
  {{#if ci.docker.registryEcr}}
97
99
  aws-region: us-east-1 # TODO: update region
98
100
  ecr-registry: "" # TODO: 123456789012.dkr.ecr.us-east-1.amazonaws.com
@@ -105,13 +107,13 @@ jobs:
105
107
  {{/if}}
106
108
  secrets:
107
109
  {{#if ci.docker.registryEcr}}
108
- AWS_ROLE_ARN: ${{'{{'}} secrets.AWS_ROLE_ARN {{'}}'}}
110
+ AWS_ROLE_ARN: $\{{ secrets.AWS_ROLE_ARN }}
109
111
  {{/if}}
110
112
  {{#if ci.docker.registryDockerHub}}
111
- DOCKERHUB_TOKEN: ${{'{{'}} secrets.DOCKERHUB_TOKEN {{'}}'}}
113
+ DOCKERHUB_TOKEN: $\{{ secrets.DOCKERHUB_TOKEN }}
112
114
  {{/if}}
113
115
  {{#if ci.docker.registryGitlab}}
114
- GITLAB_REGISTRY_TOKEN: ${{'{{'}} secrets.GITLAB_REGISTRY_TOKEN {{'}}'}}
116
+ GITLAB_REGISTRY_TOKEN: $\{{ secrets.GITLAB_REGISTRY_TOKEN }}
115
117
  {{/if}}
116
118
  permissions:
117
119
  packages: read
@@ -134,26 +136,25 @@ jobs:
134
136
  uses: actions/checkout@v4
135
137
 
136
138
  - name: Load secrets from 1Password
137
- uses: 1password/load-secrets-action@v2
139
+ uses: 1password/load-secrets-action@v4
138
140
  with:
139
141
  export-env: true
140
142
  env:
141
- OP_CONNECT_HOST: ${{'{{'}} vars.OP_CONNECT_HOST {{'}}'}}
142
- OP_CONNECT_TOKEN: ${{'{{'}} secrets.OP_CONNECT_TOKEN {{'}}'}}
143
+ OP_SERVICE_ACCOUNT_TOKEN: $\{{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
143
144
  {{#if enable_acf_pro}}
144
145
  # ACF Pro Composer auth — item shared across all projects in Hekivo-Internal
145
- ACF_CONNECT_USERNAME: op://Hekivo-Internal/{{projectName}}-acf-connect/username
146
- ACF_CONNECT_PASSWORD: op://Hekivo-Internal/{{projectName}}-acf-connect/password
146
+ ACF_CONNECT_USERNAME: op://Hekivo-Internal/hekivo-acf-connect/username
147
+ ACF_CONNECT_PASSWORD: op://Hekivo-Internal/hekivo-acf-connect/password
147
148
  {{/if}}
148
149
  # SSH transport credentials — update vault/item paths for this project
149
150
  SSH_HOST: op://Client-{{projectName}}/ssh-staging/hostname
150
151
  SSH_USER: op://Client-{{projectName}}/ssh-staging/username
151
152
  SSH_REMOTE_PATH: op://Client-{{projectName}}/ssh-staging/remote-path
152
- SSH_PRIVATE_KEY: op://Client-{{projectName}}/staging-server-ssh-key/private_key?ssh-format=openssh
153
+ SSH_PRIVATE_KEY: op://Client-{{projectName}}/staging-ssh-key/private_key?ssh-format=openssh
153
154
  {{#if ci.ssh.useCloudflare}}
154
- # Cloudflare Access Service Token for SSH tunnel (staging)
155
- TUNNEL_SERVICE_TOKEN_ID: op://Hekivo-Internal/{{projectName}}-cf-access-gha-staging/client-id
156
- TUNNEL_SERVICE_TOKEN_SECRET: op://Hekivo-Internal/{{projectName}}-cf-access-gha-staging/client-secret
155
+ # Cloudflare Access Service Token for SSH tunnel (staging) — shared item in Hekivo-Internal
156
+ TUNNEL_SERVICE_TOKEN_ID: op://Hekivo-Internal/prod-cf-access-gha-deploy-staging/client-id
157
+ TUNNEL_SERVICE_TOKEN_SECRET: op://Hekivo-Internal/prod-cf-access-gha-deploy-staging/client-secret
157
158
  {{/if}}
158
159
  # .env composition (3 layers: template + salts + DB)
159
160
  ENV_TEMPLATE: op://Client-{{projectName}}/staging-env-file/notesPlain
@@ -163,60 +164,60 @@ jobs:
163
164
  WORDPRESS_DB_PASSWORD: op://Client-{{projectName}}/staging-wp-database/password
164
165
  WORDPRESS_DB_HOST: op://Client-{{projectName}}/staging-wp-database/hostname
165
166
  WORDPRESS_DB_PORT: op://Client-{{projectName}}/staging-wp-database/port
166
- # Cloudflare cache purge
167
- CLOUDFLARE_PURGE_ZONE_ID: op://Hekivo-Internal/{{projectName}}-cloudflare-api/zone id
168
- CLOUDFLARE_PURGE_TOKEN: op://Hekivo-Internal/{{projectName}}-cloudflare-api/credential
167
+ # Cloudflare cache purge — shared item in Hekivo-Internal
168
+ CLOUDFLARE_PURGE_ZONE_ID: op://Hekivo-Internal/prod-cloudflare-api/zone id
169
+ CLOUDFLARE_PURGE_TOKEN: op://Hekivo-Internal/prod-cloudflare-api/credential
169
170
 
170
171
  - name: Setup WordPress (production deps)
171
172
  uses: hekivo/gha-workflows/actions/setup-wordpress@v1
172
173
  with:
173
- php-version: ${{'{{'}} env.PHP_VERSION {{'}}'}}
174
+ php-version: $\{{ env.PHP_VERSION }}
174
175
  no-dev: "true"
175
176
  {{#if ci.build.sage}}
176
- working-dir: ${{'{{'}} env.THEME_PATH {{'}}'}}
177
+ working-dir: $\{{ env.THEME_PATH }}
177
178
  {{/if}}
178
179
  {{#if enable_acf_pro}}
179
- acf-username: ${{'{{'}} env.ACF_CONNECT_USERNAME {{'}}'}}
180
- acf-password: ${{'{{'}} env.ACF_CONNECT_PASSWORD {{'}}'}}
180
+ acf-username: $\{{ env.ACF_CONNECT_USERNAME }}
181
+ acf-password: $\{{ env.ACF_CONNECT_PASSWORD }}
181
182
  {{/if}}
182
183
 
183
184
  {{#if ci.build.sage}}
184
185
  - name: Setup Node.js + theme
185
186
  uses: hekivo/gha-workflows/actions/setup-node-theme@v1
186
187
  with:
187
- node-version: ${{'{{'}} env.NODE_VERSION {{'}}'}}
188
+ node-version: $\{{ env.NODE_VERSION }}
188
189
  install-root: "false"
189
- theme-path: ${{'{{'}} env.THEME_PATH {{'}}'}}
190
+ theme-path: $\{{ env.THEME_PATH }}
190
191
 
191
192
  - name: Build theme assets
192
- run: npm run build --prefix "${{'{{'}} env.THEME_PATH {{'}}'}}"
193
+ run: npm run build --prefix "$\{{ env.THEME_PATH }}"
193
194
 
194
195
  {{/if}}
195
196
  - name: Compose .env
196
197
  uses: hekivo/gha-workflows/actions/compose-dotenv@v1
197
198
  with:
198
- env-template: ${{'{{'}} env.ENV_TEMPLATE {{'}}'}}
199
- wp-salts: ${{'{{'}} env.WP_SALTS_BLOCK {{'}}'}}
200
- db-name: ${{'{{'}} env.WORDPRESS_DB_NAME {{'}}'}}
201
- db-user: ${{'{{'}} env.WORDPRESS_DB_USER {{'}}'}}
202
- db-password: ${{'{{'}} env.WORDPRESS_DB_PASSWORD {{'}}'}}
203
- db-host: ${{'{{'}} env.WORDPRESS_DB_HOST {{'}}'}}
204
- db-port: ${{'{{'}} env.WORDPRESS_DB_PORT {{'}}'}}
199
+ env-template: $\{{ env.ENV_TEMPLATE }}
200
+ wp-salts: $\{{ env.WP_SALTS_BLOCK }}
201
+ db-name: $\{{ env.WORDPRESS_DB_NAME }}
202
+ db-user: $\{{ env.WORDPRESS_DB_USER }}
203
+ db-password: $\{{ env.WORDPRESS_DB_PASSWORD }}
204
+ db-host: $\{{ env.WORDPRESS_DB_HOST }}
205
+ db-port: $\{{ env.WORDPRESS_DB_PORT }}
205
206
 
206
207
  {{#if ci.ssh.useCloudflare}}
207
208
  - name: Setup SSH via Cloudflare Tunnel
208
209
  uses: hekivo/gha-workflows/actions/setup-cloudflare-ssh@v1
209
210
  with:
210
- ssh-host: ${{'{{'}} env.SSH_HOST {{'}}'}}
211
- ssh-user: ${{'{{'}} env.SSH_USER {{'}}'}}
212
- ssh-private-key: ${{'{{'}} env.SSH_PRIVATE_KEY {{'}}'}}
213
- tunnel-token-id: ${{'{{'}} env.TUNNEL_SERVICE_TOKEN_ID {{'}}'}}
214
- tunnel-token-secret: ${{'{{'}} env.TUNNEL_SERVICE_TOKEN_SECRET {{'}}'}}
211
+ ssh-host: $\{{ env.SSH_HOST }}
212
+ ssh-user: $\{{ env.SSH_USER }}
213
+ ssh-private-key: $\{{ env.SSH_PRIVATE_KEY }}
214
+ tunnel-token-id: $\{{ env.TUNNEL_SERVICE_TOKEN_ID }}
215
+ tunnel-token-secret: $\{{ env.TUNNEL_SERVICE_TOKEN_SECRET }}
215
216
  {{else}}
216
217
  - name: Configure SSH agent
217
218
  uses: webfactory/ssh-agent@v0.9.0
218
219
  with:
219
- ssh-private-key: ${{'{{'}} env.SSH_PRIVATE_KEY {{'}}'}}
220
+ ssh-private-key: $\{{ env.SSH_PRIVATE_KEY }}
220
221
 
221
222
  - name: Add known hosts
222
223
  run: |
@@ -228,8 +229,8 @@ jobs:
228
229
  - name: Deploy via rsync
229
230
  uses: hekivo/gha-workflows/actions/deploy-rsync@v1
230
231
  with:
231
- ssh-target: ${{'{{'}} env.SSH_HOST {{'}}'}}
232
- remote-root: ${{'{{'}} env.SSH_REMOTE_PATH {{'}}'}}
232
+ ssh-target: $\{{ env.SSH_HOST }}
233
+ remote-root: $\{{ env.SSH_REMOTE_PATH }}
233
234
  {{#if ci.build.sage}}
234
235
  theme-slug: {{projectName}}
235
236
  {{/if}}
@@ -237,8 +238,8 @@ jobs:
237
238
  - name: WordPress post-deploy
238
239
  uses: hekivo/gha-workflows/actions/wp-post-deploy@v1
239
240
  with:
240
- ssh-target: ${{'{{'}} env.SSH_HOST {{'}}'}}
241
- remote-root: ${{'{{'}} env.SSH_REMOTE_PATH {{'}}'}}
241
+ ssh-target: $\{{ env.SSH_HOST }}
242
+ remote-root: $\{{ env.SSH_REMOTE_PATH }}
242
243
  {{#if enable_acf_pro}}
243
244
  plugin-slug: advanced-custom-fields-pro
244
245
  {{/if}}
@@ -249,8 +250,8 @@ jobs:
249
250
  - name: Purge Cloudflare cache
250
251
  uses: hekivo/gha-workflows/actions/cloudflare-purge@v1
251
252
  with:
252
- zone-id: ${{'{{'}} env.CLOUDFLARE_PURGE_ZONE_ID {{'}}'}}
253
- api-token: ${{'{{'}} env.CLOUDFLARE_PURGE_TOKEN {{'}}'}}
253
+ zone-id: $\{{ env.CLOUDFLARE_PURGE_ZONE_ID }}
254
+ api-token: $\{{ env.CLOUDFLARE_PURGE_TOKEN }}
254
255
 
255
256
  # ── Deploy Production ─────────────────────────────────────────────────────────
256
257
  deploy-production:
@@ -266,12 +267,11 @@ jobs:
266
267
  uses: actions/checkout@v4
267
268
 
268
269
  - name: Load secrets from 1Password
269
- uses: 1password/load-secrets-action@v2
270
+ uses: 1password/load-secrets-action@v4
270
271
  with:
271
272
  export-env: true
272
273
  env:
273
- OP_CONNECT_HOST: ${{'{{'}} vars.OP_CONNECT_HOST {{'}}'}}
274
- OP_CONNECT_TOKEN: ${{'{{'}} secrets.OP_CONNECT_TOKEN {{'}}'}}
274
+ OP_SERVICE_ACCOUNT_TOKEN: $\{{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
275
275
  {{#if enable_acf_pro}}
276
276
  ACF_CONNECT_USERNAME: op://Hekivo-Internal/{{projectName}}-acf-connect/username
277
277
  ACF_CONNECT_PASSWORD: op://Hekivo-Internal/{{projectName}}-acf-connect/password
@@ -294,43 +294,43 @@ jobs:
294
294
  - name: Setup WordPress (production deps)
295
295
  uses: hekivo/gha-workflows/actions/setup-wordpress@v1
296
296
  with:
297
- php-version: ${{'{{'}} env.PHP_VERSION {{'}}'}}
297
+ php-version: $\{{ env.PHP_VERSION }}
298
298
  no-dev: "true"
299
299
  {{#if ci.build.sage}}
300
- working-dir: ${{'{{'}} env.THEME_PATH {{'}}'}}
300
+ working-dir: $\{{ env.THEME_PATH }}
301
301
  {{/if}}
302
302
  {{#if enable_acf_pro}}
303
- acf-username: ${{'{{'}} env.ACF_CONNECT_USERNAME {{'}}'}}
304
- acf-password: ${{'{{'}} env.ACF_CONNECT_PASSWORD {{'}}'}}
303
+ acf-username: $\{{ env.ACF_CONNECT_USERNAME }}
304
+ acf-password: $\{{ env.ACF_CONNECT_PASSWORD }}
305
305
  {{/if}}
306
306
 
307
307
  {{#if ci.build.sage}}
308
308
  - name: Setup Node.js + theme
309
309
  uses: hekivo/gha-workflows/actions/setup-node-theme@v1
310
310
  with:
311
- node-version: ${{'{{'}} env.NODE_VERSION {{'}}'}}
311
+ node-version: $\{{ env.NODE_VERSION }}
312
312
  install-root: "false"
313
- theme-path: ${{'{{'}} env.THEME_PATH {{'}}'}}
313
+ theme-path: $\{{ env.THEME_PATH }}
314
314
 
315
315
  - name: Build theme assets
316
- run: npm run build --prefix "${{'{{'}} env.THEME_PATH {{'}}'}}"
316
+ run: npm run build --prefix "$\{{ env.THEME_PATH }}"
317
317
 
318
318
  {{/if}}
319
319
  - name: Compose .env
320
320
  uses: hekivo/gha-workflows/actions/compose-dotenv@v1
321
321
  with:
322
- env-template: ${{'{{'}} env.ENV_TEMPLATE {{'}}'}}
323
- wp-salts: ${{'{{'}} env.WP_SALTS_BLOCK {{'}}'}}
324
- db-name: ${{'{{'}} env.WORDPRESS_DB_NAME {{'}}'}}
325
- db-user: ${{'{{'}} env.WORDPRESS_DB_USER {{'}}'}}
326
- db-password: ${{'{{'}} env.WORDPRESS_DB_PASSWORD {{'}}'}}
327
- db-host: ${{'{{'}} env.WORDPRESS_DB_HOST {{'}}'}}
328
- db-port: ${{'{{'}} env.WORDPRESS_DB_PORT {{'}}'}}
322
+ env-template: $\{{ env.ENV_TEMPLATE }}
323
+ wp-salts: $\{{ env.WP_SALTS_BLOCK }}
324
+ db-name: $\{{ env.WORDPRESS_DB_NAME }}
325
+ db-user: $\{{ env.WORDPRESS_DB_USER }}
326
+ db-password: $\{{ env.WORDPRESS_DB_PASSWORD }}
327
+ db-host: $\{{ env.WORDPRESS_DB_HOST }}
328
+ db-port: $\{{ env.WORDPRESS_DB_PORT }}
329
329
 
330
330
  - name: Configure SSH agent
331
331
  uses: webfactory/ssh-agent@v0.9.0
332
332
  with:
333
- ssh-private-key: ${{'{{'}} env.SSH_PRIVATE_KEY {{'}}'}}
333
+ ssh-private-key: $\{{ env.SSH_PRIVATE_KEY }}
334
334
 
335
335
  - name: Add known hosts
336
336
  run: |
@@ -342,9 +342,9 @@ jobs:
342
342
  - name: Deploy via rsync
343
343
  uses: hekivo/gha-workflows/actions/deploy-rsync@v1
344
344
  with:
345
- ssh-target: ${{'{{'}} env.SSH_USER {{'}}'}}@${{'{{'}} env.SSH_HOST {{'}}'}}
346
- ssh-cmd: ssh -p ${{'{{'}} env.SSH_PORT || '22' {{'}}'}}
347
- remote-root: ${{'{{'}} env.SSH_REMOTE_PATH {{'}}'}}
345
+ ssh-target: $\{{ env.SSH_USER }}@$\{{ env.SSH_HOST }}
346
+ ssh-cmd: ssh -p $\{{ env.SSH_PORT || '22' }}
347
+ remote-root: $\{{ env.SSH_REMOTE_PATH }}
348
348
  {{#if ci.build.sage}}
349
349
  theme-slug: {{projectName}}
350
350
  {{/if}}
@@ -352,9 +352,9 @@ jobs:
352
352
  - name: WordPress post-deploy
353
353
  uses: hekivo/gha-workflows/actions/wp-post-deploy@v1
354
354
  with:
355
- ssh-target: ${{'{{'}} env.SSH_USER {{'}}'}}@${{'{{'}} env.SSH_HOST {{'}}'}}
356
- ssh-cmd: ssh -p ${{'{{'}} env.SSH_PORT || '22' {{'}}'}}
357
- remote-root: ${{'{{'}} env.SSH_REMOTE_PATH {{'}}'}}
355
+ ssh-target: $\{{ env.SSH_USER }}@$\{{ env.SSH_HOST }}
356
+ ssh-cmd: ssh -p $\{{ env.SSH_PORT || '22' }}
357
+ remote-root: $\{{ env.SSH_REMOTE_PATH }}
358
358
  {{#if enable_acf_pro}}
359
359
  plugin-slug: advanced-custom-fields-pro
360
360
  {{/if}}
@@ -365,6 +365,6 @@ jobs:
365
365
  - name: Purge Cloudflare cache
366
366
  uses: hekivo/gha-workflows/actions/cloudflare-purge@v1
367
367
  with:
368
- zone-id: ${{'{{'}} env.CLOUDFLARE_PURGE_ZONE_ID {{'}}'}}
369
- api-token: ${{'{{'}} env.CLOUDFLARE_PURGE_TOKEN {{'}}'}}
368
+ zone-id: $\{{ env.CLOUDFLARE_PURGE_ZONE_ID }}
369
+ api-token: $\{{ env.CLOUDFLARE_PURGE_TOKEN }}
370
370
  {{/if}}
@@ -41,6 +41,30 @@ hours during incidents.
41
41
  - **TLS certificate management**: `{{ "{{TODO: ACM / Let's Encrypt / Cloudflare}}" }}`
42
42
  - **WAF**: `{{ "{{TODO}}" }}`
43
43
 
44
+ ## WordPress cron (production)
45
+
46
+ Default WP-Cron fires via an HTTP *loopback* to `/wp/wp-cron.php`. When the site sits
47
+ behind an edge authentication layer (e.g. **Cloudflare Access / Zero Trust**), that
48
+ loopback is redirected to the login page and **never executes** — so no scheduled event
49
+ runs (plugin caches, auto-updates, jobs), silently.
50
+
51
+ In production behind edge auth, provision **both** parts:
52
+
53
+ 1. A system cron (e.g. CloudPanel → Site → Cron Jobs) that runs WP-CLI directly, without
54
+ going through HTTP:
55
+
56
+ ```
57
+ */5 * * * * cd <htdocs> && wp cron event run --due-now --quiet
58
+ ```
59
+
60
+ 2. `WORDPRESS_DISABLE_WP_CRON=true` in the production `.env`, to stop the dead loopback.
61
+ `wp-config.php` maps each `WORDPRESS_*` var to the constant of the same name without the
62
+ prefix, so this defines `DISABLE_WP_CRON`. It must be `WORDPRESS_DISABLE_WP_CRON` — not
63
+ `WORDPRESS_DISABLE_CRON`, which would define `DISABLE_CRON` and be ignored by WordPress.
64
+
65
+ Do not enable this in the local `.env`: under Lando the loopback works and is convenient.
66
+ See [Troubleshooting](./Troubleshooting.md) for the symptom and diagnosis.
67
+
44
68
  ## Secrets and IAM
45
69
 
46
70
  - **Secrets store**: `{{ "{{TODO: cloud secret manager / Vault / env vars}}" }}`
@@ -62,4 +62,21 @@ Each entry follows the same shape:
62
62
 
63
63
  ---
64
64
 
65
+ ### Scheduled tasks never run / a plugin screen stays empty (behind edge auth)
66
+
67
+ **Symptom**: A plugin admin screen that loads data via a background refresh never populates (e.g. an items list spins or returns empty forever). More generally: any `wp_schedule_event` / WP-Cron job silently never fires in production, while the same code works under Lando.
68
+ **Likely cause**: The site is behind **Cloudflare Access** (or any edge auth fronting the whole domain). Default WP-Cron fires via a loopback HTTP request to `/wp/wp-cron.php`, which the edge `302`-redirects to its login — so `wp-cron.php` never executes and no scheduled event runs. The browser's `admin-ajax` still works (it carries the auth cookie), so the page loads but the background job never completes.
69
+ **Fix**:
70
+
71
+ 1. Add a system cron (CloudPanel → Site → Cron Jobs) running WP-CLI directly (bypasses HTTP/edge auth):
72
+ ```
73
+ */5 * * * * cd <htdocs> && wp cron event run --due-now --quiet
74
+ ```
75
+ 2. Stop the futile loopback: set `WORDPRESS_DISABLE_WP_CRON=true` in the production `.env`.
76
+ 3. One-time unblock / confirm: `wp cron event run --due-now` over SSH — pending jobs run immediately.
77
+
78
+ **Why this is the fix**: `wp cron event run` executes events in the local PHP process, never touching the public HTTP surface, so edge auth can't block it. `DISABLE_WP_CRON` only silences the dead loopback — the system cron is what runs the jobs. Confirm with `curl -I https://<domain>/wp/wp-cron.php` → `302` to the edge auth login.
79
+
80
+ ---
81
+
65
82
  `{{ "{{TODO: add project-specific entries as they come up. The list below is intentionally short — generic entries that apply to every wp-kit project.}}" }}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codigodoleo/wp-kit",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Kit opinativo para padronizar projetos WordPress com CI/CD dinâmico.",
5
5
  "keywords": [
6
6
  "codigodoleo",
@@ -48,3 +48,8 @@ WORDPRESS_AUTH_SALT={{{salts.AUTH_SALT}}}
48
48
  WORDPRESS_SECURE_AUTH_SALT={{{salts.SECURE_AUTH_SALT}}}
49
49
  WORDPRESS_LOGGED_IN_SALT={{{salts.LOGGED_IN_SALT}}}
50
50
  WORDPRESS_NONCE_SALT={{{salts.NONCE_SALT}}}
51
+
52
+ # Observability (hekivo-audit-log, fatia #5) — preencher via deploy (op://) ou
53
+ # scripts/push-obs-creds-to-site.sh do hekivo-mgmt:
54
+ # HEKIVO_AUDIT_CW_ACCESS_KEY_ID="op://Client-<Nome>/cloudwatch-observability-push/username"
55
+ # HEKIVO_AUDIT_CW_SECRET_ACCESS_KEY="op://Client-<Nome>/cloudwatch-observability-push/password"