Title: HTTPS for external ressources
Last modified: August 21, 2016

---

# HTTPS for external ressources

 *  Resolved [dam09fr](https://wordpress.org/support/users/dam09fr/)
 * (@dam09fr)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/https-for-external-ressources/)
 * 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://wordpress.org/plugins/rvg-optimize-database/](https://wordpress.org/plugins/rvg-optimize-database/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/https-for-external-ressources/#post-4616786)
 * Hey dam09fr,
 * I assume you mean this (http:// for the second link instead of [https://](https://wordpress.org/support/topic/https-for-external-ressources/?output_format=md)):
 *     ```
       # 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="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
       }
       ```
   
 * Rolf
 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/https-for-external-ressources/#post-4616792)
 * Hey dam09fr,
 * Just released version v2.7.7
    This will solve your problem.
 * Thanks for your feedback!
 * Rolf
 *  Thread Starter [dam09fr](https://wordpress.org/support/users/dam09fr/)
 * (@dam09fr)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/https-for-external-ressources/#post-4616825)
 * I just update the plugin and the 2nd link is wrong : https:// instead of [http://](https://wordpress.org/support/topic/https-for-external-ressources/?output_format=md).
   
   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="http://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.

 * ![](https://ps.w.org/rvg-optimize-database/assets/icon-256x256.png?rev=3350597)
 * [Optimize Database after Deleting Revisions](https://wordpress.org/plugins/rvg-optimize-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rvg-optimize-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rvg-optimize-database/)
 * [Active Topics](https://wordpress.org/support/plugin/rvg-optimize-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rvg-optimize-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rvg-optimize-database/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)

 * 3 replies
 * 2 participants
 * Last reply from: [dam09fr](https://wordpress.org/support/users/dam09fr/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/https-for-external-ressources/#post-4616825)
 * Status: resolved