WordPress.org

Ready to get started?Download WordPress

Forums

WP Facebook Open Graph protocol
Forced HTTPS in OG:URL (10 posts)

  1. EnlightenedShadow
    Member
    Posted 1 year ago #

    Hey guys, I am coding for http://affordablepaintingandwallpaper.com/ and I recently installed the OG plugin. It works great except for one small issue. On the main page of the site it's fine but on sub pages, the plugin inserts the OG:URL with an https instead of http. The client doesn't want to purchase an SSL and therefore the OG:URL is causing Facebook not to be able to scrap any info from the page.

    For example: what should be http://affordablepaintingandwallpaper.com/services is listing as https://affordablepaintingandwallpaper.com/services even though the link rel="canonical" is correct. Anyone know why this plugin is doing this?

    http://wordpress.org/extend/plugins/wp-facebook-open-graph-protocol/

  2. EnlightenedShadow
    Member
    Posted 1 year ago #

    UPDATE: So I figured out what was generating the S on the HTTP. It was this line in the plugin: echo "\t<meta property='og:url' content='http" . (isset($_SERVER['HTTPS'])?'s':'') . "://".$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']."' />\n";

    I removed the S and now it doesn't generate the https. I'm not a PHP developer and I don't really know exactly what the line was doing so I hope I didn't mess something up and could someone explain it to me?

  3. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    no reason for it to be doing that at all. It uses what your site is set to be. I see you don't have it installed / running now so I can't see but maybe another plugin is making pages use ssl ?

  4. EnlightenedShadow
    Member
    Posted 1 year ago #

    I do have it installed and running lol. I haven't changed anything since I removed that S in the plugin. If it is what my server is set to, how do I change that? Is it something that I have to do through my hosting provider or WordPress?

  5. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    well the reason i say that is because the pre-plugin and post-plugin comment lines aren't showing so can't be sure it's my plugin running.

    The plugin calls the domain from php so... something somewhere is configured with an https... the plugin just calls what php spits out. So it's sniffing that there's an https call and changing the meta value according to that. It just spits out what it's given.

  6. EnlightenedShadow
    Member
    Posted 1 year ago #

    OK then. Now I just have one more question. Will my change (removing the s from $_SERVER['HTTPS'] making $_SERVER['HTTP']) mess up anything in my installation or the plugin?

  7. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    technically no? but editing any plugin leaves you open for issues and overwrites when the plugin updates. And I'm pushing a big update either tonight or very soon. FYI :)

  8. EnlightenedShadow
    Member
    Posted 1 year ago #

    OK that's fine. I'll have to track down that rouge HTTPS on my server. Any tools available to do something like that you know of?

  9. Chuck Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    idk man i'm like the worst server IT guy evar... my damn sendmail isn't working and I can't even figure that shit out lol. I just know WP

  10. EnlightenedShadow
    Member
    Posted 1 year ago #

    LOL OK then. Thanks anyway.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic