{"id":5883568,"date":"2015-03-10T16:53:03","date_gmt":"2015-03-10T16:53:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/patch-https-support\/"},"modified":"2016-08-22T17:52:37","modified_gmt":"2016-08-22T17:52:37","slug":"patch-https-support","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/patch-https-support\/","title":{"rendered":"[PATCH] HTTPS support"},"content":{"rendered":"<p>Current version, 1.3.7, doesn&#8217;t work over HTTPS as it tries to load JS and CSS files over HTTP. The fix is to <a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/plugins_url#Notes\">replace the use of internal constants with plugins_url() as recommended<\/a>. Here&#8217;s the patch:<\/p>\n<p><strong>1. Change in dcwp_slick_contact.php <\/strong>line 60 from:<\/p>\n<p><code>return WP_PLUGIN_URL . &#039;\/slick-contact-forms&#039;;<\/code><\/p>\n<p>to:<\/p>\n<p><code>return plugins_url(&#039;&#039;, __FILE__);<\/code><\/p>\n<p><strong>2.Change in inc\/dcwp_plugin_admin.php <\/strong>line 29 from:<\/p>\n<p><code>wp_enqueue_style(&#039;dcwp_plugin_admin_dcscf_css&#039;, WP_CONTENT_URL . &#039;\/plugins\/&#039; . plugin_basename(dirname($this-&gt;filename)). &#039;\/css\/admin.css&#039;);<\/code><\/p>\n<p>to:<\/p>\n<p><code>wp_enqueue_style(&#039;dcwp_plugin_admin_dcscf_css&#039;, dc_jqslickcontact::get_plugin_directory() . &#039;\/css\/admin.css&#039;);<\/code><\/p>\n<p>and line 37 from:<\/p>\n<p><code>wp_enqueue_style(&#039;dcwp_plugin_admin_dcscf_jquery&#039;, WP_CONTENT_URL . &#039;\/plugins\/&#039; . plugin_basename(dirname($this-&gt;filename)). &#039;\/js\/jquery.admin.js&#039;);<\/code><\/p>\n<p>to:<\/p>\n<p><code>wp_enqueue_script(&#039;dcwp_plugin_admin_dcscf_jquery&#039;, dc_jqslickcontact::get_plugin_directory() . &#039;\/js\/jquery.admin.js&#039;);<\/code><\/p>\n<p><strong>3. Remove in inc\/dcwp_admin.php <\/strong>the row 209:<\/p>\n<p><code>add_action(&#039;init&#039;, array(&amp;$this, &#039;my_init_method&#039;));<\/code><\/p>\n<p>and 240-252:<\/p>\n<pre><code>function my_init_method() {\n\n\t\t\tif ( version_compare( get_bloginfo( &#039;version&#039; ) , &#039;3.0&#039; , &#039;&lt;&#039; ) &amp;&amp; is_ssl() ) {\n\t\t\t\t$wp_content_url = str_replace( &#039;http:\/\/&#039; , &#039;https:\/\/&#039; , get_option( &#039;siteurl&#039; ) );\n\t\t\t} else {\n\t\t\t\t$wp_content_url = get_option( &#039;siteurl&#039; );\n\t\t\t}\n\t\t\t$wp_content_url .= &#039;\/wp-content&#039;;\n\t\t\t$wp_plugin_url = $wp_content_url . &#039;\/plugins&#039;;\n\n\t\t\twp_register_style(&#039;dcwp_plugin_admin_dcscf_css&#039;, $wp_plugin_url .&#039;\/slick-contact-forms\/css\/admin.css&#039;);\n\t\t\twp_enqueue_style(&#039;dcwp_plugin_admin_dcscf_css&#039;);\n\t}<\/code><\/pre>\n<p>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&#8217;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.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/slick-contact-forms\/<\/p>\n","protected":false},"template":"","class_list":["post-5883568","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5883568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5883568\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5883568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}