• The apparent latest version that updated yesterday – 1.4.0.1 – is broken, at least on the latest WordPress version (4.2.3).

    The error resulted in a white-screen on my WordPress install.

    The logs show the error is: PHP Fatal error: Call to a member function get_setting_value() on a non-object in /path/wp-content/plugins/stripe/classes/class-stripe-checkout-scripts.php on line 51.

    The code is attempting to call an undefined function.

    A solution – at least a temporary fix that works in my case – is to remove the call from line 51, as so:

    Before change:

    if ( ( false !== strpos( $post->post_content, ‘[stripe’ ) ) || ( null !== $sc_options->get_setting_value( ‘always_enqueue’ ) ) ) {

    After change:

    if ( ( false !== strpos( $post->post_content, ‘[stripe’ ) ) ) {

    Which removes this section of the statement:

    || ( null !== $sc_options->get_setting_value( ‘always_enqueue’ ) )

    I realise this is a quick and dirty fix, and may result in unforeseen consequences; without having time to dig further into the code I haven’t done a thorough evaluation. The CSS layout is a little wonky on the settings page – not sure if this is an outcome. But the essential functionality is there, and now it works without white-screening my site – in my case at least. If anyone else uses this hack – use at your own risk.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey thanks for sending in technical details and possible workaround.

    We had 2 other reports of this coming in since the update so we’ll see if we can fix this bug soon and let you know.

    No worries, thanks for the plugin!

    I look forward to the update. Feel free to get in touch if I can be of any further assistance as regards testing a fix or whatnot.

    Zaziork,

    It seems you are comfortable editing the code. So could you do us a favor and try a fix we think we have and let us know if it works for you after? That would be awesome!

    First revert your changes so we know everything is back to normal first.

    Open up classes/class-stripe-checkout.php

    In that file you will see the __construct() method which currently will look like this:

    private function __construct() {
    
    			// Load plugin text domain
    			add_action( 'plugins_loaded', array( $this, 'plugin_textdomain' ) );
    
    			// Include all necessary files
    			add_action( 'init', array( $this, 'includes' ), 0 );
    
    			// Load all instances
    			add_action( 'init', array( $this, 'init' ), 1 );
    			add_action( 'init', array( $this, 'register_settings' ), 2 );
    		}

    Replace that whole entire method with this instead:

    private function __construct() {
    
    			// Load plugin text domain
    			add_action( 'plugins_loaded', array( $this, 'plugin_textdomain' ) );
    
    			// Include all necessary files
    			$this->includes();
    
    			add_action( 'init', array( $this, 'register_settings' ), 0 );
    
    			// Load all instances
    			add_action( 'init', array( $this, 'init' ), 1 );
    		}

    We feel there might be a timing issue with loading the main object of the plugin and this rearranges that initialization a little bit.

    Let us know if you can try it and what your results are.

    Thanks a bunch!

    Hello Nick

    I uninstalled / reinstalled first, and verified that the issue was replicated. After applying the above fix, everything works like a charm. Perfect.

    Great thanks so much for testing that our for us. Glad that did the trick. We will be pushing an official fix for it soon.

    Thanks again!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Latest update broken solution’ is closed to new replies.