Wordpress - Business Intelligence Lite plugin

We have a website to monitor the performance of a client site. We are using a Wordpress Business Intelligence plugin to display client performance. While a new customer signs up for the first time and selects their dashboard, we get the following error, and when we update the database, the error goes away, but the first time the dashboard should display a custom message. I am using the following sql query

select lastsamplestatus,lasterrorat,avguptimeday,status from
selenium_script_data as ssd inner join selenium_scripts as ss
on ss.script_id=ssd.selenium_id inner join wp_users as wu on 
wu.ID=ss.customer_id where wu.ID={{{user_ID}

      

Note: variable Undefined: label_x in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php on line 405

Note: variable Undefined: data in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php on line 417

Warning: Invalid argument provided by foreach () in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php on line 417

Note. Trying to get a non-object property in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php on line 60

Note: variable Undefined: ds in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php on line 154

Note. Trying to get a non-object property in /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php on line 154

Note: variable Undefined: table at /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php on line 158

Note. Trying to get a non-object property at /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php on line 158

We want to display a normal custom message to the user until the admin refreshes the database, I don't know where to configure the .php functionality, I got this file from the Business Intelligence plugin for Wordpress. I've pasted some of the code below, any help would be appreciated.

//Assign values and labels
    switch($wpbi_chart->type){
        case chart::DONUT:
        case chart::PIE:                if(sizeof($label_x) > 0){
                                                    $wpbi_chart -> set_x_axis_labels($label_x,
                                                    $vo_chart->chart_x_labels_size, 
                                                    $vo_chart->chart_x_labels_color);
                                                }
                                                foreach($data as $key => $value){
                                                //Overwrite data value for pie chart in order to show labels (via pie_value object)
                                                if(sizeof($label_x)>0){
                                                    for($idx = 0; $idx < sizeof($value); $idx++){
                                                        $value[$idx] = new pie_value($value[$idx], $label_x[$idx]);
                                                    }
                                                }
                                                $wpbi_chart -> set_tooltip($wpbi_dialog['charts']['pie']['tooltip']);
                                                $wpbi_chart -> create_element($key, $value);
                                                $wpbi_chart -> elements[$key] -> set_colours($wpbi_settings['pie-chart']['color-set']);
                                                }
                                                break;
        case chart::BAR_STACKED:        if(sizeof($label_x) > 0){
                                                $wpbi_chart -> set_x_axis_labels($label_x,
                                                    $_POST[$wpbi_settings['parameter']['ch-x-label-size']],
                                                    $_POST[$wpbi_settings['parameter']['ch-x-label-color']]);
                                                    $wpbi_chart->x_axis_istime = (sizeof($istime_cols) > 0);
                                                    if($wpbi_chart->x_axis_istime){
                                                        $wpbi_chart->x_axis_labels->labels = $wpbi_chart->convert_to_time($wpbi_chart->x_axis_labels->labels);
                                                    }
                                                }
                                                    $wpbi_chart-> set_y_axis_labels_color($_POST[$wpbi_settings['parameter']['ch-y-label-color']]);
                                                    $wpbi_chart-> set_y_axis_labels_size($_POST[$wpbi_settings['parameter']['ch-y-label-size']]);
                                                    foreach($data_stacked as $key => $value){
                                                        $wpbi_chart -> create_element('BAR_STACKED', $value);
                                                        $wpbi_chart -> elements['BAR_STACKED'] -> set_colours($stacked_label_color);
                                                    }
                                                    break;
        case chart::STACKED_AREA:
        case chart::LINE_AREA:      if(sizeof($label_x) > 0){
                                                    $wpbi_chart -> set_x_axis_labels($label_x,
                                                    $vo_chart->chart_x_labels_size, 
                                                    $vo_chart->chart_x_labels_color);
                                                }
                                                $wpbi_chart-> set_y_axis_labels_color($vo_chart->chart_y_labels_color);
                                                $wpbi_chart-> set_y_axis_labels_size($vo_chart->chart_y_labels_size);
                                                foreach($data as $key => $value){
                                                    $wpbi_chart -> create_element($key, $value);
                                                    $wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
                                                    $wpbi_chart -> elements[$key] -> set_fill_colour($label_color[$key]);
                                                    $wpbi_chart -> elements[$key] -> set_fill_alpha( 0.5 );
                                                }
                                                break;
        case chart::RADAR:          if(sizeof($label_x) > 0){
                                                    $wpbi_chart -> set_y_axis_labels($label_x,
                                                    $vo_chart->chart_y_labels_size, 
                                                    $vo_chart->chart_y_labels_color);
                                                }
                                                foreach($data as $key => $value){
                                                    $wpbi_chart -> create_element($key, $value);
                                                    $wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
                                                }
                                                break;
        case chart::BAR_HORIZONTAL: if(sizeof($label_x) > 0){
                                                    $wpbi_chart -> set_y_axis_labels($label_x,
                                                    $vo_chart->chart_y_labels_size, 
                                                    $vo_chart->chart_y_labels_color);
                                                }
                                                $wpbi_chart-> set_x_axis_labels_color($vo_chart->chart_x_labels_color);
                                                $wpbi_chart-> set_x_axis_labels_size($vo_chart->chart_x_labels_size);
                                                foreach($data as $key => $value){
                                                    $wpbi_chart -> create_element($key, $value);
                                                    $wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
                                                }
                                                break;
        default:                                if(sizeof($label_x) > 0){
                                                    $wpbi_chart -> set_x_axis_labels($label_x,
                                                    $vo_chart->chart_x_labels_size, 
                                                    $vo_chart->chart_x_labels_color, sizeof($istime_cols) > 0);
                                                    $wpbi_chart->x_axis_istime = (sizeof($istime_cols) > 0);
                                                    echo "welcome";
                                                } else {
                                                $wpbi_chart->set_x_axis_labels_color($vo_chart->chart_x_labels_color);
                                                $wpbi_chart->set_x_axis_labels_size($vo_chart->chart_x_labels_size);
                                                }
                                                $wpbi_chart-> set_y_axis_labels_color($vo_chart->chart_y_labels_color);
                                                $wpbi_chart-> set_y_axis_labels_size($vo_chart->chart_y_labels_size);
                                                foreach($data as $key => $value){
                                                    $wpbi_chart -> create_element($key, $value);
                                                    $wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
                                                }
                                                break;
    }

      

+3


source to share


1 answer


Good friend. Take it easy.

There are a few things you should pay attention to here:

1 - These errors are displayed because the error_reporting parameter is set to E_ALL. If you install it like below, no errors will be displayed.

error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);

      

But this will not solve the error in the code. Hide it.

2 - When you see "Invalid argument provided by foreach ()", your code tries to iterate over the empty variable. You need to go to that file and line and do something lile:



if ($yourVariable && count($yourVariable)>0)
   foreache($yourVariable as $yourValue){
   }

      

This will prevent calling foreach with invalid variables.

3 - When it says "Attempting to get a property of a non-object", on this line you have a variable that is not an object. It could be a string or an integer .. or something else .. it just isn't an object.


Looking for all the erros you can see that the data variable is empty and after that all errors happen after that, because this code always works with $ data. Try to check your code to ensure that the $ data is valid before starting the switch.

+1


source







All Articles