There is a wordpress website with a WPBakery Visual Composer constructor module embedded in the theme. The problem is that on the updated engine some of the designer’s elements are worked out (because the mod itself is outdated). Here is the code to call the constructor in the theme's functions.php :

 if (!class_exists('WPBakeryVisualComposerAbstract')) { $dir = dirname(__FILE__) . '/wpbakery/'; $composer_settings = Array( 'APP_ROOT' => $dir . '/js_composer', 'WP_ROOT' => dirname( dirname( dirname( dirname($dir ) ) ) ). '/', 'APP_DIR' => basename( $dir ) . '/js_composer/', 'CONFIG' => $dir . '/js_composer/config/', 'ASSETS_DIR' => 'assets/', 'COMPOSER' => $dir . '/js_composer/composer/', 'COMPOSER_LIB' => $dir . '/js_composer/composer/lib/', 'SHORTCODES_LIB' => $dir . '/js_composer/composer/lib/shortcodes/', 'USER_DIR_NAME' => 'extendvc/vc_templates', /* Path relative to your current theme, where VC should look for new shortcode templates */ //for which content types Visual Composer should be enabled by default 'default_post_types' => Array('page','post','portfolio_page') ); require_once locate_template('/wpbakery/js_composer/js_composer.php'); $wpVC_setup->init($composer_settings); } // Initialising Shortcodes if (class_exists('WPBakeryVisualComposerAbstract')) { require_once locate_template('/extendvc/extend-vc.php'); } 

If I comment on it and install the Visual Composer plugin, I get the following error:

 `Fatal error: Cannot redeclare wpb_getImageBySize() (previously declared in /home/likemedi/public_html/wp-content/themes/subway/wpbakery‌​/js_composer/compose‌​r/lib/helpers.php:15‌​) in /home/likemedi/public_html/wp-content/plugins/js_composer/in‌​clude/helpers/helper‌​s.php on line 114` 

    1 answer 1

    Fully comment on the composer's connection block to the theme inside functions.php and put it as a separate plug-in through the WordPress admin panel.

    • the question is to save and move blocks and plug-in plugin? - Vasya
    • one
      If there were blocks in the subject, I would transfer them to my plugin ( js_composer_extended , for example). Moreover, the block is created in a simple variant through the vc_map function inside the vc_init hook. - mihdan
    • I get Fatal error: Cannot redeclare wpb_getImageBySize() (previously declared in /home/likemedi/public_html/wp-content/themes/subway/wpbakery/js_composer/composer/lib/helpers.php:15) in /home/likemedi/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php on line 114 -