" . esc_html( $text ) . ""; ?>
array( 'class' => array(), 'id' => array() ), 'p' => array(), 'a' => array( 'href' => array() ) ) ); ?>
|
|
>
"; if ( $title ) echo "" . esc_html( $title ) . "";?>
|
" . __( "Settings saved.", 'analytics-insights' ) . "
";
if ( ! ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) ) {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
?>
" . __( "Settings saved.", 'analytics-insights' ) . "
";
if ( ! ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) ) {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
?>
" . __( "Settings saved.", 'analytics-insights' ) . "
";
if ( ! ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) ) {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
if ( 'ga4tracking' == $options['tracking_type'] ) {
$tabs = array( 'basic' => __( "Basic Settings", 'analytics-insights' ), 'events' => __( "Events Tracking", 'analytics-insights' ), 'custom' => __( "Custom Definitions", 'analytics-insights' ), 'exclude' => __( "Exclude Tracking", 'analytics-insights' ), 'advanced' => __( "Advanced Settings", 'analytics-insights' ), 'integration' => __( "Integration", 'analytics-insights' ) );
} else if ( 'tagmanager' == $options['tracking_type'] ) {
$tabs = array( 'basic' => __( "Basic Settings", 'analytics-insights' ), 'tmdatalayervars' => __( "DataLayer Variables", 'analytics-insights' ), 'exclude' => __( "Exclude Tracking", 'analytics-insights' ), 'tmadvanced' => __( "Advanced Settings", 'analytics-insights' ), 'tmintegration' => __( "Integration", 'analytics-insights' ) );
} else {
$tabs = array( 'basic' => __( "Basic Settings", 'analytics-insights' ) );
}
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config->options );
$options = self::update_options( 'frontend' );
?>
__( "Errors & Details", 'analytics-insights' ), 'config' => __( "Plugin Settings", 'analytics-insights' ), 'sysinfo' => __( "System", 'analytics-insights' ) ); ?>
' . __("Count: ", 'analytics-insights') . '' . (int)$errors_count;?>
' . __("Ajax Error Code: ", 'analytics-insights') . '' . esc_html( $error_ajax );?>
' . __("API Error Code: ", 'analytics-insights') . '' . esc_html( $error_code );?>
' . __("API Error Reason: ", 'analytics-insights') . '' . "\n" . esc_html( $error_reason );?>
' . __("API Error Details: ", 'analytics-insights') . '' . "\n" . esc_html( $error_details );?>
|
'. esc_html( $sampling['date'] ) . '' );?>
'. esc_html( $sampling['percent'] ) . '' );?>
'. esc_html( $sampling['sessions'] ) . '' ); ?>
|
%1$s %2$s
', __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'analytics-insights' ), __( 'Library conflicts between WordPress plugins', 'analytics-insights' ) );
if ( null === $aiwp->gapi_controller ) {
$aiwp->gapi_controller = new AIWP_GAPI_Controller();
}
echo '';
if ( isset( $_REQUEST['aiwp_access_code'] ) || isset( $_REQUEST['code'] ) ){
if ( isset( $_REQUEST['state'] ) && wp_verify_nonce( $_REQUEST['state'], 'aiwp_state' ) ) {
if ( isset( $_REQUEST['code'] ) ){
$aiwp_access_code = sanitize_text_field( $_REQUEST['code'] );
} else {
$aiwp_access_code = sanitize_text_field( $_REQUEST['aiwp_access_code'] );
}
AIWP_Tools::delete_cache( 'api_errors' );
AIWP_Tools::delete_cache( 'ajax_errors' );
$token = $aiwp->gapi_controller->authenticate( $aiwp_access_code );
$aiwp->config->options['token'] = $token;
$aiwp->config->set_plugin_options();
$options = self::update_options( 'general' );
$message = "
" . __( "Plugin authorization succeeded.", 'analytics-insights' ) . "
";
if ( $aiwp->config->options['token'] ) {
$webstreams = $aiwp->gapi_controller->refresh_profiles_ga4();
if ( is_array( $webstreams ) && ! empty( $webstreams ) ) {
$aiwp->config->options['ga4_webstreams_list'] = $webstreams;
if ( ! $aiwp->config->options['webstream_jail'] ) {
$property = AIWP_Tools::guess_default_domain( $webstreams, 2 );
$aiwp->config->options['webstream_jail'] = $property;
}
$aiwp->config->set_plugin_options();
$options = self::update_options( 'general' );
}
}
}
}
if ( isset( $_REQUEST['Clear'] ) ) {
if ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) {
AIWP_Tools::clear_cache();
$message = "
" . __( "Cleared Cache.", 'analytics-insights' ) . "
";
} else {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
if ( isset( $_REQUEST['Reset'] ) ) {
if ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) {
$aiwp->gapi_controller->reset_token( true, true );
AIWP_Tools::clear_cache();
$message = "
" . __( "Token Reseted and Revoked.", 'analytics-insights' ) . "
";
$options = self::update_options( 'Reset' );
} else {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
if ( isset( $_REQUEST['Reset_Err'] ) ) {
if ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) {
AIWP_Tools::delete_cache( 'api_errors' );
AIWP_Tools::delete_cache( 'ajax_errors' );
$message = "
" . __( "All errors reseted.", 'analytics-insights' ) . "
";
} else {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
if ( isset( $_REQUEST['options']['aiwp_hidden'] ) && ! isset( $_REQUEST['Clear'] ) && ! isset( $_REQUEST['Reset'] ) && ! isset( $_REQUEST['Reset_Err'] ) ) {
$message = "
" . __( "Settings saved.", 'analytics-insights' ) . "
";
if ( ! ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) ) {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
if ( isset( $_REQUEST['Hide'] ) ) {
if ( isset( $_REQUEST['aiwp_security'] ) && wp_verify_nonce( $_REQUEST['aiwp_security'], 'aiwp_form' ) ) {
$message = "
" . __( "All other domains/properties were removed.", 'analytics-insights' ) . "
";
$lock_property = AIWP_Tools::get_selected_profile( $aiwp->config->options['ga4_webstreams_list'], $aiwp->config->options['webstream_jail'] );
if ( empty( $lock_property ) ) {
$aiwp->config->options['ga4_webstreams_list'] = '';
} else {
$aiwp->config->options['ga4_webstreams_list'] = array( $lock_property );
}
$options = self::update_options( 'general' );
} else {
$message = "
" . __( "You do not have sufficient permissions to access this page.", 'analytics-insights' ) . "
";
}
}
?>
' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'analytics-insights' ) . ' Library conflicts between WordPress plugins
';
if ( null === $aiwp->gapi_controller ) {
$aiwp->gapi_controller = new AIWP_GAPI_Controller();
}
echo '';
if ( isset( $_REQUEST['aiwp_access_code'] ) || isset( $_REQUEST['code'] ) ){
if ( isset( $_REQUEST['state'] ) && wp_verify_nonce( $_REQUEST['state'], 'aiwp_state' ) ) {
if ( isset( $_REQUEST['code'] ) ){
$aiwp_access_code = sanitize_text_field( $_REQUEST['code'] );
} else {
$aiwp_access_code = sanitize_text_field( $_REQUEST['aiwp_access_code'] );
}
$aiwp_access_code = sanitize_text_field( $_REQUEST['aiwp_access_code'] );
$token = $aiwp->gapi_controller->authenticate( $aiwp_access_code );
$aiwp->config->options['token'] = $token;
$aiwp->config->set_plugin_options( true );
$options = self::update_options( 'network' );
$message = "