\app\public\wp-content\themes\asterion-bricks" ` * -Target "C:\ASTERION\GIT\WP2026\wp-content\themes\asterion-bricks" * 3. Extract ThirdParty/bricks.X.Y.Z.zip into the LocalWP themes/ folder. * 4. Extract ThirdParty/sitepress-multilingual-cms.X.Y.Z.zip into plugins/. * 5. If the new port is NOT 10004, edit the AV_TARGET_HOME constant below. * 6. Copy this file to \app\public\wp-content\mu-plugins\. * 7. Visit http://localhost:/ once — the plugin runs and self-deletes. * * What it sets up * --------------- * - WP_HOME / WP_SITEURL options pointing at localhost: * - Permalinks /%postname%/ * - Activates Bricks parent + Asterion Bricks child theme (bricks-bricks-child) * - Activates WPML core * - Configures Bricks postTypes = ['page', 'post', 'case_study', 'scenario'] * - Sets the WP timezone to Europe/Paris and locale to en_US (default) * * What it does NOT do (do these manually in WP admin) * --------------------------------------------------- * - Bricks license activation (Bricks → License → paste your key) * - WPML license + setup wizard (WPML → Setup → EN default + FR + directories) * - Bricks Theme Styles (Bricks → Theme Styles → align with tokens.css) * - Build of the Header / Footer / archive Bricks Templates * * @package AsterionBricks * @since 0.2.0 */ defined('ABSPATH') || exit; // Hardcode the target site URL. Adjust if LocalWP allocated a different port. define('AV_TARGET_HOME', 'http://localhost:10004'); add_action('init', function () { if (get_option('av_fresh_setup_done') === '1') { $self = __FILE__; add_action('shutdown', function () use ($self) { if (file_exists($self)) { @unlink($self); } }); return; } $log = []; // 1. Site URL + home (avoids the localhost:port → / 301 cache trap) update_option('siteurl', AV_TARGET_HOME); update_option('home', AV_TARGET_HOME); $log[] = "Set siteurl/home to " . AV_TARGET_HOME; // 2. Pretty permalinks (required for /customers/ /scenarios/ slugs and WPML) if (get_option('permalink_structure') !== '/%postname%/') { update_option('permalink_structure', '/%postname%/'); $log[] = "Set permalink_structure to /%postname%/"; } // 3. Timezone + WP locale defaults update_option('timezone_string', 'Europe/Paris'); if (get_locale() !== 'en_US') { update_option('WPLANG', 'en_US'); } // 4. Activate Bricks child theme (its parent Bricks must be present) $themes = wp_get_themes(); if (isset($themes['bricks']) && isset($themes['asterion-bricks'])) { if (get_option('stylesheet') !== 'asterion-bricks') { switch_theme('asterion-bricks'); $log[] = "Switched theme to asterion-bricks (parent: bricks)"; } } else { $missing = []; if (! isset($themes['bricks'])) $missing[] = 'bricks (parent)'; if (! isset($themes['asterion-bricks'])) $missing[] = 'asterion-bricks (child junction)'; $log[] = "Theme NOT switched. Missing: " . implode(', ', $missing); } // 5. Activate WPML core if (! function_exists('is_plugin_active')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $wpml_main = 'sitepress-multilingual-cms/sitepress.php'; if (file_exists(WP_PLUGIN_DIR . '/' . $wpml_main)) { if (! is_plugin_active($wpml_main)) { $result = activate_plugin($wpml_main, '', false, true); $log[] = is_wp_error($result) ? 'WPML activation FAILED: ' . $result->get_error_message() : 'WPML activated'; } else { $log[] = 'WPML already active'; } } else { $log[] = "WPML not found at plugins/{$wpml_main}"; } // 6. Bricks: enable Page/Post/CPT in Builder access > postTypes if (defined('BRICKS_DB_GLOBAL_SETTINGS')) { $settings = get_option(BRICKS_DB_GLOBAL_SETTINGS, []); $settings['postTypes'] = ['page', 'post', 'case_study', 'scenario']; update_option(BRICKS_DB_GLOBAL_SETTINGS, $settings); $log[] = "Bricks postTypes set to page/post/case_study/scenario"; } else { $log[] = "Bricks not loaded yet — re-run by visiting the site once Bricks is active"; } // 7. Flush rewrite rules so the new permalink structure takes effect flush_rewrite_rules(); update_option('av_fresh_setup_done', '1', false); update_option('av_fresh_setup_log', $log, false); }, 50);