Title: [Plugin: WordPress HTTPS] Trying to get property of non-object
Last modified: August 19, 2016

---

# [Plugin: WordPress HTTPS] Trying to get property of non-object

 *  Resolved [PeterK2003](https://wordpress.org/support/users/peterk2003/)
 * (@peterk2003)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/)
 * PHP Notice:
    Trying to get property of non-object in C:\\Program Files\\Apache
   Software Foundation\\Apache2.2\\htdocs\\wp-content\\plugins\\wordpress-https\\
   wordpress-https.php on line 232
 * We are seeing a lot these entries in out error logs. Anyone else?

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

 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003553)
 * The code around line 232 is very buggy, in addition to causing that warning. 
   If you just want to stop the warning, change
    `$post = $post->ID;` to `$post 
   and $post = $post->ID;`
 * If you want to fix the buggy code, and know how to read this, you can patch it.
   If you are using a shared SSL server, there other bugs, I can post that somewhere
   else. Here is the old and new code, around line 232.
 * _[please use a [Pastebin](http://pastebin.com/) to post large chunks of code,
   [following forum etiquette](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]_
 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003554)
 * Sorry, that code is wrong. I will post a fix.
 *  Thread Starter [PeterK2003](https://wordpress.org/support/users/peterk2003/)
 * (@peterk2003)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003555)
 * Thanks, I will appreciate the update to the plugin.
 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003556)
 * This is better, still a work in progress. I will post the whole file when done.
   Line 213.
 * _[please use a [Pastebin](http://pastebin.com/) to post large chunks of code,
   [following forum etiquette](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]_
 * Sorry, pastebin coming up.
 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003557)
 * Here it is.
    [http://pastebin.com/nHt5hL1e](http://pastebin.com/nHt5hL1e)
 *  [kitchin](https://wordpress.org/support/users/kitchin/)
 * (@kitchin)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003558)
 * The original one-line fix above is still good enough to quiet the warning, though.
   I will clean up the rest of my work and post it later if people want to try it.
 *  Thread Starter [PeterK2003](https://wordpress.org/support/users/peterk2003/)
 * (@peterk2003)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003560)
 * Thanks, I am not in a big hurry so I’ll wait till the code makes it way into 
   a new release.
 * Thanks again.
 *  Plugin Author [mvied](https://wordpress.org/support/users/mvied/)
 * (@mvied)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003579)
 * Kitchin,
 * I really didn’t want to spend time doing this, but I thought it appropriate.
 * `$url_path = str_replace(parse_url($this->https_url, PHP_URL_PATH), '', $url_path);//
   wrong, https_url already stripped of path`
    The path in the https_url is being
   stripped from the path found by the regular expression. Not https_url itself.
   The entire block you commented out works fine.
 * `if ($url_path == '/') { // wrong, external links can match this`
    That doesn’t
   matter because the code that changes the link to HTTPS is this: `$buffer = str_replace(
   $html, str_replace($this->http_url, $this->https_url, $html), $buffer);` Which
   obviously will not affect external URL’s.
 * `$force_ssl_admin= defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN && is_admin();//
   new code`
    Why would you want to force every link to a post/page in the admin
   panel to be HTTPS regardless of what the user selected just because they’re forcing
   their admin panel to be HTTPS? The idea is for the link changing to be intelligent
   and only change links to HTTPS that have been forced to do so.
 * I’m not really sure where you were going with any of your changes other than 
   the one line that suppresses the error, which I will implement in the next update.
   If the code does not appear to be working for you, please create a topic with
   specific examples of it not working so that I can review the ‘buggyness’ in action.
 * Thanks,
    Mike

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

The topic ‘[Plugin: WordPress HTTPS] Trying to get property of non-object’ 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/)

 * 8 replies
 * 3 participants
 * Last reply from: [mvied](https://wordpress.org/support/users/mvied/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpress-https-trying-to-get-property-of-non-object/#post-2003579)
 * Status: resolved