WordPress.org

Ready to get started?Download WordPress

Forums

WP Stripe
Conflict with https/ssl and WP_PLUGIN_URL (1 post)

  1. 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/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 7 months ago by Ipstenu (Mika Epstein)
  • This topic is not resolved
  • WordPress version: 3.6

Tags

No tags yet.