11#! /bin/bash
22set -eox pipefail
33
4+ echo " === SETUP.SH DEBUG ==="
5+ echo " Current working directory:"
6+ pwd
7+ echo " "
8+
9+ echo " WordPress themes directory contents:"
10+ ls -la /var/www/html/wp-content/themes/ || echo " Could not list themes directory"
11+ echo " "
12+
13+ echo " Checking for hello-elementor theme specifically:"
14+ if [ -d " /var/www/html/wp-content/themes/hello-elementor" ]; then
15+ echo " ✅ hello-elementor directory found"
16+ echo " Contents:"
17+ ls -la /var/www/html/wp-content/themes/hello-elementor/ | head -10
18+ echo " "
19+
20+ echo " Checking for style.css:"
21+ if [ -f " /var/www/html/wp-content/themes/hello-elementor/style.css" ]; then
22+ echo " ✅ style.css found"
23+ echo " Theme header:"
24+ head -10 /var/www/html/wp-content/themes/hello-elementor/style.css
25+ else
26+ echo " ❌ style.css missing"
27+ fi
28+ else
29+ echo " ❌ hello-elementor directory not found"
30+ echo " Available theme directories:"
31+ ls -la /var/www/html/wp-content/themes/
32+ fi
33+ echo " "
34+
435wp plugin activate elementor
5- wp theme activate hello-theme
36+ echo " Available themes (via WP-CLI):"
37+ wp theme list
38+ echo " "
39+
40+ echo " Attempting to activate hello-theme theme..."
41+ wp theme activate hello-theme || {
42+ echo " ❌ Failed to activate hello-theme, trying hello-elementor..."
43+ wp theme activate hello-elementor || {
44+ echo " ❌ Both activation attempts failed. Final theme list:"
45+ wp theme list
46+ echo " ❌ Available theme directories in WordPress:"
47+ ls -la /var/www/html/wp-content/themes/
48+ echo " ❌ Theme activation completely failed"
49+ exit 1
50+ }
51+ }
652
7- WP_CLI_CONFIG_PATH=hello-theme -config/wp-cli.yml wp rewrite structure ' /%postname%/' --hard
53+ WP_CLI_CONFIG_PATH=hello-elementor -config/wp-cli.yml wp rewrite structure ' /%postname%/' --hard
854
955# Remove the Guttenberg welcome guide popup
1056wp user meta add admin wp_persisted_preferences ' a:2:{s:14:\"core/edit-post\";a:2:{b:1;s:12:\"welcomeGuide\";b:0;}}'
@@ -17,8 +63,8 @@ wp option set elementor_onboarded true
1763
1864# Add user meta so the announcement popup will not be displayed - ED-9723
1965for id in $( wp user list --field=ID)
20- do wp user meta add " $id " " announcements_user_counter" 999
21- wp user meta add " $id " " elementor_onboarded" " a:1:{s:27:\" ai-get-started-announcement\" ;b:1;}"
66+ do wp user meta add " $id " " announcements_user_counter" 999
67+ wp user meta add " $id " " elementor_onboarded" " a:1:{s:27:\" ai-get-started-announcement\" ;b:1;}"
2268done
2369
2470wp cache flush
0 commit comments