|
| 1 | +{ |
| 2 | + "$schema": "https://playground.wordpress.net/blueprint-schema.json", |
| 3 | + "landingPage": "/wp-admin/options-general.php?page=ad-code-manager", |
| 4 | + "preferredVersions": { |
| 5 | + "php": "8.2", |
| 6 | + "wp": "latest" |
| 7 | + }, |
| 8 | + "phpExtensionBundles": [ "kitchen-sink" ], |
| 9 | + "steps": [ |
| 10 | + { |
| 11 | + "step": "installPlugin", |
| 12 | + "pluginData": { |
| 13 | + "resource": "wordpress.org/plugins", |
| 14 | + "slug": "ad-code-manager" |
| 15 | + }, |
| 16 | + "options": { |
| 17 | + "activate": true |
| 18 | + } |
| 19 | + }, |
| 20 | + { |
| 21 | + "step": "runPHP", |
| 22 | + "code": "<?php /* Create sample categories for conditional targeting demo */ require_once 'wordpress/wp-load.php'; wp_insert_term( 'Technology', 'category', array( 'slug' => 'technology', 'description' => 'Tech news and reviews' ) ); wp_insert_term( 'Sports', 'category', array( 'slug' => 'sports', 'description' => 'Sports coverage' ) ); wp_insert_term( 'Business', 'category', array( 'slug' => 'business', 'description' => 'Business and finance' ) ); ?>" |
| 23 | + }, |
| 24 | + { |
| 25 | + "step": "runPHP", |
| 26 | + "code": "<?php /* Create sample posts to demonstrate conditional targeting */ require_once 'wordpress/wp-load.php'; $tech_cat = get_term_by( 'slug', 'technology', 'category' ); $sports_cat = get_term_by( 'slug', 'sports', 'category' ); $business_cat = get_term_by( 'slug', 'business', 'category' ); wp_insert_post( array( 'post_title' => 'Latest Tech Innovations', 'post_content' => 'Exploring the newest technology trends.', 'post_status' => 'publish', 'post_category' => array( $tech_cat->term_id ), ) ); wp_insert_post( array( 'post_title' => 'Championship Finals Preview', 'post_content' => 'Everything you need to know about the upcoming finals.', 'post_status' => 'publish', 'post_category' => array( $sports_cat->term_id ), ) ); wp_insert_post( array( 'post_title' => 'Market Report: Q4 Results', 'post_content' => 'Analysis of quarterly business performance.', 'post_status' => 'publish', 'post_category' => array( $business_cat->term_id ), ) ); wp_insert_post( array( 'post_title' => 'Sports Tech: Wearables Revolution', 'post_content' => 'How technology is changing athletics.', 'post_status' => 'publish', 'post_category' => array( $tech_cat->term_id, $sports_cat->term_id ), ) ); ?>" |
| 27 | + }, |
| 28 | + { |
| 29 | + "step": "runPHP", |
| 30 | + "code": "<?php /* Create ad code: Leaderboard - no conditionals (runs everywhere) */ require_once 'wordpress/wp-load.php'; $ad_code_id = wp_insert_post( array( 'post_type' => 'acm-code', 'post_title' => 'Site-wide Leaderboard', 'post_status' => 'publish', ) ); if ( ! is_wp_error( $ad_code_id ) ) { update_post_meta( $ad_code_id, 'site_name', 'demo-site' ); update_post_meta( $ad_code_id, 'zone1', 'leaderboard' ); update_post_meta( $ad_code_id, 'priority', 10 ); update_post_meta( $ad_code_id, 'operator', 'OR' ); } ?>" |
| 31 | + }, |
| 32 | + { |
| 33 | + "step": "runPHP", |
| 34 | + "code": "<?php /* Create ad code: Homepage-only banner with is_home conditional */ require_once 'wordpress/wp-load.php'; $ad_code_id = wp_insert_post( array( 'post_type' => 'acm-code', 'post_title' => 'Homepage Banner', 'post_status' => 'publish', ) ); if ( ! is_wp_error( $ad_code_id ) ) { update_post_meta( $ad_code_id, 'site_name', 'demo-site' ); update_post_meta( $ad_code_id, 'zone1', 'homepage-banner' ); update_post_meta( $ad_code_id, 'priority', 5 ); update_post_meta( $ad_code_id, 'operator', 'AND' ); update_post_meta( $ad_code_id, 'conditionals', array( array( 'function' => 'is_home', 'arguments' => array() ) ) ); } ?>" |
| 35 | + }, |
| 36 | + { |
| 37 | + "step": "runPHP", |
| 38 | + "code": "<?php /* Create ad code: Single post sidebar with is_single conditional */ require_once 'wordpress/wp-load.php'; $ad_code_id = wp_insert_post( array( 'post_type' => 'acm-code', 'post_title' => 'Article Sidebar', 'post_status' => 'publish', ) ); if ( ! is_wp_error( $ad_code_id ) ) { update_post_meta( $ad_code_id, 'site_name', 'demo-site' ); update_post_meta( $ad_code_id, 'zone1', 'article-sidebar' ); update_post_meta( $ad_code_id, 'priority', 10 ); update_post_meta( $ad_code_id, 'operator', 'AND' ); update_post_meta( $ad_code_id, 'conditionals', array( array( 'function' => 'is_single', 'arguments' => array() ) ) ); } ?>" |
| 39 | + }, |
| 40 | + { |
| 41 | + "step": "runPHP", |
| 42 | + "code": "<?php /* Create ad code: Sports section ad with has_category conditional */ require_once 'wordpress/wp-load.php'; $ad_code_id = wp_insert_post( array( 'post_type' => 'acm-code', 'post_title' => 'Sports Section Ad', 'post_status' => 'publish', ) ); if ( ! is_wp_error( $ad_code_id ) ) { update_post_meta( $ad_code_id, 'site_name', 'demo-site' ); update_post_meta( $ad_code_id, 'zone1', 'sports-zone' ); update_post_meta( $ad_code_id, 'priority', 15 ); update_post_meta( $ad_code_id, 'operator', 'AND' ); update_post_meta( $ad_code_id, 'conditionals', array( array( 'function' => 'has_category', 'arguments' => array( 'sports' ) ) ) ); } ?>" |
| 43 | + }, |
| 44 | + { |
| 45 | + "step": "runPHP", |
| 46 | + "code": "<?php /* Create ad code: Premium ad with multiple conditionals (AND operator) */ require_once 'wordpress/wp-load.php'; $ad_code_id = wp_insert_post( array( 'post_type' => 'acm-code', 'post_title' => 'Premium Business Ad', 'post_status' => 'publish', ) ); if ( ! is_wp_error( $ad_code_id ) ) { update_post_meta( $ad_code_id, 'site_name', 'demo-site' ); update_post_meta( $ad_code_id, 'zone1', 'premium-zone' ); update_post_meta( $ad_code_id, 'priority', 20 ); update_post_meta( $ad_code_id, 'operator', 'AND' ); update_post_meta( $ad_code_id, 'conditionals', array( array( 'function' => 'is_single', 'arguments' => array() ), array( 'function' => 'has_category', 'arguments' => array( 'business' ) ) ) ); } ?>" |
| 47 | + }, |
| 48 | + { |
| 49 | + "step": "login", |
| 50 | + "username": "admin", |
| 51 | + "password": "password" |
| 52 | + } |
| 53 | + ] |
| 54 | +} |
0 commit comments