WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

wpsc_dirsize() WPSCache 1.0

add_action( 'dashmenu', 'delete_cache_dashboard' );

Хуков нет.

Возвращает

null. Ничего.

Использование

wpsc_dirsize( $directory, $sizes );
$directory (обязательный)
-
$sizes (обязательный)
-

Код wpsc_dirsize() WPSCache 1.7.3

<?php
function wpsc_dirsize($directory, $sizes) {
	global $cache_max_time, $cache_path, $valid_nonce, $wp_cache_preload_on, $file_prefix;
	$now = time();

	if (is_dir($directory)) {
		if( $dh = opendir( $directory ) ) {
			while( ( $entry = readdir( $dh ) ) !== false ) {
				if ($entry != '.' && $entry != '..') {
					$sizes = wpsc_dirsize( trailingslashit( $directory ) . $entry, $sizes );
				}
			}
			closedir($dh);
		}
	} else {
		if ( is_file( $directory ) && strpos( $directory, 'meta-' . $file_prefix ) === false ) {
			if ( strpos( $directory, '/' . $file_prefix ) !== false ) {
				$cache_type = 'wpcache';
			} else {
				$cache_type = 'supercache';
			}
			$keep_fresh = false;
			if ( $cache_type == 'supercache' && $wp_cache_preload_on )
				$keep_fresh = true;
			$filem = filemtime( $directory );
			if ( $keep_fresh == false && $cache_max_time > 0 && $filem + $cache_max_time <= $now ) {
				$cache_status = 'expired';
			} else {
				$cache_status = 'cached';
			}
			$sizes[ $cache_type ][ $cache_status ]+=1;
			if ( $valid_nonce && isset( $_GET[ 'listfiles' ] ) ) {
				$dir = str_replace( $cache_path . 'supercache/' , '', dirname( $directory ) );
				$age = $now - $filem;
				if ( false == isset( $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ] ) ) {
					$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'lower_age' ] = $age;
					$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'files' ] = 1;
				} else {
					$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'files' ] += 1;
					if ( $age <= $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'lower_age' ] ) {

						if ( $age < $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'lower_age' ] && !isset( $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'upper_age' ] ) )
							$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'upper_age' ] = $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'lower_age' ];

						$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'lower_age' ] = $age;

					} elseif ( !isset( $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'upper_age' ] ) || $age > $sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'upper_age' ] ) {

						$sizes[ $cache_type ][ $cache_status . '_list' ][ $dir ][ 'upper_age' ] = $age;

					}
				}
			}
			if ( ! isset( $sizes[ 'fsize' ] ) )
				$sizes[ $cache_type ][ 'fsize' ] = @filesize( $directory );
			else
				$sizes[ $cache_type ][ 'fsize' ] += @filesize( $directory );
		}
	}
	return $sizes;
}