public_html/wp-content/plugins/wp-statistics/wp-statistics.php
// This function adds the primary menu to WordPress.
This function adds the primary menu to WordPress.
This function adds the primary menu to WordPress .
function wp_statistics_menu() {
		GLOBAL $WP_Statistics;
		$read_cap = wp_statistics_validate_capability( $WP_Statistics->get_option('read_capability', 'manage_options') );
		$manage_cap = wp_statistics_validate_capability( $WP_Statistics->get_option('manage_capability', 'manage_options') );
		$WP_Statistics->menu_slugs['top'] = add_menu_page(__('Statistics', 'wp_statistics'), __('Statistics', 'wp_statistics'), $read_cap, WP_STATISTICS_OVERVIEW_PAGE, 'wp_statistics_log');
		$WP_Statistics->menu_slugs['overview'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Overview', 'wp_statistics'), __('Overview', 'wp_statistics'), $read_cap, WP_STATISTICS_OVERVIEW_PAGE, 'wp_statistics_log');
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['browsers'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Browsers', 'wp_statistics'), __('Browsers', 'wp_statistics'), $read_cap, WP_STATISTICS_BROWSERS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('geoip') && $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['countries'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Countries', 'wp_statistics'), __('Countries', 'wp_statistics'), $read_cap, WP_STATISTICS_COUNTRIES_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('record_exclusions') ) { $WP_Statistics->menu_slugs['exclusions'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Exclusions', 'wp_statistics'), __('Exclusions', 'wp_statistics'), $read_cap, WP_STATISTICS_EXCLUSIONS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visits') ) { $WP_Statistics->menu_slugs['hits'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Hits', 'wp_statistics'), __('Hits', 'wp_statistics'), $read_cap, WP_STATISTICS_HITS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('useronline') ) { $WP_Statistics->menu_slugs['online'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Online', 'wp_statistics'), __('Online', 'wp_statistics'), $read_cap, WP_STATISTICS_ONLINE_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('pages') ) { $WP_Statistics->menu_slugs['pages'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Pages', 'wp_statistics'), __('Pages', 'wp_statistics'), $read_cap, WP_STATISTICS_PAGES_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('pages') ) { $WP_Statistics->menu_slugs['categories'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Categories', 'wp_statistics'), __('Categories', 'wp_statistics'), $read_cap, WP_STATISTICS_CATEGORIES_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('pages') ) { $WP_Statistics->menu_slugs['tags'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Tags', 'wp_statistics'), __('Tags', 'wp_statistics'), $read_cap, WP_STATISTICS_TAGS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('pages') ) { $WP_Statistics->menu_slugs['authors'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Authors', 'wp_statistics'), __('Authors', 'wp_statistics'), $read_cap, WP_STATISTICS_AUTHORS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['referrers'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Referrers', 'wp_statistics'), __('Referrers', 'wp_statistics'), $read_cap, WP_STATISTICS_REFERRERS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['searches'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Searches', 'wp_statistics'), __('Searches', 'wp_statistics'), $read_cap, WP_STATISTICS_SEARCHES_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['words'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Search Words', 'wp_statistics'), __('Search Words', 'wp_statistics'), $read_cap, WP_STATISTICS_WORDS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['top.visotors'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Top Visitors Today', 'wp_statistics'), __('Top Visitors Today', 'wp_statistics'), $read_cap, WP_STATISTICS_TOP_VISITORS_PAGE, 'wp_statistics_log'); }
		if( $WP_Statistics->get_option('visitors') ) { $WP_Statistics->menu_slugs['visitors'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Visitors', 'wp_statistics'), __('Visitors', 'wp_statistics'), $read_cap, WP_STATISTICS_VISITORS_PAGE, 'wp_statistics_log'); }
		$WP_Statistics->menu_slugs['break'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, '', '', $read_cap, 'wps_break_menu', 'wp_statistics_log');
		$WP_Statistics->menu_slugs['optimize'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Optimization', 'wp_statistics'), __('Optimization', 'wp_statistics'), $manage_cap, WP_STATISTICS_OPTIMIZATION_PAGE, 'wp_statistics_optimization');
		$WP_Statistics->menu_slugs['settings'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Settings', 'wp_statistics'), __('Settings', 'wp_statistics'), $read_cap, WP_STATISTICS_SETTINGS_PAGE, 'wp_statistics_settings');
		$WP_Statistics->menu_slugs['donate'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Donate', 'wp_statistics'), __('Donate', 'wp_statistics'), $read_cap, WP_STATISTICS_DONATE_PAGE, 'wp_statistics_donate');
		if( $WP_Statistics->get_option('delete_manual') != true ) {
			$WP_Statistics->menu_slugs['manual'] = add_submenu_page(WP_STATISTICS_OVERVIEW_PAGE, __('Manual', 'wp_statistics'), __('Manual', 'wp_statistics'), $manage_cap, WP_STATISTICS_MANUAL_PAGE, 'wp_statistics_manual');
		}
		add_action('load-' . $WP_Statistics->menu_slugs['overview'], 'wp_statistics_load_overview_page');
	}
function wp_statistics_menu ( ) { GLOBAL $ WP_Statistics ; $ read_cap = wp_statistics_validate_capability ( $ WP_Statistics -> get_option ( 'read_capability' , 'manage_options' ) ) ; $ manage_cap = wp_statistics_validate_capability ( $ WP_Statistics -> get_option ( 'manage_capability' , 'manage_options' ) ) ; $ WP_Statistics -> menu_slugs [ 'top' ] = add_menu_page ( __ ( 'Statistics' , 'wp_statistics' ) , __ ( 'Statistics' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_OVERVIEW_PAGE , 'wp_statistics_log' ) ; $ WP_Statistics -> menu_slugs [ 'overview' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Overview' , 'wp_statistics' ) , __ ( 'Overview' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_OVERVIEW_PAGE , 'wp_statistics_log' ) ; if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'browsers' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Browsers' , 'wp_statistics' ) , __ ( 'Browsers' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_BROWSERS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'geoip' ) && $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'countries' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Countries' , 'wp_statistics' ) , __ ( 'Countries' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_COUNTRIES_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'record_exclusions' ) ) { $ WP_Statistics -> menu_slugs [ 'exclusions' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Exclusions' , 'wp_statistics' ) , __ ( 'Exclusions' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_EXCLUSIONS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visits' ) ) { $ WP_Statistics -> menu_slugs [ 'hits' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Hits' , 'wp_statistics' ) , __ ( 'Hits' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_HITS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'useronline' ) ) { $ WP_Statistics -> menu_slugs [ 'online' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Online' , 'wp_statistics' ) , __ ( 'Online' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_ONLINE_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'pages' ) ) { $ WP_Statistics -> menu_slugs [ 'pages' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Pages' , 'wp_statistics' ) , __ ( 'Pages' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_PAGES_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'pages' ) ) { $ WP_Statistics -> menu_slugs [ 'categories' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Categories' , 'wp_statistics' ) , __ ( 'Categories' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_CATEGORIES_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'pages' ) ) { $ WP_Statistics -> menu_slugs [ 'tags' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Tags' , 'wp_statistics' ) , __ ( 'Tags' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_TAGS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'pages' ) ) { $ WP_Statistics -> menu_slugs [ 'authors' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Authors' , 'wp_statistics' ) , __ ( 'Authors' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_AUTHORS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'referrers' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Referrers' , 'wp_statistics' ) , __ ( 'Referrers' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_REFERRERS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'searches' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Searches' , 'wp_statistics' ) , __ ( 'Searches' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_SEARCHES_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'words' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Search Words' , 'wp_statistics' ) , __ ( 'Search Words' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_WORDS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'top.visotors' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Top Visitors Today' , 'wp_statistics' ) , __ ( 'Top Visitors Today' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_TOP_VISITORS_PAGE , 'wp_statistics_log' ) ; } if ( $ WP_Statistics -> get_option ( 'visitors' ) ) { $ WP_Statistics -> menu_slugs [ 'visitors' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Visitors' , 'wp_statistics' ) , __ ( 'Visitors' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_VISITORS_PAGE , 'wp_statistics_log' ) ; } $ WP_Statistics -> menu_slugs [ 'break' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , '' , '' , $ read_cap , 'wps_break_menu' , 'wp_statistics_log' ) ; $ WP_Statistics -> menu_slugs [ 'optimize' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Optimization' , 'wp_statistics' ) , __ ( 'Optimization' , 'wp_statistics' ) , $ manage_cap , WP_STATISTICS_OPTIMIZATION_PAGE , 'wp_statistics_optimization' ) ; $ WP_Statistics -> menu_slugs [ 'settings' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Settings' , 'wp_statistics' ) , __ ( 'Settings' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_SETTINGS_PAGE , 'wp_statistics_settings' ) ; $ WP_Statistics -> menu_slugs [ 'donate' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Donate' , 'wp_statistics' ) , __ ( 'Donate' , 'wp_statistics' ) , $ read_cap , WP_STATISTICS_DONATE_PAGE , 'wp_statistics_donate' ) ; if ( $ WP_Statistics -> get_option ( 'delete_manual' ) != true ) { $ WP_Statistics -> menu_slugs [ 'manual' ] = add_submenu_page ( WP_STATISTICS_OVERVIEW_PAGE , __ ( 'Manual' , 'wp_statistics' ) , __ ( 'Manual' , 'wp_statistics' ) , $ manage_cap , WP_STATISTICS_MANUAL_PAGE , 'wp_statistics_manual' ) ; } add_action ( 'load-' . $ WP_Statistics -> menu_slugs [ 'overview' ] , 'wp_statistics_load_overview_page' ) ; }
This function adds the primary menu to WordPress.
This function adds the primary menu to WordPress .
// Get the read/write capabilities required to view/manage the plugin as set by the user. // Add the top level menu. // Add the sub items. // Only add the manual entry if it hasn't been deleted. // Add action to load the meta boxes to the overview page.