function wpa_wpc_ajax_size()
{
    check_ajax_referer('wpclone-ajax-submit', 'nonce');
    $size = wpa_wpc_dir_size(WP_CONTENT_DIR);
    $size['dbsize'] = wpa_wpc_db_size();
    echo json_encode($size);
    wp_die();
}
Пример #2
0
function wpa_wpc_ajax_size()
{
    check_ajax_referer('wpclone-ajax-submit', 'nonce');
    $cached = get_option('wpclone_directory_scan');
    $interval = 600;
    /* 10 minutes */
    if (false !== $cached && time() - $cached['time'] < $interval) {
        $size = $cached;
        $size['time'] = date('i', time() - $size['time']);
    } else {
        $size = wpa_wpc_dir_size(WP_CONTENT_DIR);
    }
    echo json_encode($size);
    wp_die();
}