{
  "preferredVersions": {
    "php": "8.3",
    "wp": "latest"
  },
  "features": {
    "networking": true
  },
  "landingPage": "/my-account/",
  "steps": [
    {
      "step": "installTheme",
      "themeData": {
        "resource": "wordpress.org/themes",
        "slug": "storefront"
      },
      "options": {
        "activate": true
      }
    },
    {
      "step": "installPlugin",
      "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "woocommerce"
      },
      "options": {
        "activate": true
      }
    },
    {
      "step": "installPlugin",
      "pluginData": {
        "resource": "wordpress.org/plugins",
        "slug": "sdp-registration-fields-for-woocommerce"
      },
      "options": {
        "activate": true
      }
    },
    {
      "step": "runPHP",
      "code": "<?php require '/wordpress/wp-load.php'; update_option('woocommerce_store_address', 'Demo Street 123'); update_option('woocommerce_store_city', 'Murcia'); update_option('woocommerce_default_country', 'ES:MU'); update_option('woocommerce_currency', 'EUR'); update_option('woocommerce_allow_tracking', 'no'); update_option('woocommerce_onboarding_profile', array('skipped' => true)); update_option('woocommerce_task_list_hidden_lists', array('setup','extended')); update_option('woocommerce_enable_myaccount_registration', 'yes'); update_option('woocommerce_registration_generate_password', 'yes'); delete_transient('woocommerce_admin_installing'); delete_transient('scrf-activado'); if (class_exists('WC_Install')) { WC_Install::create_pages(); } ?>"
    },
    {
      "step": "runPHP",
      "code": "<?php require '/wordpress/wp-load.php'; update_option('scrf_recaptcha_site_key', '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'); update_option('scrf_recaptcha_secret_key', '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'); update_option('scrf_recaptcha_enable', 'yes'); ?>"
    },
    {
      "step": "runPHP",
      "code": "<?php require '/wordpress/wp-load.php'; if (!is_dir(WPMU_PLUGIN_DIR)) { mkdir(WPMU_PLUGIN_DIR, 0777, true); } $plugin = <<<'PHP'\n<?php\nadd_action('template_redirect', function() {\n    if (!function_exists('is_account_page') || !is_account_page()) {\n        return;\n    }\n\n    if (is_user_logged_in() && current_user_can('manage_options')) {\n        wp_logout();\n        wp_safe_redirect(wc_get_page_permalink('myaccount'));\n        exit;\n    }\n}, 1);\n\nadd_action('woocommerce_before_customer_login_form', function() {\n    echo '<div class=\"woocommerce-info\" style=\"margin-bottom:24px;\"><strong>Demo tip:</strong> Explore the custom WooCommerce registration fields, layout options, and reCAPTCHA integration. Enjoy 😊</div>';\n});\nPHP; file_put_contents(WPMU_PLUGIN_DIR . '/scrf-playground-demo.php', $plugin); ?>"
    },
    {
      "step": "runPHP",
      "code": "<?php require '/wordpress/wp-load.php'; $cpt = class_exists('SCRF_CPT') ? SCRF_CPT::CPT : 'scrf_fields'; $fields = array(array('title' => 'First Name','slug' => 'first-name','type' => array('value' => 'text', 'label' => 'Text'),'label' => 'First Name','placeholder' => 'John','position' => 'before','width' => 'half','required' => 1,'order' => 10), array('title' => 'Last Name','slug' => 'last-name','type' => array('value' => 'text', 'label' => 'Text'),'label' => 'Last Name','placeholder' => 'Doe','position' => 'before','width' => 'half','required' => 1,'order' => 20), array('title' => 'VAT Number','slug' => 'vat-number','type' => array('value' => 'text', 'label' => 'Text'),'label' => 'VAT Number','placeholder' => 'ES12345678','position' => 'before','width' => 'full','required' => 0,'order' => 30,'help' => 'Optional for private customers.'), array('title' => 'Business Type','slug' => 'business-type','type' => array('value' => 'select', 'label' => 'Select'),'label' => 'Business Type','position' => 'before','width' => 'full','required' => 1,'order' => 40,'choices' => \"retail : Retail\\ndigital-products : Digital Products\\nservices : Services\\nwholesale : Wholesale\"), array('title' => 'Preferred Contact Method','slug' => 'preferred-contact-method','type' => array('value' => 'radio', 'label' => 'Radio'),'label' => 'Preferred Contact Method','position' => 'after','width' => 'full','required' => 1,'order' => 50,'choices' => \"email : Email\\nphone : Phone\"), array('title' => 'About Your Store','slug' => 'about-your-store','type' => array('value' => 'textarea', 'label' => 'Textarea'),'label' => 'Tell us more about your store','placeholder' => 'Tell us a little about your business or the products you sell...','position' => 'after','width' => 'full','required' => 0,'order' => 60), array('title' => 'Protected Message','slug' => 'protected-message','type' => array('value' => 'content', 'label' => 'Content'),'label' => 'Protected with Google reCAPTCHA','position' => 'after','width' => 'full','required' => 0,'order' => 70)); foreach ($fields as $field) { $field_id = wp_insert_post(array('post_type' => $cpt,'post_status' => 'publish','post_title' => $field['title'],'post_name' => $field['slug'],'menu_order' => $field['order'])); if ($field_id && !is_wp_error($field_id)) { update_post_meta($field_id, 'scrf_active', 1); update_post_meta($field_id, 'scrf_field_type', $field['type']); update_post_meta($field_id, 'scrf_field_label', $field['label']); update_post_meta($field_id, 'scrf_placeholder', $field['placeholder'] ?? ''); update_post_meta($field_id, 'scrf_help_text', $field['help'] ?? ''); update_post_meta($field_id, 'scrf_field_position', $field['position']); update_post_meta($field_id, 'scrf_field_width', $field['width']); update_post_meta($field_id, 'scrf_required', $field['required']); if (!empty($field['choices'])) { update_post_meta($field_id, 'scrf_choices', $field['choices']); } } } ?>"
    }
  ]
}