Plugin Directory

Changeset 738641


Ignore:
Timestamp:
07/10/2013 10:08:02 AM (13 years ago)
Author:
Driskell
Message:

3.0.1

Location:
wponlinebackup/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wponlinebackup/trunk/include/admin.php

    r724954 r738641  
    14041404        if ( !is_null( $result ) ) {
    14051405
    1406             if ( !file_exists( WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $result['filename'] ) || false !== @unlink( WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $result['filename'] ) ) {
     1406            if ( file_exists( WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $result['filename'] ) ) {
     1407
     1408                $ret = @unlink( WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $result['filename'] );
     1409
     1410            } else {
     1411
     1412                $ret = true;
     1413
     1414            }
     1415
     1416            if ( $ret === true ) {
    14071417
    14081418                $wpdb->query(
     
    14111421                );
    14121422
    1413             }
    1414 
    1415             $this->Register_Messages( array( array(
    1416                 'icon'  => 'accept',
    1417                 'text'  => __( 'Deleted backup.', 'wponlinebackup' ),
    1418             ) ) );
     1423                $this->Register_Messages( array( array(
     1424                    'icon'  => 'accept',
     1425                    'text'  => __( 'Deleted backup.', 'wponlinebackup' ),
     1426                ) ) );
     1427
     1428            } else {
     1429
     1430                $ret = OBFW_Tidy_Exception();
     1431
     1432                $this->Register_Messages( array( array(
     1433                    'icon'  => 'error',
     1434                    'text'  => sprintf( __( 'Failed to delete the backup: %s', 'wponlinebackup' ), $ret ),
     1435                ) ) );
     1436
     1437            }
    14191438
    14201439            return true;
  • wponlinebackup/trunk/include/bootstrap.php

    r727856 r738641  
    21202120        }
    21212121
     2122        $ret = true;
     2123
    21222124        // Prevent browsing by dropping in a blank index.html if there isn't one
    21232125        if ( !@file_exists( WPONLINEBACKUP_LOCALBACKUPDIR . '/index.html' ) )
    2124             @copy( WPONLINEBACKUP_PATH . '/index.html', WPONLINEBACKUP_LOCALBACKUPDIR . '/index.html' );
     2126            $ret = @copy( WPONLINEBACKUP_PATH . '/index.html', WPONLINEBACKUP_LOCALBACKUPDIR . '/index.html' );
     2127
     2128        // If we failed to copy, report a write problem - or if we didn't copy because index.html already existed, try to write to it with touch which only touches modification time
     2129        if ( false === $ret || false === @touch( WPONLINEBACKUP_LOCALBACKUPDIR . '/index.html' ) ) {
     2130
     2131            $ret = OBFW_Tidy_Exception();
     2132
     2133            $this->Log_Event(
     2134                WPONLINEBACKUP_EVENT_ERROR,
     2135                sprintf( __( 'The directory (%s) where local backups will be stored cannot be written to.', 'wponlinebackup' ), WPONLINEBACKUP_LOCALBACKUPDIR ) . PHP_EOL .
     2136                sprintf( __( 'You may need to login via FTP and "CHMOD" it to "0770" or, as a last resort, "0777". You should also check the temporary processing directory (%s) has the same permissions, also creating the folder if necessary.', 'wponlinebackup' ), $this->status['progress']['cache']['local_tmp_dir'] ) . PHP_EOL .
     2137                sprintf( __( 'Error: %s', 'wponlinebackup' ), $ret )
     2138            );
     2139
     2140            return __( 'Unable to write to the local backup directory.', 'wponlinebackup' );
     2141
     2142        }
    21252143
    21262144        return true;
     
    21722190            WPONLINEBACKUP_EVENT_ERROR,
    21732191            sprintf( __( 'The temporary data file could not be created in the temporary processing directory (%s).', 'wponlinebackup' ), $this->status['progress']['cache']['local_tmp_dir'] ) . PHP_EOL .
    2174                 __( 'If the below error is related to permissions, you may need to login to your website via FTP and change the permissions on the temporary processing directory. The permissions required, in numeric form, are normally 0770, but on some servers you may need to use 0777. Your host will be able to assist if you have any doubts.', 'wponlinebackup' ) . PHP_EOL .
    2175                 __( 'Last PHP error: ', 'wponlinebackup' ) . OBFW_Exception()
     2192            __( 'If the below error is related to permissions, you may need to login to your website via FTP and change the permissions on the temporary processing directory. The permissions required, in numeric form, are normally 0770, but on some servers you may need to use 0777. Your host will be able to assist if you have any doubts.', 'wponlinebackup' ) . PHP_EOL .
     2193            sprintf( __( 'Error: %s', 'wponlinebackup' ), OBFW_Exception() )
    21762194        );
    21772195
     
    24382456            // Allocate a file
    24392457            $wpdb->query(
    2440                 'INSERT INTO `' . $this->db_prefix . 'wponlinebackup_local` (filename, filesize, creation_date, compressed, encrypted) ' .
     2458                'REPLACE INTO `' . $this->db_prefix . 'wponlinebackup_local` (filename, filesize, creation_date, compressed, encrypted) ' .
    24412459                'VALUES (\'' . $esc_name . '\', ' . $this->status['progress']['file_set']['size'] . ', ' . $this->status['progress']['start_time'] . ', ' . $this->status['progress']['file_set']['compressed'] . ', ' . $this->status['progress']['file_set']['encrypted'] . ')'
    24422460            );
    24432461
    24442462            // Move it into place
    2445             @rename( $this->status['progress']['file_set']['file'], WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $name );
     2463            if ( false === @rename( $this->status['progress']['file_set']['file'], WPONLINEBACKUP_LOCALBACKUPDIR . '/' . $name ) ) {
     2464
     2465                // Grab the error
     2466                $ret = OBFW_Tidy_Exception();
     2467
     2468                // Delete it from the database - we add it before moving as the page view can add non-existant entries with NULL data and we don't want to do that
     2469                $wpdb->query( 'DELETE FROM `' . $this->db_prefix . 'wponlinebackup_local` WHERE filename = \'' . $esc_name . '\'' );
     2470
     2471                // Log the error
     2472                $this->Log_Event(
     2473                    WPONLINEBACKUP_EVENT_ERROR,
     2474                    sprintf( __( 'An error occurred trying to save the backup to the local backup folder at %s.', 'wponlinebackup' ), WPONLINEBACKUP_LOCALBACKUPDIR ) . PHP_EOL .
     2475                    sprintf( __( 'Error: %s', 'wponlinebackup' ), $ret )
     2476                );
     2477
     2478                return __( 'Failed to save the backup to local storage.', 'wponlinebackup' );
     2479
     2480            }
    24462481
    24472482            // Store the file name
  • wponlinebackup/trunk/readme.txt

    r735318 r738641  
    7171
    7272== Changelog ==
     73
     74= 3.0.1 =
     75* Check permissions to the local backup folder are correct at the start of backup
     76* Do not report successful backup if the backup failed to save to the local backup folder
     77* If a file cannot be deleted from the local backups folder, report an error and the reason why
    7378
    7479= 3.0.0 =
  • wponlinebackup/trunk/wponlinebackup.php

    r724954 r738641  
    55Description: Online Backup for WordPress can automatically backup your WordPress database and filesystem on a configurable schedule and can incrementally send the backup compressed (and optionally encrypted using DES or AES) to our online vault where you can later retrieve it. Backups can also be emailed to you or produced on-demand and downloaded straight to your computer. You can view the current status and change settings at "Online Backup", or by clicking the "View Dashboard" link next to the plugin name in the Plugins list.
    66Author: Jason Woods @ Backup Technology
    7 Version: 3.0.0
     7Version: 3.0.1
    88Author URI: http://www.backup-technology.com/
    99Licence: GPLv2 - See LICENCE.txt
     
    1919
    2020// Version
    21 define( 'WPONLINEBACKUP_VERSION', '3.0.0' );
     21define( 'WPONLINEBACKUP_VERSION', '3.0.1' );
    2222define( 'WPONLINEBACKUP_DBVERSION', 12 );
    2323
     
    12501250
    12511251            // Standard site_url call - this is fine in multisite since we now restrict ourselves to run only on the main site
    1252             $this->blog_url = site_url( '/', 'http' );
     1252            $this->blog_url = site_url( '/' );
    12531253
    12541254        }
Note: See TracChangeset for help on using the changeset viewer.