Freemius / wordpress-sdk

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

Starting a new trial caused PHP Notice: Trying to get property of non-object #402

Open cliffordp opened 4 years ago

cliffordp commented 4 years ago

🐞 bug report

Behavior:

PHP Notices when activating trial.

No notices, even with WP_DEBUG / WP_DEBUG_DISPLAY set to true

Versions: (*)

Plugin / Theme: (*)

Additional Information:

PHP Notice:  Trying to get property of non-object in /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php on line 22084
PHP Stack trace:
PHP   1. {main}() /wp-admin/options-general.php:0
PHP   2. require_once() /wp-admin/options-general.php:10
PHP   3. do_action() /wp-admin/admin.php:232
PHP   4. WP_Hook->do_action() /wp-includes/plugin.php:478
PHP   5. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:311
PHP   6. call_user_func_array:{/wp-includes/class-wp-hook.php:287}() /wp-includes/class-wp-hook.php:287
PHP   7. Freemius->_account_page_load() /wp-includes/class-wp-hook.php:287
PHP   8. Freemius->_handle_account_edits() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21789
PHP   9. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21708
PHP  10. Freemius->_sync_addon_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19661
PHP  11. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19694
PHP  12. Freemius->_sync_plugin_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19663
PHP  13. Freemius->send_install_update() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19798
PHP  14. Freemius->get_api_site_scope() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:9152

PHP Notice:  Trying to get property of non-object in /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php on line 22085
PHP Stack trace:
PHP   1. {main}() /wp-admin/options-general.php:0
PHP   2. require_once() /wp-admin/options-general.php:10
PHP   3. do_action() /wp-admin/admin.php:232
PHP   4. WP_Hook->do_action() /wp-includes/plugin.php:478
PHP   5. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:311
PHP   6. call_user_func_array:{/wp-includes/class-wp-hook.php:287}() /wp-includes/class-wp-hook.php:287
PHP   7. Freemius->_account_page_load() /wp-includes/class-wp-hook.php:287
PHP   8. Freemius->_handle_account_edits() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21789
PHP   9. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21708
PHP  10. Freemius->_sync_addon_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19661
PHP  11. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19694
PHP  12. Freemius->_sync_plugin_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19663
PHP  13. Freemius->send_install_update() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19798
PHP  14. Freemius->get_api_site_scope() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:9152

PHP Notice:  Trying to get property of non-object in /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php on line 22087
PHP Stack trace:
PHP   1. {main}() /wp-admin/options-general.php:0
PHP   2. require_once() /wp-admin/options-general.php:10
PHP   3. do_action() /wp-admin/admin.php:232
PHP   4. WP_Hook->do_action() /wp-includes/plugin.php:478
PHP   5. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:311
PHP   6. call_user_func_array:{/wp-includes/class-wp-hook.php:287}() /wp-includes/class-wp-hook.php:287
PHP   7. Freemius->_account_page_load() /wp-includes/class-wp-hook.php:287
PHP   8. Freemius->_handle_account_edits() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21789
PHP   9. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21708
PHP  10. Freemius->_sync_addon_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19661
PHP  11. Freemius->_sync_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19694
PHP  12. Freemius->_sync_plugin_license() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19663
PHP  13. Freemius->send_install_update() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19798
PHP  14. Freemius->get_api_site_scope() /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:9152

PHP Warning:  Cannot modify header information - headers already sent by (output started at /wp-content/plugins/tk-event-weather/vendor/freemius/wordpress-sdk/includes/class-freemius.php:22084) in /wp-admin/admin-header.php on line 9
PHP Stack trace:
PHP   1. {main}() /wp-admin/options-general.php:0
PHP   2. require_once() /wp-admin/options-general.php:10
PHP   3. require_once() /wp-admin/admin.php:234
PHP   4. header() /wp-admin/admin-header.php:9

wp-config.php:

define( 'WP_FS__DEV_MODE', true ); // adds wp-admin menu link to /wp-admin/admin.php?page=freemius
define( 'WP_FS__SKIP_EMAIL_ACTIVATION', true );
define( 'WP_FS__tk-event-weather-events-manager_SECRET_KEY', 'sk_n4.aE5...f4oo@' ); // not really with the '...'

I haven't touched this plugin in a while, and I'm unsure where that secret key came from, but I don't see any active license for myself in my Freemius Dashboard... so that's why I started a new trial. I don't think this caused the issue, since there were several others reporting very similar issues but they got closed due to lack of information or follow-up.

cliffordp commented 4 years ago

Actually, just re-visiting this link triggered the issue: http://tkeventw.local/wp-admin/options-general.php?page=tk-event-weather-settings-account&fs_action=tk-event-weather_sync_license&plugin_id=679&checkout=true&plan_id=961&pricing_id=751&billing_cycle=annual&trial=true