Testing the Contact Form 7 wpcf7_mail_sent action

This is the SLF Quick Enquiry form (with some email addresses changed)

Current GLCID:

[show_gclid]

    Request Free Call Back
    • [gclid sfl-gclid]

    It should do the action after!

     

    And here is another form which shouldn’t do jack:

      Storing JSON data as WordPress User Metadata

      update_user_meta() (and, by extension, Advanced Custom Fields update_field() function) messes up UTF-8 encoding because it strips slashes from entered data.

      Get around this by using wp_slash on your encoded JSON string

      update_user_meta( $user_id, 'my_json_field', wp_slash( $json_string ) );

      Or if you’re using the Advanced Custom Fields plugin and prefer that syntax:

      update_field( 'my_json_field', wp_slash( $json_string ), 'user_' . $user_id );

      Creating a Google Maps API key without setting up billing

      Google have been making a recent push to get people to enable billing on their account when trying to register credentials, such as an API key for use with Google Maps.

      Luckily if you already have a Google Cloud Platform account already, you can access your API keys – and create new ones – simply by following this link:

      https://console.cloud.google.com/apis/credentials

      Select a project from the top menu (or create a new one), and you’ll be able to create new API keys without handing over your card details –  for now, at least… or until you hit your API limits!

      WordPress: Fixing the “Too many redirects” error when using HTTPS and .htaccess

      So you’ve installed your SSL certificate, and updated your WordPress settings to make the switch to HTTPS…

      So far, so good…

      …only to find your site is still accessible by HTTP!

      So you try implementing a .htaccess redirect…

      RewriteEngine On
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      …only to get hit with “Too many redirects” errors in the browser.

      The good news is – it’s easy to fix!

      First – remove any attempts to enforce SSL from your your .htaccess file (such as the above example).

      Second – add this to the wp_config.php file in your root directory, just before the /* That's all, stop editing! Happy blogging. */ comment:

      if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
          $redirect = 'https://www.YOURDOMAIN.com' . $_SERVER['REQUEST_URI'];
          header('HTTP/1.1 301 Moved Permanently');
          header('Location: ' . $redirect);
          exit();
      }

      I’ll be honest, I’m not entirely sure why certain webhosts exhibit this behaviour – but implementing the redirect in PHP rather than .htaccess has worked in a handful of instances, so hopefully it can help you too.