options['appinsights_token']) { include_once ($AppInsights_Config->plugin_path . '/appinsights-api.php'); global $AppInsights_API; } else { echo '
' . __ ( "This plugin needs an authorization:", 'appinsights' ) . '
'; return; } include_once ($AppInsights_Config->plugin_path . '/appinsights-tools.php'); $tools = new AppInsights_Tools(); $tools->appinsights_cleanup_timeouts(); if (! $AppInsights_API->get_access_token()) { echo '' . __ ( "Something went wrong.", 'appinsights' ) . '
'; return; } if (current_user_can ( 'manage_options' )) { if (isset( $_REQUEST['appinsights_component_select'] )) { $AppInsights_Config->options['appinsights_component'] = $_REQUEST['appinsights_component_select']; } $components = $AppInsights_Config->options['appinsights_component_list']; $component_switch = ''; if (is_array ( $components )) { if (! $AppInsights_Config->options ['appinsights_component']) { echo '' . __ ( "Please select an application insights resource:", 'appinsights' ) . '
'; return; } $component_switch .= '"; } else { echo '' . __ ( "Something went wrong while retrieving components list.", 'appinsights' ) . '
'; return; } } $AppInsights_Config->set_plugin_options (); ?> appinsights_main_charts( $component_id, $period, $from, $to, $query ); if (! $appinsights_statsdata) { echo '' . __ ( "No stats available.", 'appinsights' ) . '
'; return; } $appinsights_bottom_stats = $AppInsights_API->appinsights_bottom_stats( $component_id, $period, $from, $to ); if (! $appinsights_bottom_stats) { echo '' . __ ( "No stats available.", 'appinsights' ) . '
'; return; } ?>