Site unavailable after update 1.3.0 : Parse error: unexpected ‘[‘ in …
-
TL;DR; Plugin update made site unavailable, fixed it by changing empty brackets ( “[]” ) to “array()” at line 560, 594 and 601 in this file:
plugins/nelio-content/includes/class-nelio-content-auto-sharer.php
I’ve installed the latest update of the Nelio Content plugin, version 1.3.0 .
But after installing the update my site didn’t work anymore. My admin site and the normal site where both white.I got the site going again by de-activating the Nelio-content plugin via the database (see #2 here).
When I tried to re-activate the plugin I got this message:
Parse error: syntax error, unexpected '[' in ..,path to my website.../wp-content/plugins/nelio-content/includes/class-nelio-content-auto-sharer.php on line 560
I’ve looked in the php file and discovered this at line 560:
return [];
Apparently it didn’t like the brackets here. So I did some googling (I am not familiar with PHP), and apparently returning an empty list is done by calling:
array()
So I replaced the brackets with that so that it looked like this:
return array();
After saving and reactivating the plugin I got the same message but then at line 594, which also contained a line with returning empty brackets. I also changed those bracket by “array()” and reactivated the plugin.
Again I got the error, but now on line 601.
There I changed the empty brackets too, but this time it wasn’t a return. After my change it looked like this:
$tags = array();
And then reactivating the plugin didn’t gave errors anymore and the plugin worked!
I use it mainly for “Featured Images”.Could it be that this problem has something to do with the PHP version I am using on my site?
- The topic ‘Site unavailable after update 1.3.0 : Parse error: unexpected ‘[‘ in …’ is closed to new replies.