Freemius / wordpress-sdk

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

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

Open bradvin opened 4 years ago

bradvin commented 4 years ago

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 commented 4 years ago

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