Wordpress - Zip档案强制下载

I am trying to give the possiblity to an user to download an archive in wordpress, but the download don't start after the creation of the archive. I can see that my archive is created, she's available on the server. Here my code :

My "library"

<?php
    function create_zip($files = array(), $destination = '', $overwrite = false) {
        if(file_exists($destination) && !$overwrite) {
            return false;
        }
        $valid_files = array();
        if(is_array($files)) {
            foreach($files as $file) {
                if(file_exists($file)) {
                    $valid_files[] = $file;
                }
            }
        }
        if(count($valid_files)) {
            $zip = new ZipArchive();
            if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
                return false;
            }
            foreach($valid_files as $file) {
                $zip->addFile($file,$file);
            }
            $zip->close();
            return file_exists($destination);
        } else {
            return false;
        }
    }

?>

The function called by wordpress :

<?php

    require "zip.php";
    $customwp = plugins_url().'/customwp/';
    wp_enqueue_style('tutoriels',$customwp.'css/tutoriels.css');
    wp_enqueue_script('tutoriels',$customwp.'js/tutoriels.js',array('jquery'),'1.0',true);

    ob_start();

    $dir = ABSPATH . 'wp-content/plugins/customwp/';
    $files_to_zip = array(
        $dir.'zip.php'
    );
    $archive_name = "archive.zip";
    $result = create_zip($files_to_zip, $archive_name);

    header('Content-Transfer-Encoding: binary'); //Transfert en binaire (fichier).
    header('Content-Disposition: attachment; filename="archive.zip"'); //Nom du fichier.
    header('Content-Length: '.filesize($archive_name)); //Taille du fichier.
    readfile($archive_name);

    $output_string=ob_get_contents();
    ob_end_clean();
    return $output_string;

?>

If you can help me, don't hesitate to try ! Best regards

the final line, where you have

return $output_string;

it should be

echo $output_string;

also, although in this case it seems it doesn't affect your code, but keep in mind that output buffering doesn't buffer your header() calls, they are sent immediately. See the php page about it:

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.