Freemius / wordpress-sdk

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

PHP Warning: The script tried to access a property on an incomplete object #678

Open bfintal opened 11 months ago

bfintal commented 11 months ago

🐞 bug report

Behavior:

This appears as a PHP warning:

PHP Warning: FS_Plugin::__construct(): The script tried to access a property on an incomplete object. Please ensure that the class definition "FS_Plugin" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition in /.../freemius/includes/entities/class-fs-plugin.php on line 134

No warning

I found this information online on something similar (also a Freemius SDK issue): https://wordpress.org/support/topic/error-message-related-to-this-plugin/ the important part goes:

I’m using Docket Cache plugin and I’ve discovered that the preload objects feature was causing this issue with the very ugly Freemius library. If I disable this in Docket Cache then error disappear from the logs.

yuvalo commented 11 months ago

Got this from one of our users as well:

I’m getting the following warnings on my page when this plugin is active. It was identified by Query Monitor

FS_Plugin::__construct(): The script tried to access a property on an incomplete object. Please ensure that the class definition β€œFS_Plugin” of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition

Location: wp-content/plugins/goal-tracker-ga/freemius/includes/entities/class-fs-plugin.php:126

and

Location: wp-content/plugins/goal-tracker-ga/freemius/includes/entities/class-fs-plugin.php:134

Thanks for any help resolving this.