You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the issue? (*)
On a fresh first opt-in for a free-only plugin ('has_paid_plans' => false), two problems occur:
Warning: Undefined property: stdClass::$plan_id in .../freemius/includes/entities/class-fs-site.php on line 123 FS_Site::__construct() reads $site->plan_id without checking the property exists.
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in .../freemius/includes/class-freemius.php:19847 _store_plans() calls count( $this->_plans ) while $this->_plans is still its initial value false.
Reproduction: activate a free-only Freemius plugin on a clean WordPress install (PHP 8+) and complete the opt-in for the first time.
What is the expected behavior?
Opt-in completes without warnings or fatal errors when the plugin has no paid plans / the install object has no plan_id.
Versions: (*)
Freemius SDK Version: 2.13.1 (code path also present in 2.13.4 / current develop)
馃悶 bug report
Behavior:
What is the issue? (*)On a fresh first opt-in for a free-only plugin (
'has_paid_plans' => false), two problems occur:Warning: Undefined property: stdClass::$plan_id in .../freemius/includes/entities/class-fs-site.php on line 123FS_Site::__construct()reads$site->plan_idwithout checking the property exists.Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in .../freemius/includes/class-freemius.php:19847_store_plans()callscount( $this->_plans )while$this->_plansis still its initial valuefalse.Reproduction: activate a free-only Freemius plugin on a clean WordPress install (PHP 8+) and complete the opt-in for the first time.
What is the expected behavior?Opt-in completes without warnings or fatal errors when the plugin has no paid plans / the install object has no
plan_id.Versions: (*)
Freemius SDK Version:2.13.1 (code path also present in 2.13.4 / current develop)WordPress Version:6.9PHP Version:8.2Plugin / Theme: (*)
Name:[redacted]Slug:[redacted]Freemius ID:[redacted]Additional Information:
Browser Type: (*)ChromeBrowser Version: (*)latestOS: (*)Windows 10 (Local by Flywheel)Stack Traces:Fatal error: Uncaught TypeError: count(): Argument Better init for addons.聽#1 ($value) must be of type Countable|array, bool given in .../freemius/includes/class-freemius.php:19847 Stack trace: #0 .../class-freemius.php(20205): Freemius->store_plans(false) Better init for addons.聽#1 .../class-freemius.php(16797): Freemius->store_account() Error When using Your Example Plugin聽#2 .../class-freemius.php(18319): Freemius->set_account(Object(FS_User), Object(FS_Site)) Calling images remotely is not allowed!聽#3 .../class-freemius.php(17446): Freemius->handle_account_connection(Array, true) Upgrade menu added without paid plans聽#4 .../class-freemius.php(17387): Freemius->setup_network_account(Object(FS_User), Array, true, false, false) [bug-fix] [admin-menu] Wrapped upgrade menu in a conditional to check for paid plans - fixes #4聽#5 .../class-freemius.php(17726): Freemius->setup_account(Object(FS_User), Object(FS_Site), true, false) Should redirect to plugin page not account page if account = false聽#6 .../class-freemius.php(17593): Freemius->install_with_new_user('[REDACTED]', 'pk[REDACTED]', 'sk[REDACTED]', true, true, true, '[REDACTED]', 'pk[REDACTED]', 'sk_[REDACTED]', true, false) Loading image on VVV does not work聽#7 .../class-freemius.php(18664): Freemius->_install_with_new_user() Activation fails if the plugin's dir is outside of the WP plugins folder and configured with symlinks聽#8 .../class-freemius.php(18537): Freemius->override_plugin_menu_with_activation() Double menu on WordPress 4.4聽#9 .../class-freemius.php(18517): Freemius->add_menu_action() Plugin icon not loading on opt-in screen聽#10 .../wp-includes/class-wp-hook.php(341): Freemius->_prepare_admin_menu('')