{
  "$schema": "https://playground.wordpress.net/blueprint-schema.json",
  "landingPage": "/wp-admin/admin.php?page=swstats_dash",
  "login": true,
  "preferredVersions": {
	"php": "8.3",
	"wp": "latest"
  },
  "steps": [
	{
	  "step": "installPlugin",
	  "pluginData": {
		"resource": "wordpress.org/plugins",
		"slug": "simple-webstats"
	  },
	  "options": {
		"activate": true
	  }
	},
	{
	  "step": "runPHP",
	  "code": "<?php require_once '/wordpress/wp-load.php'; global $wpdb; $table = $wpdb->prefix.SWSTATS_DATA_TABLE; $visitors = mt_rand(4000, 5000); $countries = ['GB', 'GB', 'GB', 'GB', 'US', 'US', 'US', 'DE', 'ES', 'ES', 'CN', 'CN', 'IT', 'BR', 'CA', 'NL', 'FR']; $types_nonbot = ['Desktop', 'Desktop', 'Tablet', 'Mobile', 'Mobile']; $types_bot = ['Crawler (Bot)', 'Search Bot (Bot)', 'Security Checker (Bot)', 'Unknown']; $platforms_nonbot = ['Windows', 'Mac', 'iOS']; $platforms_bot = ['Googlebot', 'BingBot', 'Unknown']; $browsers_nonbot = ['Chrome', 'Chrome', 'Chrome', 'Firefox', 'Firefox', 'Safari', 'Mobile Safari', 'Microsoft Edge']; $browsers_bot = ['Unknown', 'Headless Chrome']; $sources = [null, null, 'google.com', 'bing.com', 'wordpress.org', 'wordpress.org', 'facebook.com']; $locations = ['/', '/', '/', '/', '/contact/', '/about/', '/resources/', '/blog/', '/blog/', '/blog/this-is-an-example-url/', '/blog/hello-world/', '/blog/here-is-an-article-about-wordpress-plugins-that-you-might-want-to-read/', '/blog/title/']; $time_start = time()-60*60*24*90; $time_end = time(); for($i = 0; $i < $visitors; $i++) { $visitor = $i; $uid = md5($visitor); $isbot = (($visitor % 5) === 0); $country = $countries[$visitor % count($countries)]; $types = $isbot ? $types_bot : $types_nonbot; $type = $types[$visitor % count($types)]; $platforms = $isbot ? $platforms_bot : $platforms_nonbot; $platform = $platforms[$visitor % count($platforms)]; $browsers = $isbot ? $browsers_bot : $browsers_nonbot; $browser = $browsers[$visitor % count($browsers)]; $version = 'Demo'; $entrytime = mt_rand($time_start, $time_end); $referrerdomain = $isbot ? null : $sources[$visitor % count($sources)]; $first_view = true; $active = true; while($active) { $active = (mt_rand(1, 10) <= 4); $isentrypage = ($first_view) ? 1 : 0; $timeonpage = $active ? mt_rand(1, 60) : null; if(!$first_view) $referrerdomain = null; $location = $locations[mt_rand(0, count($locations)-1)]; $row = [ 'uid' => $uid, 'isbot' => $isbot ? 1 : 0, 'country' => $country, 'type' => $type, 'platform' => $platform, 'browser' => $browser, 'version' => $version, 'isentrypage' => $isentrypage, 'entrytime' => $entrytime, 'referrerdomain' => $referrerdomain, 'location' => $location ]; if($timeonpage) $row['timeonpage'] = $timeonpage; $wpdb->insert($table, $row); if($active) $entrytime += $timeonpage; $first_view = false; } }"
	}
  ]
}