Title: [PATCH] HTTPS support
Last modified: August 22, 2016

---

# [PATCH] HTTPS support

 *  [Daedalon](https://wordpress.org/support/users/daedalon/)
 * (@daedalon)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/patch-https-support/)
 * Current version, 1.3.7, doesn’t work over HTTPS as it tries to load JS and CSS
   files over HTTP. The fix is to [replace the use of internal constants with plugins_url() as recommended](http://codex.wordpress.org/Function_Reference/plugins_url#Notes).
   Here’s the patch:
 * **1. Change in dcwp_slick_contact.php **line 60 from:
 * `return WP_PLUGIN_URL . '/slick-contact-forms';`
 * to:
 * `return plugins_url('', __FILE__);`
 * **2.Change in inc/dcwp_plugin_admin.php **line 29 from:
 * `wp_enqueue_style('dcwp_plugin_admin_dcscf_css', WP_CONTENT_URL . '/plugins/'.
   plugin_basename(dirname($this->filename)). '/css/admin.css');`
 * to:
 * `wp_enqueue_style('dcwp_plugin_admin_dcscf_css', dc_jqslickcontact::get_plugin_directory().'/
   css/admin.css');`
 * and line 37 from:
 * `wp_enqueue_style('dcwp_plugin_admin_dcscf_jquery', WP_CONTENT_URL . '/plugins/'.
   plugin_basename(dirname($this->filename)). '/js/jquery.admin.js');`
 * to:
 * `wp_enqueue_script('dcwp_plugin_admin_dcscf_jquery', dc_jqslickcontact::get_plugin_directory().'/
   js/jquery.admin.js');`
 * **3. Remove in inc/dcwp_admin.php **the row 209:
 * `add_action('init', array(&$this, 'my_init_method'));`
 * and 240-252:
 *     ```
       function my_init_method() {
   
       			if ( version_compare( get_bloginfo( 'version' ) , '3.0' , '<' ) && is_ssl() ) {
       				$wp_content_url = str_replace( 'http://' , 'https://' , get_option( 'siteurl' ) );
       			} else {
       				$wp_content_url = get_option( 'siteurl' );
       			}
       			$wp_content_url .= '/wp-content';
       			$wp_plugin_url = $wp_content_url . '/plugins';
   
       			wp_register_style('dcwp_plugin_admin_dcscf_css', $wp_plugin_url .'/slick-contact-forms/css/admin.css');
       			wp_enqueue_style('dcwp_plugin_admin_dcscf_css');
       	}
       ```
   
 * This patch fixes two other bugs as well. The removed lines added admin CSS style
   unnecessarily to all front end pages; a different piece of code already ensures
   the style is added to admin pages where it’s needed. Removing this speeds up 
   every site that uses this plugin. The second one is that admin jQuery code was
   incorrectly enqueued as a style instead of a script.
 * [https://wordpress.org/plugins/slick-contact-forms/](https://wordpress.org/plugins/slick-contact-forms/)

The topic ‘[PATCH] HTTPS support’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/slick-contact-forms.svg)
 * [Slick Contact Forms](https://wordpress.org/plugins/slick-contact-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/slick-contact-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/slick-contact-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/slick-contact-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/slick-contact-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/slick-contact-forms/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Daedalon](https://wordpress.org/support/users/daedalon/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/patch-https-support/)
 * Status: not resolved