Title: [Plugin: WordPress HTTPS (SSL)] Why normalizeElements??? I don&#039;t get it.
Last modified: August 20, 2016

---

# [Plugin: WordPress HTTPS (SSL)] Why normalizeElements??? I don't get it.

 *  Resolved [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/)
 * Hi Mvied,
 * I am having issue with internal / local links. The plugin is setting all my local
   links to http and shouldn’t it be allowing https when I have set the force ssl
   exclusively???.
 * I debugged the plugin & found that your this function
 * normalizeElements() forcibly making internal links to http????????
 * Quick reply will be appreciated. And if you need my help in fixing it, let me
   know.
 * Syed
 * [http://wordpress.org/extend/plugins/wordpress-https/](http://wordpress.org/extend/plugins/wordpress-https/)

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

 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739705)
 * Any page that isn’t forced to HTTPS will be set to HTTP with that setting, so
   it’s doing what it’s supposed to do.
 * What are you trying to do?
 *  Thread Starter [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739706)
 * I am trying to use
 * Force SSL Exclusively ??? I set it to checked. But It still normalize my https
   links (which they are as I have set my home url & site url to https).
 * But in normalizeElements()
 * you are checking for “ssl_host_diff” value which is hidden value
 * <input type=”hidden” name=”ssl_host_diff” value=”<?php echo (($this->getPlugin()-
   >getSetting(‘ssl_host_diff’) != 1) ? 0 : 1); ?>” />
 * So I suppose it should have either be available in settings or Force SSL Exclusively
   should have been considered to making decision whether to go for http or https????????????
 * What are your thoughts?
 *  Thread Starter [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739714)
 * I have further investigated it & found out your this logic doesn’t make any sense
 *     ```
       $this->getPlugin()->makeUrlHttp($url)????????????? why???????????
   
       $matches = array_merge($httpMatches, $httpsMatches);
       ```
   
 * this gets me all https links
 * and you are forcing all those to be http???????
 * Shouldn’t it considered either Force SSL Exclusively ????? if its set to yes 
   then it should not convert to http.
 * Like if it set to true it should have converted all none http to https
    or if
   false
 * converted all https to http.
 *     ```
       if ($this->getPlugin()->getSetting('exclusive_https')) {
                                     $this->_html = str_replace($url, $this->getPlugin()->makeUrlHttps($url), $this->_html);
                                    } else {
                                   $this->_html = str_replace($url, $this->getPlugin()->makeUrlHttp($url), $this->_html);
                                   }
       ```
   
 * I modified like this and now I have got partial http & https links (means mix)
   if I comment the normalize function all of my links are https.
 * Can you explain the original logic of normalize function so I can be of help????
 *  Thread Starter [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739726)
 * The second area where the https links are forced to http
 * function fixLinksAndForms();
 *     ```
       else if ($this->getPlugin()->isUrlLocal($url) && ($post = get_page_by_path($url_parts['path']))) {
                       $post = $post->ID;
                       //TODO When logged in to HTTP and visiting an HTTPS page, admin links will always be forced to HTTPS, even if the user is not logged in via HTTPS. I need to find a way to detect this.
                   }
       ```
   
 * so both the normalizeElements & fixLinksAndForms are causing issue for me
 * I modified the normalizeElements as per this code
 *     ```
       if ($this->getPlugin()->getSetting('exclusive_https')) {
                                     $this->_html = str_replace($url, $this->getPlugin()->makeUrlHttps($url), $this->_html);
                                    } else {
                                   $this->_html = str_replace($url, $this->getPlugin()->makeUrlHttp($url), $this->_html);
                                   }
       ```
   
 * but not sure how I can fix the above fixLinksAndForms code????????
 * I will appreciate if you let me know or I will have to digg more 🙁 I have already
   spent too much time on this. Hope you have the answer quick.
 *  Thread Starter [saas](https://wordpress.org/support/users/saas/)
 * (@saas)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739731)
 * 😀 Its fixed now. I have get the source from github & upload it and it fixed 
   the issue. And I found you have fixed it a week ago. And its working for me. 
   I will appreciate if you update the wordpress plugins repository as I am sure
   there will be lots of guys like me having this issue.
 * Thanks for fixing it.
    Kind Regards, Syed

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

The topic ‘[Plugin: WordPress HTTPS (SSL)] Why normalizeElements??? I don't get 
it.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-https_bec2c9.svg)
 * [WordPress HTTPS (SSL)](https://wordpress.org/plugins/wordpress-https/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-https/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-https/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-https/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-https/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-https/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [saas](https://wordpress.org/support/users/saas/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-https-ssl-why-normalizeelements-i-dont-get-it/#post-2739731)
 * Status: resolved