Webapp Substrate script for WordPress on Debian-Nginx
The outer heredoc construct isn't really required.
You do not verify that you have command line arguments.
You do not assign your command line arguments to the variable domain.
You use the variable domain when it is uninitialised.


You make a number of assumptions, any one of which could bite you hard.


You assume that the nginx package has been installed and that it has created the paths and other things you require.
You assume that the MySQL packages have been installed.
You assume that the certbot package has been installed.
You assume that the /var/www/html directory exists.
You assume that the www-data user exists.
You assume that this is the first time that the script has been run for domain. It will have unexpected results if domain already exists.


Think about those assumptions and what would happen if they were incorrect and things didn't exist as you expect.

Your variable names are not good - why, for example, is the database user's password assigned to waps and not something like dbpassword?

It's not clear if you are planning on passing more than one domain to the script per invocation. If you only plan one domain per invocation you do not need the for loop. 

You assume that all of your commands will complete correctly. You really should check the exit status of those that could reasonably be expected to fail. For example the wget could fail for many reasons. If it does then everything after it should not be run. What happens if certbot fails or mysql or tar or ...

Your chown -R... command assumes that nothing else is installed in /var/www/html or that everything installed there should be owned by www-data, this may not be the case, use /var/www/html/${domain}. Your find commands are the same.

Your find commands will exec chmod for every file found. It is more efficient to use find ... -exec {} + which optimises the size of the command line and reduces the number of execs. 


  I especially hope to learn how I could shorten this code in at least 10 rows, if at all.


How sweet, I can see it being considerably larger.