{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/wp-admin/edit.php?post_type=page",
	"preferredVersions": {
		"php": "8.3",
		"wp": "latest"
	},
	"features": {
		"networking": true
	},
	"login": true,
	"steps": [
		{
			"step": "installPlugin",
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "elementor"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "installPlugin",
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "blogmentor"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\nupdate_option( 'elementor_onboarded', '2.0.0' );\ndelete_transient( 'elementor_activation_redirect' );\n\nrequire_once ABSPATH . 'wp-admin/includes/image.php';\n\n$sample_posts = array(\n\tarray(\n\t\t'title'   => 'The Art of Minimalist Design',\n\t\t'content' => 'Minimalist design strips away the unnecessary so the message can breathe. In this post we look at how less can truly be more.',\n\t),\n\tarray(\n\t\t'title'   => '10 Tips for Better Blogging',\n\t\t'content' => 'From finding your voice to staying consistent, these ten tips will help you grow a blog readers keep coming back to.',\n\t),\n\tarray(\n\t\t'title'   => 'Exploring Modern Web Trends',\n\t\t'content' => 'Web design keeps evolving. We break down the trends shaping how modern websites look, feel, and perform.',\n\t),\n\tarray(\n\t\t'title'   => 'How to Build a Content Strategy',\n\t\t'content' => 'A solid content strategy turns random posts into a plan that grows your audience over time. Here is where to start.',\n\t),\n\tarray(\n\t\t'title'   => 'Photography Basics for Beginners',\n\t\t'content' => 'Great photos start with a few fundamentals. Learn the basics of light, composition, and framing in this beginner guide.',\n\t),\n);\n\n$placeholder_source = BLOGMENTOR_PATH . 'assets/images/placeholder.jpg';\n$upload_dir         = wp_upload_dir();\n\nforeach ( $sample_posts as $index => $sample_post ) {\n\t$post_id = wp_insert_post(\n\t\tarray(\n\t\t\t'post_title'   => $sample_post['title'],\n\t\t\t'post_content' => $sample_post['content'],\n\t\t\t'post_status'  => 'publish',\n\t\t\t'post_type'    => 'post',\n\t\t),\n\t\ttrue\n\t);\n\n\tif ( is_wp_error( $post_id ) ) {\n\t\tcontinue;\n\t}\n\n\t$filename     = 'blogmentor-sample-' . ( $index + 1 ) . '.jpg';\n\t$destination  = trailingslashit( $upload_dir['path'] ) . $filename;\n\n\tif ( ! copy( $placeholder_source, $destination ) ) {\n\t\tcontinue;\n\t}\n\n\t$attachment_id = wp_insert_attachment(\n\t\tarray(\n\t\t\t'post_mime_type' => 'image/jpeg',\n\t\t\t'post_title'     => $sample_post['title'],\n\t\t\t'post_status'    => 'inherit',\n\t\t),\n\t\t$destination,\n\t\t$post_id\n\t);\n\n\tif ( is_wp_error( $attachment_id ) ) {\n\t\tcontinue;\n\t}\n\n\t$attachment_data = wp_generate_attachment_metadata( $attachment_id, $destination );\n\twp_update_attachment_metadata( $attachment_id, $attachment_data );\n\tset_post_thumbnail( $post_id, $attachment_id );\n}\n\n$elementor_data = array(\n\tarray(\n\t\t'id' => '1a2b3c4',\n\t\t'elType' => 'section',\n\t\t'settings' => array(),\n\t\t'elements' => array(\n\t\t\tarray(\n\t\t\t\t'id' => '2b3c4d5',\n\t\t\t\t'elType' => 'column',\n\t\t\t\t'settings' => array( '_column_size' => 100 ),\n\t\t\t\t'elements' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3c4d5e6',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'heading',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'title' => 'Blogmentor - Blog Layouts for Elementor',\n\t\t\t\t\t\t\t'header_size' => 'h2',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t),\n\tarray(\n\t\t'id' => '4d5e6f7',\n\t\t'elType' => 'section',\n\t\t'settings' => array(),\n\t\t'elements' => array(\n\t\t\tarray(\n\t\t\t\t'id' => '5e6f7a8',\n\t\t\t\t'elType' => 'column',\n\t\t\t\t'settings' => array( '_column_size' => 100 ),\n\t\t\t\t'elements' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '6f7a8b9',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'heading',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'title' => 'Grid Layout',\n\t\t\t\t\t\t\t'header_size' => 'h3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '7a8b9c0',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'blogmentor_blog_posts',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'bm_blog_layout' => 'grid',\n\t\t\t\t\t\t\t'bm_blog_style' => 'bm_blog_style_1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t),\n\tarray(\n\t\t'id' => '8b9c0d1',\n\t\t'elType' => 'section',\n\t\t'settings' => array(),\n\t\t'elements' => array(\n\t\t\tarray(\n\t\t\t\t'id' => '9c0d1e2',\n\t\t\t\t'elType' => 'column',\n\t\t\t\t'settings' => array( '_column_size' => 100 ),\n\t\t\t\t'elements' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '0d1e2f3',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'heading',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'title' => 'Masonry Layout',\n\t\t\t\t\t\t\t'header_size' => 'h3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1e2f3a4',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'blogmentor_blog_posts',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'bm_blog_layout' => 'masonry',\n\t\t\t\t\t\t\t'bm_blog_style' => 'bm_blog_style_1',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t),\n\tarray(\n\t\t'id' => '2f3a4b5',\n\t\t'elType' => 'section',\n\t\t'settings' => array(),\n\t\t'elements' => array(\n\t\t\tarray(\n\t\t\t\t'id' => '3a4b5c6',\n\t\t\t\t'elType' => 'column',\n\t\t\t\t'settings' => array( '_column_size' => 100 ),\n\t\t\t\t'elements' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '4b5c6d7',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'heading',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'title' => 'Metro Layout',\n\t\t\t\t\t\t\t'header_size' => 'h3',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '5c6d7e8',\n\t\t\t\t\t\t'elType' => 'widget',\n\t\t\t\t\t\t'widgetType' => 'blogmentor_blog_posts',\n\t\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t\t'bm_blog_layout' => 'metro',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'elements' => array(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t),\n);\n\n$page_id = wp_insert_post(\n    array(\n        'post_title'   => 'Blogmentor Demo',\n        'post_status'  => 'publish',\n        'post_type'    => 'page'\n    ),\n    true\n);\n\nif ( is_wp_error( $page_id ) ) {\n    throw new RuntimeException( $page_id->get_error_message() );\n}\n\nupdate_post_meta( $page_id, '_elementor_edit_mode', 'builder' );\nupdate_post_meta( $page_id, '_elementor_template_type', 'wp-page' );\nupdate_post_meta( $page_id, '_elementor_version', defined( 'ELEMENTOR_VERSION' ) ? ELEMENTOR_VERSION : '3.0.0' );\nupdate_post_meta( $page_id, '_elementor_data', wp_slash( wp_json_encode( $elementor_data ) ) );\n"
		}
	]
}
