echo;
echo UPDATE WP TO USE SSL;
echo;
echo Use with caution! ;echo;echo Include www if itís needed, and use ONLY in the root directory of WP;
echo;
echo Current directory:;
pwd;
echo;
echo Copy URL below excluding http://;echo;wp option get siteurl;
wp option get home;read -ep "URL: " url; 
echo Updating SiteURL;
echo;
wp option set siteurl https://$url;echo Updating Home;
echo;
wp option set home https://$url;echo Force https in .htaccess;
echo;
sed -i '1 i\RewriteEngine On\nRewriteCond %{SERVER_PORT} 80\nRewriteRule ^(.*)$ https://'$url'/$1 [R,L]' .htaccess;
echo New .htaccess head:;
echo;
head -3 .htaccess;
echo;
echo Replace hard-coded links:;
echo;
wp search-replace 'http://'$url 'https://'$url
