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 ############################################################ # Help # ############################################################ Help() { # Display Help echo "Optimize a site for litespeed cache" echo echo "Syntax: optimize.sh [-d|h|p]" echo "options:" echo "d Domain name" echo "h Print this Help" echo "p Plan type ('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')" echo } ############################################################ ############################################################ # Main program # ############################################################ ############################################################ # Set variables PLAN="shared" DOMAIN="a2hosting.com" ############################################################ # Process the input options. Add options as needed. # ############################################################ # Get the options while getopts ":dhp:" option; do case $option in h) # display Help Help exit;; d) # Enter a domain DOMAIN=$OPTARG;; p) # Enter a plan PLAN=$OPTARG;; \?) # Invalid option echo "Error: Invalid option" exit;; esac done echo "The following inforamtion is needed to start run this script, so make sure you have the following information: 1. The server type installing on: Shared, which type of VPS, or which type of Dedi 2. Is LSCWP going to Handle the Image Optiziation? 3. Is A2 Opt already installed? 4. Is LSCWP already Installed? 5. The Domain that is being optimized 6. The cPanel Username 7. The cPanel Password 8. Download the profile file as instructed in the manual here: https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.sc19ul44t9z0 The other information needed will be presented to you to confirm as the script is running." read -p "Press enter to continue"; echo "You should have already removed conflicts and tuned the themes and page builders as discussed here: https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.yry5h98e12h6 and https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.ntx5kfpqu19q Before the optimization process begins, we need to check if the site we are optimizing is on a CDN." read -p "Press enter to continue"; echo "$DOMAIN"; echo "========CDN Check====================="; # shellcheck complains about the usage of grep in the next line. It should be fine as there is little data coming back from the curl call. It's normally raising an issue when reading files from a directory and we want to stop on the first occurance. echo "As per the manual here: https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.z19ei2cncgon" if [[ $(curl -sLH "Accept: text/javascript, text/html, application/xml, */*" --head "$DOMAIN" | grep -E "cf-cache-status: HIT|cf-apo-via: tcache|cf-edge-cache: cache,platform=wordpress") ]]; then echo "APO enabled"; else echo "APO not enabled"; fi; if [[ $(curl -sIL "$DOMAIN" | grep -E "Server: cloudflare") ]]; then echo "Cloudflare CDN"; fi; if [[ $(curl -sIL "$DOMAIN" | grep -E "Server: Sucuri") ]]; then echo "Sucuri enabled"; fi; echo " If it returned APO Enabled or Sucuri enabled, you will need to stop as this point and follow the instuctions from the link above. If it returned Cloudflare CDN you need to make sure the customer has supplied the inormation needed as per the instruction link above so that LSCWP can put Cloudflare into Development Mode. If they have then you can continue. If the results returned are not any of the above you can also continue." echo "Do you want to continue?"; select yn in "Yes" "No"; do case $yn in Yes )break;; No ) exit 0; esac done; echo "Is A2 Opimized WP already installed?" select yn in "Yes" "No"; do case $yn in Yes ) A2PLG=1; break;; No ) A2PLG=0; break;; esac done; echo "$A2PLG"; echo "Is LiteSpped Cache already installed?" select yn in "Yes" "No"; do case $yn in Yes ) LSCWP=1; break;; No ) LSCWP=0; break;; esac done; echo "$LSCWP"; echo "Yes the optimization is going to use the LSCWP plugin to do the image optimization which is the recommended method or No the image optimization method being used is already installed." select yn in "Yes" "No"; do case $yn in Yes ) IMGOPT=0; break;; No ) IMGOPT=1; break;; esac done; echo "$IMGOPT"; echo "Does https://$DOMAIN/sitemap.xml show a show a sitemap when loaded in a browser?"; select yn in "Yes" "No"; do case $yn in Yes )SMAP=1; break;; No ) SMAP=0; break;; esac done; echo "$SMAP"; read -p "Enter cPanel User Name: " CPUSER; echo "$CPUSER"; echo "Please confirm the diretory for the WordPress Installation and the IP address. To confirm, plese enter them in full when requested" sudo grep ^"$DOMAIN" /etc/userdatadomains|awk -F'==' '{print $5"\n"$6}'|sed 's/:80//' read -p "Enter IP Address: " IPADDRESS; echo "$IPADDRESS"; read -p "Enter Home Directory: " HOMEDIR; echo "$HOMEDIR"; echo " Yes we need to create a backup of the database and site or No a backup has one already been made?"; select yn in "Yes" "No"; do case $yn in Yes ) RQBKUP=1; echo "$RQBKUP"; break;; No ) RQBKUP=0; read -p "Enter in other Backup details: " WHYNOBKUP; echo "$RQBKUP "; echo "$WHYNOBKUP"; break;; esac done; echo "======Server Type======"; 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"; echo " Are you ready to proceed with the Optimization? "; read -p "Press enter to continue"; echo "======Creating the .redis.on file======"; su "$CPUSER" -p -c "cd /home/$CPUSER; touch .redis.on; echo 'Created: /home/$CPUSER/.redis.on'; echo '======Listing Plugins and Themes======'; cd $HOMEDIR; wp plugin list; wp theme list; echo '======Checking the Home and Site URL======'; wp option get home; wp option get siteurl; echo '******IMPORTANT********** If they are the same you are good to go! If they are NOT the same do not continue until you have Followed the instructions here: https://docs.google.com/document/d/1FLe_rlX1z72yu6P3VfrXR6Uh45zWPCnqIQWt54Iz9zk/edit#bookmark=id.3gh7eo68uimv ********************************************'; read -p 'Press enter to continue'; if (($RQBKUP == 1)); then read -p 'Press enter to backup the database'; wp db export; read -p 'Press enter to backup the site'; tar -vczf sitebackup.gz . ; echo 'sitebackup.gz. Both DB backup and the site will be in the archive.'; fi; if (($RQBKUP == 0)); then echo 'No backup was made because $WHYNOBKUP'; fi; if (($A2PLG == 1)); then wp plugin update a2-optimized-wp; echo 'a2 optimized is updated'; fi; if (($A2PLG == 0)); then wp plugin install a2-optimized-wp; echo 'a2 optimized is installed'; fi; if (($LSCWP == 1)); then wp litespeed-option export; wp plugin update litespeed-cache; echo 'backed up old configuration file for LSCWP and also updated the plugin'; fi; if (($LSCWP == 0)); then wp plugin install litespeed-cache --activate; echo 'LSCWP plugin installed and activated'; fi; wp litespeed-option import /opt/a2-optimized/wordpress/LSCWP_Default_Configuration.data; echo 'Default profile has been uploaded to LSCWP'; if (( $STYPE == 8 )); then wp litespeed-option set crawler-load_limit 1.6; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 28800; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Mach 8 VPS'; fi; if (( $STYPE == 16 )); then wp litespeed-option set crawler-load_limit 4.8; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 28800; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Mach 16 VPS'; fi; if (( $STYPE == 32 )); then wp litespeed-option set crawler-load_limit 6.4; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 7200; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Mach 32 VPS'; fi; if (( $STYPE == 1 )); then wp litespeed-option set crawler-load_limit 6.4; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 7200; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Warp 2 Turbo AMD Dedi'; fi; if (( $STYPE == 2 )); then wp litespeed-option set crawler-load_limit 6.4; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 7200; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Warp 2 Turbo Intel Dedi'; fi; if (( $STYPE == 3 )); then wp litespeed-option set crawler-load_limit 6.4; wp litespeed-option set crawler-threads 3; wp litespeed-option set purge-stale 0; wp litespeed-option set util-instant_click 1; wp litespeed-option set crawler-crawl_interval 7200; wp litespeed-option set optm-ccss_per_url 1; echo 'Profile upated to Warp 3 Turbo AMD Dedi'; fi; if (( $STYPE == 0 )); then echo 'Profile upated to shared server'; fi; wp litespeed-option set server_ip $IPADDRESS; echo 'Set the IP address'; wp litespeed-online init; echo 'Requested Domain Key from Quik.cloud'; if (( $IMGOPT == 1 )); then wp litespeed-option set img_optm-auto 0; wp litespeed-option set img_optm-cron 0; wp litespeed-option set img_optm-ori 0; wp litespeed-option set img_optm-webp 0; wp litespeed-option set ig_optm-webp_replace 0; wp litespeed-option set img_optm-webp_replace_srcset 0; wp litespeed-option set media-lazy 0; wp litespeed-option set media-iframe_lazy 0; echo 'Adjusted LSCWP to not use its image optimization'; fi; if (( $SMAP == 0 )); then wp plugin install google-sitemap-generator --activate; wp litespeed-option set crawler-sitemap https://$DOMAIN/sitemap.xml; echo 'Google Site Map Generator plugin has been installed and activated it has also been set to be the crawler map in LSCWP Please SWARM and ask L2 to activate the crawler in LiteSpeed.' read -p 'Press enter to continue'; fi; if (( $SMAP == 1 )); then echo 'Please SWARM and ask L2 to activate the crawler in LiteSpeed.'; read -p 'Press enter to continue'; fi; wp litespeed-option set object-host /home/$CPUSER/.redis/redis.sock; echo '===The Unix Sock for Redis to be used for the Object Cache was set to:==='; echo '/home/$CPUSER/.redis/redis.sock'; wp litespeed-image push; echo '===The image optimization has been primed, if you see an error,'; echo 'it just means the WP Heartbeat did it first==='; wp litespeed-purge all; echo '======The Cache has been purged======'; wp litespeed-option export; echo 'A backup has been created of the LSCWP settings';" 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 "======If Any Errors, swarm and escalate to a L2===="; echo "Manually finish the optimization, at Step 29";