Uncaught TypeError: Argument 1 passed to Freemius::get_api_user_scope_by_user() must be an instance of FS_User

When we tried migrating a site from a multi-site instance to a single site instance, we were getting the following uncaught typeerror from PHP when we tried activating an installed plugin. This Freemius error prevented us from activating the plugin.

Uncaught TypeError: Argument 1 passed to Freemius::get_api_user_scope_by_user() must be an instance of FS_User

In addition to the above error we were also receiving an undefined index Freemius error when we tried to activate the WP Stackable plugin:

Notice: Undefined index: stackable-ultimate-gutenberg-blocks in /var/www/website/wp-content/plugins/stackable-ultimate-gutenberg-blocks-premium/freemius/includes/class-freemius.php on line 14754

SOLUTION:

This “Freemius::get_api_user_scope_by_user() must be an instance of FS_User” error and the “Undefined index” Freemius error were both pretty frustrating as we didn’t find a lot of documentation on how to fix it.

However, we ran across the following solution, a plugin that Freemius built called the Freemius Fixer. This plugin is targeted at specifically solving the following two errors:

  1. When a plugin cannot be activated
  2. When a site’s rendering is broken as a result of a Freemium error

All you have to do is download the Freemius Fixer plugin at https://github.com/Freemius/freemius-fixer. Then, install and activate that Freemius Fixer plugin on the WordPress site that is having the issues. That fixed our issues!

Per https://github.com/Freemius/freemius-fixer,Freemius also recommends that you:

  1. Download the Freemius data (without cleaning the fix button).
  2. Send you a screenshot of the Freemius Debug page /wp-admin/admin.php?page=freemius

Leave a Reply

Your email address will not be published. Required fields are marked *