WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] [Plugin: WordPress HTTPS] Version 1.9.1 Conflicts with "User Switching" Plugin (3 posts)

  1. fwchapman
    Member
    Posted 2 years ago #

    Dear Mike,

    I've been using your plugin on two different sites for many months and find it to be the most comprehensive solution for managing SSL and HTTPS. Unfortunately, I'm starting to experience conflicts with a couple of my other plugins.

    I use the User Switching plugin to make it easy for me to switch between the admin account and non-admin accounts:

    http://wordpress.org/extend/plugins/user-switching/

    I had no problems under Version 1.8.5 of your plugin, but since I upgraded to Version 1.9.1, User Switching no longer works.

    Can you duplicate the problem on a test site if you install User Switching? Is there anything you can do to fix this?

    Thanks very much,

    Fred Chapman
    [ Signature moderated. ]

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

  2. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey Fred,

    I imagine this because the User Switching plugin is using the pluggable wp_set_auth_cookie function to log you in as another user. I implemented a custom wp_set_auth_cookie function to accommodate people using Shared SSL. I didn't think it would cause any issues to have the function be used when not using Shared SSL since it works the same, but I can see how it would cause an issue in this case. Two plugins cannot redefine the same pluggable function.

    Since I just pushed out a new version, I'll just edit 1.9.1 to only redefine the pluggable function if Shared SSL is being used since that's really the only time it's necessary. In the meantime, you can go into the wordpress-https.php file and replace this section:

    // Use WordPress HTTPS wp_set_auth_cookie method for WordPress' wp_set_auth_cookie pluggable function
    if ( !function_exists('wp_set_auth_cookie') ) {
    	function wp_set_auth_cookie($user_id, $remember, $secure) {
    		global $wordpress_https;
    		return $wordpress_https->wp_set_auth_cookie($user_id, $remember, $secure);
    	}
    }

    With

    // Use WordPress HTTPS wp_set_auth_cookie method for WordPress' wp_set_auth_cookie pluggable function if using Shared SSL
    if ( $wordpress_https->shared_ssl == 1 && !function_exists('wp_set_auth_cookie') ) {
    	function wp_set_auth_cookie($user_id, $remember, $secure) {
    		global $wordpress_https;
    		return $wordpress_https->wp_set_auth_cookie($user_id, $remember, $secure);
    	}
    }

    Please let me know if that fixes it for you.

    Thanks,
    Mike

  3. fwchapman
    Member
    Posted 2 years ago #

    Mike,

    Thanks for your super-speedy reply! I made the code swap you suggested and it solved the problem perfectly. You hit the nail right on the head!

    Thanks so much,

    Fred

    P.S. I ran into another plugin conflict recently, but I'll start a new thread so we can mark this one resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic