• Resolved dam09fr

    (@dam09fr)


    Hello,

    I am a happy (French) user of your plugin.
    However, the wp-admin dir of my sites is secured with HTTPS and browsers blocks the inclusion of static resources of your plugin (jQuery) because the URLs are statically defined with HTTP.

    Can you please change the code to dynamic change the jQuery URL when the site is hosted in HTTPS ?

    Below is a code example:

    # jQuery FRAMEWORK
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    } else {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    }

    Thank you in advance.

    https://www.ads-software.com/plugins/rvg-optimize-database/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor cageehv

    (@cageehv)

    Hey dam09fr,

    I assume you mean this (https:// for the second link instead of https://):

    # jQuery FRAMEWORK
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    } else {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    }

    Rolf

    Plugin Contributor cageehv

    (@cageehv)

    Hey dam09fr,

    Just released version v2.7.7
    This will solve your problem.

    Thanks for your feedback!

    Rolf

    Thread Starter dam09fr

    (@dam09fr)

    I just update the plugin and the 2nd link is wrong : https:// instead of https://.
    The good code must be :

    # jQuery FRAMEWORK
    if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    } else {
    	echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
    }

    Sorry to give you an error, it was late in france while I wrote my demand !

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HTTPS for external ressources’ is closed to new replies.