All posts by acrane

About acrane

A web designer from Charlotte, NC, I enjoy working in the yard, kayaking, building stuff, making things, creating, thinking and of course WordPress.

How to SSH into Digital Ocean when using SpinupWP

Spinupwp is a great new way to manage WordPress sites on Digital Ocean. Fortunately or Unfortunately, they handle access to the server in a more limited version that dealing directly with Digital Ocean.

Cutting to the chase, Spinupwp will not let you access the server via ssh with the root user or with password authentication.

You must set up ssh keys. After you’ve set up the keys, you must set up a sudo user.

Once you’ve done these two steps, you’re free to ssh into your Digital Ocean server using the sudo user. It will look something like the following:

ssh sudo_user_name@server_ip_address

htaccess Force https

If someone comes to your site with a non-secure link it will not render as secure. You can add a couple lines to your htaccess that will force a secure connection. After the “RewriteEngine On” line, put the following 2 lines. Be sure to change “example” to your domain.

 

Add Multiple Google Captcha per page and disable submit button until verify

This will show you how to add multiple Google Captcha per page and disable the submit button until the user clicks and verify’s that they are not a robot.

First, we create the forms. You can follow along in the comments how to setup the ID’s that we will target later to render the Captcha

Second, before the end of your web page, we will include the required javascript from Google Captcha.

<script src=”https://www.google.com/recaptcha/api.js?onload=myCallBack&render=explicit” async defer></script>

Third, between the <head></head> tags, insert the following functions that will render your Google Captcha. Important things to note:

  1. there are test keys you can uncomment to test locally on your computer, but you must switch those to your own keys in production
  2. your function, “myCallBack” is called from the script you included above before the end of your file. You are going to do this in render mode, so that also needs to be in the script call above.

Above the myCallBack function, in the same script tags, place the following functions that will enable your submit button to be clicked when a user successfully clicks the captcha.

Finally, we need to disable the submit button before the user clicks on the captcha. Do that by placing the following at the end of your webpage before the call to the Google Captcha script.

And this is what it looks like all together. If you need to see other ways to render with other parameters, you can do so at Google’s documentation.