forked from littlebizzy/slickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathss-clean-files.txt
1551 lines (1417 loc) · 94.2 KB
/
ss-clean-files.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
####################################################################################################
#### author: SlickStack ############################################################################
#### link: https://slickstack.io ###################################################################
#### mirror: https://mirrors.slickstack.io/bash/ss-clean-files.txt #################################
#### path: /var/www/ss-clean-files #################################################################
#### destination: n/a (not a boilerplate) ##########################################################
#### purpose: Cleans up various unsafe and unnecessary files on the SlickStack server ##############
#### module version: Ubuntu 22.04 LTS ##############################################################
#### sourced by: n/a ###############################################################################
#### bash aliases: ss clean files, ss cleanup files ################################################
####################################################################################################
## CERTAIN UNSAFE FILES WILL BE FORCE DELETED REGARDLESS OF YOUR SLICKSTACK SETTINGS ##
## SS-CLEAN-FILES DOES NOT PERFORM ANY MALWARE SCANNING (USE SS-SCAN-MALWARE) ##
####################################################################################################
#### TABLE OF CONTENTS (SS-Clean-Files) ############################################################
####################################################################################################
## this is a brief summary of the different code snippets you will find in this script ##
## each section should be commented so you understand what is being accomplished ##
## A. Source SS-Config + SS-Functions
## B. Touch Timestamp File
## C. Message (Begin Script)
## D. Delete SSH Private Key (If Exists)
## E. Delete Bash Command History
## F. Delete Staging Site Files (Conditional)
## G. Delete MySQL Data Folder Backups
## H. Delete Oldest SS-Config Backups
## I. Delete Deprecated WordPress MU Plugins
## J. Delete Deprecated Bash Scripts
## K. Delete Deprecated SlickStack Files
## L. Delete Unused WordPress Core Files
## J. Delete Junk Linux System Files
## L. Delete Certain Files Throughout Public Web Root (Required)
## L. Delete Certain Files In WordPress Content Directory
## L. Delete Certain WordPress Plugins (Required)
## M. Delete Junk Files In WordPress Plugins Directory
## N. Delete Junk Files In WordPress Themes Directory
## Purge Cache (PHP OPcache)
## Reset Permissions (SlickStack Scripts)
####################################################################################################
#### A. SS-Clean-Files: Source SS-Config + SS-Functions ############################################
####################################################################################################
## before anything else we must source the critical variables that power this script ##
## ss-config is setup during ss-install wizard but ss-functions is hardcoded ##
## source ss-config ##
source /var/www/ss-config
## source ss-functions ##
source /var/www/ss-functions
## BELOW THIS RELIES ON SS-CONFIG AND SS-FUNCTIONS
####################################################################################################
#### B. SS-Clean-Files: Touch Timestamp File #######################################################
####################################################################################################
## this is a dummy timestamp file that will remember the last time this script was run ##
## it can be useful for developer reference and is sometimes used by SlickStack ##
## script timestamp ##
ss_touch "${TIMESTAMP_SS_CLEAN_FILES}"
####################################################################################################
#### C. SS-Clean-Files: Message (Begin Script) #####################################################
####################################################################################################
## this is a simple message that announces to the shell the purpose of this bash script ##
## it will only be noticed by sudo users who manually call ss core bash scripts ##
## echo message ##
ss_echo "${COLOR_INFO}Running ss-clean-files... ${COLOR_RESET}"
####################################################################################################
#### D. SS-Clean-Files: Delete SSH Private Key (If Exists) #########################################
####################################################################################################
## this will delete the private SSH key generated by SlickStack if found on the server ##
## it is briefly displayed via ss-stack-overview after ss-install first runs ##
## delete private key if more than 6 hours old ##
if [[ -n $(find "${PATH_SSH_PRIVATE_KEY_FILE}" -amin +360) ]]; then
ss_rm "${PATH_SSH_PRIVATE_KEY_FILE}"
fi
####################################################################################################
#### E. SS-Clean-Files: Delete Bash Command History ################################################
####################################################################################################
## many sensitive data items like passwords are often saved indefinitely in Bash history ##
## this command will erase the Bash history file contents for better security ##
## null bash history ##
ss_null /home/"${SFTP_USER}"/.bash_history
ss_null /home/"${SUDO_USER}"/.bash_history
ss_null /root/.bash_history
####################################################################################################
#### F. SS-Clean-Files: Delete Staging Site Files (Conditional) ####################################
####################################################################################################
## this will delete any staging files and folders in case STAGING_SITE is set to false ##
## to avoid data loss we never delete dev files since they are standalone sites ##
## delete staging site files ##
if [[ "${STAGING_SITE}" == "false" ]]; then
ss_rm /var/www/html/staging
fi
####################################################################################################
#### G. SS-Clean-Files: Delete MySQL Data Folder Backups ###########################################
####################################################################################################
## by default SlickStack does not backup the MySQL data folder since it is often too big ##
## to clear disk space we delete that folder here if setting is not set to true ##
## delete mysql data backups ##
if [[ "${SS_DUMP_DATABASE_FILES}" != "true" ]]; then
ss_rm /var/www/backups/mysql/data
fi
####################################################################################################
#### H. SS-Clean-Files: Delete Oldest SS-Config Backups ############################################
####################################################################################################
## in order to rotate ss-config file backups we delete the oldest versions to clear space ##
## the newest intact backup of ss-config is auto-restored by SlickStack when needed ##
## delete oldest ss-config backups ##
find /var/www/backups/config -maxdepth 1 -name "ss-config.bak*" -type f -mtime +3 -delete
####################################################################################################
#### I. SS-Clean-Files: Delete Deprecated WordPress MU Plugins #####################################
####################################################################################################
## deleted deprecated mu plugins (production) ##
ss_rm /var/www/html/wp-content/mu-plugins/dashboard-cleanup*
ss_rm /var/www/html/wp-content/mu-plugins/delete-expired-transients*
ss_rm /var/www/html/wp-content/mu-plugins/disable-embeds*
ss_rm /var/www/html/wp-content/mu-plugins/disable-gutenberg*
ss_rm /var/www/html/wp-content/mu-plugins/error-log-monitor*
ss_rm /var/www/html/wp-content/mu-plugins/force-strong-hashing*
ss_rm /var/www/html/wp-content/mu-plugins/index-autoload*
ss_rm /var/www/html/wp-content/mu-plugins/limit-heartbeat*
ss_rm /var/www/html/wp-content/mu-plugins/minify-html*
ss_rm /var/www/html/wp-content/mu-plugins/redis-cache*
ss_rm /var/www/html/wp-content/mu-plugins/remove-query-strings*
ss_rm /var/www/html/wp-content/mu-plugins/server-status*
ss_rm /var/www/html/wp-content/mu-plugins/sftp-details*
ss_rm /var/www/html/wp-content/mu-plugins/virtual-robotstxt*
ss_rm /var/www/html/wp-content/mu-plugins/xxx-dev*
ss_rm /var/www/html/wp-content/mu-plugins/xxx-notices*
ss_rm /var/www/html/wp-content/mu-plugins/xxx-staging*
## deleted deprecated mu plugins (staging) ##
ss_rm /var/www/html/staging/wp-content/mu-plugins/dashboard-cleanup*
ss_rm /var/www/html/staging/wp-content/mu-plugins/delete-expired-transients*
ss_rm /var/www/html/staging/wp-content/mu-plugins/disable-embeds*
ss_rm /var/www/html/staging/wp-content/mu-plugins/disable-gutenberg*
ss_rm /var/www/html/staging/wp-content/mu-plugins/error-log-monitor*
ss_rm /var/www/html/staging/wp-content/mu-plugins/force-strong-hashing*
ss_rm /var/www/html/staging/wp-content/mu-plugins/index-autoload*
ss_rm /var/www/html/staging/wp-content/mu-plugins/limit-heartbeat*
ss_rm /var/www/html/staging/wp-content/mu-plugins/minify-html*
ss_rm /var/www/html/staging/wp-content/mu-plugins/redis-cache*
ss_rm /var/www/html/staging/wp-content/mu-plugins/remove-query-strings*
ss_rm /var/www/html/staging/wp-content/mu-plugins/server-status*
ss_rm /var/www/html/staging/wp-content/mu-plugins/sftp-details*
ss_rm /var/www/html/staging/wp-content/mu-plugins/virtual-robotstxt*
ss_rm /var/www/html/staging/wp-content/mu-plugins/xxx-dev*
ss_rm /var/www/html/staging/wp-content/mu-plugins/xxx-notices*
ss_rm /var/www/html/staging/wp-content/mu-plugins/xxx-staging*
## deleted deprecated mu plugins (developement) ##
ss_rm /var/www/html/dev/wp-content/mu-plugins/dashboard-cleanup*
ss_rm /var/www/html/dev/wp-content/mu-plugins/delete-expired-transients*
ss_rm /var/www/html/dev/wp-content/mu-plugins/disable-embeds*
ss_rm /var/www/html/dev/wp-content/mu-plugins/disable-gutenberg*
ss_rm /var/www/html/dev/wp-content/mu-plugins/error-log-monitor*
ss_rm /var/www/html/dev/wp-content/mu-plugins/force-strong-hashing*
ss_rm /var/www/html/dev/wp-content/mu-plugins/index-autoload*
ss_rm /var/www/html/dev/wp-content/mu-plugins/limit-heartbeat*
ss_rm /var/www/html/dev/wp-content/mu-plugins/minify-html*
ss_rm /var/www/html/dev/wp-content/mu-plugins/redis-cache*
ss_rm /var/www/html/dev/wp-content/mu-plugins/remove-query-strings*
ss_rm /var/www/html/dev/wp-content/mu-plugins/server-status*
ss_rm /var/www/html/dev/wp-content/mu-plugins/sftp-details*
ss_rm /var/www/html/dev/wp-content/mu-plugins/virtual-robotstxt*
ss_rm /var/www/html/dev/wp-content/mu-plugins/xxx-dev*
ss_rm /var/www/html/dev/wp-content/mu-plugins/xxx-notices*
ss_rm /var/www/html/dev/wp-content/mu-plugins/xxx-staging*
####################################################################################################
#### J. SS-Clean-Files: Delete Deprecated Bash Scripts #############################################
####################################################################################################
## delete deprecated bash scripts ##
ss_rm /var/www/0-crontab
ss_rm /var/www/1-cron-often
ss_rm /var/www/2-cron-regular
ss_rm /var/www/3-cron-hourly
ss_rm /var/www/3-cron-quarter-hourly
ss_rm /var/www/4-cron-half-hourly
ss_rm /var/www/4-cron-quarter-daily
ss_rm /var/www/5-cron-half-daily
ss_rm /var/www/5-cron-hourly
ss_rm /var/www/6-cron-daily
ss_rm /var/www/6-cron-quarter-daily
ss_rm /var/www/7-cron-half-daily
ss_rm /var/www/7-cron-weekly
ss_rm /var/www/8-cron-daily
ss_rm /var/www/8-cron-monthly
ss_rm /var/www/9-cron-half-weekly
ss_rm /var/www/9-cron-sometimes
ss_rm /var/www/00-crontab
ss_rm /var/www/01-cron-often
ss_rm /var/www/02-cron-regular
ss_rm /var/www/03-cron-quarter-hourly
ss_rm /var/www/04-cron-half-hourly
ss_rm /var/www/05-cron-hourly
ss_rm /var/www/06-cron-quarter-daily
ss_rm /var/www/07-cron-half-daily
ss_rm /var/www/08-cron-daily
ss_rm /var/www/09-cron-half-weekly
ss_rm /var/www/10-cron-weekly
ss_rm /var/www/11-cron-half-monthly
ss_rm /var/www/12-cron-monthly
ss_rm /var/www/13-cron-sometimes
ss_rm /var/www/ss-install-postfix
ss_rm /var/www/ss-install-redis
ss_rm /var/www/ss-install-php-core
ss_rm /var/www/ss-install-nginx-core
ss_rm /var/www/ss-install-magento-config
ss_rm /var/www/ss-install-magento-core
ss_rm /var/www/ss-install-mysql-core
ss_rm /var/www/ss-install-ufw-core
ss_rm /var/www/ss-perms-postfix
ss_rm /var/www/ss-perms-php-core
ss_rm /var/www/ss-perms-nginx-core
ss_rm /var/www/ss-perms-nginx
ss_rm /var/www/ss-perms-redis
ss_rm /var/www/ss-perms-mysql
ss_rm /var/www/ss-overview
ss_rm /var/www/ss-update
ss_rm /var/www/ss-update-packages
ss_rm /var/www/ss-remote
ss_rm /var/www/ss-dos2unix
ss_rm /var/www/ss-dos2unix-files
ss_rm /var/www/ss-encrypt
ss_rm /var/www/ss-reboot
ss_rm /var/www/ss-import
ss_rm /var/www/ss-perms-ufw
ss_rm /var/www/ss-perms-ufw-core
ss_rm /var/www/ss-monitor
ss_rm /var/www/ss-reset-logs
ss_rm /var/www/ss-restart-services
ss_rm /var/www/ss-restart-services-mysql
ss_rm /var/www/ss-restart-services-php
ss_rm /var/www/ss-restart-services-redis
ss_rm /var/www/ss-restart-services-nginx
ss_rm /var/www/ss-install-mysql
ss_rm /var/www/ss-install-ubuntu-swap
ss_rm /var/www/ss-install-php
ss_rm /var/www/ss-install-nginx
ss_rm /var/www/ss-install-ufw
ss_rm /var/www/ss-perms-php
ss_rm /var/www/ss-perms-nginx
ss_rm /var/www/ss-perms-ubuntu-swap
ss_rm /var/www/ss-purge
####################################################################################################
#### K. SS-Clean-Files: Delete Deprecated SlickStack Files #########################################
####################################################################################################
## as SlickStack evolves there are certain files that become irrelevant and not used ##
## for example bash scripts change names or config files change locations ##
## temp fix to delete files generated from empty variables in ss-config MU plugins ##
ss_rm /var/www/html/wp-content/mu-plugins/tmp* ## junk folder from before
## delete deprecated log files ##
ss_rm /var/www/logs/cron.log ## deprecated
ss_rm /var/www/logs/error.log ## now php-error.log
ss_rm /var/www/logs/nginx.log ## now nginx-error.log
## delete deprecated directories ##
ss_rm /etc/nginx/cache*
## deprecated (production) ##
ss_rm /var/www/html/wp-content/functions.php
ss_rm /var/www/html/staging/wp-content/functions.php
ss_rm /var/www/html/dev/wp-content/functions.php
## delete deprecated throwaway themes ##
ss_rm /var/www/html/wp-content/themes/throwaway*
ss_rm /var/www/html/staging/wp-content/themes/throwaway*
ss_rm /var/www/html/dev/wp-content/themes/throwaway*
## cleanup conflicting log files (SlickStack uses unique log paths) ##
ss_rm /var/log/fpm-php.www.log*
ss_rm /var/log/php7.0-fpm.log*
ss_rm /var/log/php7.1-fpm.log*
ss_rm /var/log/php7.2-fpm.log*
ss_rm /var/log/php-fpm/*
ss_rm /var/log/monit.log*
####################################################################################################
#### L. SS-Clean-Files: Delete Any Leftover WordPress Installation Files #########################################
####################################################################################################
## production ##
ss_rm /var/www/html/wordpress
ss_rm /var/www/html/wordpress.zip*
## staging ##
ss_rm /var/www/html/staging/wordpress
ss_rm /var/www/html/staging/wordpress.zip*
## development ##
ss_rm /var/www/html/dev/wordpress
ss_rm /var/www/html/dev/wordpress.zip*
####################################################################################################
#### L. SS-Clean-Files: Delete Unused WordPress Core Files #########################################
####################################################################################################
## partly for backwards compatibility (but also stubborness) WP Core retains these files ##
## none are critical yet they greatly hurt security thus SlickStack deletes them ##
## wordpress junk files (production) ##
ss_rm /var/www/html/readme.html*
ss_rm /var/www/html/license.txt*
ss_rm /var/www/html/licence.txt*
## wordpress junk files (staging) ##
ss_rm /var/www/html/staging/readme.html*
ss_rm /var/www/html/staging/license.txt*
ss_rm /var/www/html/staging/licence.txt*
## wordpress junk files (development) ##
ss_rm /var/www/html/dev/readme.html*
ss_rm /var/www/html/dev/license.txt*
ss_rm /var/www/html/dev/licence.txt*
## wordpress unused files (production) ##
ss_rm /var/www/html/wp-admin/install.php
ss_rm /var/www/html/wp-links-opml.php*
ss_rm /var/www/html/wp-mail.php*
ss_rm /var/www/html/wp-trackback.php*
ss_rm /var/www/html/xmlrpc.php*
## wordpress unused files (staging) ##
ss_rm /var/www/html/staging/wp-admin/install.php
ss_rm /var/www/html/staging/wp-links-opml.php*
ss_rm /var/www/html/staging/wp-mail.php*
ss_rm /var/www/html/staging/wp-trackback.php*
ss_rm /var/www/html/staging/xmlrpc.php*
## wordpress unused files (development) ##
ss_rm /var/www/html/dev/wp-admin/install.php
ss_rm /var/www/html/dev/wp-links-opml.php*
ss_rm /var/www/html/dev/wp-mail.php*
ss_rm /var/www/html/dev/wp-trackback.php*
ss_rm /var/www/html/dev/xmlrpc.php*
####################################################################################################
#### J. SS-Clean-Files: Delete Junk Linux System Files #############################################
####################################################################################################
## delete Ubuntu junk files ##
# ss_rm /tmp/systemd-*
# ss_rm /var/tmp/systemd-*
# find /var/backups/ -name "*.gz" -type f -delete
find /var/www/html/ -name "wget-log*" -type f -delete
# ss_rm /media*
## delete non-critical system logs ##
ss_rm /var/log/journal/*
## wget junk ##
find /var/www/html/ -name "wget-log*" -type f -delete
## linux logs ##
find /var/log/ -name "*.gz" -type f -delete
find /var/log/ -name "*.log.*" -type f -delete
## not linux move this ##
ss_rm /var/lib/mysql/binlog.*
####################################################################################################
#### SS-Clean-Files: Delete Any PHP Error Handling Hacks In WordPress Plugins + Themes #############
####################################################################################################
## an unfortunate feature of PHP is that scripts can override WP or server-level settings ##
## this set of commands safely removes any PHP error handling hacks from scripts ##
## CRASHES SOME PLUGINS
## replace this with WP Admin warning message if files found ##
# find /var/www/html/wp-content/mu-plugins -type f -name "*.php" -exec sed -i '/ini_set/d' {} \;
# find /var/www/html/wp-content/plugins -type f -name "*.php" -exec sed -i '/ini_set/d' {} \;
# find /var/www/html/wp-content/themes -type f -name "*.php" -exec sed -i '/ini_set/d' {} \;
# find /var/www/html/wp-content/mu-plugins -type f -name "*.php" -exec sed -i '/error_reporting/d' {} \;
# find /var/www/html/wp-content/plugins -type f -name "*.php" -exec sed -i '/error_reporting/d' {} \;
# find /var/www/html/wp-content/themes -type f -name "*.php" -exec sed -i '/error_reporting/d' {} \;
####################################################################################################
#### K. SS-Clean-Files: Cleanup SlickStack Core Files Under /var/www/ #################################
####################################################################################################
if [[ "$SS_CLEAN_FILES_ROOT_PRIVATE" != "false" ]]; then
## delete SlickStack leftovers ##
ss_rm /var/www/maintenance.txt
ss_rm /var/www/backups/html/export.tar.gz
# ss_rm /var/www/meta/.bash-aliases ## activate this soon
ss_rm /var/www/auth/shell
ss_rm /var/www/shell
ss_rm /var/www/meta/shell
ss_rm /var/www/meta/.ssh/authorized_keys
ss_rm /var/www/meta/.ssh
ss_rm /var/www/backups/mysql/wp.sql
ss_rm /etc/nginx/sites-available/*
ss_rm /etc/nginx/sites-enabled/*
ss_rm /home/${SUDO_USER}/.wp-cli/config.yml
ss_rm /root/.wp-cli/config.yml
ss_rm /var/www/meta/timestamps/ss-dos2unix-files.timestamp
ss_rm /var/www/meta/.ss ## folder from testing
ss_rm /var/www/meta/.timestamp*
ss_rm /var/www/meta/timestamps/.timestamp*
ss_rm /var/www/meta/archive
ss_rm /var/www/meta/archive/config
ss_rm /var/www/meta/archive/mysql
ss_rm /var/www/meta/archive/mysql/data
ss_rm /var/www/meta/wp.sql
ss_rm /var/www/meta/mysql.bak
ss_rm /var/www/meta/mysql-files.bak
ss_rm /var/www/meta/mysql-keyring.bak
ss_rm /var/www/meta/ss-config.bak*
ss_rm /var/www/sites/block-dev
ss_rm /var/www/sites/block-production
ss_rm /var/www/sites/block-staging
ss_rm /home/${SUDO_USER}/.bash-aliases
ss_rm /var/www/ss-perms-ad
ss_rm /tmp/dos2unix*
ss_rm /var/www/meta/.cherry*
ss_rm /var/ss-config*.bak*
ss_rm /var/www/'$'
ss_rm /var/www/ss
ss_rm /var/www/bash/ ## we decided to keep ss core scripts in /var/www/ for now (usability)
ss_rm /var/www/cron/ ## folder only
ss_rm /var/www/touch
ss_rm /var/www/tools
ss_rm /tmp/ss
ss_rm /home/$SUDO_USER/ss
ss_rm /home/$SFTP_USER/ss
ss_rm /root/ss
ss_rm /var/www/cache/fastcgi
ss_rm /var/www/meta/.timestamp-01-cron-regular*
ss_rm /var/www/meta/.timestamp-ss-restart
ss_rm /var/www/meta/.timestamp-ss-reset-password
ss_rm /var/www/meta/.timestamp-ss-scan
ss_rm /var/www/meta/.timestamp-ss-optimize
ss_rm /var/www/meta/.timestamp-ss-sync
ss_rm /var/www/meta/.timestamp-ss-dump
ss_rm /var/www/meta/.timestamp-ss-install-ubuntu-aliases
ss_rm /var/www/meta/.timestamp-ss-perms-ubuntu-aliases
ss_rm /var/www/meta/.timestamp-ss-clean
ss_rm /var/www/ss-install-aliases
ss_rm /var/www/ss-install-bash
ss_rm /var/www/ss-install-cron
ss_rm /var/www/ss-install-misc
ss_rm /var/www/ss-install-muplugins
ss_rm /var/www/ss-install-wordpress
ss_rm /var/www/ss-install-wpconfig
ss_rm /var/www/ss-install-wordp ## incomplete file
ss_rm /var/www/ss-install-ubuntu-aliases
ss_rm /var/www/ss-perms-ubuntu-aliases
ss_rm /var/www/ss-dump
ss_rm /var/www/ss-encrypt
ss_rm /var/www/ss-muplugs
ss_rm /var/www/ss-restart
ss_rm /var/www/ss-reset-password
ss_rm /var/www/ss-scan
ss_rm /var/www/ss-sync
ss_rm /var/www/ss-chec
ss_rm /var/www/ss-clean
ss_rm /var/www/ss-optimize
ss_rm /var/www/ss-purge-fcgi
ss_rm /var/www/monit.log
ss_rm /var/www/html/wp-completion.bash
ss_rm /var/www/meta/wp-completion.bash
ss_rm /var/www/meta/.wp-completion.bash
ss_rm /home/wp-completion.bash
ss_rm /home/${SUDO_USER}/config.yml
ss_rm /home/${SUDO_USER}/wp-cli.yml
# ss_rm /var/www/html/.wp-cli
# ss_rm /var/www/html/wp-cli
ss_rm /var/www/html/staging/staging*
ss_rm /var/www/logs/mysql.log
## cleanup ##
rm -v ~/secure_our_mysql.sh
## delete SlickStack junk files ##
find /var/www/ -name "*.save*" -type f -delete
ss_rm /var/www/wp.sql*
ss_rm /var/www/meta/myisam-tables.txt*
ss_rm /var/www/meta/myisam-tables.sql*
fi
####################################################################################################
#### L. SS-Clean-Files: Delete Certain Files Throughout Public Web Root (Required) #################
####################################################################################################
## this powerful snippet deletes several unsafe file types throughout the public dir ##
## these files will be permanently deleted regardless of where they are found ##
## delete known malware files ##
# find /var/www/html/ -name "script.php" -type f -delete
# find /var/www/html/ -name "licensed.php" -type f -delete
# find /var/www/html/ -name "apikey*.zip" -type f -delete
find /var/www/html/ -name "wp_ftp*.php" -type f -delete
find /var/www/html/ -name "wp-xmlrpc*.php" -type f -delete
find /var/www/html/ -name "zgepd_oddsd*.php" -type f -delete
find /var/www/html/ -name "index2*.php" -type f -delete
find /var/www/html/ -name "index_.php" -type f -delete
find /var/www/html/ -name "wp-counts*.php" -type f -delete
find /var/www/html/ -name "wp-interst*.php" -type f -delete
# find /var/www/html/ -name "idb.php" -type f -delete
# find /var/www/html/ -name "validate.php" -type f -delete
find /var/www/html/ -name "tbl_status.php" -type f -delete
find /var/www/html/ -name "wp_p.php" -type f -delete
find /var/www/html/ -name "temp-crawl*.php" -type f -delete
find /var/www/html/ -name "wp-crawl*.php" -type f -delete
# find /var/www/html/ -name "robots.php" -type f -delete
find /var/www/html/ -name "timthumb*.php" -type f -delete
# find /var/www/html/ -name "syslib.php" -type f -delete
find /var/www/html/ -name "settings_v2.php" -type f -delete
# find /var/www/html/ -name "minify.php" -type f -delete
find /var/www/html/ -name "wpsetting.php" -type f -delete
find /var/www/html/ -name "new_license.php" -type f -delete
find /var/www/html/ -name "site-site-icon-functions.php" -type f -delete
# find /var/www/html/ -name "wp-media.php" -type f -delete
find /var/www/html/ -name "wp-reset-*.php" -type f -delete
ss_rm /var/www/html/lte_
ss_rm /var/www/html/wp-domain.php
ss_rm /var/www/html/wp-main.php
ss_rm /var/www/html/wp-uti.php
ss_rm /var/www/html/wp.php
ss_rm /var/www/html/w.php
ss_rm /var/www/html/wp-sid.php
ss_rm /var/www/html/about.php
ss_rm /var/www/html/content.php
ss_rm /var/www/html/gank.php*
ss_rm /var/www/html/m3.php
ss_rm /var/www/html/mini.php
ss_rm /var/www/html/1index.php
ss_rm /var/www/html/baindex.php
ss_rm /var/www/html/hbf0oajf_index.php
ss_rm /var/www/html/*_index.php
ss_rm /var/www/html/kindex.php
ss_rm /var/www/html/mindex.php
ss_rm /var/www/html/wp-beckup.php
ss_rm /var/www/html/wikindex.php
ss_rm /var/www/html/wp-content/coment* ## also placed in /uploads/2020/ (etc) types of folders
ss_rm /var/www/html/wp-content/plugins/bots.txt*
ss_rm /var/www/html/wp-content/plugins/plug1*
ss_rm /var/www/html/wp-content/plugins/plug1-1*
ss_rm /var/www/html/wp-content/plugins/wpematico*
ss_rm /var/www/html/dev/wp-content/plugins/bots.txt*
ss_rm /var/www/html/dev/wp-content/plugins/plug1*
ss_rm /var/www/html/dev/wp-content/plugins/plug1-1*
ss_rm /var/www/html/dev/wp-content/plugins/wpematico*
ss_rm /var/www/html/staging/wp-content/plugins/bots.txt*
ss_rm /var/www/html/staging/wp-content/plugins/plug1*
ss_rm /var/www/html/staging/wp-content/plugins/plug1-1*
ss_rm /var/www/html/staging/wp-content/plugins/wpematico*
# ss_rm /var/www/html/staging/wp-content/uploads/symbols/ ## not sure if directory is made by the malware or taken over by the malware
## known malware filenames that cant be deleted because they conflict with WP Core filenames ##
# find /var/www/html/ -name "cache.php*" -type f -delete
# find /var/www/html/ -name "update.php*" -type f -delete
# find /var/www/html/ -name "settings.php*" -type f -delete
# find /var/www/html/ -name "wp_api.php*" -type f -delete ## not malware but possibly exploitable SSO script
## find /var/www/html/ -name "http.php" -type f -delete ## exists in WP Core under /wp-includes/
# find /var/www/html/ -name "stats.php" -type f -delete ## conflicts with some themes
find /var/www/html/ -name "wp-xmlrpc.php" -type f -delete
## delete unsafe file extensions ##
find /var/www/html/ -name "*.asp" -type f -delete
find /var/www/html/ -name "*.aspx" -type f -delete
find /var/www/html/ -name "*.ascx" -type f -delete
find /var/www/html/ -name "*.asis" -type f -delete
find /var/www/html/ -name "*.bat" -type f -delete
find /var/www/html/ -name "*.cfc" -type f -delete
find /var/www/html/ -name "*.cfm" -type f -delete
find /var/www/html/ -name "*.cfml" -type f -delete
find /var/www/html/ -name "*.cfr" -type f -delete
find /var/www/html/ -name "*.cfswf" -type f -delete
find /var/www/html/ -name "*.cmd" -type f -delete
find /var/www/html/ -name "*.cpl" -type f -delete
find /var/www/html/ -name "*.com" -type f -delete
find /var/www/html/ -name "*.dll" -type f -delete
find /var/www/html/ -name "*.exe" -type f -delete
find /var/www/html/ -name "*.fla" -type f -delete
find /var/www/html/ -name "*.flv" -type f -delete
find /var/www/html/ -name "*.htc" -type f -delete
find /var/www/html/ -name "*.jhtml" -type f -delete
find /var/www/html/ -name "*.jsb" -type f -delete
find /var/www/html/ -name "*.jsp" -type f -delete
find /var/www/html/ -name "*.jws" -type f -delete
find /var/www/html/ -name "*.mht" -type f -delete
find /var/www/html/ -name "*.mhtml" -type f -delete
find /var/www/html/ -name "*.msi" -type f -delete
find /var/www/html/ -name "*.pif" -type f -delete
find /var/www/html/ -name "*.py" -type f -delete
find /var/www/html/ -name "*.pwml" -type f -delete
find /var/www/html/ -name "*.rb" -type f -delete
find /var/www/html/ -name "*.reg" -type f -delete
find /var/www/html/ -name "*.scr" -type f -delete
find /var/www/html/ -name "*.swf" -type f -delete
find /var/www/html/ -name "*.swt" -type f -delete
find /var/www/html/ -name "*.swc" -type f -delete
find /var/www/html/ -name "*.sem" -type f -delete ## (Alpha Five software)
find /var/www/html/ -name "*.vbs" -type f -delete
find /var/www/html/ -name "*.vxd" -type f -delete
## delete unsupported file types ##
find /var/www/html/ -name "*.conf" -type f -delete ## Nginx hacks
find /var/www/html/ -name "*.config" -type f -delete ## Nginx hacks
find /var/www/html/ -name ".DS_Store*" -type f -delete ## macOS files
find /var/www/html/ -name "error_log*" -type f -delete ## Apache error logs (not supported on Nginx servers)
find /var/www/html/ -name "*.ftpquota" -type f -delete ## cPanel style files
find /var/www/html/ -name ".htaccess*" -type f -delete ## Apache files (not supported on Nginx servers)
# find /var/www/html/ -name "*.ini" -type f -delete ## PHP hacks ## DISABLED BECAUSE CERTAIN WP PLUGINS CRASH IF FILE MISSING
find /var/www/html/ -name "*.ini.php" -type f -delete ## PHP hacks
find /var/www/html/ -name "nginx.conf" -type f -delete ## Nginx hacks
find /var/www/html/ -name "*.user.ini" -type f -delete ## PHP hacks
## MAYBE QUARANTINE THESE into /backups/quarantine/
## delete unsafe database dumps ##
# find /var/www/html/ -name "*.sql" -type f -delete ## unsafe dumps
# find /var/www/html/ -name "*.wpress" -type f -delete ## All In One Migration archives
## delete linux junk files ##
# find /var/www/html/ -name ".listing*" -type f -delete
## delete php.ini hijacking ##
sed -i '/INI_SET/d' /var/www/html/wp-config.php
sed -i '/ini_set/d' /var/www/html/wp-config.php
## delete leftover plugin junk file types ##
find /var/www/html/ -name "adminer*.version*" -type f -delete ## Adminer plugin config
find /var/www/html/ -name "php_errorlog*" -type f -delete ## Adminer plugin config
## BASED ON RECENT MALWARE ATTACK FINDINGS ... some plugins use the /uploads/ folder for all kinds of improper stuff, PHP should never be here ##
## .htaccess and index.php files also not needed for security reasons as SlickStack already blocks these folders from frontend indexing ##
## potential malware or improper files ##
# find /var/www/html/wp-content/uploads/ -name "*.php" -type f -delete
# find /var/www/html/wp-content/languages/ -name "*.php" -type f -delete
find /var/www/html/wp-content/temp/ -name "*.php" -type f -delete
####################################################################################################
#### SS-Clean-Files: cleanup Various Files Directly Under /var/www/html/ ###########################
####################################################################################################
if [[ "$SS_CLEAN_FILES_ROOT_PUBLIC" != "false" ]]; then
# ss_rm /var/www/html/http_* ## improper wget leftovers?
## delete Nginx junk files ##
ss_rm /var/www/html/index.nginx-debian*.html*
ss_rm /var/www/html/.fw-config.php* ## vendor-specific (Flywheel)
## delete insecure database access points (Adminer accessible at example.com/adminer) ##
ss_rm /var/www/html/adminer*
ss_rm /var/www/html/*adminer*.php*
ss_rm /var/www/html/database.php*
ss_rm /var/www/html/db.php*
ss_rm /var/www/html/database
ss_rm /var/www/html/DATABASE
ss_rm /var/www/html/db
ss_rm /var/www/html/DB
ss_rm /var/www/html/phpmyadmin*
ss_rm /var/www/html/phpMyAdmin*
ss_rm /var/www/html/phpmyadmin*.php* ## no support for phpMyAdmin
ss_rm /var/www/html/phpMyAdmin*.php* ## no support for phpMyAdmin
## delete various files ##
ss_rm /var/www/html/.closte* ## vendor specific (Closte)
ss_rm /var/www/html/.maintenance*
ss_rm /var/www/html/.quarantine*
ss_rm /var/www/html/.tmb*
ss_rm /var/www/html/*_archive.zip ## leftover migration junk (Duplicator plugin)
ss_rm /var/www/html/_wpeprivate* ## vendor specific (WP Engine)
ss_rm /var/www/html/bing*.xml ## junk domain verification files
ss_rm /var/www/html/Bing*.xml ## junk domain verification files
# ss_rm /var/www/html/browserconfig.xml*
ss_rm /var/www/html/cache* ## invalid cache files
ss_rm /var/www/html/cgi-bin* ## ss conflicts
ss_rm /var/www/html/cookie.txt* ## (Netscape HTTP Cookie File)
ss_rm /var/www/html/crossdomain.xml ## https://sethsec.blogspot.com/2014/03/exploiting-misconfigured-crossdomainxml.html
ss_rm /var/www/html/dup-installer* ## unsafe archives and leftover migration junk (Duplicator plugin)
ss_rm /var/www/html/error_log* ## leftover Apache error logs
ss_rm /var/www/html/favicon.gif ## invalid favicons
ss_rm /var/www/html/GetYoastData*.php ##
ss_rm /var/www/html/liesmich.html ## readme after updating german wordpress
## delete domain verification files (use DNS instead) ##
ss_rm /var/www/html/ahrefs* ## Ahrefs
ss_rm /var/www/html/google*.html ## junk domain verification files
ss_rm /var/www/html/google*.txt ## junk domain verification files
ss_rm /var/www/html/imagify-backup* ## junk plugin files
ss_rm /var/www/html/index.htm ## ss conflicts
ss_rm /var/www/html/index.html ## ss conflicts
ss_rm /var/www/html/i.php ## obvious phpinfo files
ss_rm /var/www/html/i.html ## obvious phpinfo files
ss_rm /var/www/html/info.php ## obvious phpinfo files
ss_rm /var/www/html/info.html ## obvious phpinfo files
ss_rm /var/www/html/installer*.php ## leftover migration junk (Duplicator plugin)
ss_rm /var/www/html/iwp-restore-log* ## improper log location
# ss_rm /var/www/html/manifest.json*
ss_rm /var/www/html/my-wp-backup* ## ss conflicts, unsafe archives
ss_rm /var/www/html/networko* ## known malware infection
ss_rm /var/www/html/nortonsw*.html ## junk domain verification files
ss_rm /var/www/html/php.php ## obvious phpinfo files
ss_rm /var/www/html/php.html ## obvious phpinfo files
ss_rm /var/www/html/phpinfo*.php ## obvious phpinfo files
ss_rm /var/www/html/phpinfo*.html ## obvious phpinfo files
ss_rm /var/www/html/php-errors.log* ## ss conflicts, duplicate logs
ss_rm /var/www/html/pinterest*.html ## junk domain verification files
ss_rm /var/www/html/ror.xml
ss_rm /var/www/html/sap-logs* ## plugin logs (AccessPress Social Auto Post)
ss_rm /var/www/html/wp-snapshots* ## ss conflicts, unsafe archives
ss_rm /var/www/html/ssv3_directory.php* ## vendor specific (Bluehost)
ss_rm /var/www/html/sucuri*.php
ss_rm /var/www/html/sys-cache/ ## unknown
ss_rm /var/www/html/test.php ## obvious phpinfo files
ss_rm /var/www/html/test.html ## obvious phpinfo files
ss_rm /var/www/html/theme-option-export-file* ## local theme export archives
ss_rm /var/www/html/web.config*
ss_rm /var/www/html/wordfence-waf* ## ss conflicts, bloated, creates instability (WordFence)
ss_rm /var/www/html/yandex*.html ## junk domain verification files
ss_rm /var/www/html/wp-snapshots* ## unsafe archives (Duplicator)
ss_rm /var/www/html/wps-fbre-logs* ## unknown
fi
####################################################################################################
#### L. SS-Clean-Files: Delete Certain Files In WordPress Content Directory ########################
####################################################################################################
## going forward this snippet will only delete things that are high risk categories ##
## this means malware, exploitable, thrashing, or conflicts with SlickStack ##
## production ##
ss_rm /var/www/html/wp-content/advanced-cache.php* ## ss conflicts
ss_rm /var/www/html/wp-content/ari-adminer-config.php* ## ss conflicts
ss_rm /var/www/html/wp-content/deleteme*.php ## junk files
ss_rm /var/www/html/wp-content/install.php* ## junk files (by Jetpack)
ss_rm /var/www/html/wp-content/litespeed* ## ss conflicts
ss_rm /var/www/html/wp-content/nginx-helper* ## ss conflicts (by Nginx Helper)
ss_rm /var/www/html/wp-content/siteground-migrator* ## vendor-specific
ss_rm /var/www/html/wp-content/temp-write-test* ## junk files
ss_rm /var/www/html/wp-content/w3tc-config* ## ss conflicts
ss_rm /var/www/html/wp-content/wcfe* ## ss conflicts (by WP Config File Editor)
ss_rm /var/www/html/wp-content/wflogs* ## ss conflicts (by WordFence)
ss_rm /var/www/html/wp-content/wp-cache-config.php* ## ss conflicts
ss_rm /var/www/html/wp-content/wp-rocket* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/wp-content/wp-rocket-config* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/wp-content/wp-performance-score-booster* ## ss conflicts (by WP Performance Score Booster)
ss_rm /var/www/html/wp-content/wpo-cache* ## ss conflicts (by WP-Optimize)
ss_rm /var/www/html/wp-content/wphb-cache* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/wp-content/wphb-logs* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/wp-content/sunrise.php* ## deprecated (previously for Multisite domain mapping)
## staging ##
if [[ "${STAGING_SITE}" == "true" ]]; then
ss_rm /var/www/html/staging/wp-content/advanced-cache.php* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/ari-adminer-config.php* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/deleteme*.php ## junk files
ss_rm /var/www/html/staging/wp-content/install.php* ## junk files (by Jetpack)
ss_rm /var/www/html/staging/wp-content/litespeed* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/nginx-helper* ## ss conflicts (by Nginx Helper)
ss_rm /var/www/html/staging/wp-content/siteground-migrator* ## vendor-specific
ss_rm /var/www/html/staging/wp-content/temp-write-test* ## junk files
ss_rm /var/www/html/staging/wp-content/w3tc-config* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/wcfe* ## ss conflicts (by WP Config File Editor)
ss_rm /var/www/html/staging/wp-content/wflogs* ## ss conflicts (by WordFence)
ss_rm /var/www/html/staging/wp-content/wp-cache-config.php* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/wp-rocket* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/staging/wp-content/wp-rocket-config* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/staging/wp-content/wp-performance-score-booster* ## ss conflicts (by WP Performance Score Booster)
ss_rm /var/www/html/staging/wp-content/wpo-cache* ## ss conflicts (by WP-Optimize)
ss_rm /var/www/html/staging/wp-content/wphb-cache* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/staging/wp-content/wphb-logs* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/staging/wp-content/sunrise.php* ## deprecated (previously for Multisite domain mapping)
fi
## development ##
if [[ "${DEV_SITE}" == "true" ]]; then
ss_rm /var/www/html/dev/wp-content/advanced-cache.php* ## ss conflicts
ss_rm /var/www/html/dev/wp-content/ari-adminer-config.php* ## ss conflicts
ss_rm /var/www/html/dev/wp-content/deleteme*.php ## junk files
ss_rm /var/www/html/dev/wp-content/install.php* ## junk files (by Jetpack)
ss_rm /var/www/html/dev/wp-content/litespeed* ## ss conflicts
ss_rm /var/www/html/dev/wp-content/nginx-helper* ## ss conflicts (by Nginx Helper)
ss_rm /var/www/html/dev/wp-content/siteground-migrator* ## vendor-specific
ss_rm /var/www/html/dev/wp-content/temp-write-test* ## junk files
ss_rm /var/www/html/dev/wp-content/w3tc-config* ## ss conflicts
ss_rm /var/www/html/dev/wp-content/wcfe* ## ss conflicts (by WP Config File Editor)
ss_rm /var/www/html/dev/wp-content/wflogs* ## ss conflicts (by WordFence)
ss_rm /var/www/html/dev/wp-content/wp-cache-config.php* ## ss conflicts
ss_rm /var/www/html/dev/wp-content/wp-rocket* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/dev/wp-content/wp-rocket-config* ## ss conflicts (by WP Rocket)
ss_rm /var/www/html/dev/wp-content/wp-performance-score-booster* ## ss conflicts (by WP Performance Score Booster)
ss_rm /var/www/html/dev/wp-content/wpo-cache* ## ss conflicts (by WP-Optimize)
ss_rm /var/www/html/dev/wp-content/wphb-cache* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/dev/wp-content/wphb-logs* ## ss conflicts (by Hummingbird)
ss_rm /var/www/html/dev/wp-content/sunrise.php* ## deprecated (previously for Multisite domain mapping)
fi
####################################################################################################
#### SS-Clean-Files: /var/www/html/wp-content/mu-plugins/ ##########################################
####################################################################################################
ss_rm /var/www/html/wp-content/mu-plugins/0-worker* ## creates instability, resource intensive (ManageWP)
ss_rm /var/www/html/wp-content/mu-plugins/et-safe-mode* ## Elegant Themes
ss_rm /var/www/html/wp-content/mu-plugins/mainwp-child* ## creates instability, resource intensive (MainWP)
ss_rm /var/www/html/wp-content/mu-plugins/SupportCenterMUAutoloader.php* ## Elegant Themes
####################################################################################################
#### L. SS-Clean-Files: Delete Certain WordPress Plugins (Required) ################################
####################################################################################################
## delete plugins with malware, exploits, database thrashing, or SlickStack conflicts ##
## this snippet will run regardless of any settings you have in your ss-config ##
## production ##
ss_rm /var/www/html/wp-content/plugins/accelerated-mobile-pages ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/adminer* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/add-index-to-autoload* ## ss conflicts, feature exists in WP Core 5.3+
ss_rm /var/www/html/wp-content/plugins/ajax-thumbnail-rebuild* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/all-in-one-wp-security-and-firewall* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/allow-php-in-posts-and-pages* ## php hacks
ss_rm /var/www/html/wp-content/plugins/amp ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/amp-enhancer ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/amp-for-contact-form-7 ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/amp-google-analytics-4-support ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/amp-post-script ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/amp-wp ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/apikey ## malware
ss_rm /var/www/html/wp-content/plugins/ari-adminer* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/askapache-debug-viewer* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/autologin-links* ## exploitable, ss conflicts
ss_rm /var/www/html/wp-content/plugins/bad-behavior* ## ss conflicts, deprecated
ss_rm /var/www/html/wp-content/plugins/better-wp-security* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/bitcoin-plus-miner* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/BoosterPage ## deprecated, exploitable (Smart Marketer)
ss_rm /var/www/html/wp-content/plugins/browser-caching-with-htaccess* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/cache-enabler* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/captcha ## deprecated
ss_rm /var/www/html/wp-content/plugins/change-wp-admin-login* ## ss conflicts (by Nuno Morais Sarmento)
ss_rm /var/www/html/wp-content/plugins/clear-cache-for-widgets* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/clearfy* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/comet-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/custom-sidebars* ## exploitable, errors/conflicts, resource intensive, bad practice (WPMU Dev)
ss_rm /var/www/html/wp-content/plugins/defender-security* ## ss conflicts (by WPMU Dev)
ss_rm /var/www/html/wp-content/plugins/display-widgets ## malware/spyware
ss_rm /var/www/html/wp-content/plugins/dreamhost* ## vendor-specific
ss_rm /var/www/html/wp-content/plugins/dreamobjects* ## vendor-specific
ss_rm /var/www/html/wp-content/plugins/envato-wordpress-toolkit* ## deprecated
ss_rm /var/www/html/wp-content/plugins/fb-instant-articles ## not maintained, serious errors (by Automattic)
ss_rm /var/www/html/wp-content/plugins/fb-messenger ## deprecated
ss_rm /var/www/html/wp-content/plugins/folders ## creates instability, ss conflicts
ss_rm /var/www/html/wp-content/plugins/fuzzy-seo-booster* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/hello.php* ## pointless
ss_rm /var/www/html/wp-content/plugins/hide_my_wp* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/htaccess* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/hummingbird-performance* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/hyper-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/hyperdb* ## ss conflicts, not maintained
ss_rm /var/www/html/wp-content/plugins/increase-upload-file-size-maximum-execution-time-limit* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/integrate-monero-miner* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/jm-live-blog* ## serious errors, database thrashing, not maintained
ss_rm /var/www/html/wp-content/plugins/jonradio-multiple-themes* ## creates instability
ss_rm /var/www/html/wp-content/plugins/jsecoin* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/last-modified-timestamp* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/linkman* ## deprecated, database thrashing
ss_rm /var/www/html/wp-content/plugins/litespeed* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/litespeed-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/login-lockdown* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/maintenance-mode-littlebizzy* ## not maintained
ss_rm /var/www/html/wp-content/plugins/miwoftp* ## exploitable
ss_rm /var/www/html/wp-content/plugins/my-wp-backup* ## blacklisted vendor (by MyThemeShop)
ss_rm /var/www/html/wp-content/plugins/my-wp-backup-pro-master* ## blacklisted vendor (by MyThemeShop)
ss_rm /var/www/html/wp-content/plugins/myrp* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/mythemeshop-connect* ## ransomware (by MyThemeShop)
ss_rm /var/www/html/wp-content/plugins/onlywire-bookmark-share-button* ## deprecated, serious errors
ss_rm /var/www/html/wp-content/plugins/optimizemember* ## potential data loss
ss_rm /var/www/html/wp-content/plugins/optimizeMember* ## potential data loss
ss_rm /var/www/html/wp-content/plugins/optimizePress* ## potential data loss
ss_rm /var/www/html/wp-content/plugins/optimizePressPlugin* ## potential data loss
ss_rm /var/www/html/wp-content/plugins/optimizepress* ## potential data loss
ss_rm /var/www/html/wp-content/plugins/outtatimr* ## deprecated (by DigitalMarketer)
ss_rm /var/www/html/wp-content/plugins/page-links-to* ## not maintained, bad practice
ss_rm /var/www/html/wp-content/plugins/perfmatters* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/periods-in-titles* ## bad for seo
ss_rm /var/www/html/wp-content/plugins/php-settings* ## php hacks, ss conflicts
ss_rm /var/www/html/wp-content/plugins/phpmyadmin* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/powered-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/protect-wp-admin* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/pushlive* ## deprecated, ss conflicts (by 1 Squared, Jamin Szczesny)
ss_rm /var/www/html/wp-content/plugins/qtranslate-x* ## deprecated, database thrashing
ss_rm /var/www/html/wp-content/plugins/redis-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/redis-object-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/rest-api/ ## deprecated, exists in wp core (Rest API)
ss_rm /var/www/html/wp-content/plugins/seo-alrp* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/sg-cachepress* ## ss conflicts, vendor specific (by Siteground)
ss_rm /var/www/html/wp-content/plugins/sg-security* ## ss conflicts, vendor specific (by Siteground)
ss_rm /var/www/html/wp-content/plugins/shopbop-widget* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/similar-posts* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/simple-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/simple-monero-miner-coin-hive* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/simple-wistia-embed* ## exists in wp core
ss_rm /var/www/html/wp-content/plugins/sitespeed* ## malware (as per Sucuri report)
ss_rm /var/www/html/wp-content/plugins/sitewide-message/ ## deprecated
ss_rm /var/www/html/wp-content/plugins/sweetcaptcha* ## malware/spyware
ss_rm /var/www/html/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service* ## malware/spyware
ss_rm /var/www/html/wp-content/plugins/timthumb* ## exploitable, deprecated
ss_rm /var/www/html/wp-content/plugins/total-donations* ## exploitable, deprecated
ss_rm /var/www/html/wp-content/plugins/totaldonations* ## exploitable, deprecated
ss_rm /var/www/html/wp-content/plugins/tweet-blender* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/upload-max-file-size* ## ss conflicts, php hacks
ss_rm /var/www/html/wp-content/plugins/uploadify* ## exploitable
ss_rm /var/www/html/wp-content/plugins/w3-total-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/w3speedster* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/way2enjoy-compress-images* ## deprecated
ss_rm /var/www/html/wp-content/plugins/wc-password-strength-settings* ## exploitable, bad practice
ss_rm /var/www/html/wp-content/plugins/weather-for-us-widget* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/wistia-responsive* ## exists in wp core
ss_rm /var/www/html/wp-content/plugins/woocommerce-jquery-cookie-fix* ## ss conflicts, creates instability
ss_rm /var/www/html/wp-content/plugins/woothemes-updater* ## deprecated
ss_rm /var/www/html/wp-content/plugins/wordfence* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-advanced-importer* ## not maintained, serious errors
ss_rm /var/www/html/wp-content/plugins/wp-amp-it-up ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-amp-website ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-coinhive ## cryptomining
ss_rm /var/www/html/wp-content/plugins/wp-editor* ## exists in wp core (syntax editor)
ss_rm /var/www/html/wp-content/plugins/wp-fastest-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-htaccess-control* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-maximum-execution-time-exceeded* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-monero-miner-using-coin-hive* ## cryptomining
ss_rm /var/www/html/wp-content/plugins/wp-optimize* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-performance ## ss conflicts (by alaca)
ss_rm /var/www/html/wp-content/plugins/wp-performance-score-booster* ## ss conflicts, bad practice
ss_rm /var/www/html/wp-content/plugins/wp-phpmyadmin-extension* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-postviews* ## database thrashing
ss_rm /var/www/html/wp-content/plugins/wp-redis* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-rocket* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-rocket-static-exclude-defer-js* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-roilbacks* ## malware
ss_rm /var/www/html/wp-content/plugins/wp-security* ## malware (reported by Sucuri)
ss_rm /var/www/html/wp-content/plugins/wp-site-migrate* ## vendor specific (WP Engine)
ss_rm /var/www/html/wp-content/plugins/wp-speedup* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wp-super-cache* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/wpe-advanced-cache-options* ## vendor specific
ss_rm /var/www/html/wp-content/plugins/wpengine-geoip* ## vendor specific (by WP Engine)
ss_rm /var/www/html/wp-content/plugins/wpframework* ## malware (reported by Sucuri)
ss_rm /var/www/html/wp-content/plugins/wpide ## exists in wp core (syntax editor)
ss_rm /var/www/html/wp-content/plugins/wpmudev-updates* ## ss conflicts, vendor specific (by WPMU Dev)
ss_rm /var/www/html/wp-content/plugins/wps-hide-login* ## ss conflicts
ss_rm /var/www/html/wp-content/plugins/yoast-seo-search-index-purge* ## ss conflicts, serious errors
ss_rm /var/www/html/wp-content/plugins/youtube-embed-* ## malware
ss_rm /var/www/html/wp-content/plugins/yuzo-related-post* ## deprecated, exploitable
## staging ##
if [[ "${STAGING_SITE}" == "true" ]]; then
ss_rm /var/www/html/staging/wp-content/plugins/accelerated-mobile-pages ## ss conflicts
ss_rm /var/www/html/staging/wp-content/plugins/adminer* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/plugins/add-index-to-autoload* ## ss conflicts, feature exists in WP Core 5.3+
ss_rm /var/www/html/staging/wp-content/plugins/ajax-thumbnail-rebuild* ## database thrashing
ss_rm /var/www/html/staging/wp-content/plugins/all-in-one-wp-security-and-firewall* ## ss conflicts
ss_rm /var/www/html/staging/wp-content/plugins/allow-php-in-posts-and-pages* ## php hacks
ss_rm /var/www/html/staging/wp-content/plugins/amp ## ss conflicts
ss_rm /var/www/html/staging/wp-content/plugins/amp-enhancer ## ss conflicts
ss_rm /var/www/html/staging/wp-content/plugins/amp-for-contact-form-7 ## ss conflicts