• Moderator Ipstenu (Mika Epstein)

    (@ipstenu)


    πŸ³οΈβ€πŸŒˆ Advisor and Activist

    Per http://core.trac.wordpress.org/ticket/13941 – the old constants don’t work with SSL.

    To make this work on an SSL site, I had to add in this:

    if (isset($_SERVER['HTTPS'])) {
            define( 'WP_PLUGIN_URL', 'https://'.$_SERVER['HTTP_HOST'].'/wp-content/plugins' );
    }

    Would it be possible to change the call to WP_PLUGIN_URL to plugin_dir_url() instead?

    The code is here: http://plugins.trac.wordpress.org/browser/wp-stripe/trunk/wp-stripe.php#L15

    define ( 'WP_STRIPE_PATH', WP_PLUGIN_URL . '/' . end( explode( DIRECTORY_SEPARATOR, dirname( __FILE__ ) ) ) );

    would become:

    define ( 'WP_STRIPE_PATH', plugin_dir_url() );

    (plugin_dir_url() calls plugin_url(), but since you just want the URL of the plugin, and not a sub file, plugin_dir_url() seemed more appropriate. If you were calling subfiles, like for jquery, it’d be plugins_url( 'js/fartscroll.js' , __FILE__ ) instead – and I know Noel already knows this, but now people reading do too! πŸ˜‰ )

    http://wordpress.org/plugins/wp-stripe/

  • The topic ‘Conflict with https/ssl and WP_PLUGIN_URL’ is closed to new replies.