I can't access to my wordpress site since I installed the Visual Composer plugin

admin

Administrator
Staff member
I can't connect to my wordpress site anymore since I installed the Visual Composer plugin. I have this error : Fatal error: Call to undefined function vc_map_integrate_shortcode() in /home/animalsp/www/wp-content/plugins/addons-for-visual-composer/includes/addons/testimonials-slider/class-lvca-testimonials-slider.php on line 210.

Here is the code :

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override">
Code:
&lt;?php

/*
Widget Name: Livemesh Testimonials Slider
Description: Display responsive touch friendly slider of testimonials from clients/customers.
Author: LiveMesh
Author URI: https://www.livemeshthemes.com
*/


class LVCA_Testimonials_Slider {

    protected $_per_line;

    /**
     * Get things started
     */
    public function __construct() {

        add_action('wp_enqueue_scripts', array($this, 'load_scripts'));

        add_shortcode('lvca_testimonials_slider', array($this, 'shortcode_func'));

        add_shortcode('lvca_testimonial_slide', array($this, 'child_shortcode_func'));

        add_action('init', array($this, 'map_vc_element'));

        add_action('init', array($this, 'map_child_vc_element'));

    }

    function load_scripts() {

        wp_enqueue_script('lvca-flexslider', LVCA_PLUGIN_URL . 'assets/js/jquery.flexslider' . LVCA_JS_SUFFIX . '.js', array('jquery'), LVCA_VERSION);

        wp_enqueue_style('lvca-flexslider', LVCA_PLUGIN_URL . 'assets/css/flexslider.css', array(), LVCA_VERSION);

        wp_enqueue_script('lvca-testimonials-slider', plugin_dir_url(__FILE__) . 'js/testimonials' . LVCA_JS_SUFFIX . '.js', array('jquery'), LVCA_VERSION);

        wp_enqueue_style('lvca-testimonials-slider', plugin_dir_url(__FILE__) . 'css/style.css', array(), LVCA_VERSION);

    }

    public function shortcode_func($atts, $content = null, $tag) {

        //$slideshow_speed = $animation_speed = $animation = $pause_on_action = $pause_on_hover = $direction_nav = $control_nav = '';

        $settings = shortcode_atts(array(
            'slideshow_speed' =&gt; 5000,
            'animation_speed' =&gt; 600,
            'animation' =&gt; 'slide',
            'pause_on_action' =&gt; 'false',
            'pause_on_hover' =&gt; 'false',
            'direction_nav' =&gt; 'false',
            'control_nav' =&gt; 'false',

        ), $atts);

        ob_start();

        ?&gt;

        &lt;div
            class="lvca-testimonials-slider lvca-flexslider lvca-container"&lt;?php foreach ($settings as $key =&gt; $val) {
            if (!empty($val)) {
                echo ' data-' . $key . '="' . esc_attr($val) . '"';
            }
        } ?&gt;&gt;

            &lt;div class="lvca-slides"&gt;

                &lt;?php

                do_shortcode($content);

                ?&gt;

            &lt;/div&gt;

        &lt;/div&gt;

        &lt;?php

        $output = ob_get_clean();

        return $output;
    }

    public function child_shortcode_func($atts, $content = null, $tag) {

        $author = $credentials = $author_image = '';
        extract(shortcode_atts(array(
            'author' =&gt; '',
            'credentials' =&gt; '',
            'author_image' =&gt; ''

        ), $atts));

        if (function_exists('wpb_js_remove_wpautop'))
            $content = wpb_js_remove_wpautop($content); // fix unclosed/unwanted paragraph tags in $content

        ?&gt;

        &lt;div class="lvca-slide lvca-testimonial-wrapper"&gt;

            &lt;div class="lvca-testimonial"&gt;

                &lt;div class="lvca-testimonial-text"&gt;

                    &lt;i class="lvca-icon-quote"&gt;&lt;/i&gt;

                    &lt;?php echo wp_kses_post($content) ?&gt;

                &lt;/div&gt;

                &lt;div class="lvca-testimonial-user"&gt;

                    &lt;div class="lvca-image-wrapper"&gt;
                        &lt;?php echo wp_get_attachment_image($author_image, 'thumbnail', false, array('class' =&gt; 'lvca-image full')); ?&gt;
                    &lt;/div&gt;

                    &lt;div class="lvca-text"&gt;
                        &lt;h4 class="lvca-author-name"&gt;&lt;?php echo esc_html($author) ?&gt;&lt;/h4&gt;

                        &lt;div class="lvca-author-credentials"&gt;&lt;?php echo wp_kses_post($credentials); ?&gt;&lt;/div&gt;
                    &lt;/div&gt;

                &lt;/div&gt;

            &lt;/div&gt;

        &lt;/div&gt;

        &lt;?php
    }

    function map_vc_element() {
        if (function_exists("vc_map")) {

            //Register "container" content element. It will hold all your inner (child) content elements
            vc_map(array(
                "name" =&gt; __("Livemesh Testimonials Slider", "livemesh-vc-addons"),
                "base" =&gt; "lvca_testimonials_slider",
                "as_parent" =&gt; array('only' =&gt; 'lvca_testimonial_slide'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
                "content_element" =&gt; true,
                "show_settings_on_create" =&gt; true,
                "category" =&gt; __("Livemesh VC Addons", "livemesh-vc-addons"),
                "is_container" =&gt; true,
                'description' =&gt; __('Capture client testimonials in a slider.', 'livemesh-vc-addons'),
                "js_view" =&gt; 'VcColumnView',
                "icon" =&gt; 'icon-lvca-testimonials-slider',
                "params" =&gt; array(

                    array(
                        'type' =&gt; 'lvca_number',
                        "param_name" =&gt; "slideshow_speed",
                        'heading' =&gt; __('Slideshow speed', 'livemesh-vc-addons'),
                        'value' =&gt; 5000
                    ),

                    array(
                        'type' =&gt; 'lvca_number',
                        "param_name" =&gt; "animation_speed",
                        'heading' =&gt; __('Animation Speed', 'livemesh-vc-addons'),
                        'value' =&gt; 600
                    ),

                    array(
                        'type' =&gt; 'checkbox',
                        "param_name" =&gt; "pause_on_action",
                        'heading' =&gt; __('Pause slider on action.', 'livemesh-vc-addons'),
                        'description' =&gt; __('Should the slideshow pause once user initiates an action using navigation/direction controls.', 'livemesh-vc-addons'),
                        "value" =&gt; array(__("Yes", "livemesh-vc-addons") =&gt; 'true'),
                    ),

                    array(
                        'type' =&gt; 'checkbox',
                        "param_name" =&gt; "pause_on_hover",
                        'heading' =&gt; __('Pause on Hover', 'livemesh-vc-addons'),
                        'description' =&gt; __('Should the slider pause on mouse hover over the slider.', 'livemesh-vc-addons'),
                        "value" =&gt; array(__("Yes", "livemesh-vc-addons") =&gt; 'true'),
                    ),

                    array(
                        'type' =&gt; 'checkbox',
                        "param_name" =&gt; "direction_nav",
                        'heading' =&gt; __('Direction Navigation', 'livemesh-vc-addons'),
                        'description' =&gt; __('Should the slider have direction navigation.', 'livemesh-vc-addons'),
                        "value" =&gt; array(__("Yes", "livemesh-vc-addons") =&gt; 'true'),
                    ),

                    array(
                        'type' =&gt; 'checkbox',
                        "param_name" =&gt; "control_nav",
                        'heading' =&gt; __('Navigation Controls', 'livemesh-vc-addons'),
                        'description' =&gt; __('Should the slider have navigation controls.', 'livemesh-vc-addons'),
                        "value" =&gt; array(__("Yes", "livemesh-vc-addons") =&gt; 'true'),
                    ),
                ),
            ));


        }
    }


function map_child_vc_element() {
        if (function_exists("vc_map")) {

            $testimonial_params = vc_map_integrate_shortcode('lvca_testimonial', '', __('Testimonials', 'livemesh-vc-addons'));

            vc_map(array(
                    "name" =&gt; __("Livemesh Testimonial Slide", "livemesh-vc-addons"),
                    "base" =&gt; "lvca_testimonial_slide",
                    "content_element" =&gt; true,
                    "as_child" =&gt; array('only' =&gt; 'lvca_testimonials_slider'), // Use only|except attributes to limit parent (separate multiple values with comma)
                    "icon" =&gt; 'icon-lvca-testimonials-slide',
                    "category" =&gt; __("Livemesh VC Addons", "livemesh-vc-addons"),
                    "params" =&gt; $testimonial_params
                )

            );

        }
    }

}

//Your "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
if (class_exists('WPBakeryShortCodesContainer')) {
    class WPBakeryShortCode_lvca_testimonials_slider extends WPBakeryShortCodesContainer {
    }
}
if (class_exists('WPBakeryShortCode')) {
    class WPBakeryShortCode_lvca_testimonial_slide extends WPBakeryShortCode {
    }
}

// Initialize Element Class
if (class_exists('LVCA_Testimonials_Slider')) {
    new LVCA_Testimonials_Slider();
}</code></pre>
</div>
</div>