Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
a2-optimized /
wordpress /
Delete
Unzip
Name
Size
Permission
Date
Action
A2ReCaptcha
[ DIR ]
drwxr-xr-x
2025-04-30 04:08
bin
[ DIR ]
drwxr-xr-x
2025-04-30 04:08
LSCWP_Default_Configuration.data
7.4
KB
-rw-r--r--
2025-04-29 15:41
Optimizations.php
241
B
-rw-r--r--
2025-04-29 15:41
am-bundle.php
1010
B
-rw-r--r--
2025-04-29 15:41
class.A2_Optimized_Private_Optimizations.php
36.09
KB
-rw-r--r--
2025-04-29 15:41
class.A2_Optimized_Private_Optimizations_v3.php
35.31
KB
-rw-r--r--
2025-04-29 15:41
cron-job.php
2.39
KB
-rw-r--r--
2025-04-29 15:41
fix-w3tc.php
2.02
KB
-rw-r--r--
2025-04-29 15:41
hcaptcha_lib.php
2.1
KB
-rw-r--r--
2025-04-29 15:41
managedwp_functions.php
3.78
KB
-rw-r--r--
2025-04-29 15:41
opt-init-variables.txt
797
B
-rw-r--r--
2025-04-29 15:41
optimize.sh
12.29
KB
-rw-r--r--
2025-04-29 15:41
p2-wp-opt-v1.data
7.39
KB
-rw-r--r--
2025-04-29 15:41
p2-wp-opt-v1.sh
20.48
KB
-rwxr-xr-x
2025-04-29 15:41
pagespeed.php
3.2
KB
-rw-r--r--
2025-04-29 15:41
privkey
0
B
-rw-r--r--
2025-04-29 15:41
pubkey
0
B
-rw-r--r--
2025-04-29 15:41
recaptcha_autoload.php
1.14
KB
-rw-r--r--
2025-04-29 15:41
recaptchalib.php
9.36
KB
-rw-r--r--
2025-04-29 15:41
recaptchalib_v2.php
2.95
KB
-rw-r--r--
2025-04-29 15:41
turbo-default.txt
7.39
KB
-rw-r--r--
2025-04-29 15:41
warp-imagick.json
940
B
-rw-r--r--
2025-04-29 15:41
wp-opt-v1.sh
41.12
KB
-rwxr-xr-x
2025-04-29 15:41
Save
Rename
#!/bin/bash # WP Optimize script Red=$'\e[1;31m'; Green=$'\e[1;32m'; Clear=$'\e[0m'; sdt="$(date +%F_%H-%M-%S)"; me="$(whoami)"; clear echo "$Green ********************* A2 LSCWP OPT SCRIPT *********************$Clear" echo "$Green ********************Get Prepared************************************* $Clear"; echo "$Green Note: YOU MAY WANT TO START THIS IN A SCREEN $Clear" echo "Open a browser and preload the following tabs:"; echo " *Optimization Ticket"; echo " *WHMCS to the CXs page"; echo " *cPanel for the account"; echo " *WordPress Admin area for site being optimized"; echo " https://gtmetrix.com/"; echo " https://pagespeed.web.dev/"; read -r -p "Enter Domain Name: " DOMAIN; echo "Domain: $DOMAIN" | tee -a "$DOMAIN".log.txt; echo "start: $sdt" | tee "$DOMAIN".log.txt echo "#### Initial Clean up of possible garbage ####" test -f /home/"$me"/"$DOMAIN".header.txt && rm /home/"$me"/"$DOMAIN".header.txt; test -f /home/"$me"/"$DOMAIN".theme.txt && rm /home/"$me"/"$DOMAIN".theme.txt; test -f /home/"$me"/"$DOMAIN".plugin.txt && rm /home/"$me"/"$DOMAIN".plugin.txt; test -f /home/"$me"/"$DOMAIN".home.txt && rm /home/"$me"/"$DOMAIN".home.txt; test -f /home/"$me"/"$DOMAIN".siteurl.txt && rm /home/"$me"/"$DOMAIN".siteurl.txt; test -f /home/"$me"/"$DOMAIN".cx.txt && rm /home/"$me"/"$DOMAIN".cx.txt; test -f /home/"$me"/"$DOMAIN".userdomainsort.txt && rm /home/"$me"/"$DOMAIN".userdomainsort.txt; test -f /home/"$me"/sitemap.xml && rm /home/"$me"/"$DOMAIN".sitemap.xml; clear # shellcheck source=/dev/null source /home/"$me"/opt-init-variables.txt echo "$Green *******************Pre Optimized Tests************" | tee -a "$DOMAIN".log.txt; echo "Pre-optimization data, this stage gathers data and establishes a baseline for the current performance of the site. We ask that you use GTmetrix to establish the two performance metrics of TTFB (Time to first Byte) and FLT (Fully Loaded Time). Additionally use Google Pagespeed Insights to record a general *Performance Score*, FCP (First Contentful Paint), and LCP (Largest Contentful Paint) $Clear"; echo "=============================================================================="; echo "Domain: $DOMAIN" | tee -a "$DOMAIN".log.txt; echo "$Red ENTER ALL TIMES IM MS (MILLASECONDS 1,000 ms = 1 sec) $Clear"; echo "GTmetrx" | tee -a "$DOMAIN".log.txt; read -r -p "Enter TTFB: " preTTFB; echo "Pre-Opt TTFB was $preTTFB ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter FLT: " preFLT; echo "Pre-Opt FLT was $preFLT ms " | tee -a "$DOMAIN".log.txt; echo "PageSpeed Mobile Scores" | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile FCP: " mpreFCP; echo "Pre-Opt Mobile FCP was $mpreFCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile LCP: " mpreLCP; echo "Pre-Opt Mobile LCP was $mpreLCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile Performance Score: " mpreSCORE; echo "Pre-Opt Mobile Performance Score was $mpreSCORE ms " | tee -a "$DOMAIN".log.txt; echo "PageSpeed Dsktop Scores" | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop FCP: " dtpreFCP; echo "Pre-Opt Deskto FCP was $dtpreFCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop LCP: " dtpreLCP; echo "Pre-Opt Deskto LCP was $dtpreLCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop Performance Score: " dtpreSCORE; echo "Pre-Opt Deskto Performance Score was $dtpreSCORE ms " | tee -a "$DOMAIN".log.txt; read -r -p "Press enter to continue"; echo "$Green**************A2 LSCWP Optimization Script: Part 2 **************"; echo "Collect cPanel and site header variables $Clear"; # create text files for logs and analizing the header curl -ILH "Accept: text/javascript, text/html, application/xml, */*" --head "$DOMAIN" | tee "$DOMAIN".header.txt HOMEDIR=$(sudo grep ^"$DOMAIN" /etc/userdatadomains|awk -F'==' '{print $5}'); echo "Home directory for the domain: $HOMEDIR" | tee -a "$DOMAIN".log.txt; CPUSER=$(sudo grep ^"$DOMAIN" /etc/userdatadomains|awk '{print $2}'| awk -F'==' '{print $1}'); echo "cPanel username: $CPUSER" | tee -a "$DOMAIN".log.txt; IPADDRESS=$(sudo grep ^"$DOMAIN" /etc/userdatadomains|awk -F'==' '{print $6}'|sed 's/:80//'); echo "IP address of the site is: $IPADDRESS" | tee -a "$DOMAIN".log.txt; echo "$Green **************A2 LSCWP Optimization Script: Part 2************** $Clear"; echo "Collect WordPress variables" | tee -a "$DOMAIN".log.txt; echo "Collect WordPress plugin variables" | tee "$DOMAIN".plugin.txt; echo "Collect WordPress theme variables" | tee "$DOMAIN".theme.txt; echo "$Green ==========================Switch to cPanel user======================================$Clear"; read -r -p "Press enter to continue"; sudo su - "$CPUSER" -c "cd $HOMEDIR; touch /home/$CPUSER/.redis.on echo '=================Remove Possible Garbage==========================' test -f /home/$CPUSER/$DOMAIN.plugin.txt && rm /home/$CPUSER/$DOMAIN.plugin.txt; test -f /home/$CPUSER/$DOMAIN.theme.txt && rm /home/$CPUSER/$DOMAIN.theme.txt; test -f /home/$CPUSER/$DOMAIN.home.txt && rm /home/$CPUSER/$DOMAIN.home.txt; test -f /home/$CPUSER/$DOMAIN.siteurl.txt && rm /home/$CPUSER/$DOMAIN.siteurl.txt; echo '=================Logs when cPanel User==========================' wp plugin status | tee /home/$CPUSER/$DOMAIN.plugin.txt; wp theme status | tee /home/$CPUSER/$DOMAIN.theme.txt; wp option get home | tee /home/$CPUSER/$DOMAIN.home.txt; wp option get siteurl | tee /home/$CPUSER/$DOMAIN.siteurl.txt; # done with first round as Cpanel User " echo "=====exit as cPanel User======" echo "$(</home/"$CPUSER"/"$DOMAIN".plugin.txt)" | tee -a "$DOMAIN".plugin.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".theme.txt)" | tee -a "$DOMAIN".theme.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".home.txt)" | tee "$DOMAIN".home.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".siteurl.txt)" | tee "$DOMAIN".siteurl.txt; echo "====================================================="; echo "$Green **************A2 LSCWP Optimization Script: Part 3**************"; echo "Check for proper directory structure $Clear"; echo "cPanels direcotry structure"; echo "cPanel has the home direcotry of the wordpress install as $HOMEDIR" | tee "$DOMAIN".cx.txt sudo grep "$CPUSER" /etc/userdatadomains |awk '{print $2}' | awk -F'==' '{print $5 " " $4 " "}'|sort > userdomainsort.txt; pdir=${HOMEDIR%/*}; echo "$pdir is the parent directory"; echo "$pdir"; searchpdir="${pdir} "; if [ "$pdir" == "/home/$CPUSER" ]; then NEEDCHECKpdir=0; DOsearchpdir=0; echo "The parent directoy of the home directory of $HOMEDIR is $pdir. This is the cPanel user home directory. Proper directory structure." | tee -a "$DOMAIN".cx.txt; else NEEDCHECKpdir=1; searchpdir="${pdir} "; DOsearchpdir=1; fi; if [ "$(< userdomainsort.txt grep -c "$searchpdir")" -gt 0 ] && [ "$DOsearchpdir" -ne 0 ]; then pdomain="$(< userdomainsort.txt grep "$searchpdir" | awk '{print $2}')" ; NEEDCHECKpdir=1; echo "$NEEDCHECKpdir" echo "$Red The parent directory of the home directory of $HOMEDIR is $pdir. cPanel says that the parent directory is the home direcotry for $pdomain. This will cause erratic behavior to $DOMAIN due to the recursive nature of htaccess. You will need move your Wordpress installation from $HOMEDIR to /home/$CPUSER/$DOMAIN $Clear" | tee -a "$DOMAIN".cx.txt ; else NEEDCHECKpdir=0; echo "The parent directory of the home directory of $HOMEDIR is $pdir. cPanel says that the parent directory is NOT the home direcotry for another domain. Proper directory structure." | tee -a "$DOMAIN".log.txt >> "$DOMAIN".cx.txt ; fi; echo "Check for proper directory structure"; echo "WordPress direcotry structure"; wphome="$(< "$DOMAIN".home.txt)"; wpsite="$(< "$DOMAIN".siteurl.txt)"; if [ "$wphome" == "$wpsite" ]; then echo "The home url for WordPress is $wphome and is the same as the site URL for WordPress which is $wpsite. This means the default wp-config.php is all that is needed." | tee -a "$DOMAIN".log.txt ; wpconfigCHANGE=0; else wpconfigCHANGE=1; echo "$Red The home url for WordPress is $wphome and is NOT the same as the site URL for WordPress which is $wpsite. This means the wp-config.php will need to be edited. It will be edited right before the step to update/install LSCWP. $Clear" | tee -a "$DOMAIN".log.txt ; fi; echo "$Green **************A2 LSCWP Optimization Script: Part 4************** $Clear" | tee -a "$DOMAIN".log.txt ; echo "Check Headers" | tee -a "$DOMAIN".log.txt ; # check to see if header contains CF-Cache-Satus. If so the Cloudflaire is integrated. # if CFCS is 1 and CFAPIinfoNeed is 1 then we need to add the API infor to LSCWP if [ "$(<"$DOMAIN".header.txt grep -c "CF-Cache-Status:")" -gt 0 ]; then CFCS=1; echo "$Red The header indicates that Cloudflare is integreated $Clear" | tee -a "$DOMAIN".log.txt; else CFCS=0; echo "The header indicates that Cloudflare is NOT integreated $CFCS " | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains CF-Cache-Satus HITS. If so the Cloudflaire is integrated. # if CFCSH is 1 idicated the CF is not in Developer Mode or turned off if [ "$(< "$DOMAIN".header.txt grep -c "CF-Cache-Status: HIT")" -gt 0 ]; then CFCSH=1; echo "$Red The header indicates that the content was served from the Cloudflare cache amd is not in Dev Mode $Clear" | tee -a "$DOMAIN".log.txt; else CFCSH=0; echo "The header indicates that the content was NOT served from the Cloudflare cache $CFCSH" | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains cf-edge-cache. If so then the CloudFlare WordPress plugin may be installed. We will uninstall once we get API info. # if CFEC is 1 then the CX has the QP CF plugin installed so we need to be fure we have the API info so CFAPIinfoNeed is set to 1 if [ "$(< "$DOMAIN".header.txt grep -c "cf-edge-cache:")" -gt 0 ]; then CFEC=1; echo "$Red The header indicates that the Clouflaire Plugin for WordPress is installed but not activated $Clear" | tee -a "$DOMAIN".log.txt; else CFEC=0; echo "The header indicates that the Clouflaire Plugin for WordPress is NOT installed" | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains cf-edge-cache: cache,platform=wordpress. If so then the CloudFlare WordPress plugin is installed, active and configured. We will uninstall once we get API info. # if CFECCPWP is 1 it indicated that the Wp CF plugin in integrated and actived. So once again we set CFAPIinfoNeed to 1 to make sure we get the So we can continuw whne we receive it if [ "$(< "$DOMAIN".header.txt grep -c "cf-edge-cache: cache,platform=wordpress")" -gt 0 ]; then CFECCPWP=1; echo "$Red The header indicates that the Clouflaire Plugin for WordPress is definitly installed and activated $Clear" | tee -a "$DOMAIN".log.txt; else CFECCPWP=0; echo "The header indicates that the Clouflaire Plugin for WordPress may not be activated $CFECCPWP" | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains Server: cloudflare. This if fine as long as it is the free plan and API info is given to us by CX. if [ "$(< "$DOMAIN".header.txt grep -c "Server: cloudflare")" -gt 0 ]; then SERVERCF=1; echo "$Red The header indicates that the site is being proxied through CF $Clear" | tee -a "$DOMAIN".log.txt; else SERVERCF=0; echo "The header indicates that the site is NOT being proxied trhrough CF $SERVERCF" | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains cf-apo-via. If so then APO may be integrated. Need to make sure the customer has turned off and gone to free plan. # if CFAVis 1 and APOinfoNeed is 1 it means that APO is onn the account and we hjave to make surte the CX turned it oof array=( CFCSH CFCS CFEC CFECCPWP SERVERCF ) CFapiTotal=$(IFS=+; echo "$((${array[*]}))") echo "$CFapiTotal" if [ "$CFapiTotal" -gt 0 ]; then CFAPIinfoNeed=1; fi; if [ "$(< "$DOMAIN".header.txt grep -c "cf-apo-via:")" -gt 0 ]; then CFAV=1; echo "$Red The header indicates that APO was in use $Clear" | tee -a "$DOMAIN".log.txt; else CFAV=0; echo "The header indicates that APO was NOT in use $CFAV" | tee -a "$DOMAIN".log.txt; fi; # check to see if header contains cf-apo-via: tcache. If so then APO is integrated and active. customer will need to turn off and go to free plan." # if is 1 tells us that the site is untilizing APO for contet and because APOinfoNeed is 1 the CX has not imformed us yet; if APOinfoNeed was 0 then the CX sqaid it was utned of but it was not if [ "$(< "$DOMAIN".header.txt grep -c "cf-apo-via: tcache")" -gt 0 ]; then CFAVT=1; echo "$Red The header indicates that APO status for delivery of this page was ON $Clear" | tee -a "$DOMAIN".log.txt; else CFAVT=0; echo "The header indicates that APO status for delivery of this page was OFF" | tee -a "$DOMAIN".log.txt; fi; arrayy=( CFAV CFAVT ) cfAPOTotal=$(IFS=+; echo "$((${arrayy[*]}))") echo "$cfAPOTotal" if [ "$cfAPOTotal" -gt 0 ] ; then APOinfoNeed=1; fi; # Do a quick check to see if Sucuri is installed. # if SERVERSUCURI is 1 it means that Sucuri is being used so we set SUinfoNeed to one so we get info to ingrate or the CX has integrated if [ "$(< "$DOMAIN".header.txt grep -c "Server: Sucuri")" -gt 0 ]; then SERVERSUCURI=1; SUinfoNeed=1; echo "$Red The header indicates that Sucuri WAF is being Used $SERVERSUCURI $Clear" | tee -a "$DOMAIN".log.txt; fi; # if the CX gives us the CFA API info we need to enter it and if so we will set CFAPIinfoNeed to 0 so we know we have it and have entered in the info if [ "$CFAPIinfoNeed" = 1 ]; then echo "The CX is using Cloudflare." | tee -a "$DOMAIN".log.txt; echo "Did the Cx provide the CFG API Info, CF email and Global API Key" | tee -a "$DOMAIN".log.txt; select yn in "Yes" "No"; do case $yn in Yes ) read -r -p "Enter eamil adress used for CF API: " CFAPIemail; read -r -p "Enter Global API Key: " CFAPIkey; CFAPIinfoNeed=0; echo "$CFAPIemail $CFAPIkey"; echo "Cx has supplied the CF API Info" | tee -a "$DOMAIN".log.txt; CFgotAPI=1; break;; No ) echo "Cx has NOT supplied API Info" | tee -a "$DOMAIN".log.txt; echo "In our preliminary check, the headers for the webpages inform us that Cloudflare is proxy for the site. We need to let the LiteSpeed Cache for WordPress to be able to control Cloudflare. It must be controlled through the LiteSpped plugin and not via a Cloudflare plugin. We will need the following API information: the email address used at Cloudflare and the API Key. check here form more information https://blog.litespeedtech.com/2018/01/17/cloudflare-management-lscache/ under the Setting it Up section." | tee -a "$DOMAIN".cx.txt; break;; esac done; fi; # if CF APO is intalled we need to make sure it is turned off so will start tracking by setting APOinfoNeed to 1 if [ "$APOinfoNeed" = 1 ]; then echo "The CX is/was using APO" | tee -a "$DOMAIN".log.txt; echo "Did the Cx say they disabled APO" | tee -a "$DOMAIN".log.txt; select yn in "Yes" "No"; do case $yn in Yes ) echo "Cx said disabled APO" | tee -a "$DOMAIN".log.txt; APOinfoNeed=0; if [ "$CFAVT" = 1 ]; then APOinfoNeed=1; echo "The headers for your webpages reveal that APO is still active and integrated on your website, even though you say you have disabled them. Maybe disable is the wrong term to use here. APO is included for free with the paid plan or as an addon to the free plan. You need to cancel any paid plan or paid add-on at Cloudflare. You should be running just the free plan." | tee -a "$DOMAIN".cx.txt; else APOinfoNeed=0; echo "Cx says they have disabled APO." | tee -a "$DOMAIN".log.txt; fi; break;; No ) APOinfoNeed=1; echo "Cx has NOT supplied APO info " | tee -a "$DOMAIN".log.txt; echo "APO offered by Cloudflare conficts with any cache system that also optimizes the js or CSS. The headers for your webpages reveal that APO is integrated on your website. APO is included for free with the paid plan or as an addon to the free plan. You need to cancel any paid plan or paid add-on at Cloudflare. You should be running just the free plan. Please let us know when this is done." | tee -a "$DOMAIN".cx.txt; break;; esac done; fi; # we need to find out if susuri is through a2 Hosting ans set SUCURIa2 to 1 or another provider and set it to 0 SUCURIa2=0; if [ "$SUinfoNeed" = 1 ]; then echo "Cx is using Sucuri" | tee -a "$DOMAIN".log.txt; echo "Is the Sucuri Service through A2 Hosting?" select yn in "Yes" "No"; do case $yn in Yes ) echo "Sucuri is through A2 Hosting" | tee -a "$DOMAIN".log.txt; SUCURIa2=1; break;; No ) SUCURIa2=0; echo "CX will need to get Sucuri configured by provider." | tee -a "$DOMAIN".log.txt; break;; esac done; fi; if [ "$SUinfoNeed" = 1 ]; then echo "Cx is using Sucuri " | tee -a "$DOMAIN".log.txt; echo "Has Sucuri been configured to work with LSCWP. The IPs for LS have added to Sucuri, we have a link to clear the cache, we can set or unset developer mode, and Sucuri IPs have been whitlisted in our firewall?" | tee -a "$DOMAIN".log.txt; select yn in "Yes" "No"; do case $yn in Yes ) echo "Sucuri has been integrated" | tee -a "$DOMAIN".log.txt; SUinfoNeed=0; break;; No ) SUinfoNeed=1; if [ "$SUCURIa2" = 1 ]; then echo "Please follow the manual for the proceedure with Sucuri. It is here: https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.l1qwrlho8192 " | tee -a "$DOMAIN".log.txt; echo "Sucuri needs to be configure to work with the LiteSpeed Plugin. This can take from 24-48 hours before it is completed. We will inform you when it is completed and then continue with the optimization of the website." | tee -a "$DOMAIN".log.txt; fi; if [ "$SUCURIa2" = 0 ]; then echo "Our pre-optimization check revealed that you are using Sucuri Firewall. This is not a problem for the optimization, but in order to continue we will need the following: A: The Sucuri plugin installed and configured, including the firewall AF integration B: The IP address for the LiteSpeed servers to do the optimizations need to be whitelisted. You can find the list in different formats here: https://quic.cloud/docs/onboarding/adding-quic-cloud-ips-to-allowlist/ Please contact Sucuri or your Sucuri provider to whitelist these IP addresses. There are over 100 of them. Sucuri and most of their providers already have a script for doing so. C: The cache level in Sucuri to Disabled D: The link to flush the static cache in Sucuri E: List of Sucuri IPs so we can whitelist them Once these items are done we will be able to continue with the optimization process." | tee -a "$DOMAIN".cx.txt; fi; break;; esac done; fi; # Just collecting variables echo "ONLY Check for conflicting plugins or conflicting plugin settings $Clear"; read -r -p "Press enter to continue"; # IMGOPTlscwp=0 do not disable other image opt plugin echo "Yes the site's image optimization is going to use the"; echo "LSCWP plugin?"; echo "-----OR------" echo "No the site's image optimization going to use a"; echo "Different plugin ?"; select yn in "Yes" "No"; do case $yn in Yes ) IMGOPTlscwp=1; echo "Image OPT will be handled by LSCWP. " | tee -a "$DOMAIN".log.txt; break;; No ) IMGOPTlscwp=0; echo "Image OPT will NOT be handled by LSCWP. " | tee -a "$DOMAIN".log.txt; break;; esac done; # check for sitemap.xml. wget https://"$DOMAIN"/sitemap.xml; if [ "$(< sitemap.xml grep -c ".xml")" -gt 0 ]; then echo "XML Site-Map activated" | tee -a "$DOMAIN".log.txt; PLG_IA_google_sitemap_generator=0; fi; rm sitemap.xml # check for a2 Optimized WP. if [ "$(< "$DOMAIN".plugin.txt grep -c "a2-optimized-wp")" -gt 0 ]; then PLG_IA_a2_optimized_wp=0; UP_PLG_a2_optimized_wp=0; echo "a2-optimized-wp is already installed" | tee -a "$DOMAIN".log.txt; else "a2-optimized-wp needs to be installed" | tee -a "$DOMAIN".log.txt; PLG_IA_a2_optimized_wp=1; fi; if [ "$(< "$DOMAIN".plugin.txt grep -c "UI a2-optimized-wp")" -gt 0 ] || [ "$(< "$DOMAIN".plugin.txt grep -c "UA a2-optimized-wp")" -gt 0 ]; then UP_PLG_a2_optimized_wp=1; echo "Update the a2-optimized-plugin." | tee -a "$DOMAIN".log.txt; else UP_PLG_a2_optimized_wp=0; fi; # check for a2 LSCWP is installed and active. if [ "$(< "$DOMAIN".plugin.txt grep -c "litespeed-cache")" -gt 0 ]; then PLG_IA_litespeed_cache=0; UP_PLG_litespeed_cache=1; echo "litespeed-cache is already installed" | tee -a "$DOMAIN".log.txt; else "litespeed-cache needs to be installed" | tee -a "$DOMAIN".log.txt; PLG_IA_litespeed_cache=1; fi; if [ "$(< "$DOMAIN".plugin.txt grep -c "UI litespeed-cache")" -gt 0 ] || [ "$(< "$DOMAIN".plugin.txt grep -c "UA litespeed-cache")" -gt 0 ]; then echo "LSCWP needs to be updated"; UP_PLG_litespeed_cache=1; echo "Update the litespeed-cache. $UP_PLG_litespeed_cache" | tee -a "$DOMAIN".log.txt; else UP_PLG_litespeed_cache=0; fi; # check for plugin settings that need to be changed so no conflicts # check for JetPack if [ "$(< "$DOMAIN".plugin.txt grep -c "jetpack")" -gt 0 ]; then CSPLUG_jetpack=1; echo "Need to change JetPack settings that conflict" | tee -a "$DOMAIN".log.txt; # wp jetpack module deactivate lazy-images # wp jetpack module deactivate custom-css # wp jetpack module deactivate google-fonts # wp jetpack module deactivate photon-cdn # wp jetpack module deactivate photon fi; # check for JetPack Boost if [ "$(< "$DOMAIN".plugin.txt grep -c "jetpack-boost")" -gt 0 ]; then CSPLUG_jetpack_boost=1; echo "Need to deactivate JetPack Boost plugin" | tee -a "$DOMAIN".log.txt; fi; # check for WP-Optimize removes all setting and data on unistall. But before deleting go into the settings and disable the page cache and clear the cache # https://getwpo.com/documentation/#Caching-your-site if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-optimize")" -gt 0 ]; then PLGcloudflareDisDel=1; echo "cloudflare plugin is installed, need to remove and enter API into LSCWP" | tee -a "$DOMAIN".log.txt; fi; if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-optimize")" -gt 0 ]; then CSPLUG_wp_optimize=1; echo "Need to change fully deactivate wp-optimize" | tee -a "$DOMAIN".log.txt; echo "https://getwpo.com/?s=uninstall"; fi; # check for W3 Total Cache # wp w3-total-cache flush all CSPLUG_w3_total_cache=0 if [ "$(< "$DOMAIN".plugin.txt grep -c "w3-total-cache")" -gt 0 ]; then CSPLUG_w3_total_cache=1; echo "Need to change fully deactivate w3-total-cache" | tee -a "$DOMAIN".log.txt; echo "https://www.thewebmaster.com/how-to-uninstall-w3-total-cache-manually/"; fi; # check for WP Fastest Cache CSPLUG_wp_fastest_cache=0; if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-fastest-cache")" -gt 0 ]; then CSPLUG_wp_fastest_cache=1; echo "Need to change fully deactivate wp-fastest-cache" | tee -a "$DOMAIN".log.txt; echo "https://bloggingcommerce.com/en/how-to-completely-uninstall-cache-plugins-in-wordpress-updated/#Como_desinstalar_completamente_WP_Fastest_Cache"; fi; # check for wp-super-cache if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-super-cache")" -gt 0 ]; then CSPLUG_wp_super_cache=1; echo "Need to fully deactivate wp-super-cache" | tee -a "$DOMAIN".log.txt; echo "https://tipsnfreeware.com/how-to-uninstall-wp-super-cache-wordpress-plugin/"; fi; # check for hummingbird-performance if [ "$(< "$DOMAIN".plugin.txt grep -c "hummingbird-performance")" -gt 0 ]; then CSPLUG_hummingbird_performance=1; echo "Need to fully deactivate hummingbird-performance" | tee -a "$DOMAIN".log.txt; echo "https://wordpress.org/support/topic/need-directions-on-how-to-completely-remove-all-hummingbird-files/#:~:text=To%20uninstall%20Humminbird%20complete%2C%20please,entries%20while%20uninstalling%20the%20plugin."; fi; # check for wp-rocket if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-rocket")" -gt 0 ]; then CSPLUG_wp_rocket=1; echo "Need to fully deactivate wp-rocket" | tee -a "$DOMAIN".log.txt; #Login to your admin panel and go to “Settings > WP Rocket > Dashboard” section and clear you cached files first. #2 disbale and delete using wp-cli #3 dlete drop ins of advanced-cache.php, object.cache.php, memcached #4 Delete “/wp-content/cache/” folder #5 /wp-content/wp-rocket-config/ #6 Check any entries existing in the file between #BEGIN WP ROCKET and #END WP ROCKET block. #7 define('WP_CACHE', true) remove from wp-config.php #8 delete these cached image files from your “/wp-content/uploads/” #9 Locate your database and navigate to wp_options table. Search the table with “rocket” and delete the entries you find. #10 Select the tables “wp_ wpr_rucss_resources” and “wp_ wpr_rucss_used_css” and delete them. #https://github.com/wp-media/wp-rocket-cli fi; # check for comet-cache if [ "$(< "$DOMAIN".plugin.txt grep -c "comet-cache")" -gt 0 ]; then CSPLUG_comet_cache=1; echo "Need to fully deactivate comet-cache" | tee -a "$DOMAIN".log.txt; echo "https://cometcache.com/kb-article/how-do-i-uninstall-comet-cache/"; fi; # check for autoptimize if [ "$(< "$DOMAIN".plugin.txt grep -c "autoptimize")" -gt 0 ]; then CSPLUG_autoptimize=1; echo "Need to fully deactivate autoptimize" | tee -a "$DOMAIN".log.txt; echo "https://wordpress.org/plugins/autoptimize/#i%20want%20out%2C%20how%20should%20i%20remove%20autoptimize%3F"; fi; # check for perfmatters CSPLUG_perfmatters=0; if [ "$(< "$DOMAIN".plugin.txt grep -c "perfmatters")" -gt 0 ]; then CSPLUG_perfmatters=1; echo "Need to fully deactivate perfmatters" | tee -a "$DOMAIN".log.txt; echo "https://perfmatters.io/docs/clean-uninstall/"; fi; # check for image plugin that need to be disabled/uninstalled so no conflicts if IMGOPTlscwp=1 # check for smush if [ "$(< "$DOMAIN".plugin.txt grep -c "wp-smushit")" -gt 0 ] && [ "$IMGOPTlscwp" = 1 ]; then CSPLUG_wp_smushit=1; echo "Need to fully deactivate wp-smushit" | tee -a "$DOMAIN".log.txt; echo "https://wordpress.org/support/topic/how-to-uninstall-smush/"; fi; # check for imagify if [ "$(< "$DOMAIN".plugin.txt grep -c "imagify")" -gt 0 ] && [ "$IMGOPTlscwp" = 1 ]; then CSPLUG_imagify=1; echo "Need to fully deactivate imagify" | tee -a "$DOMAIN".log.txt; echo "https://imagify.io/documentation/uninstall-imagify-plugin/"; fi; # check for ewww-image-optimize if [ "$(< "$DOMAIN".plugin.txt grep -c "ewww-image-optimizer")" -gt 0 ] && [ "$IMGOPTlscwp" = 1 ]; then CSPLUG_ewww_image_optimizer=1; echo "Need to fully deactivate ewww-image-optimizer" | tee -a "$DOMAIN".log.txt; echo "https://docs.ewww.io/article/83-uninstalling-ewww-image-optimizer"; fi; # check for shortpixel-image-optimiser if [ "$(< "$DOMAIN".plugin.txt grep -c "shortpixel-image-optimiser")" -gt 0 ] && [ "$IMGOPTlscwp" = 1 ]; then CSPLUG_shortpixel_image_optimiser=1; echo "Need to fully deactivate shortpixel-image-optimiser" | tee -a "$DOMAIN".log.txt; echo "https://shortpixel.com/knowledge-base/article/81-remove-all-the-shortpixel-related-data-on-a-wp-website"; fi; # check for builders and proper settings # check for Elementor Page Builder # elementor or elementor-pro echo "$CSPLUG_elementor" if [ "$(< "$DOMAIN".plugin.txt grep -c "elementor")" -gt 0 ] || [ "$(< "$DOMAIN".plugin.txt grep -c "elementor-pro")" -gt 0 ] ; then CSPLUG_elementor=1; echo "Has a cli but not fully written" | tee -a "$DOMAIN".log.txt; echo "https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.xh4xo41czel2"; fi; echo "$CSPLUG_elementor_pro" if [ "$(< "$DOMAIN".plugin.txt grep -c "elementor-pro")" -gt 0 ] || [ "$(< "$DOMAIN".plugin.txt grep -c "elementor-pro")" -gt 0 ] ; then CSPLUG_elementor_pro=1; echo "Has a cli but not fully written" | tee -a "$DOMAIN".log.txt; echo "https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.xh4xo41czel2"; fi; # check for Generate Press # generatepress if [ "$(< "$DOMAIN".theme.txt grep -c "generatepress")" -gt 0 ]; then CSPLUG_generatepress=1; echo "https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.mmz6fxl4b7y9"; fi; # Divi theme builder # divi-builder if [ "$(< "$DOMAIN".plugin.txt grep -c "divi-builder")" -gt 0 ]; then CSPLUG_divi_builder=1; echo "https://divicommunity.com/rooms/topic/litespeed-and-divi-cache-settings/"; echo "With Divi enable all options at Divi -> Theme options -> General -> Performance except *Defer Additional Third Party Scripts*" echo "https://divilife.com/how-to-clear-all-your-caches-on-your-divi-wordpress-website/"; echo "Follow these steps to Clear the Divi Cache: Navigate to Divi Theme Options from the WP Admin menu Then go to the Builder Tab, then the Advanced sub-tab. Click the *Clear Cache* button next to Static CSS File Generation" fi; # check for Oxygen # oxygen-builder if [ "$(< "$DOMAIN".plugin.txt grep -c "oxygen-builder")" -gt 0 ]; then CSPLUG_oxygen_builder=1; fi; # check for WPBakery (Coming Soon) # check for WP Page Builder (Coming Soon) # check for Site Origin Page Builder (Coming Soon) # check for Visual Composer (Coming Soon) # check for Page Builder Sandwich (Coming Soon) # check for BoldGrid (Coming Soon) # check for MotoPress Visual Page Builder (Coming Soon) # check for Brizy (Coming Soon) # check for Themify (Coming Soon) echo "Yes we need to create a backup of the database and site or No a backup has one already been made?" | tee -a "$DOMAIN".log.txt; select yn in "Yes" "No"; do case $yn in Yes ) RQBKUP=1; echo "$RQBKUP" | tee -a "$DOMAIN".log.txt; break;; No ) RQBKUP=0; read -r -p "Enter in other Backup details: " WHYNOBKUP; echo "$RQBKUP " | tee -a "$DOMAIN".log.txt; echo "$WHYNOBKUP" | tee -a "$DOMAIN".log.txt; break;; esac done; echo "======Server Type======" | tee -a "$DOMAIN".log.txt; PS3='Choose the server type: ' sertype=("Mach 8 VPS" "Mach 16 VPS" "Mach 32 VPS" "Warp 2 Turbo AMD Dedi" "Warp 2 Turbo Intel Dedi" "Warp 3 Turbo AMD Dedi" "Shared") select ser in "${sertype[@]}"; do case $ser in "Mach 8 VPS") STYPE=8; break;; "Mach 16 VPS") STYPE=16; break;; "Mach 32 VPS") STYPE=8; break;; "Warp 2 Turbo AMD Dedi") STYPE=1; break;; "Warp 2 Turbo Intel Dedi") STYPE=2; break;; "Warp 3 Turbo AMD Dedi") STYPE=3; break;; "Shared")STYPE=0; break;; *) echo "invalid option $REPLY";; esac done; echo "$STYPE" | tee -a "$DOMAIN".log.txt; test -f /home/"$me"/pass-var-p1.txt && rm /home/"$me"/pass-var-p1.txt; cd /home/"$me" || exit touch pass-var-p1.txt { echo "DOMAIN=$DOMAIN" echo "NEEDCHECKpdir=$NEEDCHECKpdir" echo "DOsearchpdir=$DOsearchpdir" echo "wpconfigCHANGE=$wpconfigCHANGE" echo "CFCS=$CFCS" echo "CFCSH=$CFCSH" echo "CFEC=$CFEC" echo "CFECCPWP=$CFECCPWP" echo "PLGcloudflareDisDel=$PLGcloudflareDisDel" echo "SERVERCF=$SERVERCF" echo "CFAPIinfoNeed=$CFAPIinfoNeed" echo "CFAV=$CFAV" echo "CFAVT=$CFAVT" echo "APOinfoNeed=$APOinfoNeed" echo "SERVERSUCURI=$SERVERCF" echo "SUinfoNeed=$SUinfoNeed" echo "SUCURIa2=$SUCURIa2" echo "canCONTINUE=$canCONTINUE" echo "IMGOPTlscwp=$IMGOPTlscwp" echo "PLG_IA_google_sitemap_generator=$PLG_IA_google_sitemap_generator" echo "PLG_IA_a2_optimized_wp=$PLG_IA_a2_optimized_wp" echo "UP_PLG_a2_optimized_wp=$UP_PLG_a2_optimized_wp" echo "PLG_IA_litespeed_cache=$PLG_IA_litespeed_cache" echo "UP_PLG_litespeed_cache=$UP_PLG_litespeed_cache" echo "CSPLUG_jetpack=$CSPLUG_jetpack" echo "CSPLUG_jetpack_boost=$CSPLUG_jetpack_boost" echo "CSPLUG_wp_optimize=$CSPLUG_wp_optimize" echo "CSPLUG_wp_super_cache=$CSPLUG_wp_super_cache" echo "CSPLUG_hummingbird_performance=$CSPLUG_hummingbird_performance" echo "CSPLUG_wp_rocket=$CSPLUG_wp_rocket" echo "CSPLUG_comet_cache=$CSPLUG_comet_cache" echo "CSPLUG_autoptimize=$CSPLUG_autoptimize" echo "CSPLUG_wp_smushit=$CSPLUG_wp_smushit" echo "CSPLUG_imagify=$CSPLUG_imagify" echo "CSPLUG_ewww_image_optimizer=$CSPLUG_ewww_image_optimizer" echo "CSPLUG_shortpixel_image_optimiser=$CSPLUG_shortpixel_image_optimiser" echo "CSPLUG_elementor=$CSPLUG_elementor" echo "CSPLUG_elementor_pro=$CSPLUG_elementor_pro" echo "CSPLUG_generatepress=$CSPLUG_generatepress" echo "CSPLUG_divi_builder=$CSPLUG_divi_builder" echo "CSPLUG_oxygen_builder=$CSPLUG_oxygen_builder" echo "RQBKUP=$RQBKUP" echo "CFgotAPI=$CFgotAPI" echo "preTTFB=$preTTFB" echo "preFLT=$preFLT" echo "mpreFCP=$mpreFCP" echo "mpreLCP=$mpreLCP" echo "mpreSCORE=$mpreSCORE" echo "dtpreFCP=$dtpreFCP" echo "dtpreLCP=$dtpreLCP" echo "dtpreSCORE=$dtpreSCORE" echo "HOMEDIR=$HOMEDIR" echo "CPUSER=$CPUSER" echo "IPADDRESS=$IPADDRESS" echo "pdir=$pdir" echo "pdomain=$pdomain" echo "wphome=$wphome" echo "wpsite=$wpsite" echo "CSPLUG_w3_total_cache=$CSPLUG_w3_total_cache" echo "CSPLUG_wp_fastest_cache=$CSPLUG_wp_fastest_cache" echo "CSPLUG_perfmatters=$CSPLUG_perfmatters" echo "STYPE=$STYPE" echo "WHYNOBKUP=$WHYNOBKUP" echo "CFAPIemail=$CFAPIemail" echo "CFAPIkey =$CFAPIkey" } >> pass-var-p1.txt clear echo "These are the items where we need information from the CX or will take some time for us to do." | tee -a "$DOMAIN".log.txt; if [ "$NEEDCHECKpdir" = 1 ]; then echo "The directory of the WordPress needs to be moved. Interaction with Cx." | tee -a "$DOMAIN".cx.txt; canCONTINUE=0; fi; if [ "$APOinfoNeed" = 1 ]; then echo "CX Needs to disable APO and go to the Cloudflare FREE plan." | tee -a "$DOMAIN".cx.txt; canCONTINUE=0; fi; if [ "$CFAPIinfoNeed" = 1 ]; then echo "CX Needs to supply the API credentails for Cloudflare so that LSCWP can control it." | tee -a "$DOMAIN".cx.txt; canCONTINUE=0; fi; if [ "$SUCURIa2" = 0 ] && [ "$SUinfoNeed" = 1 ]; then echo "CX Needs have his Sucuri Provider set up Sucuri for Integration with LiteSpeed." | tee -a "$DOMAIN".cx.txt; canCONTINUE=0; fi; if [ "$SUCURIa2" = 1 ] && [ "$SUinfoNeed" = 1 ]; then echo "We are the Sucuri provider and need to set up the integration." | tee -a "$DOMAIN".log.txt; canCONTINUE=0; fi; if [ "$canCONTINUE" = 1 ]; then echo "Nothing is stopping us we can continue..." | tee -a "$DOMAIN".log.txt; fi; if [ "$canCONTINUE" = 0 ]; then echo "We need to stop here and gather the info and do the tasks before we can continue again." | tee -a "$DOMAIN".log.txt; echo "=====> All correspondance you need for the ticket to the customer has been collected...." | tee -a "$DOMAIN".log.txt; echo "$Red ********** Start the dump to the screen **********"; cat "$DOMAIN".cx.txt; echo "********** End dump to the screen ********** $Clear"; echo "======> Make sure to copy the dump from your screen to a notepad!" read -r -p "Press enter to continue"; echo "File clean up time!"; read -r -p "Press enter to continue"; echo "********** $DOMAIN.header.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".header.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.plugin.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".plugin.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.theme.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".theme.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.wpvar.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".wpvar.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.cx.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".cx.txt)" | tee -a "$DOMAIN".log.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".theme.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".plugin.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".home.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".siteurl.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".cx.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".log.txt; rm "$DOMAIN".header.txt; rm "$DOMAIN".theme.txt; rm "$DOMAIN".plugin.txt; rm "$DOMAIN".wpvar.txt; rm "$DOMAIN".cx.txt; rm userdomainsort.txt; rm sitemap.xm*; mkdir wp-opt-logs me="$(whoami)"; NewName="${DOMAIN}_${me}_${sdt}"; mv /home/"$me"/"$DOMAIN".log.txt /home/"$me"/wp-opt-logs/"$NewName".txt ; exit 0; fi; sudo cp /home/"$me"/pass-var-p1.txt /home/"$CPUSER"/p2-var.txt sudo su - "$CPUSER" -c "sh p2-wp-opt-v1.sh"; echo "=====exit as cPanel User======" echo "$(</home/"$CPUSER"/"$DOMAIN".plugin.txt)" | tee -a "$DOMAIN".plugin.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".theme.txt)" | tee -a "$DOMAIN".theme.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".home.txt)" | tee "$DOMAIN".home.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".siteurl.txt)" | tee "$DOMAIN".siteurl.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".cx.txt)" | tee -a "$DOMAIN".cx.txt; echo "$(</home/"$CPUSER"/"$DOMAIN".log.txt)" | tee -a "$DOMAIN".log.txt; echo "====================================================="; echo "***Swarm and ask your friendly L2 to activate the craweler in LiteSpeed***"; read -r -p "Press enter to continue"; echo "===Verifying that the LS cPanel plugin regonizes the WP Site and LSCWP==="; # sudo /usr/local/lsws/admin/misc/lscmctl addinstalls -wpinstall /home/"$CPUSER"/public_html /home/"$CPUSER"/public_html "$DOMAIN" "$DOMAIN"; # sudo /usr/local/lsws/admin/misc/lscmctl status /home/"$CPUSER"/public_html; echo "$Red if you hove root access and you can" echo " sudo su - to the root user " echo " then when you finish this script please run the following " echo " /usr/local/lsws/admin/misc/lscmctl addinstalls -wpinstall /home/$CPUSER/public_html /home/$CPUSER/public_html $DOMAIN $DOMAIN" echo " /usr/local/lsws/admin/misc/lscmctl status /home/$CPUSER/public_html" echo "if not ahve someone with access run it for you, Swarm, L2, Team Lead $Clear" echo "$Green *******************Post Optimized Tests***********"; echo "Post-Optimization data, this stage gathers data and establishes the results of the optimization of the site. We ask that you use GTmetrix to establish the two performance metrics of TTFB (Time to first Byte) and FLT (Fully Loaded Time). Additionally use Google Pagespeed Insights to record a general *Performance Score*, FCP (First Contentful Paint), and LCP (Largest Contentful Paint) $Clear"; echo "=============================================================================="; echo "$Red ENTER ALL TIMES IM MS (MILLASECONDS 1,000 ms = 1 sec) $Clear"; echo "GTmetrx" | tee -a "$DOMAIN".log.txt; read -r -p "Enter TTFB: " postTTFB; echo "Post-Opt TTFB was $postTTFB ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter FLT: " postFLT; echo "Post-Opt FLT was $postFLT ms " | tee -a "$DOMAIN".log.txt; echo "PageSpeed Mobile Scores" | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile FCP: " mpostFCP; echo "Post-Opt Mobile FCP was $mpostFCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile LCP: " mpostLCP; echo "Post-Opt Mobile LCP was $mpostLCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Mobile Performance Score: " mpostSCORE; echo "Post-Opt Mobile Performance Score was $mpostSCORE ms " | tee -a "$DOMAIN".log.txt; echo "PageSpeed Dsktop Scores" | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop FCP: " dtpostFCP; echo "Post-Opt Deskto FCP was $dtpostFCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop LCP: " dtpostLCP; echo "Post-Opt Deskto LCP was $dtpostLCP ms " | tee -a "$DOMAIN".log.txt; read -r -p "Enter Desktop Performance Score: " dtpostSCORE; echo "Post-Opt Deskto Performance Score was $dtpostSCORE ms " | tee -a "$DOMAIN".log.txt; read -r -p "Press enter to continue"; edt="$(date +%F_%H-%M-%S)"; echo "End Time: $edt" | tee -a "$DOMAIN".log.txt; echo "======If Any Errors, swarm and escalate to a L2===="; echo "File clean up time!"; read -r -p "Press enter to continue"; echo "********** $DOMAIN.header.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".header.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.plugin.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".plugin.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.theme.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".theme.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.home.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".home.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.siteurl.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".siteurl.txt)" | tee -a "$DOMAIN".log.txt; echo "********** $DOMAIN.cx.txt **********" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".cx.txt)" | tee -a "$DOMAIN".log.txt; echo "$(<"$DOMAIN".txt)" | tee -a "$DOMAIN".log.txt; edt="$(date +%F_%H-%M-%S)"; echo "end: $edt" | tee -a "$DOMAIN".log.txt sudo rm /home/"$CPUSER"/"$DOMAIN".theme.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".plugin.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".home.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".siteurl.txt sudo rm /home/"$CPUSER"/"$DOMAIN".cx.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".log.txt; sudo rm /home/"$CPUSER"/"$DOMAIN".txt; sudo rm /home/"$CPUSER"/p2-var.txt; sudo rm /home/"$CPUSER"/p2-wp-opt-v1.data; sudo rm /home/"$CPUSER"/p2-wp-opt-v1.sh; rm "$DOMAIN".header.txt; rm "$DOMAIN".theme.txt; rm "$DOMAIN".plugin.txt; rm "$DOMAIN".wpvar.txt; rm "$DOMAIN".cx.txt; rm "$DOMAIN".home.txt; rm "$DOMAIN".siteurl.txt; rm userdomainsort.txt; rm sitemap.xml* rm headers; mkdir wp-opt-logs me="$(whoami)"; NewName="${DOMAIN}_${me}_${edt}"; mv /home/"$me"/"$DOMAIN".log.txt /home/"$me"/wp-opt-logs/"$NewName".txt ; echo "Please remember to enable the A2-opt Plugin and the settings for that." echo "If the site is uning the Free Cloudflare, to go now and finish the intergation, clear the CF cache, and put the site into Devleoper mode before doing any testing" exit 0;