public_html/wp-content/plugins/wp-statistics/wp-statistics.php
// This function outputs error messages in the admin interface if the primary components of WP Statistics are enabled.
This function outputs error messages in the admin interface if the primary components of WP Statistics are enabled.
This function outputs error messages in the admin interface if the primary components of WP Statistics are enabled .
function wp_statistics_not_enable() {
		GLOBAL $WP_Statistics;
		if( !$WP_Statistics->get_option('hide_notices') ) {
			$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option('manage_capability', 'manage_options') );
			if( ! current_user_can( $manage_cap ) ) { return; }
			$get_bloginfo_url = get_admin_url() . "admin.php?page=" . WP_STATISTICS_SETTINGS_PAGE;
			$itemstoenable = array();
			if( !$WP_Statistics->get_option('useronline') ) { $itemstoenable[] = __('online user tracking', 'wp_statistics'); }
			if( !$WP_Statistics->get_option('visits') ) { $itemstoenable[] = __('hit tracking', 'wp_statistics'); }
			if( !$WP_Statistics->get_option('visitors') ) { $itemstoenable[] = __('visitor tracking', 'wp_statistics'); }
			if( !$WP_Statistics->get_option('geoip') && wp_statistics_geoip_supported()) { $itemstoenable[] = __('geoip collection', 'wp_statistics'); }
			if( count( $itemstoenable ) > 0 )
				echo '<div class="update-nag">'.sprintf(__('The following features are disabled, please go to %s and enable them: %s', 'wp_statistics'), '<a href="' . $get_bloginfo_url . '">' . __( 'settings page', 'wp_statistics') . '</a>', implode(__(',', 'wp_statistics'), $itemstoenable)).'</div>';
			$get_bloginfo_url = get_admin_url() . "admin.php?page=" . WP_STATISTICS_OPTIMIZATION_PAGE . "&tab=database";
			$dbupdatestodo = array();
			if(!$WP_Statistics->get_option('search_converted')) { $dbupdatestodo[] = __('search table', 'wp_statistics'); }
			$dbupdates = $WP_Statistics->get_option('pending_db_updates', false);
			if( is_array( $dbupdates ) ) { 
				$dbstrings = array( 'date_ip_agent' => __('countries database index', 'wp_statistics'), 'unique_date' => __('visit database index', 'wp_statistics') );
				foreach( $dbupdates as $key => $update ) {
					if( $update == true ) {
						$dbupdatestodo[] = $dbstrings[$key];
					}
				}
			if( count( $dbupdatestodo ) > 0 ) 
				echo '<div class="update-nag">'.sprintf(__('Database updates are required, please go to %s and update the following: %s', 'wp_statistics'), '<a href="' . $get_bloginfo_url . '">' . __( 'optimization page', 'wp_statistics') . '</a>', implode(__(',', 'wp_statistics'), $dbupdatestodo)).'</div>';
			}
		}
	}
function wp_statistics_not_enable ( ) { GLOBAL $ WP_Statistics ; if ( ! $ WP_Statistics -> get_option ( 'hide_notices' ) ) { $ manage_cap = wp_statistics_validate_capability ( $ WP_Statistics -> get_option ( 'manage_capability' , 'manage_options' ) ) ; if ( ! current_user_can ( $ manage_cap ) ) { return ; } $ get_bloginfo_url = get_admin_url ( ) . " admin.php?page= " . WP_STATISTICS_SETTINGS_PAGE ; $ itemstoenable = array ( ) ; if ( ! $ WP_Statistics -> get_option ( 'useronline' ) ) { $ itemstoenable [ ] = __ ( 'online user tracking' , 'wp_statistics' ) ; } if ( ! $ WP_Statistics -> get_option ( 'visits' ) ) { $ itemstoenable [ ] = __ ( 'hit tracking' , 'wp_statistics' ) ; } if ( ! $ WP_Statistics -> get_option ( 'visitors' ) ) { $ itemstoenable [ ] = __ ( 'visitor tracking' , 'wp_statistics' ) ; } if ( ! $ WP_Statistics -> get_option ( 'geoip' ) && wp_statistics_geoip_supported ( ) ) { $ itemstoenable [ ] = __ ( 'geoip collection' , 'wp_statistics' ) ; } if ( count ( $ itemstoenable ) > 0 ) echo '<div class="update-nag">' . sprintf ( __ ( 'The following features are disabled, please go to %s and enable them: %s' , 'wp_statistics' ) , '<a href="' . $ get_bloginfo_url . '">' . __ ( 'settings page' , 'wp_statistics' ) . '</a>' , implode ( __ ( ',' , 'wp_statistics' ) , $ itemstoenable ) ) . '</div>' ; $ get_bloginfo_url = get_admin_url ( ) . " admin.php?page= " . WP_STATISTICS_OPTIMIZATION_PAGE . " &tab=database " ; $ dbupdatestodo = array ( ) ; if ( ! $ WP_Statistics -> get_option ( 'search_converted' ) ) { $ dbupdatestodo [ ] = __ ( 'search table' , 'wp_statistics' ) ; } $ dbupdates = $ WP_Statistics -> get_option ( 'pending_db_updates' , false ) ; if ( is_array ( $ dbupdates ) ) { $ dbstrings = array ( 'date_ip_agent' => __ ( 'countries database index' , 'wp_statistics' ) , 'unique_date' => __ ( 'visit database index' , 'wp_statistics' ) ) ; foreach ( $ dbupdates as $ key => $ update ) { if ( $ update == true ) { $ dbupdatestodo [ ] = $ dbstrings [ $ key ] ; } } if ( count ( $ dbupdatestodo ) > 0 ) echo '<div class="update-nag">' . sprintf ( __ ( 'Database updates are required, please go to %s and update the following: %s' , 'wp_statistics' ) , '<a href="' . $ get_bloginfo_url . '">' . __ ( 'optimization page' , 'wp_statistics' ) . '</a>' , implode ( __ ( ',' , 'wp_statistics' ) , $ dbupdatestodo ) ) . '</div>' ; } } }
This function outputs error messages in the admin interface if the primary components of WP Statistics are enabled.
This function outputs error messages in the admin interface if the primary components of WP Statistics are enabled .
// If the user had told us to be quite, do so. // Check to make sure the current user can manage WP Statistics, if not there's no point displaying the warnings. // Check to see if there are any database changes the user hasn't done yet. // The database updates are stored in an array so loop thorugh it and output some notices.