{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/wp-admin/admin.php?page=twec-settings",
	"preferredVersions": {
		"php": "8.2",
		"wp": "6.9.4"
	},
	"steps": [
		{
			"step": "login",
			"username": "admin",
			"password": "password"
		},
		{
			"step": "installPlugin",
			"pluginZipFile": {
				"resource": "wordpress.org/plugins",
				"slug": "planit-event-manager"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Create Event Categories\n$categories = array(\n\t'Conferences' => 'Professional and business conferences',\n\t'Workshops' => 'Hands-on learning workshops',\n\t'Concerts' => 'Live music and entertainment',\n\t'Festivals' => 'Community festivals and celebrations',\n\t'Webinars' => 'Online educational webinars'\n);\n\nforeach ($categories as $name => $description) {\n\t$term = wp_insert_term($name, 'twec_event_category', array(\n\t\t'description' => $description\n\t));\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Create Event Tags\n$tags = array('Free', 'Networking', 'Technology', 'Music', 'Business', 'Education', 'Community');\n\nforeach ($tags as $tag) {\n\twp_insert_term($tag, 'twec_event_tag');\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Create Sample Venues\n$venues = array(\n\tarray(\n\t\t'name' => 'Convention Center',\n\t\t'address' => '123 Main Street',\n\t\t'city' => 'New York',\n\t\t'state' => 'NY',\n\t\t'zip' => '10001',\n\t\t'country' => 'United States',\n\t\t'phone' => '(555) 123-4567',\n\t\t'website' => 'https://example.com/convention-center',\n\t\t'description' => 'A spacious venue perfect for large conferences and events.'\n\t),\n\tarray(\n\t\t'name' => 'Community Park Amphitheater',\n\t\t'address' => '456 Oak Avenue',\n\t\t'city' => 'Los Angeles',\n\t\t'state' => 'CA',\n\t\t'zip' => '90001',\n\t\t'country' => 'United States',\n\t\t'phone' => '(555) 234-5678',\n\t\t'website' => 'https://example.com/amphitheater',\n\t\t'description' => 'Beautiful outdoor venue for concerts and festivals.'\n\t),\n\tarray(\n\t\t'name' => 'Tech Hub Conference Room',\n\t\t'address' => '789 Innovation Drive',\n\t\t'city' => 'San Francisco',\n\t\t'state' => 'CA',\n\t\t'zip' => '94102',\n\t\t'country' => 'United States',\n\t\t'phone' => '(555) 345-6789',\n\t\t'website' => 'https://example.com/techhub',\n\t\t'description' => 'Modern conference facility for tech workshops and seminars.'\n\t)\n);\n\n$venue_ids = array();\nforeach ($venues as $venue_data) {\n\t$venue_id = wp_insert_post(array(\n\t\t'post_title' => $venue_data['name'],\n\t\t'post_content' => $venue_data['description'],\n\t\t'post_type' => 'twec_venue',\n\t\t'post_status' => 'publish'\n\t));\n\t\n\tif ($venue_id) {\n\t\tupdate_post_meta($venue_id, '_twec_venue_address', $venue_data['address']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_city', $venue_data['city']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_state', $venue_data['state']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_zip', $venue_data['zip']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_country', $venue_data['country']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_phone', $venue_data['phone']);\n\t\tupdate_post_meta($venue_id, '_twec_venue_website', $venue_data['website']);\n\t\t$venue_ids[] = $venue_id;\n\t}\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Create Sample Organizers\n$organizers = array(\n\tarray(\n\t\t'name' => 'Tech Events Network',\n\t\t'email' => 'info@techeventsnetwork.com',\n\t\t'phone' => '(555) 111-2222',\n\t\t'website' => 'https://example.com/tech-events',\n\t\t'description' => 'Leading organizer of technology conferences and workshops.'\n\t),\n\tarray(\n\t\t'name' => 'Community Arts Council',\n\t\t'email' => 'events@communityarts.org',\n\t\t'phone' => '(555) 222-3333',\n\t\t'website' => 'https://example.com/community-arts',\n\t\t'description' => 'Promoting local arts and culture through community events.'\n\t),\n\tarray(\n\t\t'name' => 'Business Leaders Association',\n\t\t'email' => 'contact@businessleaders.org',\n\t\t'phone' => '(555) 333-4444',\n\t\t'website' => 'https://example.com/business-leaders',\n\t\t'description' => 'Connecting business professionals through networking events.'\n\t)\n);\n\n$organizer_ids = array();\nforeach ($organizers as $organizer_data) {\n\t$organizer_id = wp_insert_post(array(\n\t\t'post_title' => $organizer_data['name'],\n\t\t'post_content' => $organizer_data['description'],\n\t\t'post_type' => 'twec_organizer',\n\t\t'post_status' => 'publish'\n\t));\n\t\n\tif ($organizer_id) {\n\t\tupdate_post_meta($organizer_id, '_twec_organizer_email', $organizer_data['email']);\n\t\tupdate_post_meta($organizer_id, '_twec_organizer_phone', $organizer_data['phone']);\n\t\tupdate_post_meta($organizer_id, '_twec_organizer_website', $organizer_data['website']);\n\t\t$organizer_ids[] = $organizer_id;\n\t}\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Get category and tag IDs\n$conference_cat = get_term_by('name', 'Conferences', 'twec_event_category');\n$workshop_cat = get_term_by('name', 'Workshops', 'twec_event_category');\n$concert_cat = get_term_by('name', 'Concerts', 'twec_event_category');\n$webinar_cat = get_term_by('name', 'Webinars', 'twec_event_category');\n\n$free_tag = get_term_by('name', 'Free', 'twec_event_tag');\n$tech_tag = get_term_by('name', 'Technology', 'twec_event_tag');\n$networking_tag = get_term_by('name', 'Networking', 'twec_event_tag');\n\n// Get venue and organizer IDs\n$venues = get_posts(array('post_type' => 'twec_venue', 'posts_per_page' => -1));\n$organizers = get_posts(array('post_type' => 'twec_organizer', 'posts_per_page' => -1));\n\n$venue_ids = wp_list_pluck($venues, 'ID');\n$organizer_ids = wp_list_pluck($organizers, 'ID');\n\n// Create sample events\n$events = array(\n\tarray(\n\t\t'title' => 'WordPress Developer Conference 2024',\n\t\t'content' => 'Join us for the largest WordPress developer conference of the year. Learn from industry experts, network with peers, and discover the latest trends in WordPress development.',\n\t\t'start_date' => date('Y-m-d', strtotime('+15 days')),\n\t\t'start_time' => '09:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+15 days')),\n\t\t'end_time' => '17:00',\n\t\t'category' => $conference_cat ? $conference_cat->term_id : null,\n\t\t'tags' => $tech_tag ? array($tech_tag->term_id) : array(),\n\t\t'venue' => isset($venue_ids[0]) ? $venue_ids[0] : null,\n\t\t'organizer' => isset($organizer_ids[0]) ? $organizer_ids[0] : null\n\t),\n\tarray(\n\t\t'title' => 'JavaScript Masterclass Workshop',\n\t\t'content' => 'Deep dive into modern JavaScript techniques. This hands-on workshop covers ES6+, async programming, and best practices for building scalable applications.',\n\t\t'start_date' => date('Y-m-d', strtotime('+20 days')),\n\t\t'start_time' => '10:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+20 days')),\n\t\t'end_time' => '16:00',\n\t\t'category' => $workshop_cat ? $workshop_cat->term_id : null,\n\t\t'tags' => $tech_tag ? array($tech_tag->term_id) : array(),\n\t\t'venue' => isset($venue_ids[2]) ? $venue_ids[2] : null,\n\t\t'organizer' => isset($organizer_ids[0]) ? $organizer_ids[0] : null\n\t),\n\tarray(\n\t\t'title' => 'Summer Music Festival',\n\t\t'content' => 'Enjoy an incredible lineup of local and international artists at our annual summer music festival. Food trucks, art vendors, and family-friendly activities.',\n\t\t'start_date' => date('Y-m-d', strtotime('+30 days')),\n\t\t'start_time' => '14:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+30 days')),\n\t\t'end_time' => '22:00',\n\t\t'category' => $concert_cat ? $concert_cat->term_id : null,\n\t\t'tags' => $free_tag ? array($free_tag->term_id) : array(),\n\t\t'venue' => isset($venue_ids[1]) ? $venue_ids[1] : null,\n\t\t'organizer' => isset($organizer_ids[1]) ? $organizer_ids[1] : null\n\t),\n\tarray(\n\t\t'title' => 'Digital Marketing Webinar Series',\n\t\t'content' => 'Learn effective digital marketing strategies in this comprehensive webinar series. Topics include SEO, social media marketing, email campaigns, and analytics.',\n\t\t'start_date' => date('Y-m-d', strtotime('+5 days')),\n\t\t'start_time' => '14:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+5 days')),\n\t\t'end_time' => '15:30',\n\t\t'category' => $webinar_cat ? $webinar_cat->term_id : null,\n\t\t'tags' => $free_tag ? array($free_tag->term_id) : array(),\n\t\t'venue' => null,\n\t\t'organizer' => isset($organizer_ids[2]) ? $organizer_ids[2] : null\n\t),\n\tarray(\n\t\t'title' => 'Business Networking Mixer',\n\t\t'content' => 'Connect with local business leaders and entrepreneurs. Light refreshments provided. Open to all professionals looking to expand their network.',\n\t\t'start_date' => date('Y-m-d', strtotime('+10 days')),\n\t\t'start_time' => '18:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+10 days')),\n\t\t'end_time' => '20:00',\n\t\t'category' => $conference_cat ? $conference_cat->term_id : null,\n\t\t'tags' => $networking_tag ? array($networking_tag->term_id) : array(),\n\t\t'venue' => isset($venue_ids[0]) ? $venue_ids[0] : null,\n\t\t'organizer' => isset($organizer_ids[2]) ? $organizer_ids[2] : null\n\t),\n\tarray(\n\t\t'title' => 'React & Next.js Workshop',\n\t\t'content' => 'Build modern web applications with React and Next.js. This intermediate workshop covers server-side rendering, API routes, and deployment strategies.',\n\t\t'start_date' => date('Y-m-d', strtotime('+25 days')),\n\t\t'start_time' => '09:00',\n\t\t'end_date' => date('Y-m-d', strtotime('+25 days')),\n\t\t'end_time' => '17:00',\n\t\t'category' => $workshop_cat ? $workshop_cat->term_id : null,\n\t\t'tags' => $tech_tag ? array($tech_tag->term_id) : array(),\n\t\t'venue' => isset($venue_ids[2]) ? $venue_ids[2] : null,\n\t\t'organizer' => isset($organizer_ids[0]) ? $organizer_ids[0] : null\n\t)\n);\n\nforeach ($events as $event_data) {\n\t$event_id = wp_insert_post(array(\n\t\t'post_title' => $event_data['title'],\n\t\t'post_content' => $event_data['content'],\n\t\t'post_type' => 'twec_event',\n\t\t'post_status' => 'publish'\n\t));\n\t\n\tif ($event_id) {\n\t\t// Set event dates and times\n\t\tupdate_post_meta($event_id, '_twec_event_start_date', $event_data['start_date']);\n\t\tupdate_post_meta($event_id, '_twec_event_start_time', $event_data['start_time']);\n\t\tupdate_post_meta($event_id, '_twec_event_end_date', $event_data['end_date']);\n\t\tupdate_post_meta($event_id, '_twec_event_end_time', $event_data['end_time']);\n\t\t\n\t\t// Set venue and organizer\n\t\tif ($event_data['venue']) {\n\t\t\tupdate_post_meta($event_id, '_twec_event_venue', $event_data['venue']);\n\t\t}\n\t\tif ($event_data['organizer']) {\n\t\t\tupdate_post_meta($event_id, '_twec_event_organizer', $event_data['organizer']);\n\t\t}\n\t\t\n\t\t// Set categories and tags\n\t\tif ($event_data['category']) {\n\t\t\twp_set_post_terms($event_id, array($event_data['category']), 'twec_event_category');\n\t\t}\n\t\tif (!empty($event_data['tags'])) {\n\t\t\twp_set_post_terms($event_id, $event_data['tags'], 'twec_event_tag');\n\t\t}\n\t}\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Create a demo page showcasing the plugin\n$demo_page = wp_insert_post(array(\n\t'post_title' => 'Event Calendar Demo',\n\t'post_content' => '<h2>PlanIt Event Manager - Calendar View</h2>\n<p>Check out our event calendar below:</p>\n[twec_calendar view=\"month\"]\n\n<h2>Upcoming Events List</h2>\n<p>Browse all upcoming events:</p>\n[twec_list per_page=\"10\"]\n\n<p><a href=\"/events/\">View All Events →</a></p>',\n\t'post_status' => 'publish',\n\t'post_type' => 'page'\n));\n\n// Set as homepage if no homepage is set\nif (!get_option('page_on_front')) {\n\tupdate_option('show_on_front', 'page');\n\tupdate_option('page_on_front', $demo_page);\n}"
		},
		{
			"step": "runPHP",
			"code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Configure plugin settings\n$settings = array(\n\t'hide_past_events' => '1',\n\t'events_per_page' => '10',\n\t'date_format' => 'F j, Y',\n\t'time_format' => 'g:i A'\n);\n\nupdate_option('twec_settings', $settings);"
		}
	]
}

