options['appinsights_token']) { include_once ($AppInsights_Config->plugin_path . '/appinsights-api.php'); global $AppInsights_API; } else { echo '

' . __ ( "This plugin needs an authorization:", 'appinsights' ) . '

' . get_submit_button ( __ ( "Authorize Plugin", 'appinsights' ), 'secondary' ) . '
'; 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' ) . '

' . get_submit_button ( __ ( "Application insights settings", 'appinsights' ), 'secondary' ) . '
'; return; } if (current_user_can ( 'manage_options' )) { if (is_array ($AppInsights_Config->options['appinsights_component_list']) == FALSE || !$AppInsights_Config->options ['appinsights_component']) { echo '

' . __ ( "Please select an application insights resource/component:", 'appinsights' ) . '

' . get_submit_button ( __ ( "Select component", 'appinsights' ), 'secondary' ) . '
'; return; } else { $component_id = $AppInsights_Config->options ['appinsights_component']; } } $AppInsights_Config->set_plugin_options (); ?>
options ['appinsights_default_metric'] = $query = $_REQUEST ['query']; $AppInsights_Config->set_plugin_options (); } else { $query = isset ( $AppInsights_Config->options ['appinsights_default_metric'] ) ? $AppInsights_Config->options ['appinsights_default_metric'] : 'context.session.id.hash'; } if (isset ( $_REQUEST ['period'] )) { $AppInsights_Config->options ['appinsights_default_dimension'] = $period = $_REQUEST ['period']; $AppInsights_Config->set_plugin_options (); } else { $period = isset ( $AppInsights_Config->options ['appinsights_default_dimension'] ) ? $AppInsights_Config->options ['appinsights_default_dimension'] : '30daysAgo'; } ?>