forked from aubreypwd-old/wordpress-themereview-vvv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vvv-init.sh
147 lines (110 loc) · 3.44 KB
/
vvv-init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
/home/vagrant/bin/xdebug_off
# for multiple usage
BASE=$(basename $(pwd) )
DBNAME="wordpress_"${BASE//[^[:alnum:]]/}
echo "Database: "$DBNAME
# If we delete htdocs, let's just start over.
if [ ! -d htdocs ]
then
mkdir htdocs
cd htdocs
# **
# Database
# **
# Create the database over again.
mysql -u root --password=root -e "DROP DATABASE IF EXISTS "$DBNAME
mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS "$DBNAME
mysql -u root --password=root -e "GRANT ALL PRIVILEGES ON "$DBNAME".* TO wp@localhost IDENTIFIED BY 'wp';"
# **
# WordPress
# **
# Download WordPress
wp core download
# Install WordPress.
wp core config --dbname=$DBNAME --dbuser=wp --dbpass=wp --dbhost="localhost" --extra-php <<PHP
define( 'WP_DEBUG', true );
// Enable Pods Developer Preview features
define( "PODS_DEVELOPER", true );
// Enable Pods GitHub updates
define( "PODS_GITHUB_UPDATE", true );
define( 'GITHUB_UPDATER_EXTENDED_NAMING', true );
// Enable Pods debugging and strict debugging (mu plugin)
define( "PODS_DEBUG", true );
// Disable Debug logging to the /wp-content/debug.log file
define( "WP_DEBUG_LOG", false );
// Force display of errors and warnings
define( "WP_DEBUG_DISPLAY", true );
@ini_set( "display_errors", 1 );
// Enable Save Queries
define( "SAVEQUERIES", true );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( "SCRIPT_DEBUG", true );
// Set Jetpack to Debug
define( "JETPACK_DEV_DEBUG", true );
PHP
# Install into DB
wp core install --url=pods.wordpress.dev --title=$BASE --admin_user=admin --admin_password=password --admin_email=changme@changeme.com
# **
# Your themes
# **
for i in `ls ../*.zip`
do
wp theme install $i
done
# **
# # Plugins
# **
wp plugin install wordpress-importer --activate
wp plugin install developer
wp plugin install what-the-file --activate
wp plugin install wordpress-database-reset --activate
wp plugin install query-monitor --activate
wp plugin install debug-bar-console --activate
wp plugin install debug-bar-cron --activate
wp plugin install debug-bar-extender --activate
wp plugin install debug-bar-constants
wp plugin install debug-bar-post-types --activate
wp plugin install debug-bar-shortcodes
wp plugin install tdd-debug-bar-post-meta --activate
wp plugin install rewrite-rules-inspector --activate
wp plugin install log-deprecated-notices --activate
wp plugin install log-viewer --activate
wp plugin install monster-widget
wp plugin install user-switching
wp plugin install simply-show-ids --activate
wp plugin install wordpress-beta-tester
wp plugin install https://github.com/afragen/github-updater/archive/5.1.1.zip --activate
# **
# Unit Data
# **
# Import the unit data.
curl -O https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml
wp import theme-unit-test-data.xml --authors=create
rm theme-unit-test-data.xml
# Replace url from unit data
wp search-replace 'wpthemetestdata.wordpress.com' 'pods.wordpress.dev' --skip-columns=guid
cd wp-content/plugins
git clone https://github.com/pods-framework/pods
cd ../../../
else
cd htdocs/
# Updates
if $(wp core is-installed); then
# Update WordPress.
wp core update
wp core update-db
# Update Plugins
wp plugin update --all --skip-plugins=pods
# **
# Your themes
# **
for i in `ls ../*.zip`
do
wp theme install $i
done
fi
cd ..
fi
# Enable debugging per default
/home/vagrant/bin/xdebug_on