Hello, when you activate OceanWP, can you still access your dashboard?
If this is the case, go to your plugins and deactivate two or three randomly, check if this solves the problem, if so, ask your web host to increase your php_memory_limit.
Hi, thanks for reply,
When i activate OceanWP i can’t access to my dashboard. In fact, i had to change the active theme directly from wordpress database field to access dashboard again.
Respect with php memory_limit i increased it from 128 to 256 Mbs, without results.
On the other side, when i try preview the theme, screens turns white 🙁
-
This reply was modified 8 years, 8 months ago by
comunycaos.
Have you updated your PHP to 5.6, 7.0 or 7.1?
If you enable WP_DEBUG, have you an error displayed instead of the white screen?
Hello,
My host provider can’t update PHP version due to compatibility problems with other webapps running on the server. So currently i’m using PHP 5.3 (I would like update, but i can’t change my host provider at the moment)
Otherwise, if i enable WP_DEBUB i get the next message:
Parse error: syntax error, unexpected ‘[‘ in /home/calas/public_html/wp-content/themes/oceanwp/inc/customizer/settings/header.php on line 3068
By the way, few days ago, i get the same error message on other web after update OceanWP to the last version, and it crashed my web, but i could solve it by uploading the previous version of “oceanwp/inc/customizer/settings/header.php”, then OceanWP worked fine again.
Good news: I have just tried it in the multisite web and seems work fine too, so it looks like the problem i’ve found is related with the last OceanWP theme update.
Have you idea why it is happening?, i guess it isn’t a common error along OceanWP users.
Thank you.
The line in question uses “[]” to define an empty array. This syntax is available in PHP >= 5.4 only. You can replace the code fraction by “array()” in header.php. I had the exact same problem, since I’m on an outdated PHP version as well.
Would be cool, if this could be fixed in OceanWP for better compatibility to older PHP versions. Though, I understand that technically this is not a bug and “[]” is perfectly legit in recent versions of PHP.
For reference see the official PHP documentation:
As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].
@actronab Thank you very much! I’ll insist in update PHP to my workmates regarding to futures plugins updates.
Hello, yes it is because of your PHP version, I recommend to use at least PHP 5.6 but it would be better for you to use PHP 7.0 or 7.1.
I cannot use an array in that line.
Thank you @actronab 🙂
You can use an array in that line for sure. Simply replace “[]” by “array()”. That’s how I fixed the problem for downward PHP compatibility.
Hi @actronab, this is a variable in a foreach “$val[‘label’]”.
@oceanwp: OP reported a problem in oceanwp/inc/customizer/settings/header.php, line 3068 (click here to see code on GitHub). There [] is used as the default value in a method definition:
private static function get_post_types( $args = [] ) {
You can replace that line by the following code
private static function get_post_types( $args = array() ) {
and it will work with PHP versions prior to PHP 5.4 as well. 😉
Oh, I thought the problem came from this code: $val[‘label’]
I modified this file so the lines are different. Yes, I can put an array in this function.
Thank you @actronab 🙂