D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
dh_urepzd
/
Filename :
.bash_history
back
Copy
#1739257139 echo ; echo '========================================' ; echo -e '\033[1m -- WORDPRESS OPTIMIZATION CHECKS -- \033[0m' ; echo '========================================' ; printf '\n \033[1m-- WORDPRESS CORE VERSION --\033[0m\n\n' ; wp core version --skip-plugins --skip-themes && printf '\n \033[1m-- CHECK CORE UPDATES --\033[0m\n\n' && if [[ $(wp core check-update --skip-plugins --skip-themes) == "Success: WordPress is at the latest version." ]] ; then echo -e "\e[1;32m WordPress is at the latest version! \e[0m\n" ; else eval wp core check-update --fields=version,update_type --skip-plugins --skip-themes ; fi && printf '\n \033[1m-- PHP VERSION --\033[0m\n\n' ; echo "<?php phpinfo(); ?>" > info.php && curl -s https://`cut -d/ -f4 <<< "${PWD}"`/info.php | grep 'PHP Version' | tail -1 | awk -F"[><]+" '{print $7}' && rm info.php ; printf '\n\n \033[1m-- CHECKING FOR MULTISITE --\033[0m\n\n' && if [[ $(wp core is-installed --network --skip-plugins --skip-themes > /dev/null 2>&1 ; echo $?) -eq 0 ]] ; then printf "\033[1;31m\n WARNING MULTISITE FOUND! \033[0m\n" && eval wp site list && printf "\n\n" ; else printf "\033[1;32m Good! Not a multisite, moving on \033[0m\n\n" ; fi ; printf '\n \033[1m-- CHECKING FOR WOOCOMMERCE PLUGIN ACTIVE ON SHARED --\033[0m\n\n' && if [[ $(hostname -s) == *-shared-* || ! $(hostname -s) =~ [0-9] ]] && [[ $(wp plugin is-active woocommerce --skip-plugins --skip-themes && echo $?) = 0 ]] ; then printf "\033[1;31m\n WARNING Woocommerce Found Active on Shared Hosting\n\n\033[0m" ; else printf "\033[1;32mNot Found\n\n\033[0m" ; fi ; printf '\n \033[1m-- PLUGIN DETAILS --\033[0m\n\n' ; wp plugin status --skip-themes --skip-plugins ; printf '\n \033[1m-- CHECK ACTIVE PLUGINS WITH AVAILABLE UPDATES --\033[0m\n\n' ; if [[ -z $(wp plugin list --status=active --skip-plugins --skip-themes | grep available) ]] ; then printf "\e[32mAll Plugins Are Up to Date\e[0m\n\n" ; else eval wp plugin list --status=active --update=available --fields=status,name,version,update,update_version --skip-plugins --skip-themes ; fi && printf '\n \033[1m-- THEME DETAILS --\033[0m\n\n' ; wp theme status --skip-themes --skip-plugins ; printf '\n \033[1m-- CHECK FOR ACTIVE PARENT/CHILD THEME UPDATE --\n\n' ; if [[ -z $(wp theme list --status=active,parent --skip-plugins --skip-themes | grep available) ]] ; then printf "\033[32mActive Theme Is Up To Date\033[0m\n\n" ; else eval wp theme list --update=available --status=parent,active --fields=status,name,version,update,update_version --skip-plugins --skip-themes ; fi ; echo ; echo -e '\033[1m -- DATABASE DETAILS -- \033[0m' ; wp db size --size_format=mb --tables --skip-themes --skip-plugins ; printf "\n--AUTOLOAD SIZE IN OPTIONS / TOP 25 LARGEST IN AUTOLOAD--\n\n" ; wp db query "SELECT 'autoload-options-size' AS name, IF(SUM(LENGTH(option_value))/1048576 < 0.9, 'success', 'warning') AS status, CONCAT('Autoloaded options size is ', ROUND(SUM(LENGTH(option_value))/1048576, 2), 'MB (Threshold: 0.9MB).') AS message FROM $(wp config get table_prefix)options WHERE autoload='yes';" && wp db query "SELECT option_name, LENGTH(option_value)/1048576 AS 'Size (MB)' FROM $(wp config get table_prefix)options WHERE autoload='yes' ORDER BY LENGTH(option_value) DESC LIMIT 25;" ; echo; echo '==================' ; echo -e '\033[1m Home and Siteurl LINKS\033[0m' ; echo '==================' ; wp option get home --skip-plugins --skip-themes ; wp option get siteurl --skip-plugins --skip-themes; echo ; printf '\n\033[1m -- HTTPS TRAFFIC DETAILS -- \033[0m\n' ; printf "\n-- TOTAL NUMBER OF HTTPS REQUESTS EACH DAY --\n\n" ; for k in `ls -S ~/logs/$(pwd | awk -F'/' '{print $NF}')/https/access.log* 2>/dev/null | grep -v .gz`; do wc -l $k | sort -r -n; done ; printf "\n\n-- MOST REQUESTED FILES IN HTTPS --\n\n" ; awk '{print $7}' ~/logs/`cut -d/ -f4 <<< "${PWD}"`/https/access.log 2>/dev/null | cut -d? -f1 | sort |uniq -c | sort -n | tail -n10 ; printf "\n\n-- REPEAT IP REQUESTS TO HTTPS --\n\n" ; awk '{print $1}' ~/logs/`cut -d/ -f4 <<< "${PWD}"`/https/access.log 2>/dev/null | sort | uniq -c |sort -n | tail -n10 && printf "\n\n-- MOST REQUESTED HTTPS PAGES --\n\n" ; awk '{print $11}' ~/logs/`cut -d/ -f4 <<< "${PWD}"`/https/access.log 2>/dev/null | cut -d? -f1 | sort |uniq -c | sort -n | tail -n10 ; printf "\n================-- BOT HITS --====================\n\n" ; for k in $(find ~/logs/$(basename $(pwd))/https/ -name 'access.log'); do awk -F"compatible;" '/compatible/ {print $2}' "$k" | cut -d\; -f1 | cut -d/ -f1 | awk '{print $1}' | sort | uniq -c | sort -n | tail; done ; printf "\n================-- CACHE INFO --====================\n" ; printf "\n\n-- LOOKING FOR PLUGIN PAGE CACHING SET IN WP-CONFIG.PHP --\n\n" && if [[ -z $(grep WP_CACHE wp-config.php ; grep WPCACHEHOME wp-config.php) ]] ; then printf "\033[0;31mNo Cache Rules Found in Wp-Config.php\033[0m\n\n" ; else eval grep WP_CACHE wp-config.php ; grep WPCACHEHOME wp-config.php ; fi ; printf '\n==================\n' ; printf "\n--CRON EVENTS--\n\n" ; wp cron event list --skip-themes --skip-plugins; echo; echo '==================' ; printf "\n-- Disable Cron Status in Wp-Config --\n\n"; cron_setting=$(grep -nE "\s*define\(\s*'DISABLE_WP_CRON'\s*,\s*true\s*\)\s*;" wp-config.php) && { line_number=$(echo "$cron_setting" | cut -d: -f1); printf "WP Cron is Disabled on line: $line_number\n"; echo "$cron_setting" | cut -d: -f2-; printf "\n"; } || printf "No DISABLE_WP_CRON rule found in wp-config, moving on\n\n"; printf '\n==================\n\n' ; echo -e '\033[1mLAST ENTRIES ON ERROR LOGS\033[0m' ; echo ; echo '==================' ; tail -20 ../logs/$"`pwd | awk -F'/' {'print $4'}`"/https/error.log; echo ; printf "\n================ -- Having problems understanding WP Performance? reach out in #wps_assists for help! -- ====================\n\n" ; #1739258450 wp db export ~/backup`date +"%m-%d-%Y-%T"`.sql #1739258455 wp plugin list #1739258460 wp plugin list --skip-themes --skip-plugins #1739258472 wp plugin toggle elementor --skip-themes --skip-plugins #1739258477 wp plugin list