public static function convert_hr_to_bytes($size)
{
# Annoyingly, wp_convert_hr_to_bytes() is defined in a file that's only
# loaded in the admin area, so we'll use our own version.
# See also http://core.trac.wordpress.org/ticket/17725
$bytes = (double) $size;
if ($bytes) {
$last = strtolower(substr($size, -1));
$pos = strpos(' kmg', $last, 1);
if ($pos) {
$bytes *= pow(1024, $pos);
}
$bytes = round($bytes);
}
return $bytes;
}