{
  "$schema": "https://playground.wordpress.net/blueprint-schema.json",
  "meta": {
    "title": "WP DevOps Dashboard",
    "author": "tlloancy",
    "description": "Opens the dashboard. SSH, Ansible and Docker need a server this preview does not have. Do not paste a real key here."
  },
  "landingPage": "/wp-admin/admin.php?page=wpkginst-package-manager",
  "preferredVersions": {
    "php": "latest",
    "wp": "latest"
  },
  "steps": [
    {
      "step": "installPlugin",
      "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "package-installator"
      },
      "options": {
        "activate": true
      },
      "ifAlreadyInstalled": "skip"
    },
    {
      "step": "runPHP",
      "code": "<?php\nrequire_once '/wordpress/wp-load.php';\nupdate_option( 'permalink_structure', '/%postname%/' );\n\nfunction bp_page( $title, $slug, $content, $front = false ) {\n\t$existing = get_page_by_path( $slug );\n\tif ( $existing instanceof WP_Post ) {\n\t\twp_update_post(\n\t\t\tarray(\n\t\t\t\t'ID'           => $existing->ID,\n\t\t\t\t'post_content' => $content,\n\t\t\t\t'post_status'  => 'publish',\n\t\t\t)\n\t\t);\n\t\t$id = (int) $existing->ID;\n\t} else {\n\t\t$id = (int) wp_insert_post(\n\t\t\tarray(\n\t\t\t\t'post_title'   => $title,\n\t\t\t\t'post_name'    => $slug,\n\t\t\t\t'post_status'  => 'publish',\n\t\t\t\t'post_type'    => 'page',\n\t\t\t\t'post_content' => $content,\n\t\t\t)\n\t\t);\n\t}\n\tif ( $front && $id ) {\n\t\tupdate_option( 'show_on_front', 'page' );\n\t\tupdate_option( 'page_on_front', $id );\n\t}\n\treturn $id;\n}\n\nupdate_option( 'blogname', 'DevOps preview' );\nflush_rewrite_rules();\n"
    },
    {
      "step": "login",
      "username": "admin",
      "password": "password"
    }
  ]
}
