Freemius / wordpress-sdk

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

"Trying to get property 'http' of non-object" when trying to activate premium while offline #372

Open genseirin opened 4 years ago

genseirin commented 4 years ago

🐞 bug report

Behavior:

I'm testing on a local MAMP - which is offline - with the free plugin activated and the premium plugin deactivated. A valid license is available.

I see the message:

Yee-haw! You have a Premium license. The paid version of Tag Groups is already installed. Please activate it to start benefiting the Premium features. Activate Premium features

I click on "Activate Premium features". On the next screen the activation fails with the following message: `Notice: Trying to get property 'http' of non-object in /.../wp-content/plugins/tag-groups/vendor/freemius/includes/class-fs-api.php on line 290

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in / … /wp-includes/update.php on line 388 The link you followed has expired. Please try again.`

Activating the premium version through the "Activate Premium features" link works fine when the computer is connected to internet. It also works fine from the plugins screen (both online and offline):

W00t! Premium plugin version was successfully activated.

- `What is the expected behavior?`

It should be possible to activate the premium plugin through the link in the notice without errors even when there is no internet connection available. If a connection is required, a message should inform about it. But apparently it is not required since activation works fine offline through the plugin list.

Versions: (*)

Plugin / Theme: (*)

Additional Information:


Note: (*) indicates required information. Without this information, your issue may be auto-closed.

You can find your Freemius SDK version at /freemius/start.php

You can find your Freemius product ID in the Freemius dashboard: SETTINGS -> INTEGRATION.

Do not modify the titles or questions. Simply add your responses to the ends of the questions. Add more lines if needed.

cliffordp commented 4 years ago

I think the same issue - browser tab left open for a long time, maybe went offline...

[31-May-2020 21:17:05 UTC] PHP Notice:  Trying to get property 'http' of non-object in /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-fs-api.php on line 290
[31-May-2020 21:17:05 UTC] PHP Stack trace:
[31-May-2020 21:17:05 UTC] PHP   1. {main}() /wp-admin/admin.php:0
[31-May-2020 21:17:05 UTC] PHP   2. do_action() /wp-admin/admin.php:254
[31-May-2020 21:17:05 UTC] PHP   3. WP_Hook->do_action() /wp-includes/plugin.php:478
[31-May-2020 21:17:05 UTC] PHP   4. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:312
[31-May-2020 21:17:05 UTC] PHP   5. Freemius->_account_page_render() /wp-includes/class-wp-hook.php:288
[31-May-2020 21:17:05 UTC] PHP   6. fs_get_template() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-freemius.php:21831
[31-May-2020 21:17:05 UTC] PHP   7. require() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/fs-core-functions.php:57
[31-May-2020 21:17:05 UTC] PHP   8. Freemius->get_update() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/templates/account.php:24
[31-May-2020 21:17:05 UTC] PHP   9. Freemius->check_updates() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19414
[31-May-2020 21:17:05 UTC] PHP  10. Freemius->_fetch_newer_version() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-freemius.php:20970
[31-May-2020 21:17:05 UTC] PHP  11. Freemius->_fetch_latest_version() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-freemius.php:19369
[31-May-2020 21:17:05 UTC] PHP  12. FS_Api->get() /wp-content/plugins/rankbear/vendor/freemius/wordpress-sdk/includes/class-freemius.php:20815