Freemius / wordpress-sdk

https://freemius.com
GNU General Public License v3.0
267 stars 77 forks source link

Initial value for _plans triggers fatal error #99

Open cyberhobo opened 8 years ago

cyberhobo commented 8 years ago

I got this after clicking the button to connect Freemius for the first time after activating the plugin on a development install:

screenshot 2016-10-12 17 25 26

I reproduced it once and verified that _plans still had the initial value of false, making count($this->_plans) equal to 1 instead of 0. Looks like this could happen in a few place.

vovafeldman commented 8 years ago

@cyberhobo thanks for sharing. I have a few questions:

  1. What SDK version are you using? (you can find it in the start.php file)
  2. Are you using any custom SDK code besides the init_sdk method? If so, please share.
cyberhobo commented 8 years ago

SDK version 1.2.1

Here's my init code:

        self::$freemius = fs_dynamic_init( array(
            'id' => '164',
            'slug' => 'postmatic',
            'public_key' => 'pk_3ecff09a994aaeb35de148a63756e',
            'is_premium' => false,
            'has_addons' => false,
            'has_paid_plans' => false,
            'menu' => array(
                'slug' => 'postmatic',
                'contact' => false,
                'account' => false,
                'support' => false,
                'parent' => array(
                    'slug' => 'options-general.php',
                ),
            ),
        ) );

        self::$freemius->add_filter( 
            'connect_message_on_update', 
            array( __CLASS__, 'custom_connect_message_on_update' ), 
            10, 
            6
        );

        self::$freemius->add_action(
            'after_account_connection',
            array( __CLASS__, 'after_account_connection' ),
            10,
            2
        );

        self::$freemius->add_action( 'after_account_delete', array( __CLASS__, 'after_account_delete' ) );
vovafeldman commented 8 years ago

Any chance your environment had/have other Freemius powered plugins installed before/now?

cyberhobo commented 8 years ago

As far as I know it's just the one plugin, but an earlier version used version 1.1.9 of the SDK.

On Thu, Oct 13, 2016 at 2:36 PM, Vova Feldman notifications@github.com wrote:

Any chance your environment had/have other Freemius powered plugin installed before/now?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Freemius/wordpress-sdk/issues/99#issuecomment-253599803, or mute the thread https://github.com/notifications/unsubscribe-auth/AARgdpZaopSyK8fUuqATJI2N1e2fxV0Bks5qznoUgaJpZM4KWLgG .

Vernal commented 7 years ago

Hey @vovafeldman is there any progress on this? We're starting to see it show up in the wild....

Vernal commented 7 years ago

And again.... Anything?