forked from littlebizzy/slickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathss-muplugs.txt
290 lines (266 loc) · 14.7 KB
/
ss-muplugs.txt
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
#!/bin/bash
#############################################################
#### author: SlickStack #####################################
#### link: https://slickstack.io ############################
#### mirror: http://mirrors.slickstack.io/ss-muplugs.txt ####
#### path: /var/www/ss-muplugs ##############################
#### destination: n/a #######################################
#### purpose: installs various WordPress mu-plugins #########
#### ss version: SlickStack alpha ss4a ######################
#### module version: n/a ####################################
#############################################################
## slickstack config ##
source /var/www/ss-config
## ensure mu-plugins directory exists ##
mkdir /var/www/html/wp-content/mu-plugins
######################################################
#### install slickstack mu-plugins and autoloader ####
######################################################
## delete tmp files (mu-plugins) ##
rm -R -f /tmp/autoloader*
rm -R -f /tmp/cloudflare*
rm -R -f /tmp/clear-caches*
rm -R -f /tmp/custom-functions*
rm -R -f /tmp/dashboard-cleanup*
rm -R -f /tmp/delete-expired-transients*
rm -R -f /tmp/disable-attachment-pages*
rm -R -f /tmp/disable-embeds*
rm -R -f /tmp/disable-emojis*
rm -R -f /tmp/disable-empty-trash*
rm -R -f /tmp/disable-gutenberg*
rm -R -f /tmp/disable-image-compression*
rm -R -f /tmp/disable-post-via-email*
rm -R -f /tmp/disable-xml-rpc*
rm -R -f /tmp/error-log-monitor*
rm -R -f /tmp/force-https*
rm -R -f /tmp/force-strong-hashing*
rm -R -f /tmp/header-cleanup*
rm -R -f /tmp/index-autoload*
rm -R -f /tmp/limit-heartbeat*
rm -R -f /tmp/maintenance-mode*
rm -R -f /tmp/minify-html*
rm -R -f /tmp/object-cache*
rm -R -f /tmp/plugin-blacklist*
rm -R -f /tmp/remove-query-strings*
rm -R -f /tmp/server-status*
rm -R -f /tmp/sftp-details*
rm -R -f /tmp/virtual-robotstxt*
## download latest mu-plugins ##
cd /tmp/
wget --no-cache http://mirrors.slickstack.io/mu-plugins/autoloader.txt
wget --no-cache http://mirrors.slickstack.io/mu-plugins/clear-caches.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/cloudflare.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/custom-functions.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/dashboard-cleanup.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/delete-expired-transients.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-attachment-pages.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-embeds.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-emojis.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-empty-trash.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-gutenberg.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-image-compression.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-post-via-email.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/disable-xml-rpc.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/error-log-monitor.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/force-https.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/force-strong-hashing.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/header-cleanup.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/index-autoload.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/limit-heartbeat.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/maintenance-mode.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/minify-html.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/plugin-blacklist.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/remove-query-strings.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/server-status.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/sftp-details.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/virtual-robotstxt.zip
wget --no-cache http://mirrors.slickstack.io/mu-plugins/xxx-notices.txt
## download latest drop-in plugins ##
wget --no-cache http://mirrors.slickstack.io/wordpress/object-cache.txt
## rename files ##
cd /tmp/
mv autoloader.txt autoloader.php
mv object-cache.txt object-cache.php
mv xxx-notices.txt xxx-notices.php
## unzip files ##
cd /tmp/
unzip /tmp/clear-caches.zip
unzip /tmp/cloudflare.zip
unzip /tmp/custom-functions.zip
unzip /tmp/dashboard-cleanup.zip
unzip /tmp/delete-expired-transients.zip
unzip /tmp/disable-attachment-pages.zip
unzip /tmp/disable-embeds.zip
unzip /tmp/disable-emojis.zip
unzip /tmp/disable-empty-trash.zip
unzip /tmp/disable-gutenberg.zip
unzip /tmp/disable-image-compression.zip
unzip /tmp/disable-post-via-email.zip
unzip /tmp/disable-xml-rpc.zip
unzip /tmp/error-log-monitor.zip
unzip /tmp/force-https.zip
unzip /tmp/force-strong-hashing.zip
unzip /tmp/header-cleanup.zip
unzip /tmp/index-autoload.zip
unzip /tmp/limit-heartbeat.zip
unzip /tmp/maintenance-mode.zip
unzip /tmp/minify-html.zip
unzip /tmp/plugin-blacklist.zip
unzip /tmp/remove-query-strings.zip
unzip /tmp/server-status.zip
unzip /tmp/sftp-details.zip
unzip /tmp/virtual-robotstxt.zip
## delete plugins instances ##
rm -R -f /var/www/html/wp-content/plugins/autoloader*
rm -R -f /var/www/html/wp-content/plugins/clear-caches*
rm -R -f /var/www/html/wp-content/plugins/cloudflare*
rm -R -f /var/www/html/wp-content/plugins/cf-littlebizzy*
rm -R -f /var/www/html/wp-content/plugins/custom-functions*
rm -R -f /var/www/html/wp-content/plugins/dashboard-cleanup*
rm -R -f /var/www/html/wp-content/plugins/delete-expired-transients*
rm -R -f /var/www/html/wp-content/plugins/disable-attachment-pages*
rm -R -f /var/www/html/wp-content/plugins/disable-embeds*
rm -R -f /var/www/html/wp-content/plugins/disable-emojis*
rm -R -f /var/www/html/wp-content/plugins/disable-empty-trash*
rm -R -f /var/www/html/wp-content/plugins/disable-gutenberg*
rm -R -f /var/www/html/wp-content/plugins/disable-image-compression*
rm -R -f /var/www/html/wp-content/plugins/disable-post-via-email*
rm -R -f /var/www/html/wp-content/plugins/disable-xml-rpc*
rm -R -f /var/www/html/wp-content/plugins/error-log-monitor*
rm -R -f /var/www/html/wp-content/plugins/force-https*
rm -R -f /var/www/html/wp-content/plugins/force-strong-hashing*
rm -R -f /var/www/html/wp-content/plugins/header-cleanup*
rm -R -f /var/www/html/wp-content/plugins/index-autoload*
rm -R -f /var/www/html/wp-content/plugins/limit-heartbeat*
rm -R -f /var/www/html/wp-content/plugins/maintenance-mode*
rm -R -f /var/www/html/wp-content/plugins/minify-html*
rm -R -f /var/www/html/wp-content/plugins/object-cache*
rm -R -f /var/www/html/wp-content/plugins/plugin-blacklist*
rm -R -f /var/www/html/wp-content/plugins/remove-query-strings*
rm -R -f /var/www/html/wp-content/plugins/server-status*
rm -R -f /var/www/html/wp-content/plugins/sftp-details*
rm -R -f /var/www/html/wp-content/plugins/virtual-robotstxt*
rm -R -f /var/www/html/wp-content/plugins/xxx-notices*
## delete mu-plugins instances ##
rm -R -f /var/www/html/wp-content/mu-plugins/*
rm -R -f /var/www/html/wp-content/mu-plugins/autoloader*
rm -R -f /var/www/html/wp-content/mu-plugins/clear-caches*
rm -R -f /var/www/html/wp-content/mu-plugins/cloudflare*
rm -R -f /var/www/html/wp-content/mu-plugins/cf-littlebizzy*
rm -R -f /var/www/html/wp-content/mu-plugins/custom-functions*
rm -R -f /var/www/html/wp-content/mu-plugins/dashboard-cleanup*
rm -R -f /var/www/html/wp-content/mu-plugins/delete-expired-transients*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-attachment-pages*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-embeds*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-emojis*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-empty-trash*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-gutenberg*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-image-compression*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-post-via-email*
rm -R -f /var/www/html/wp-content/mu-plugins/disable-xml-rpc*
rm -R -f /var/www/html/wp-content/mu-plugins/error-log-monitor*
rm -R -f /var/www/html/wp-content/mu-plugins/force-https*
rm -R -f /var/www/html/wp-content/mu-plugins/force-strong-hashing*
rm -R -f /var/www/html/wp-content/mu-plugins/header-cleanup*
rm -R -f /var/www/html/wp-content/mu-plugins/index-autoload*
rm -R -f /var/www/html/wp-content/mu-plugins/limit-heartbeat*
rm -R -f /var/www/html/wp-content/mu-plugins/maintenance-mode*
rm -R -f /var/www/html/wp-content/mu-plugins/minify-html*
rm -R -f /var/www/html/wp-content/mu-plugins/object-cache*
rm -R -f /var/www/html/wp-content/mu-plugins/plugin-blacklist*
rm -R -f /var/www/html/wp-content/mu-plugins/remove-query-strings*
rm -R -f /var/www/html/wp-content/mu-plugins/server-status*
rm -R -f /var/www/html/wp-content/mu-plugins/sftp-details*
rm -R -f /var/www/html/wp-content/mu-plugins/virtual-robotstxt*
rm -R -f /var/www/html/wp-content/mu-plugins/xxx-notices*
## copy mu-plugins to the mu-plugins directory ##
cp -R -f -d --no-preserve=mode,ownership /tmp/autoloader.php /var/www/html/wp-content/mu-plugins/autoloader.php
cp -R -f -d --no-preserve=mode,ownership /tmp/clear-caches /var/www/html/wp-content/mu-plugins/clear-caches
cp -R -f -d --no-preserve=mode,ownership /tmp/cloudflare /var/www/html/wp-content/mu-plugins/cloudflare
cp -R -f -d --no-preserve=mode,ownership /tmp/custom-functions /var/www/html/wp-content/mu-plugins/custom-functions
cp -R -f -d --no-preserve=mode,ownership /tmp/dashboard-cleanup /var/www/html/wp-content/mu-plugins/dashboard-cleanup
cp -R -f -d --no-preserve=mode,ownership /tmp/delete-expired-transients /var/www/html/wp-content/mu-plugins/delete-expired-transients
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-attachment-pages /var/www/html/wp-content/mu-plugins/disable-attachment-pages
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-embeds /var/www/html/wp-content/mu-plugins/disable-embeds
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-emojis /var/www/html/wp-content/mu-plugins/disable-emojis
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-empty-trash /var/www/html/wp-content/mu-plugins/disable-empty-trash
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-gutenberg /var/www/html/wp-content/mu-plugins/disable-gutenberg
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-image-compression /var/www/html/wp-content/mu-plugins/disable-image-compression
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-post-via-email /var/www/html/wp-content/mu-plugins/disable-post-via-email
cp -R -f -d --no-preserve=mode,ownership /tmp/disable-xml-rpc /var/www/html/wp-content/mu-plugins/disable-xml-rpc
cp -R -f -d --no-preserve=mode,ownership /tmp/error-log-monitor /var/www/html/wp-content/mu-plugins/error-log-monitor
cp -R -f -d --no-preserve=mode,ownership /tmp/force-https /var/www/html/wp-content/mu-plugins/force-https
cp -R -f -d --no-preserve=mode,ownership /tmp/force-strong-hashing /var/www/html/wp-content/mu-plugins/force-strong-hashing
cp -R -f -d --no-preserve=mode,ownership /tmp/header-cleanup /var/www/html/wp-content/mu-plugins/header-cleanup
cp -R -f -d --no-preserve=mode,ownership /tmp/index-autoload /var/www/html/wp-content/mu-plugins/index-autoload
cp -R -f -d --no-preserve=mode,ownership /tmp/limit-heartbeat /var/www/html/wp-content/mu-plugins/limit-heartbeat
cp -R -f -d --no-preserve=mode,ownership /tmp/maintenance-mode /var/www/html/wp-content/mu-plugins/maintenance-mode
cp -R -f -d --no-preserve=mode,ownership /tmp/minify-html /var/www/html/wp-content/mu-plugins/minify-html
cp -R -f -d --no-preserve=mode,ownership /tmp/plugin-blacklist /var/www/html/wp-content/mu-plugins/plugin-blacklist
cp -R -f -d --no-preserve=mode,ownership /tmp/remove-query-strings /var/www/html/wp-content/mu-plugins/remove-query-strings
cp -R -f -d --no-preserve=mode,ownership /tmp/server-status /var/www/html/wp-content/mu-plugins/server-status
cp -R -f -d --no-preserve=mode,ownership /tmp/sftp-details /var/www/html/wp-content/mu-plugins/sftp-details
cp -R -f -d --no-preserve=mode,ownership /tmp/virtual-robotstxt /var/www/html/wp-content/mu-plugins/virtual-robotstxt
cp -R -f -d --no-preserve=mode,ownership /tmp/xxx-notices.php /var/www/html/wp-content/mu-plugins/xxx-notices.php
## delete drop-in plugin instances ##
rm -R -f /var/www/html/wp-content/object-cache*
## copy drop-ins to the wp-content directory ##
cp -R -f -d --no-preserve=mode,ownership /tmp/object-cache.php /var/www/html/wp-content/object-cache.php
## delete tmp files ##
rm -R -f /tmp/autoloader*
rm -R -f /tmp/cloudflare*
rm -R -f /tmp/clear-caches*
rm -R -f /tmp/custom-functions*
rm -R -f /tmp/dashboard-cleanup*
rm -R -f /tmp/delete-expired-transients*
rm -R -f /tmp/disable-attachment-pages*
rm -R -f /tmp/disable-embeds*
rm -R -f /tmp/disable-emojis*
rm -R -f /tmp/disable-empty-trash*
rm -R -f /tmp/disable-gutenberg*
rm -R -f /tmp/disable-image-compression*
rm -R -f /tmp/disable-post-via-email*
rm -R -f /tmp/disable-xml-rpc*
rm -R -f /tmp/error-log-monitor*
rm -R -f /tmp/force-https*
rm -R -f /tmp/force-strong-hashing*
rm -R -f /tmp/header-cleanup*
rm -R -f /tmp/index-autoload*
rm -R -f /tmp/limit-heartbeat*
rm -R -f /tmp/maintenance-mode*
rm -R -f /tmp/minify-html*
rm -R -f /tmp/object-cache*
rm -R -f /tmp/plugin-blacklist*
rm -R -f /tmp/remove-query-strings*
rm -R -f /tmp/server-status*
rm -R -f /tmp/sftp-details*
rm -R -f /tmp/virtual-robotstxt*
#####################################################################
#### (re)input relevant variables to /var/www/html/wp-config.php ####
#####################################################################
## delete old sftp details configuration lines ##
sed -i '/SFTP_DETAILS_SERVER/d' /var/www/html/wp-config.php
## replace sftp details placeholders ##
sed -i "s/@SFTPDETAILSUSER/${user}/g" /var/www/html/wp-config.php
sed -i "s/@SFTPDETAILSPASSWORD/${userpass}/g" /var/www/html/wp-config.php
sed -i "s/@SFTPDETAILSPORT/${userport}/g" /var/www/html/wp-config.php
sed -i "s#@SFTPDETAILSROOT#${userroot}#g" /var/www/html/wp-config.php
sed -i "s#@SFTPDETAILSPUBLIC#${userpublic}#g" /var/www/html/wp-config.php
## replace cloudflare placeholders ##
sed -i "s/@CLOUDFLAREAPIKEY/${cloudflareapikey}/g" /var/www/html/wp-config.php
sed -i "s/@CLOUDFLAREAPIEMAIL/${cloudflareapiemail}/g" /var/www/html/wp-config.php
##### echo '
#### ## source Bash completion file for WP-CLI ##
##### source /home/wp-completion.bash' >> /home/${sudo}/.bashrc
################################################
#### reset permissions and restart services ####
################################################
## reset mu-plugins permissions ##
chown -R www-data:wordpress /var/www/html/wp-content/mu-plugins
find /var/www/html/wp-content/mu-plugins/ -type d -exec chmod 775 {} \;
find /var/www/html/wp-content/mu-plugins/ -type f -exec chmod 664 {} \;
## reset drop-in plugins permissions ##
chown -R www-data:wordpress /var/www/html/wp-content/object-cache.php
chmod 664 /var/www/html/wp-content/object-cache.php
## restart services ##
/etc/init.d/php7.2-fpm restart