wordpress-sdk icon indicating copy to clipboard operation
wordpress-sdk copied to clipboard

Fatal error: Can't use method return value in write context

Open bradvin opened this issue 5 years ago • 1 comments

A customer reported the following fatal error:

Fatal error: Can't use method return value in write context in /home3/idigdesi/public_html/wp-content/plugins/foogallery/freeminus/includes/class-freeminus.php on line 12736

Which points to this line : https://github.com/Freemius/wordpress-sdk/blob/180042ee5653e073dd4a98aa0aae1b9adc9c351c/includes/class-freemius.php#L12736

This is only happening in < PHP 5.5

I did some googling and found the following which is very useful:

https://stackoverflow.com/questions/1075534/cant-use-method-return-value-in-write-context

bradvin avatar Jun 23 '20 19:06 bradvin

potentially this simple change could fix it:

            $installs = $this->get_installs_ids_with_foreign_licenses();
            if ( empty( $installs ) ) {
                // Handle user change only when the parent product or one of its add-ons is activated with a foreign license.
                return;
            }

I will send this to the customer to try, and if it works I will let you know

bradvin avatar Jun 23 '20 19:06 bradvin