diff --git a/actions/fetch-cdn-scenario/.gitignore b/actions/fetch-cdn-scenario/.gitignore new file mode 100644 index 000000000..536a53d54 --- /dev/null +++ b/actions/fetch-cdn-scenario/.gitignore @@ -0,0 +1,2 @@ +# Temporary files created during fetch +*.tmp-* diff --git a/actions/fetch-cdn-scenario/README.md b/actions/fetch-cdn-scenario/README.md new file mode 100644 index 000000000..0e004b5e3 --- /dev/null +++ b/actions/fetch-cdn-scenario/README.md @@ -0,0 +1,130 @@ +# Fetch CDN Scenario + +Shared GitHub Actions composite action that provides CDN campaign promotion test infrastructure for both Elementor Core and Elementor Pro. + +## Overview + +The action provides: + +1. **Fetch script** (`fetch-cdn-scenario.mjs`) - Downloads the current CDN JSON files into a `live` scenario, with retries, a request timeout and optional failure tolerance +2. **Mock mu-plugin** (`mock-editor-assets-cdn.php`) - Answers WordPress requests to `assets.elementor.com` from local fixtures instead of the live CDN +3. **Shared fixtures** - The `no-promotion` scenario (the default, current CDN content) and the `active-campaign` scenario (a campaign with `e2e-` texts and links that differ from every Core default) + +## Mocked CDN files + +| CDN path | Used by | +| ----------------------------------------------- | ------------------------------------------------------------ | +| `editor-promotions/v1/*.json` | Plugins page, admin menu, conversion banner, pointer, editor | +| `notifications/v1/notifications.json` | What's New | +| `home-screen/v1/home-screen.json` | Home screen, including the sidebar banner for each tier | +| `packages/v1/promotions.json` | V4 (atomic) promotions, `elementor.config.v4Promotions` | +| `free-to-pro-upsell/v1/free-to-pro-upsell.json` | Widget upsell images, `elementorPromotionsData` | + +A CDN file without a fixture is not mocked and reaches the live CDN, so a new CDN file needs a fixture here, a path in `CDN_PATHS` and its cache option in `ELEMENTOR_E2E_CDN_CACHE_OPTIONS`. + +The `active-campaign` scenario gives every case a value that the live CDN and the defaults do not have, so a test that finds it proves the mock answered: + +- What's New: a Free-only card, a Pro-only card and a card for everyone +- Home screen sidebar: a different `e2e-campaign-home-sidebar-*` link and `e2e-campaign-*.svg` image URL for the `free`, `essential`, `essential-oct2023` and `expired` tiers + +The fixtures hold JSON only. The browser loads images from the CDN itself, not through the mock, and the `e2e-campaign-*.svg` images do not exist there: the tests check the image URL, not the picture. + +## Features + +- **Retries**: Up to 3 attempts per file, waiting 2s and then 4s +- **Timeout**: 15s per request +- **Graceful failure**: `allow-failure` lets WordPress start even if the CDN is down. The previous `live` scenario is kept. +- **Atomic updates**: Files are fetched into a staging directory, which replaces `live` only when every file succeeded +- **Flexible source**: The live CDN (`assets.elementor.com`), staging CDN (`assets.stg.elementor.red`), or a local directory + +## Inputs + +| Input | Description | Required | Default | +| ---------------- | -------------------------------------------------------------------------------------------- | -------- | ------------------------------ | +| `output-dir` | Directory of the `live` scenario. The shared scenarios are copied next to it. | **Yes** | - | +| `fetch-live` | Fetch the live CDN into `output-dir`. Set to `false` on PR CI to stay offline. | No | `true` | +| `cdn-source` | CDN source URL or local directory, empty means the production CDN | No | `https://assets.elementor.com` | +| `allow-failure` | Allow WordPress to start if the fetch fails | No | `false` | +| `mu-plugins-dir` | Directory to copy the mock mu-plugin into | No | `''` | +| `copy-fixtures` | Copy the shared `no-promotion` and `active-campaign` scenarios to the parent of `output-dir` | No | `true` | + +## Usage + +PR CI runs offline against the shared fixtures. A scheduled job fetches the live CDN and runs the promotion tests against it with `E2E_CDN_SCENARIO=live`, so a broken live campaign is reported within a day. + +### PR CI + +```yaml +- name: Setup CDN promotion fixtures + uses: elementor/elementor-editor-github-actions/actions/fetch-cdn-scenario@main + with: + output-dir: tests/playwright/mu-plugins/editor-assets-cdn/live + mu-plugins-dir: tests/playwright/mu-plugins + fetch-live: false +``` + +### Nightly live CDN check + +```yaml +- name: Fetch live CDN scenario + uses: elementor/elementor-editor-github-actions/actions/fetch-cdn-scenario@main + with: + output-dir: tests/playwright/mu-plugins/editor-assets-cdn/live + mu-plugins-dir: tests/playwright/mu-plugins + +- name: Run promotion tests against the live CDN + env: + E2E_CDN_SCENARIO: live + run: npx playwright test --grep "live @promotions" +``` + +`allow-failure` stays `false` here on purpose: a CDN that cannot be fetched fails the job. + +## Advanced Usage + +### Testing a campaign before it goes live + +**Core example**: + +```yaml +- name: Fetch CDN from local editor-assets build + uses: elementor/elementor-editor-github-actions/actions/fetch-cdn-scenario@main + with: + cdn-source: ../editor-assets/out + output-dir: tests/playwright/mu-plugins/editor-assets-cdn/live + mu-plugins-dir: tests/playwright/mu-plugins +``` + +**Staging example**: every editor-assets pull request to `master` is deployed to `https://assets.stg.elementor.red`. + +```yaml +- name: Fetch CDN from staging + uses: elementor/elementor-editor-github-actions/actions/fetch-cdn-scenario@main + with: + cdn-source: https://assets.stg.elementor.red + output-dir: tests/playwright/mu-plugins/editor-assets-cdn/live + mu-plugins-dir: tests/playwright/mu-plugins +``` + +### Skip copying fixtures (if you have custom ones) + +```yaml +- uses: elementor/elementor-editor-github-actions/actions/fetch-cdn-scenario@main + with: + output-dir: tests/playwright/mu-plugins/editor-assets-cdn/live + mu-plugins-dir: tests/playwright/mu-plugins + copy-fixtures: false +``` + +## How It Works + +1. **Fetch**: Downloads the mocked CDN files from the source into a staging directory +2. **Atomic swap**: The staging directory replaces `output-dir` only when every file succeeded +3. **Missing files**: A file that the source does not have is skipped with a warning, and the default scenario answers for it. A source without any of the files fails the fetch. +4. **Mock plugin**: The mu-plugin answers `assets.elementor.com` requests from the fixtures of the selected scenario, or of the default scenario +5. **Scenarios**: Tests select a scenario with the `e2e_cdn_scenario` cookie. A non-default scenario skips the CDN cache options, so its data never reaches requests of the default scenario. + +## Used by + +- Elementor Core: the `Playwright` workflow, nightly `live @promotions` at 04:30 UTC +- Elementor Pro: the `Playwright CDN Promotions` workflow, nightly at 04:30 UTC diff --git a/actions/fetch-cdn-scenario/action.yml b/actions/fetch-cdn-scenario/action.yml new file mode 100644 index 000000000..8d276b994 --- /dev/null +++ b/actions/fetch-cdn-scenario/action.yml @@ -0,0 +1,77 @@ +name: Fetch CDN Scenario +description: Fetch live editor-assets CDN data and set up mock CDN infrastructure for Playwright tests + +inputs: + cdn-source: + description: 'CDN source URL or local directory to fetch from, e.g. https://assets.stg.elementor.red. Empty means https://assets.elementor.com.' + required: false + default: 'https://assets.elementor.com' + allow-failure: + description: 'Allow WordPress to start even if CDN fetch fails (default: false)' + required: false + default: 'false' + output-dir: + description: 'Target directory for fetched CDN files (required)' + required: true + mu-plugins-dir: + description: 'Target directory for the mock CDN mu-plugin (optional, if you want to copy the mu-plugin)' + required: false + default: '' + copy-fixtures: + description: 'Copy the shared no-promotion and active-campaign scenarios to the parent of output-dir (default: true)' + required: false + default: 'true' + fetch-live: + description: 'Fetch live CDN data into output-dir (default: true). Set to false on PR CI to stay offline.' + required: false + default: 'true' + +runs: + using: composite + steps: + - name: Fetch CDN scenario + if: inputs.fetch-live == 'true' + shell: bash + env: + ACTION_PATH: ${{ github.action_path }} + CDN_SOURCE: ${{ inputs.cdn-source }} + ALLOW_FAILURE: ${{ inputs.allow-failure }} + OUTPUT_DIR: ${{ inputs.output-dir }} + run: | + ARGS=( --output="$OUTPUT_DIR" ) + + if [ -n "$CDN_SOURCE" ]; then + ARGS+=( --from="$CDN_SOURCE" ) + fi + + if [ "$ALLOW_FAILURE" = "true" ]; then + ARGS+=( --allow-failure ) + fi + + node "$ACTION_PATH/fetch-cdn-scenario.mjs" "${ARGS[@]}" + + - name: Copy mock CDN mu-plugin + if: inputs.mu-plugins-dir != '' + shell: bash + env: + ACTION_PATH: ${{ github.action_path }} + MU_PLUGINS_DIR: ${{ inputs.mu-plugins-dir }} + run: | + mkdir -p "$MU_PLUGINS_DIR" + cp "$ACTION_PATH/mock-editor-assets-cdn.php" "$MU_PLUGINS_DIR/" + echo "Copied mock-editor-assets-cdn.php to $MU_PLUGINS_DIR" + + - name: Copy shared fixtures + if: inputs.copy-fixtures == 'true' + shell: bash + env: + ACTION_PATH: ${{ github.action_path }} + OUTPUT_DIR: ${{ inputs.output-dir }} + run: | + FIXTURES_BASE=$(dirname "$OUTPUT_DIR") + for scenario in no-promotion active-campaign; do + rm -rf "$FIXTURES_BASE/$scenario" + mkdir -p "$FIXTURES_BASE/$scenario" + cp -r "$ACTION_PATH/fixtures/$scenario/"* "$FIXTURES_BASE/$scenario/" + echo "Copied shared $scenario fixtures to $FIXTURES_BASE/$scenario" + done diff --git a/actions/fetch-cdn-scenario/fetch-cdn-scenario.mjs b/actions/fetch-cdn-scenario/fetch-cdn-scenario.mjs new file mode 100644 index 000000000..33fe4f595 --- /dev/null +++ b/actions/fetch-cdn-scenario/fetch-cdn-scenario.mjs @@ -0,0 +1,218 @@ +import { existsSync } from 'node:fs'; +import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises'; +import { dirname, resolve } from 'node:path'; +import { setTimeout as sleep } from 'node:timers/promises'; +import { parseArgs } from 'node:util'; + +const CDN_ORIGIN = 'https://assets.elementor.com'; +const ALLOWED_CDN_ORIGINS = new Set([ + CDN_ORIGIN, + 'https://assets.stg.elementor.red', +]); +const HTTP_NOT_FOUND = 404; +const HTTP_TOO_MANY_REQUESTS = 429; +const HTTP_SERVER_ERROR_MIN = 500; +const MAX_ATTEMPTS = 3; +const RETRY_DELAY_MS = 2000; +const REQUEST_TIMEOUT_MS = 15000; + +const CDN_PATHS = [ + 'editor-promotions/v1/connect-page.json', + 'editor-promotions/v1/conversion-banner.json', + 'editor-promotions/v1/plugins-page.json', + 'editor-promotions/v1/pointer.json', + 'editor-promotions/v1/pro-setup-panel.json', + 'editor-promotions/v1/side-menu.json', + 'editor-promotions/v1/sticky-panel.json', + 'editor-promotions/v1/theme-builder.json', + 'notifications/v1/notifications.json', + 'home-screen/v1/home-screen.json', + 'packages/v1/promotions.json', + 'free-to-pro-upsell/v1/free-to-pro-upsell.json', +]; + +const { + values: { from, 'allow-failure': allowFailure = false, output: outputDir }, +} = parseArgs({ + options: { + from: { type: 'string' }, + 'allow-failure': { type: 'boolean' }, + output: { type: 'string' }, + }, +}); + +if (!outputDir) { + console.error( + 'Error: --output is required. Specify the target directory for CDN files.', + ); + process.exitCode = 1; + throw new Error('Missing required --output argument'); +} + +// Callers pass an empty source when they have none, so it means the production CDN. +const source = from || CDN_ORIGIN; +const LIVE_SCENARIO_DIR = resolve(outputDir); +const STAGING_DIR = `${LIVE_SCENARIO_DIR}.tmp-${String(process.pid)}`; +const isUrl = /^https?:\/\//i.test(source); + +/** + * @param {string} rawUrl + * @returns {string} + */ +const resolveAllowedUrlBase = (rawUrl) => { + const parsed = new URL(rawUrl); + + if ( + 'https:' !== parsed.protocol || + !ALLOWED_CDN_ORIGINS.has(parsed.origin) + ) { + throw new Error( + `Unsupported CDN URL origin "${parsed.origin}". Allowed origins: ${[...ALLOWED_CDN_ORIGINS].join(', ')}`, + ); + } + + if (parsed.username || parsed.password || parsed.search || parsed.hash) { + throw new Error( + `CDN URL must not include credentials, query, or hash: ${rawUrl}`, + ); + } + + const normalizedPath = parsed.pathname.replace(/\/+$/, ''); + return `${parsed.origin}${normalizedPath}`; +}; + +const urlBase = isUrl ? resolveAllowedUrlBase(source) : ''; + +class NonRetryableHttpError extends Error {} + +/** @param {unknown} error */ +const getErrorMessage = (error) => + error instanceof Error ? error.message : String(error); + +/** + * @param {string} path + * @returns {Promise} + */ +const fetchOnce = async (path) => { + const response = await fetch(`${urlBase}/${path}`, { + cache: 'no-store', + signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS), + }); + + if (HTTP_NOT_FOUND === response.status) { + return undefined; + } + + if (!response.ok) { + const message = `${urlBase} answered ${String(response.status)} for ${path}`; + const isRetryable = + HTTP_TOO_MANY_REQUESTS === response.status || + response.status >= HTTP_SERVER_ERROR_MIN; + + throw isRetryable + ? new Error(message) + : new NonRetryableHttpError(message); + } + + const data = /** @type {unknown} */ (await response.json()); + return data; +}; + +/** + * @param {string} path + * @returns {Promise} + */ +const readFromUrl = async (path) => { + for (let attempt = 1; ; attempt++) { + try { + return await fetchOnce(path); + } catch (error) { + if ( + error instanceof NonRetryableHttpError || + attempt >= MAX_ATTEMPTS + ) { + throw error; + } + + console.warn( + `Attempt ${String(attempt)} of ${String(MAX_ATTEMPTS)} failed for ${path}: ${getErrorMessage(error)}`, + ); + await sleep(RETRY_DELAY_MS * attempt); + } + } +}; + +/** + * @param {string} path + * @returns {Promise} + */ +const readFromDir = async (path) => { + const file = resolve(source, path); + + if (!existsSync(file)) { + return undefined; + } + + const data = /** @type {unknown} */ ( + JSON.parse(await readFile(file, 'utf8')) + ); + return data; +}; + +/** + * @param {string} path + * @returns {Promise} Whether the source has the file. + */ +const copyCdnFile = async (path) => { + const json = await (isUrl ? readFromUrl(path) : readFromDir(path)); + + if (undefined === json) { + console.warn( + `Missing in ${source}, the default scenario answers instead: ${path}`, + ); + return false; + } + + const target = resolve(STAGING_DIR, path); + + await mkdir(dirname(target), { recursive: true }); + await writeFile(target, JSON.stringify(json, null, '\t') + '\n'); + console.log(`Saved ${path}`); + return true; +}; + +try { + await rm(STAGING_DIR, { recursive: true, force: true }); + await mkdir(STAGING_DIR, { recursive: true }); + // Every write settles before the staging directory may be removed below. + const results = await Promise.allSettled(CDN_PATHS.map(copyCdnFile)); + + for (const result of results) { + if ('rejected' === result.status) { + throw result.reason; + } + } + + // A source without any of the files is a wrong source, not a CDN that dropped a file. + if (!results.some((result) => result.value)) { + throw new Error( + `none of the ${String(CDN_PATHS.length)} CDN files exist there, check the source`, + ); + } + + await rm(LIVE_SCENARIO_DIR, { recursive: true, force: true }); + await rename(STAGING_DIR, LIVE_SCENARIO_DIR); +} catch (error) { + await rm(STAGING_DIR, { recursive: true, force: true }); + + const kept = existsSync(LIVE_SCENARIO_DIR) + ? 'The previous live scenario is kept.' + : 'There is no live scenario, so the live CDN promotion tests will fail.'; + console.error( + `Could not fetch the CDN scenario from ${source}: ${getErrorMessage(error)}. ${kept}`, + ); + + if (!allowFailure) { + process.exitCode = 1; + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/conversion-banner.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/conversion-banner.json new file mode 100644 index 000000000..3f878eef7 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/conversion-banner.json @@ -0,0 +1,9 @@ +{ + "conversion-banner": { + "is_active": true, + "title": "E2E campaign conversion banner title", + "text": "E2E campaign conversion banner text", + "cta_text": "E2E campaign conversion banner button", + "cta_url": "https://go.elementor.com/e2e-campaign-conversion-banner/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/plugins-page.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/plugins-page.json new file mode 100644 index 000000000..d1a960b39 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/plugins-page.json @@ -0,0 +1,7 @@ +{ + "plugins-page": { + "is_active": true, + "label": "E2E campaign plugins page label", + "url": "https://go.elementor.com/e2e-campaign-plugins-page/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/pointer.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/pointer.json new file mode 100644 index 000000000..dec4bd862 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/pointer.json @@ -0,0 +1,10 @@ +{ + "pointer": { + "is_active": true, + "campaign_id": "e2e-campaign", + "title": "E2E campaign pointer title", + "text": "E2E campaign pointer text", + "cta_text": "E2E campaign pointer button", + "cta_url": "https://go.elementor.com/e2e-campaign-pointer/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/side-menu.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/side-menu.json new file mode 100644 index 000000000..179b1bc1f --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/side-menu.json @@ -0,0 +1,7 @@ +{ + "side-menu": { + "is_active": true, + "label": "E2E campaign side menu label", + "url": "https://go.elementor.com/e2e-campaign-side-menu/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/sticky-panel.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/sticky-panel.json new file mode 100644 index 000000000..aebbdb285 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/sticky-panel.json @@ -0,0 +1,8 @@ +{ + "sticky-panel": { + "is_active": true, + "message": "E2E campaign sticky panel message", + "button_text": "E2E campaign sticky panel button", + "url": "https://go.elementor.com/e2e-campaign-sticky-panel/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/theme-builder.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/theme-builder.json new file mode 100644 index 000000000..f740e61f2 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/editor-promotions/v1/theme-builder.json @@ -0,0 +1,7 @@ +{ + "theme-builder": { + "is_active": true, + "button_text": "E2E campaign theme builder button", + "url": "https://go.elementor.com/e2e-campaign-theme-builder/" + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/free-to-pro-upsell/v1/free-to-pro-upsell.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/free-to-pro-upsell/v1/free-to-pro-upsell.json new file mode 100644 index 000000000..a116f49d6 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/free-to-pro-upsell/v1/free-to-pro-upsell.json @@ -0,0 +1,29 @@ +{ + "lastUpdated": "2026-11-19T13:44:16.080Z", + "free-to-pro-upsell": [ + { + "id": "animated_headline", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/animated_headline.jpg?e2e-campaign" + }, + { + "id": "video_playlist", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/video_playlist.jpg" + }, + { + "id": "cta", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/cta.jpg" + }, + { + "id": "testimonial_widget", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/testimonial_widget.jpg" + }, + { + "id": "image_carousel", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/image_carousel.jpg" + }, + { + "id": "connect-pro-upgrade", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/connect-pro-upgrade.jpg" + } + ] +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/home-screen/v1/home-screen.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/home-screen/v1/home-screen.json new file mode 100644 index 000000000..5c213b4b0 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/home-screen/v1/home-screen.json @@ -0,0 +1,536 @@ +{ + "lastUpdated": "2026-11-17T12:57:56.662Z", + "home-screen": { + "top_with_licences": [ + { + "license": ["free"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Start building your website with Elementor's no code drag & drop editor.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=le72grP_Q6k&t=1s", + "youtube_embed_id": "le72grP_Q6k?si=g2akyWNODL6usu6u" + }, + { + "license": ["pro"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Now you've got all the tools to start creating professional, high-performing websites - and that journey begins by creating your first page.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=QdkDGrS8ZZs", + "youtube_embed_id": "QdkDGrS8ZZs?si=s_VjZCQR6Fh1jgB5" + }, + { + "license": ["one"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Now you've got all the tools to start creating professional, high-performing websites - and that journey begins by creating your first page.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=QdkDGrS8ZZs", + "youtube_embed_id": "QdkDGrS8ZZs?si=s_VjZCQR6Fh1jgB5" + } + ], + "get_started": [ + { + "license": ["free"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&page=popup_templates", + "is_relative_url": true, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg", + "title_small_color": "text.tertiary" + } + ] + }, + { + "license": ["pro"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&tabs_group=popup&elementor_library_type=popup", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg" + } + ] + }, + { + "license": ["one"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&tabs_group=popup&elementor_library_type=popup", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg" + } + ] + } + ], + "add_ons": { + "hide_section": ["free", "essential", "pro", "one"], + "header": { + "title": "Expand your design toolkit", + "description": "These plugins, add-ons, and tools, have been selected to streamline your workflow and maximize your creativity." + }, + "repeater": [ + { + "file_path": "pojo-accessibility/pojo-accessibility.php", + "title": "Ally - Web Accessibility. Simplified.", + "url": "", + "description": "Make your website more accessible with powerful tools to detect and fix issues, enhance usability, and create a better experience for all visitors.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/ally_logo.svg", + "type": "wporg" + }, + { + "file_path": "site-mailer/site-mailer.php", + "title": "Site Mailer", + "url": "", + "description": "Keep your WordPress emails out of the spam folder with improved deliverability and an easy setup—no need for an SMTP plugin or complicated configurations.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/site-mailer.svg", + "type": "wporg" + }, + { + "file_path": "image-optimization/image-optimization.php", + "title": "Image Optimizer", + "url": "https://go.elementor.com/wp-dash-apps-author-uri-elementor-io/", + "description": "Check out this incredibly useful plugin that will compress and optimize your images, giving you leaner, faster websites.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/image-optimizer.svg", + "type": "wporg" + }, + { + "title": "Elementor AI", + "url": "https://go.elementor.com/wp-dash-apps-author-uri-elementor-ai/", + "description": "Boost creativity with Elementor AI. Craft & enhance copy, create custom CSS & Code, and generate images to elevate your website.", + "button_label": "Let's go", + "image": "https://assets.elementor.com/home-screen/v1/images/elementor.svg", + "type": "link", + "condition": { + "key": "introduction_meta", + "value": "ai_get_started" + } + } + ], + "footer": { + "label": "Explore more add-ons", + "file_path": "wp-admin/admin.php?page=elementor-apps" + } + }, + "sidebar_promotion_variants": [ + { + "license": ["essential"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/e2e-campaign-essential.svg", + "link": "https://go.elementor.com/e2e-campaign-home-sidebar-essential/" + } + }, + { + "license": ["essential-oct2023"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/e2e-campaign-essential-oct2023.svg", + "link": "https://go.elementor.com/e2e-campaign-home-sidebar-essential-oct2023/" + } + }, + { + "license": ["free"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/e2e-campaign-free.svg", + "link": "https://go.elementor.com/e2e-campaign-home-sidebar/" + } + }, + { + "license": ["expired"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/e2e-campaign-expired.svg", + "link": "https://go.elementor.com/e2e-campaign-home-sidebar-expired/" + } + }, + { + "license": ["free"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + }, + { + "license": ["pro"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + }, + { + "license": ["one"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + } + ], + "external_links": [ + { + "label": "Help Center", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-question-mark.svg", + "url": "https://elementor.com/help/" + }, + { + "label": "Youtube", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-youtube.svg", + "url": "https://www.youtube.com/@Elementor" + }, + { + "label": "Facebook Community", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-community.svg", + "url": "https://www.facebook.com/groups/Elementors" + }, + { + "label": "Blog", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-academic-hat.svg", + "url": "https://elementor.com/blog/" + } + ], + "site_builder": { + "0": { + "hasInput": true, + "title": "From idea to website in minutes", + "placeholder": "What site do you want to build?", + "buttonLabel": "Create my site" + }, + "1": { + "hasInput": false, + "title": "From idea to website in minutes", + "text": "Review your brief and generate your website", + "buttonLabel": "Create site" + }, + "2": { + "hasInput": false, + "title": "Let's turn your sitemap into a design", + "text": "Your sitemap is waiting for you to continue.", + "buttonLabel": "Visit sitemap" + }, + "3": { + "hasInput": false, + "title": "Your site design is waiting", + "text": "Jump back in to review, edit, and add to Elementor.", + "buttonLabel": "Review design" + }, + "4": { + "hasInput": false, + "title": "Your site design is ready to go live", + "text": "Review and publish your site to continue editing in Elementor.", + "buttonLabel": "Review & publish" + }, + "5": { + "hasInput": true, + "title": "Expand your site with Elementor AI", + "placeholder": "Which page do you want to create?", + "buttonLabel": "Create page" + }, + "6": { + "hasInput": true, + "title": "Expand your site with Elementor AI", + "placeholder": "Which page do you want to create?", + "buttonLabel": "Create page" + } + } + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/notifications/v1/notifications.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/notifications/v1/notifications.json new file mode 100644 index 000000000..8f87bd8e4 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/notifications/v1/notifications.json @@ -0,0 +1,48 @@ +{ + "notifications": [ + { + "id": "e2e-campaign-free", + "title": "E2E campaign notification title", + "description": "E2E campaign notification description", + "topic": "Campaign", + "cta": "E2E campaign notification button", + "ctaLink": "https://go.elementor.com/e2e-campaign-notification/", + "featured": true, + "conditions": [ + [ + { + "type": "plugin", + "operator": "!=", + "plugin": "elementor-pro/elementor-pro.php" + } + ] + ] + }, + { + "id": "e2e-campaign-pro", + "title": "E2E campaign Pro notification title", + "description": "E2E campaign Pro notification description", + "topic": "Campaign", + "cta": "E2E campaign Pro notification button", + "ctaLink": "https://go.elementor.com/e2e-campaign-notification-pro/", + "featured": true, + "conditions": [ + [ + { + "type": "plugin", + "operator": "==", + "plugin": "elementor-pro/elementor-pro.php" + } + ] + ] + }, + { + "id": "e2e-campaign-all", + "title": "E2E campaign notification for everyone", + "description": "E2E campaign notification for everyone description", + "topic": "Campaign", + "cta": "E2E campaign notification for everyone button", + "ctaLink": "https://go.elementor.com/e2e-campaign-notification-all/" + } + ] +} diff --git a/actions/fetch-cdn-scenario/fixtures/active-campaign/packages/v1/promotions.json b/actions/fetch-cdn-scenario/fixtures/active-campaign/packages/v1/promotions.json new file mode 100644 index 000000000..21cea3ef6 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/active-campaign/packages/v1/promotions.json @@ -0,0 +1,75 @@ +{ + "lastUpdated": "2026-11-19T13:44:16.241Z", + "promotions": [ + { + "customCss": { + "title": "Custom CSS", + "content": "Add custom CSS to refine and enrich the appearance of any element on your site.", + "ctaUrl": "https://go.elementor.com/go-pro-style-custom-css/", + "image": "https://assets.elementor.com/packages/v1/images/custom_css_promotion.png" + }, + "displayConditions": { + "title": "Display conditions", + "content": "Control when and where elements are shown across your site.", + "ctaUrl": "https://go.elementor.com/go-pro-display-conditions-modal/", + "image": "https://assets.elementor.com/packages/v1/images/display_conditions_promotion.png" + }, + "attributes": { + "title": "E2E campaign attributes title", + "content": "E2E campaign attributes content", + "ctaUrl": "https://go.elementor.com/e2e-campaign-attributes/", + "image": "https://assets.elementor.com/packages/v1/images/attributes_promotion.png?e2e-campaign" + }, + "Portfolio": { + "title": "Portfolio", + "content": "Upgrade to build dynamic portfolio grids featuring interactive category filtering and engaging hover effects designed to captivate your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Portfolio_promotion.png" + }, + "Form": { + "title": "Form", + "content": "Upgrade to build advanced forms featuring custom fields, multi-step layouts, automated email notifications, and direct CRM integrations.", + "image": "https://assets.elementor.com/packages/v1/images/Form_promotion.png" + }, + "PriceList": { + "title": "Price list", + "content": "Upgrade to present items, descriptions, and pricing within a cohesive structure that aligned perfectly with your site.", + "image": "https://assets.elementor.com/packages/v1/images/Price_list_promotion.png" + }, + "PriceTable": { + "title": "Price table", + "content": "Upgrade to build pricing matrices featuring highlighted columns, interactive check mark lists, and integrated action buttons.", + "image": "https://assets.elementor.com/packages/v1/images/Price_table_promotion.png" + }, + "LoopGrid": { + "title": "Loop Grid", + "content": "Upgrade to connect custom layouts directly to your site database, seamlessly rendering dynamic content queries that engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Loop_grid_promotion.png" + }, + "CallToAction": { + "title": "Call to Action", + "content": "Upgrade to build Call to Action blocks with image overlays, custom hover animations, and promotional layout control across your site.", + "image": "https://assets.elementor.com/packages/v1/images/CTA_promotion.png" + }, + "Template": { + "title": "Template", + "content": "Upgrade to embed saved templates that sync automatically across your entire site, preserving layout integrity and accelerating your production speed.", + "image": "https://assets.elementor.com/packages/v1/images/Template_promotion.png" + }, + "Gallery": { + "title": "Gallery pro", + "content": "Upgrade to build gallery with dynamic categorization and custom layout control across your site.", + "image": "https://assets.elementor.com/packages/v1/images/Gallery_pro_promotion.png" + }, + "MediaCarousel": { + "title": "Media carousel", + "content": "Upgrade to build advanced Media Carousel with dynamic video elements into your sliders to better engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Media_carousel_promotion.png" + }, + "LoopCarousel": { + "title": "Loop carousel", + "content": "Upgrade to build advanced Loop Carousel with dynamic posts, custom layouts seamlessly to better engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Loop_carousel_promotion.png" + } + } + ] +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/connect-page.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/connect-page.json new file mode 100644 index 000000000..7db944d88 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/connect-page.json @@ -0,0 +1,5 @@ +{ + "connect-page": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/conversion-banner.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/conversion-banner.json new file mode 100644 index 000000000..6bc6d39ab --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/conversion-banner.json @@ -0,0 +1,5 @@ +{ + "conversion-banner": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/plugins-page.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/plugins-page.json new file mode 100644 index 000000000..3f1e4f3e5 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/plugins-page.json @@ -0,0 +1,5 @@ +{ + "plugins-page": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pointer.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pointer.json new file mode 100644 index 000000000..4b51615d5 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pointer.json @@ -0,0 +1,5 @@ +{ + "pointer": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pro-setup-panel.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pro-setup-panel.json new file mode 100644 index 000000000..ae74b5248 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/pro-setup-panel.json @@ -0,0 +1,5 @@ +{ + "pro-setup-panel": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/side-menu.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/side-menu.json new file mode 100644 index 000000000..94fd45f0f --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/side-menu.json @@ -0,0 +1,5 @@ +{ + "side-menu": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/sticky-panel.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/sticky-panel.json new file mode 100644 index 000000000..562804d0b --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/sticky-panel.json @@ -0,0 +1,5 @@ +{ + "sticky-panel": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/theme-builder.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/theme-builder.json new file mode 100644 index 000000000..fe6fcb5d3 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/editor-promotions/v1/theme-builder.json @@ -0,0 +1,5 @@ +{ + "theme-builder": { + "is_active": false + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/free-to-pro-upsell/v1/free-to-pro-upsell.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/free-to-pro-upsell/v1/free-to-pro-upsell.json new file mode 100644 index 000000000..2ae738ec2 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/free-to-pro-upsell/v1/free-to-pro-upsell.json @@ -0,0 +1,29 @@ +{ + "lastUpdated": "2026-11-19T13:44:16.080Z", + "free-to-pro-upsell": [ + { + "id": "animated_headline", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/animated_headline.jpg" + }, + { + "id": "video_playlist", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/video_playlist.jpg" + }, + { + "id": "cta", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/cta.jpg" + }, + { + "id": "testimonial_widget", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/testimonial_widget.jpg" + }, + { + "id": "image_carousel", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/image_carousel.jpg" + }, + { + "id": "connect-pro-upgrade", + "imageSrc": "https://assets.elementor.com/free-to-pro-upsell/v1/images/connect-pro-upgrade.jpg" + } + ] +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/home-screen/v1/home-screen.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/home-screen/v1/home-screen.json new file mode 100644 index 000000000..07ac681e1 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/home-screen/v1/home-screen.json @@ -0,0 +1,527 @@ +{ + "lastUpdated": "2026-11-17T12:57:56.662Z", + "home-screen": { + "top_with_licences": [ + { + "license": ["free"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Start building your website with Elementor's no code drag & drop editor.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=le72grP_Q6k&t=1s", + "youtube_embed_id": "le72grP_Q6k?si=g2akyWNODL6usu6u" + }, + { + "license": ["pro"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Now you've got all the tools to start creating professional, high-performing websites - and that journey begins by creating your first page.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=QdkDGrS8ZZs", + "youtube_embed_id": "QdkDGrS8ZZs?si=s_VjZCQR6Fh1jgB5" + }, + { + "license": ["one"], + "title_small": "Hi!", + "title": "Unleash your imagination with Elementor", + "description": "Now you've got all the tools to start creating professional, high-performing websites - and that journey begins by creating your first page.", + "button_create_page_title": "Create a Page", + "button_watch_title": "Watch a guide", + "button_watch_url": "https://www.youtube.com/watch?v=QdkDGrS8ZZs", + "youtube_embed_id": "QdkDGrS8ZZs?si=s_VjZCQR6Fh1jgB5" + } + ], + "get_started": [ + { + "license": ["free"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&page=popup_templates", + "is_relative_url": true, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "title_small_color": "text.tertiary", + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg", + "title_small_color": "text.tertiary" + } + ] + }, + { + "license": ["pro"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&tabs_group=popup&elementor_library_type=popup", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg" + } + ] + }, + { + "license": ["one"], + "header": { + "title": "Jumpstart your web-creation", + "description": "These quick actions will get your site airborne with a customized design." + }, + "repeater": [ + { + "title": "Site Settings", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/site-settings.svg" + }, + { + "title": "Site Logo", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "settings-site-identity", + "image": "https://assets.elementor.com/home-screen/v1/images/site-logo.svg" + }, + { + "title": "Global Colors", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-colors", + "image": "https://assets.elementor.com/home-screen/v1/images/global-colors.svg" + }, + { + "title": "Global Fonts", + "title_small": "Customize", + "url": "", + "is_relative_url": false, + "tab_id": "global-typography", + "image": "https://assets.elementor.com/home-screen/v1/images/global-fonts.svg" + }, + { + "title": "Theme Builder", + "title_small": "Customize", + "url": "admin.php?page=elementor-app", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/theme-builder.svg" + }, + { + "title": "Popups", + "title_small": "Customize", + "url": "edit.php?post_type=elementor_library&tabs_group=popup&elementor_library_type=popup", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/popups.svg" + }, + { + "title": "Custom Icons", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_icons", + "is_relative_url": false, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-icons.svg" + }, + { + "title": "Custom Fonts", + "title_small": "Customize", + "url": "admin.php?page=elementor_custom_fonts", + "is_relative_url": true, + "image": "https://assets.elementor.com/home-screen/v1/images/custom-fonts.svg" + } + ] + } + ], + "add_ons": { + "hide_section": ["free", "essential", "pro", "one"], + "header": { + "title": "Expand your design toolkit", + "description": "These plugins, add-ons, and tools, have been selected to streamline your workflow and maximize your creativity." + }, + "repeater": [ + { + "file_path": "pojo-accessibility/pojo-accessibility.php", + "title": "Ally - Web Accessibility. Simplified.", + "url": "", + "description": "Make your website more accessible with powerful tools to detect and fix issues, enhance usability, and create a better experience for all visitors.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/ally_logo.svg", + "type": "wporg" + }, + { + "file_path": "site-mailer/site-mailer.php", + "title": "Site Mailer", + "url": "", + "description": "Keep your WordPress emails out of the spam folder with improved deliverability and an easy setup—no need for an SMTP plugin or complicated configurations.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/site-mailer.svg", + "type": "wporg" + }, + { + "file_path": "image-optimization/image-optimization.php", + "title": "Image Optimizer", + "url": "https://go.elementor.com/wp-dash-apps-author-uri-elementor-io/", + "description": "Check out this incredibly useful plugin that will compress and optimize your images, giving you leaner, faster websites.", + "button_label": "Install", + "image": "https://assets.elementor.com/home-screen/v1/images/image-optimizer.svg", + "type": "wporg" + }, + { + "title": "Elementor AI", + "url": "https://go.elementor.com/wp-dash-apps-author-uri-elementor-ai/", + "description": "Boost creativity with Elementor AI. Craft & enhance copy, create custom CSS & Code, and generate images to elevate your website.", + "button_label": "Let's go", + "image": "https://assets.elementor.com/home-screen/v1/images/elementor.svg", + "type": "link", + "condition": { + "key": "introduction_meta", + "value": "ai_get_started" + } + } + ], + "footer": { + "label": "Explore more add-ons", + "file_path": "wp-admin/admin.php?page=elementor-apps" + } + }, + "sidebar_promotion_variants": [ + { + "license": ["essential"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/essential-upgrade.svg", + "link": "https://go.elementor.com/go-pro-advanced-home-sidebar-upgrade/" + } + }, + { + "license": ["free"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/upgrade-free.svg", + "link": "https://go.elementor.com/go-pro-home-sidebar-upgrade/" + } + }, + { + "license": ["expired"], + "is_enabled": "true", + "type": "banner", + "data": { + "image": "https://assets.elementor.com/home-screen/v1/images/upgrade-free.svg", + "link": "https://go.elementor.com/go-pro-home-sidebar-expired/" + } + }, + { + "license": ["free"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + }, + { + "license": ["pro"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + }, + { + "license": ["one"], + "is_enabled": "false", + "type": "default", + "data": { + "header": { + "title": "Bring your vision to life", + "description": "Get complete design flexibility for your website with Elementor Pro's advanced tools and premium features.", + "image": "https://assets.elementor.com/home-screen/v1/images/update-sidebar.svg" + }, + "cta": { + "label": "Upgrade Now", + "url": "https://go.elementor.com/go-pro-home-sidebar-upgrade/", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-crown.svg" + }, + "repeater": [ + { + "title": "Popup Builder" + }, + { + "title": "Custom Code & CSS" + }, + { + "title": "E-commerce Features" + }, + { + "title": "Collaborative Notes" + }, + { + "title": "Form Submission" + }, + { + "title": "Form Integrations" + }, + { + "title": "Custom Attributes" + }, + { + "title": "Role Manager" + } + ] + } + } + ], + "external_links": [ + { + "label": "Help Center", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-question-mark.svg", + "url": "https://elementor.com/help/" + }, + { + "label": "Youtube", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-youtube.svg", + "url": "https://www.youtube.com/@Elementor" + }, + { + "label": "Facebook Community", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-community.svg", + "url": "https://www.facebook.com/groups/Elementors" + }, + { + "label": "Blog", + "image": "https://assets.elementor.com/home-screen/v1/images/icon-academic-hat.svg", + "url": "https://elementor.com/blog/" + } + ], + "site_builder": { + "0": { + "hasInput": true, + "title": "From idea to website in minutes", + "placeholder": "What site do you want to build?", + "buttonLabel": "Create my site" + }, + "1": { + "hasInput": false, + "title": "From idea to website in minutes", + "text": "Review your brief and generate your website", + "buttonLabel": "Create site" + }, + "2": { + "hasInput": false, + "title": "Let's turn your sitemap into a design", + "text": "Your sitemap is waiting for you to continue.", + "buttonLabel": "Visit sitemap" + }, + "3": { + "hasInput": false, + "title": "Your site design is waiting", + "text": "Jump back in to review, edit, and add to Elementor.", + "buttonLabel": "Review design" + }, + "4": { + "hasInput": false, + "title": "Your site design is ready to go live", + "text": "Review and publish your site to continue editing in Elementor.", + "buttonLabel": "Review & publish" + }, + "5": { + "hasInput": true, + "title": "Expand your site with Elementor AI", + "placeholder": "Which page do you want to create?", + "buttonLabel": "Create page" + }, + "6": { + "hasInput": true, + "title": "Expand your site with Elementor AI", + "placeholder": "Which page do you want to create?", + "buttonLabel": "Create page" + } + } + } +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/notifications/v1/notifications.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/notifications/v1/notifications.json new file mode 100644 index 000000000..f1c6f2bbe --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/notifications/v1/notifications.json @@ -0,0 +1,3 @@ +{ + "notifications": [] +} diff --git a/actions/fetch-cdn-scenario/fixtures/no-promotion/packages/v1/promotions.json b/actions/fetch-cdn-scenario/fixtures/no-promotion/packages/v1/promotions.json new file mode 100644 index 000000000..f0b347025 --- /dev/null +++ b/actions/fetch-cdn-scenario/fixtures/no-promotion/packages/v1/promotions.json @@ -0,0 +1,75 @@ +{ + "lastUpdated": "2026-11-19T13:44:16.241Z", + "promotions": [ + { + "customCss": { + "title": "Custom CSS", + "content": "Add custom CSS to refine and enrich the appearance of any element on your site.", + "ctaUrl": "https://go.elementor.com/go-pro-style-custom-css/", + "image": "https://assets.elementor.com/packages/v1/images/custom_css_promotion.png" + }, + "displayConditions": { + "title": "Display conditions", + "content": "Control when and where elements are shown across your site.", + "ctaUrl": "https://go.elementor.com/go-pro-display-conditions-modal/", + "image": "https://assets.elementor.com/packages/v1/images/display_conditions_promotion.png" + }, + "attributes": { + "title": "Attributes", + "content": "Add custom attributes when you need deeper customization and better accessibility.", + "ctaUrl": "https://go.elementor.com/go-pro-attributes-modal/", + "image": "https://assets.elementor.com/packages/v1/images/attributes_promotion.png" + }, + "Portfolio": { + "title": "Portfolio", + "content": "Upgrade to build dynamic portfolio grids featuring interactive category filtering and engaging hover effects designed to captivate your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Portfolio_promotion.png" + }, + "Form": { + "title": "Form", + "content": "Upgrade to build advanced forms featuring custom fields, multi-step layouts, automated email notifications, and direct CRM integrations.", + "image": "https://assets.elementor.com/packages/v1/images/Form_promotion.png" + }, + "PriceList": { + "title": "Price list", + "content": "Upgrade to present items, descriptions, and pricing within a cohesive structure that aligned perfectly with your site.", + "image": "https://assets.elementor.com/packages/v1/images/Price_list_promotion.png" + }, + "PriceTable": { + "title": "Price table", + "content": "Upgrade to build pricing matrices featuring highlighted columns, interactive check mark lists, and integrated action buttons.", + "image": "https://assets.elementor.com/packages/v1/images/Price_table_promotion.png" + }, + "LoopGrid": { + "title": "Loop Grid", + "content": "Upgrade to connect custom layouts directly to your site database, seamlessly rendering dynamic content queries that engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Loop_grid_promotion.png" + }, + "CallToAction": { + "title": "Call to Action", + "content": "Upgrade to build Call to Action blocks with image overlays, custom hover animations, and promotional layout control across your site.", + "image": "https://assets.elementor.com/packages/v1/images/CTA_promotion.png" + }, + "Template": { + "title": "Template", + "content": "Upgrade to embed saved templates that sync automatically across your entire site, preserving layout integrity and accelerating your production speed.", + "image": "https://assets.elementor.com/packages/v1/images/Template_promotion.png" + }, + "Gallery": { + "title": "Gallery pro", + "content": "Upgrade to build gallery with dynamic categorization and custom layout control across your site.", + "image": "https://assets.elementor.com/packages/v1/images/Gallery_pro_promotion.png" + }, + "MediaCarousel": { + "title": "Media carousel", + "content": "Upgrade to build advanced Media Carousel with dynamic video elements into your sliders to better engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Media_carousel_promotion.png" + }, + "LoopCarousel": { + "title": "Loop carousel", + "content": "Upgrade to build advanced Loop Carousel with dynamic posts, custom layouts seamlessly to better engage your site visitors.", + "image": "https://assets.elementor.com/packages/v1/images/Loop_carousel_promotion.png" + } + } + ] +} diff --git a/actions/fetch-cdn-scenario/mock-editor-assets-cdn.php b/actions/fetch-cdn-scenario/mock-editor-assets-cdn.php new file mode 100644 index 000000000..5bd773753 --- /dev/null +++ b/actions/fetch-cdn-scenario/mock-editor-assets-cdn.php @@ -0,0 +1,93 @@ + [ 'content-type' => 'application/json' ], + 'body' => (string) file_get_contents( $fixture ), + 'response' => [ + 'code' => 200, + 'message' => 'OK', + ], + 'cookies' => [], + 'filename' => null, + ]; +}, 10, 3 ); + +// Campaign requests skip the shared CDN cache, so their data never leaks into parallel default-scenario requests. +if ( ELEMENTOR_E2E_CDN_DEFAULT_SCENARIO !== elementor_e2e_cdn_scenario() ) { + foreach ( ELEMENTOR_E2E_CDN_CACHE_OPTIONS as $elementor_e2e_cdn_cache_option ) { + add_filter( "pre_option_{$elementor_e2e_cdn_cache_option}", '__return_empty_array' ); + add_filter( "pre_update_option_{$elementor_e2e_cdn_cache_option}", fn( $value, $old_value ) => $old_value, 10, 2 ); + } +}