WordPress.org

Ready to get started?Download WordPress

Forums

Backup
quick hack to improve usability on GDrive (3 posts)

  1. jakub.tomanik
    Member
    Posted 2 years ago #

    Hi,

    First of all, great plugin!
    I'm heavy Google drive user and and this plugin is an absolute MUST-HAVE.

    I've noticed an usability issue though. Backups are sent to google without ".zip" extension and even when file is renamed on GDrive to filename.zip you cant preview it's contents on line.

    That's not much but those details make a difference between good and great stuff. I came with realy quick and dirty patch if anyone is interested.

    find file backup/backup.php

    find this function

    /**
    	 * Initiates the backup procedure.
    	 *
    	 * @global string  $wp_version WordPress version
    	 */
    	public function do_backup

    and change this

    if ( empty( $this->options['backup_list'][$id]['location'] ) ) {
    				$this->log( 'NOTICE', __( "Attempting to upload archive to Google Drive.", $this->text_domain ) );
    				$location = $this->gdocs->prepare_upload(
    					$this->options['backup_list'][$id]['file_path'],
    					$this->options['backup_list'][$id]['title'],
    					$this->options['drive_folder']
    				);

    to this

    if ( empty( $this->options['backup_list'][$id]['location'] ) ) {
    				$this->log( 'NOTICE', __( "Attempting to upload archive to Google Drive.", $this->text_domain ) );
    				$location = $this->gdocs->prepare_upload(
    					$this->options['backup_list'][$id]['file_path'],
    					$this->options['backup_list'][$id]['title'].'.zip',
    					$this->options['drive_folder'],
    					'application/zip'
    				);

    quick and easy and now you can preview your backups online!

    http://wordpress.org/extend/plugins/backup/

  2. hel.io
    Member
    Plugin Author

    Posted 2 years ago #

    Not sure why you couldn't preview your backups without this patch, the MIME type is being added automatically anyway from WordPress's bult-in list of MIME types.

    I've always been able to preview my backups.

  3. jakub.tomanik
    Member
    Posted 2 years ago #

    Hmm let me give you some insights

    I have a fresh WP instal running on appfog.com . I have only two plugins installed ( MU domain mapping and yours). I had no problems with authorisation whatsoever. When I did backup file went to GDrive nicely, but file name was without an extension and I couldn't preview it. After downloading it and adding extension manually it was ok, no errors during decompression nothing missing.

    But I thought It would be nice to be able to see what's in backup without downloading it. So I started to play with source. As soon as I added hardcoded mime type I was able to preview backup online but it was still missing extension. So I've added hardcoded extension and it started to work as expected.

    Hope this will help others who might have same problem

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.