Support » Plugin: Error Log Monitor » Killed my network

  • All I saw on front-end:

    Fatal error: Uncaught TypeError: Argument 1 passed to Freemius::get_api_user_scope_by_user() must be an instance of FS_User, boolean given, called in /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php on line 18507 and defined in /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php:18521 Stack trace: #0 /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php(18507): Freemius->get_api_user_scope_by_user(false) #1 /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php(18545): Freemius->get_api_user_scope(false) #2 /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php(15956): Freemius->get_current_or_network_user_api_scope() #3 /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-lo in /srv/users/serverpilot/apps/tswbintcom/public/wp-content/plugins/error-log-monitor/freemius/includes/class-freemius.php on line 18521

    Uninstalled and tings worked again

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    Thank you for the report. That looks like it could be a bug in the Freemius library. Did it happen immediately after activating the plugin or at some later point? Did you network activate the plugin or was it active only on certain sites?

    • This reply was modified 1 year, 3 months ago by Janis Elsts.
    Plugin Author Janis Elsts

    (@whiteshadow)

    After further investigation, I think I’ve found the bug and a way to work around it. Please try the updated development version. It shouldn’t throw that error any more.

    Hi Janis
    Thanks, will try it and report back.
    Cheers

    Hi @nossfloda, my name is Vova and I’m from Freemius. First of all – apologies for the inconvenience. We already patched the issue that you mentioned, it’s an edge-case related to your network environment together.

    Long story short, @whiteshadow – please update the SDK to the latest develop branch (it is stable): https://github.com/Freemius/wordpress-sdk/tree/develop

    Then, after the SDK is updated, @nossfloda – you’ll need to update the plugin to the version, go to /wp-admin/network/admin.php?page=freemius and click the Migrate Options to Network button.

    Please let me know if that resolved the issue guys.

    Plugin Author Janis Elsts

    (@whiteshadow)

    Based on my (admittedly limited) understanding of the SDK code, the error was caused by the fact in a certain cases the SDK will attempt to use the user object before it has been loaded. Does the patch address that? I don’t see any changes to that part of the code in the develop branch, though of course it’s entirely possible that I might have missed something.

    Specifically, it seems that _load_account can call _sync_plans. When synchronizing plans, the SDK calls _fetch_plugin_plans, which then calls get_current_or_network_user_api_scope. This last function seems to assume that one of these must be true:

    a) The account has already been loaded. Of course, this isn’t the case when _sync_plans is called from _load_account.
    b) The plugin is active for the entire network.

    So if there’s ever a situation where the plugin is only active on certain sites and plans haven’t been synchronized yet, the get_current_or_network_user_api_scope function will call get_api_user_scope, which will try to use the uninitialized _user object and trigger an error.

    I tried to test this by slightly changing _load_account to make it call _sync_plans every time. This still triggers a fatal error even when running the develop branch.

    Hi both
    Sorry for the late answer.

    I reistalled the plugin again and everything seems to work. No errors to show and all frontends work on the network.

    I went to /wp-admin/network/admin.php?page=freemius
    and see this under “Plugins”
    “Freemius SDK couldn’t find the plugin’s main file. Please contact sdk@freemius.com with the current error. Module: ; SDK: 2.1.2;”

    There is no “Migrate Options to Network”, only a Simulate button.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Killed my network’ is closed to new replies.