How to remove SSL Activated alert?

Home Forums Multisite How to remove SSL Activated alert?

This topic contains 7 replies, has 3 voices, and was last updated by  Mark Wolters 1 month, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24971 Reply

    Blake

    Hi,

    How can I prevent the following text from being displayed at the top?

    “SSL activated! Don’t forget to change your settings in Google Analytics en Webmaster tools. More info.”

    I run a multisite, and every time a new site is made that alert pops up.

    #24972 Reply

    Hi, It should go away when you click the “x” in the right top corner. Did you already try that?

    Rogier

    #24991 Reply

    Blake

    Yes, but I would like to disable it from displaying overall. So I do not have to click the X every time (Ok, I know, not that big of a deal, but it is confusing some people in my network on what it is)

    #25039 Reply

    Yes, I understand. A good idea for the plugin I guess. I’ll add it to the to do list.

    For now, you can use a simple script, which requests all sites one by one, then sets the “ssl_success_message_show” option to true, and saves it. This function needs wp 4.6 or higher.

    $sites = get_sites();
    foreach ( $sites as $site ) {
      switch_to_blog($site->blog_id );
      $options = get_option('rlrsssl_options');
      $options['ssl_success_message_shown'] = TRUE;
      update_option('rlrsssl_options',$options);
      restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
    }

    If you paste this in your functions.php, and let it run once, all sites will have this option updated.

    #25040 Reply

    Just saw I missed a part of your question. If you need this message not to pop up on new sites as well, you need a hook that hooks in to the new site creation, then set the value to true:

    function rsssl_prevent_ssl_message( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
      switch_to_blog($blog_id );
      $options = get_option('rlrsssl_options');
      $options['ssl_success_message_shown'] = TRUE;
      update_option('rlrsssl_options',$options);
      restore_current_blog(); //switches back to previous blog, not current, so we have to do it each loop
    }
    add_action( 'wpmu_new_blog', 'rsssl_prevent_ssl_message', 10, 6 );

    I think you would need to add this to the mu-plugins folder, so it will execute always for all sites.

    #111602 Reply

    Mattia

    Dear Rogier,

    Weirdly enough I do not get an “X” to close this and it follows me since I’ve activated SSL…

    Any simple handling?

    Best,
    Mattia

    #134262 Reply

    Naman Modi

    1. Check that the resources specified in the mixed content warnings load properly over HTTPS on their own.

    2. Copy the URL of the resource in your browser and make sure a https:// is in front. If the resource is unable to load properly this means that it is not from the same host as your zone (thus, does not have a supported SSL certificate) and you have a few options:

    Use the resource from a different host that supports HTTPS.
    If allowed, serve the resource directly from your host instead.
    Remove the resource from your site.

    3. Change every instance of http:// to https:// or // in your page HTML code to make sure resources like images and JavaScript files are being loaded specifically over HTTPS.

    4. Alternatively, consider using Cloudflare Automatic HTTPS Rewrites. However, be aware that resources loaded by JavaScript or CSS will not be automatically rewritten and mixed content warnings will still appear.

    After issues with mixed content are fixed, browsers will display the green lock icon in the address bar.

    #134542 Reply

    Mark Wolters
    Keymaster

    The mixed content fixer in Really Simple SSL will automatically rewrite all occurrences of http:// to your own domain to https://.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: How to remove SSL Activated alert?
Your information: