diff --git a/packages/playground/puzzle/src/site-builder/blueprints/yith.json b/packages/playground/puzzle/src/site-builder/blueprints/yith.json index a2040c5396..e50f94c52b 100644 --- a/packages/playground/puzzle/src/site-builder/blueprints/yith.json +++ b/packages/playground/puzzle/src/site-builder/blueprints/yith.json @@ -1,29 +1,43 @@ { - "landingPage": "/wp-admin/edit.php?post_type=gift_card&post_status=publish&yith-plugin-fw-panel-skip-redirect=1", + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "landingPage": "/wp-admin/admin.php?page=yith_wcwl_panel&tab=settings&sub_tab=settings-add_to_wishlist", "steps": [ { "step": "installPlugin", "pluginZipFile": { "resource": "wordpress.org/plugins", "slug": "woocommerce" - }, - "options": { - "activate": true } }, { - "step": "runPHP", - "code": " true]);" + "step": "installPlugin", + "pluginZipFile": { + "resource": "wordpress.org/plugins", + "slug": "wordpress-importer" + } }, { "step": "installPlugin", "pluginZipFile": { "resource": "wordpress.org/plugins", - "slug": "yith-woocommerce-gift-cards" - }, - "options": { - "activate": true + "slug": "yith-woocommerce-wishlist" } + }, + { + "step": "wp-cli", + "command": "wp option update yith_wcwl_show_on_loop 'yes'" + }, + { + "step": "wp-cli", + "command": "wp import /wordpress/wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=create" + }, + { + "step": "wp-cli", + "command": "wp transient set _wc_activation_redirect 0 259200" + }, + { + "step": "wp-cli", + "command": "wp option update woocommerce_onboarding_profile '{\"skipped\": true}' --format=json" } ] } diff --git a/packages/playground/puzzle/src/site-builder/processor.ts b/packages/playground/puzzle/src/site-builder/processor.ts index 97f8e3b852..1270c3594e 100644 --- a/packages/playground/puzzle/src/site-builder/processor.ts +++ b/packages/playground/puzzle/src/site-builder/processor.ts @@ -113,6 +113,8 @@ export const processImage = async (actions: string[]) => { ); if (actions.includes('/wp-admin/')) { blueprint['landingPage'] = '/wp-admin/'; + } else if (actions.length > 1) { + blueprint['landingPage'] = '/wp-admin/plugins.php'; } if (actions.includes('multisite')) { @@ -188,7 +190,6 @@ const mergeBlueprints = (blueprints: any[]) => { }; const landingPages: string[] = []; - let pluginsInstalled = 0; let themeInstalled = false; for (const blueprint of blueprints) { if (!blueprint) { @@ -207,10 +208,6 @@ const mergeBlueprints = (blueprints: any[]) => { ), ]; - pluginsInstalled += blueprint.steps.filter( - (step: any) => step.step === 'installPlugin' - ).length; - if ( themeInstalled === false && blueprint.steps.find((step: any) => step.step === 'installTheme') @@ -219,12 +216,8 @@ const mergeBlueprints = (blueprints: any[]) => { } } - // If multiple plugins are installed, go to the plugins list - if (pluginsInstalled > 1) { - newBlueprint.landingPage = '/wp-admin/plugins.php'; - } // If one landing page is defined, use it - else if (themeInstalled) { + if (themeInstalled) { newBlueprint.landingPage = '/'; } // If multiple landing pages are defined, go to the first one