From 85e581652ea7fba8e4d61bce3ebabf8ce7793d95 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 14 Feb 2025 13:57:06 +0200 Subject: [PATCH 1/4] Add the actual blueprint --- assets/blueprints/blueprint.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 assets/blueprints/blueprint.json diff --git a/assets/blueprints/blueprint.json b/assets/blueprints/blueprint.json new file mode 100644 index 00000000..f4457183 --- /dev/null +++ b/assets/blueprints/blueprint.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "landingPage": "/wp-admin/profile.php", + "preferredVersions": { + "php": "7.4", + "wp": "latest" + }, + "steps": [ + { + "step": "login" + }, + { + "step": "installPlugin", + "pluginData": { + "resource": "wordpress.org/plugins", + "slug": "two-factor" + }, + "options": { + "activate": true + } + } + ] +} From ea0abb630d8727251b04c09d0964ca9125e2da85 Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 14 Feb 2025 13:57:20 +0200 Subject: [PATCH 2/4] Helpers to generate the blueprint URL for testing --- Gruntfile.js | 9 +++++++++ package.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9a58b436..12258219 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,6 @@ /* eslint-env node,es6 */ +const fs = require( 'fs' ); const ignoreParse = require( 'parse-gitignore' ); module.exports = function( grunt ) { @@ -45,4 +46,12 @@ module.exports = function( grunt ) { 'copy', ] ); + + grunt.registerTask( + 'blueprint-url', + function() { + const blueprintJson = JSON.parse( fs.readFileSync( 'assets/blueprints/blueprint.json', 'utf8' ) ); + grunt.log.write( `Blueprint URL: https://playground.wordpress.net/#${ encodeURI( JSON.stringify( blueprintJson ) ) }` ); + } + ); }; diff --git a/package.json b/package.json index 894e834d..d96386ce 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "test": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor vendor/bin/phpunit --", "test:watch": "npm run composer test:watch", "composer": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor composer --", - "preinstall": "composer install" + "preinstall": "composer install", + "blueprint": "grunt blueprint-url" }, "repository": { "type": "git", From a8b652c4e2bc807f8ad77f1cdfb610278c04a42f Mon Sep 17 00:00:00 2001 From: Kaspars Dambis Date: Fri, 14 Feb 2025 14:01:03 +0200 Subject: [PATCH 3/4] Consistent formatting --- assets/blueprints/blueprint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/blueprints/blueprint.json b/assets/blueprints/blueprint.json index f4457183..0096b8ef 100644 --- a/assets/blueprints/blueprint.json +++ b/assets/blueprints/blueprint.json @@ -1,5 +1,5 @@ { - "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "$schema": "https://playground.wordpress.net/blueprint-schema.json", "landingPage": "/wp-admin/profile.php", "preferredVersions": { "php": "7.4", From a006a252cf19cf10775854296fac3c7bc9fc6bda Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Fri, 14 Feb 2025 10:20:11 -0600 Subject: [PATCH 4/4] Update blueprint.json --- assets/blueprints/blueprint.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/blueprints/blueprint.json b/assets/blueprints/blueprint.json index 0096b8ef..3221e499 100644 --- a/assets/blueprints/blueprint.json +++ b/assets/blueprints/blueprint.json @@ -1,18 +1,20 @@ { "$schema": "https://playground.wordpress.net/blueprint-schema.json", - "landingPage": "/wp-admin/profile.php", + "landingPage": "\/wp-admin\/profile.php", "preferredVersions": { "php": "7.4", "wp": "latest" }, "steps": [ { - "step": "login" + "step": "login", + "username": "admin", + "password": "password" }, { "step": "installPlugin", - "pluginData": { - "resource": "wordpress.org/plugins", + "pluginZipFile": { + "resource": "wordpress.org\/plugins", "slug": "two-factor" }, "options": {