• I recently took over the management of a wordpress site that had been neglected for many years. It was running on a host still using PHP 7.2 and had many out of date plugins.

    I have updated all the plugins that needed updating and replaced others that were long since expired. This week I also took the plunge and upgraded PHP to the latest (7.4) and while the site will load fine, when I log in, I get the familiar error window stating that a serious issue has occurred, blocking access to the dashboard.

    I enabled debug logging and there were around a dozen PHP Warnings related to files in the theme that is being used. This theme is very old (it’s called Tersus) and is running with a child theme – I have fixed all the warnings in the PHP code, but I am stuck on one which seems to relate to an embedded version of WPBakery:

    PHP Warning: Declaration of WPBakeryVisualComposer::addShortCode($shortcode) should be compatible with WPBakeryVisualComposerAbstract::addShortCode($tag, $func) in /home/website/public_html/wp-content/themes/Tersus/lib/adm/inc/js_composer/composer/lib/composer.php on line 60

    This theme seems to make use of WPBakery shortcodes and the offending bit of code is this:

        public function addShortCode($shortcode) {
            $name = 'WPBakeryShortCode_' . $shortcode['base'];
            if( class_exists( $name ) && is_subclass_of( $name, 'WPBakeryShortCode' ) )
                $this->shortcodes[$shortcode['base']] = new $name($shortcode);
            else
                $this->shortcodes[$shortcode['base']] = new WPBakeryShortCodeFishBones($shortcode);
        }

    Does anyone have any idea whether it is possible to fix this code somehow?
    thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP errors after upgrading to new release of PHP’ is closed to new replies.