Fatal error when trying to activate plugin
-
Just to let you know and to help others:
I installed the plugin and i got an error “The plugin does not have a valid header”. It was installed but not activated. When I tried to activate it I got a fatal error “Parse error: syntax error, unexpected ‘[‘ in file /woocommerce-pay-for-payment/woocommerce-payforpayment.php in line 117”. I checked the code giving the error and it’s this one:
$chosen_methods=[];
Note that my PHP version was 5.3.29
After some investigation I found out that as of PHP 5.4.0 a shortened syntax for declaring arrays has been introduced, so whoever has PHP under 5.4 will get a fatal error. Maybe you can change the code to not use the shortened syntax so that users with previous versions of PHP will not have a problem.
https://www.ads-software.com/plugins/woocommerce-pay-for-payment/
- The topic ‘Fatal error when trying to activate plugin’ is closed to new replies.