syntax error in class-wcpbc-admin-notices.php causes 500 error in wp dashboard
-
Here is the line from the log:
29711 nightlord.co.uk [Fri May 04 11:39:46 2018] [error] [client 80.41.199.146:51198] AH01215: PHP Parse error: syntax error, unexpected ‘{‘, expecting T_STRING or T_VARIABLE or ‘$’ in /home/sites/nightlord.co.uk/public_html/wp-content/plugins/woocommerce-product-price-based-on-countries/includes/admin/class-wcpbc-admin-notices.php on line 182: /home/sites/nightlord.co.uk/public_html/wp-admin/admin.php
which refers to this section of code:
if ( method_exists( __CLASS__, $callback) ) { self::{$callback}(); }
I suspect this may be because I am running PHP 5.6 and this might require PHP 7?
I changed this line to:
eval("self::$callback()");
…which at least has stopped the error but as I’m a novice at debugging other people’s code I’m not entirely sure this is the correct workaround.
The page I need help with: [log in to see the link]
- The topic ‘syntax error in class-wcpbc-admin-notices.php causes 500 error in wp dashboard’ is closed to new replies.