WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] [Plugin: WordPress HTTPS] When generating a sitemap, some URLs are still using SSL (12 posts)

  1. Olivier
    Member
    Posted 3 years ago #

    I decided to give this plugin a go because I was sick and tired of all the plugins failing to send the normal URL to external services just because I'm managing the network using a secure URL and so far, so good, almost :)

    I enabled "Disable Automatic HTTPS" and tested a few plugins.
    There was a problem with the sitemap plugin, with the "tag" URLs.

    They look like this
    https://domain.com/tag/silly

    Maybe the HTTPS plugin is not parsing those?

    http://wordpress.org/extend/plugins/wordpress-https/

  2. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    You're right, I missed one!

    Give me 10 minutes or so and I'll just push out a new version to fix this.

    Thanks for downloading! :)

  3. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    Alright, version 1.6.2 is up. Let me know if it works for you.

  4. Olivier
    Member
    Posted 3 years ago #

    Just tested and it's fixed! Thank you! :)

  5. Olivier
    Member
    Posted 3 years ago #

    Seems like a newer version of the plugin switched things back.
    All the links in the sitemap are now using HTTPS when I manually generate the sitemap from the dashboard.

    EDIT: The sitemap is fine when not generated from the dashboard. The devs of the sitemap plugin have already been notified of the problem when using a secure dashboard.

  6. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    I'm sure the only reason it was generated with HTTP in earlier versions was because my plugin was parsing URL's in the admin panel with the 'Disable Automatic HTTPS' option enabled, which wasn't really necessary. So, I changed it to only parse URL's on the front-end.

  7. Olivier
    Member
    Posted 3 years ago #

    It's still necessary for some links in the backend. I've just noticed that all the plugins that were fixed with your plugin aren't working properly again.

    These plugins are requesting the permalink and it seems WP is always returning the SSL URL.

    So if they send a link to Twitter per example, they'll send the SSL URL.

    Would it be possible to only fix those special cases? There could be more than permalinks, but that's the one I know about.

  8. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    I'd like to avoid any special cases in my plugin, if at all possible. The maintenance of those special cases could become quite tiresome, especially when the plugin authors could fix them themselves. Before 3.0, most functions were not sensitive to SSL, so it didn't matter. Now that they are, plugin authors need to go into their plugins and fix them.

    In the meantime, find line 131:
    add_action('save_post', array(&$this, 'post_save'));

    Add this below it:

    add_filter('page_link', array(&$this, 'replace_https'));
    add_filter('post_link', array(&$this, 'replace_https'));

    And that should change any post/page links to HTTP in the admin panel. I will consider adding this to the plugin, but I will have to dig around to make sure it doesn't break anything else.

  9. Olivier
    Member
    Posted 3 years ago #

    Thx for the fix. It worked like a charm for plugins needing to get a hold of those links.

    I'm surprised by that behavior for links in WP. WP should automatically save and spit out the HTTP link when FORCE_SSL_ADMIN is turned on. None of the links that are going to be displayed in the frontend should contain httpS. And if it needs to display something in the backend, then it can transform it then.

    Do you have a link handy to the reference on how plugins should load links properly?

  10. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    Well, you're not 100% correct. If your site url is set to HTTPS, then front-end links would need to be HTTPS. On the other hand, if you're in the admin panel, the page is SSL, and your site url is not set to HTTPS, then yes, post/page (and maybe other) links should be changed to HTTP. Once you click that link (such as when you click 'View Post' on the edit/add post screen), if you have 'Force SSL' on that page, it will simply be redirected back to HTTPS, which isn't a problem.

    I'm pretty sure this wouldn't break anything for anyone, and would help fix some things for other plugins.

    The plugin authors are loading links properly. All functions in WordPress that return a URL check to see if the current page is HTTPS, and if it is, it returns an HTTPS url. That is just how WordPress works now. Like I've said, before 3.0, this was not the case, and now that it is, most plugin developers aren't even aware.

    Really, WordPress needs to build links based on if the site url is set to HTTPS or not, not the current page.

  11. Olivier
    Member
    Posted 3 years ago #

    Agreed, I've just written a post in the feedback section and hopefully I got it right :D.

    Just had one thought. Wouldn't it be easier to filter home_url? I mean if it's only the admin zone that is using SSL, then home_url should never return an SSL link, no?

  12. Mvied
    Member
    Plugin Author

    Posted 3 years ago #

    Yeah, I'll probably end up using the home_url rather than site_url when checking if the whole site is HTTPS, because WordPress actually uses home_url to build all of its links, not site_url. My bad. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic