license->get_site_license_key(); $license_key = $license_key ? $license_key : MonsterInsights()->license->get_network_license_key(); $license_key = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key(); $license_type = MonsterInsights()->license->get_site_license_type(); ?>
license->get_site_license_key() ) { ?> license->is_network_licensed() ) { ?>

license->site_license_has_error() ) { ?> license->get_site_license_error() ); ?>
' . $license_type . '' ); ?>

auth->get_viewname() && MonsterInsights()->auth->get_ua() ) { ?>
auth->get_viewname() && MonsterInsights()->auth->get_ua() ) { ?> license->is_site_licensed() ) { ?>

auth->get_viewname(); ?>

license->is_site_licensed() ) { ?>

', '' ); ?>
', '' ); ?>

auth->get_viewname() ) { ?> auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : ''); ?> > auth->get_manual_ua(); $auth_ua = MonsterInsights()->auth->get_ua(); if ( empty( $manual_ua ) && empty( $auth_ua ) && monsterinsights_get_network_ua() ) { ?>

auth->get_manual_ua(); if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old === $manual_ua_code ) { // Same code we had before // Do nothing } else if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old !== $manual_ua_code ) { // Different UA code MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); } else if ( $manual_ua_code && empty( $manual_ua_code_old ) ) { // Move to manual MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); } else if ( empty( $manual_ua_code ) && $manual_ua_code_old ) { // Deleted manual MonsterInsights()->auth->delete_manual_ua(); } else if ( isset( $_POST['manual_ua_code'] ) && empty( $manual_ua_code ) ) { $throw_notice = true; } else { // Not UA before or after // Do nothing } $dashboards_disabled = isset( $_POST['dashboards_disabled'] ) ? 1 : 0; $dashboards_disabled_old = monsterinsights_get_option( 'dashboards_disabled', false ); if ( $dashboards_disabled && ! $dashboards_disabled_old ) { do_action( 'monsterinsights_reports_delete_aggregate_data' ); } monsterinsights_update_option( 'dashboards_disabled', $dashboards_disabled ); monsterinsights_update_option( 'tracking_mode', 'analytics' ); $automatic_updates = isset( $_POST['automatic_updates'] ) && in_array( $_POST['automatic_updates'], array( 'all', 'minor', 'none' ) ) ? $_POST['automatic_updates'] : false; if ( $automatic_updates ) { monsterinsights_update_option( 'automatic_updates', $automatic_updates ); } $anonymous_data = isset( $_POST['anonymous_data'] ) ? 1 : 0; if ( $anonymous_data ) { if ( monsterinsights_is_pro_version() ) { monsterinsights_update_option( 'anonymous_data', 1 ); } else { monsterinsights_update_option( 'anonymous_data', $anonymous_data ); } } /** * Developer Alert: * * Per the README, this is considered an internal hook and should * not be used by other developers. This hook's behavior may be modified * or the hook may be removed at any time, without warning. */ do_action( 'monsterinsights_settings_save_general_end' ); // Output an admin notice so the user knows what happened if ( $throw_notice ) { add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' ); } else { add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_updated_settings' ); } } add_action( 'monsterinsights_settings_save_general', 'monsterinsights_settings_save_general', 11 );