How can I fix fatal RevSlider error in dashboard after upgrading to PHP 7? [closed]

I can access the public side of the site. But the dashboard comes up blank.

The log shows an error pointing to the RevSlider plugin:

PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /var/www/html/wp-content/plugins/revslider/includes/framework/base-admin.class.php:141

Here’s the full trace:

#0 /var/www/html/wp-content/plugins/revslider/admin/revslider-admin.class.php(1143): RevSliderBaseAdmin::addMetaBox('Revolution Slid...', '', Array, NULL)
#1 /var/www/html/wp-content/plugins/revslider/admin/revslider-admin.class.php(145): RevSliderAdmin->addSliderMetaBox()
#2 /var/www/html/wp-content/plugins/revslider/admin/revslider-admin.class.php(87): RevSliderAdmin->init()
#3 /var/www/html/wp-content/plugins/revslider/revslider.php(327): RevSliderAdmin->__construct('/var/www/html/w...')
#4 /var/www/html/wp-settings.php(304): include_once('/var/www/html/w...')
#5 /var/www/html/wp-config.php(81): require_once('/var/www/html/w...')
#6 /var/www/html/wp-load.php(37): require_once('/var/www/html/w...')
#7 /var/www/html/wp-admin/admin-ajax.php(22): require_once('/var/www/html/w...')
#8 {main}
  thrown in /var/www/html/wp-content/plugins/revslider/includes/framework/base-admin.class.php on line 141, referer: https://192.168.16.18/wp-admin/plugins.php

1

I was able to fix the error by hotfixing the RevSlider plugin on my server as documented here.

In revslider/includes/framework/base-admin.class.php, I changed the following line (l. 21 of my version) from:

private static $arrMetaBoxes="";         //option boxes that will be added to post

to:

private static $arrMetaBoxes = array();    //option boxes that will be added to post

Leave a Comment